Browse Source

Refactoring

pull/3854/head
Thomas Kaul 11 months ago
parent
commit
d509da33ba
  1. 2
      apps/client/src/locales/messages.ca.xlf
  2. 2
      apps/client/src/locales/messages.es.xlf
  3. 2
      apps/client/src/locales/messages.fr.xlf
  4. 2
      apps/client/src/locales/messages.it.xlf
  5. 2
      apps/client/src/locales/messages.nl.xlf
  6. 2
      apps/client/src/locales/messages.pl.xlf
  7. 2
      apps/client/src/locales/messages.pt.xlf
  8. 2
      apps/client/src/locales/messages.tr.xlf
  9. 2
      apps/client/src/locales/messages.xlf
  10. 2
      apps/client/src/locales/messages.zh.xlf
  11. 11
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html
  12. 8
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

2
apps/client/src/locales/messages.ca.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.es.xlf

@ -7269,4 +7269,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.fr.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.it.xlf

@ -7269,4 +7269,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.nl.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.pl.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.pt.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.tr.xlf

@ -7268,4 +7268,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.xlf

@ -6574,4 +6574,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

2
apps/client/src/locales/messages.zh.xlf

@ -7269,4 +7269,4 @@
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

11
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html

@ -12,11 +12,6 @@
(optionSelected)="onUpdateSymbol($event)" (optionSelected)="onUpdateSymbol($event)"
> >
@if (!isLoading) { @if (!isLoading) {
@if (hasNoItemsPostLoading) {
<mat-option class="line-height-1" disabled="true" i18n
>Oops! Could not find any assets.
</mat-option>
}
@for (lookupItem of filteredLookupItems; track lookupItem) { @for (lookupItem of filteredLookupItems; track lookupItem) {
<mat-option <mat-option
class="line-height-1" class="line-height-1"
@ -36,6 +31,12 @@
} }
</small> </small>
</mat-option> </mat-option>
} @empty {
@if (control.value?.length > 1) {
<mat-option class="line-height-1" disabled="true" i18n
>Oops! Could not find any assets.
</mat-option>
}
} }
} }
</mat-autocomplete> </mat-autocomplete>

8
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

@ -85,7 +85,6 @@ export class GfSymbolAutocompleteComponent
@ViewChild('symbolAutocomplete') public symbolAutocomplete: MatAutocomplete; @ViewChild('symbolAutocomplete') public symbolAutocomplete: MatAutocomplete;
public control = new FormControl(); public control = new FormControl();
public hasNoItemsPostLoading = false;
public filteredLookupItems: (LookupItem & { assetSubClassString: string })[] = public filteredLookupItems: (LookupItem & { assetSubClassString: string })[] =
[]; [];
@ -118,17 +117,17 @@ export class GfSymbolAutocompleteComponent
this.control.valueChanges this.control.valueChanges
.pipe( .pipe(
debounceTime(400),
distinctUntilChanged(),
filter((query) => { filter((query) => {
return isString(query) && query.length > 1; return isString(query) && query.length > 1;
}), }),
takeUntil(this.unsubscribeSubject),
tap(() => { tap(() => {
this.isLoading = true; this.isLoading = true;
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
}), }),
debounceTime(400),
distinctUntilChanged(),
takeUntil(this.unsubscribeSubject),
switchMap((query: string) => { switchMap((query: string) => {
return this.dataService.fetchSymbols({ return this.dataService.fetchSymbols({
query, query,
@ -145,7 +144,6 @@ export class GfSymbolAutocompleteComponent
}); });
this.isLoading = false; this.isLoading = false;
this.hasNoItemsPostLoading = !this.filteredLookupItems.length;
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
}); });

Loading…
Cancel
Save