From 85a7838a96257916df2f4b4e774fd8693d032f7e Mon Sep 17 00:00:00 2001 From: dw-0 Date: Thu, 3 Oct 2024 20:14:06 +0200 Subject: [PATCH] Feature/show message if no results have been found in activity dialog (#3854) * Show message if no results have been found in activity dialog * Update changelog --------- Signed-off-by: Dominik Willner Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> --- CHANGELOG.md | 1 + apps/client/src/locales/messages.ca.xlf | 8 ++++++++ apps/client/src/locales/messages.de.xlf | 8 ++++++++ apps/client/src/locales/messages.es.xlf | 8 ++++++++ apps/client/src/locales/messages.fr.xlf | 8 ++++++++ apps/client/src/locales/messages.it.xlf | 8 ++++++++ apps/client/src/locales/messages.nl.xlf | 8 ++++++++ apps/client/src/locales/messages.pl.xlf | 8 ++++++++ apps/client/src/locales/messages.pt.xlf | 8 ++++++++ apps/client/src/locales/messages.tr.xlf | 8 ++++++++ apps/client/src/locales/messages.xlf | 7 +++++++ apps/client/src/locales/messages.zh.xlf | 8 ++++++++ .../symbol-autocomplete.component.html | 6 ++++++ .../symbol-autocomplete/symbol-autocomplete.component.ts | 6 +++--- 14 files changed, 97 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92f82935a..bb824f43b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added a message to the search asset component if no results have been found in the create or update activity dialog - Added support to customize the rule thresholds in the _X-ray_ section (experimental) ### Changed diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index 597b88260..4be556c77 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 6929db1ef..dabb2bb66 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Ups! Es konnten leider keine Assets gefunden werden. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index b5d7f41f9..1cdc11f5f 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -7259,6 +7259,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index e880df353..7e37f0d8c 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index a2c1f0cb2..3ca902aed 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -7259,6 +7259,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index e686b6559..c768cf1b9 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index a585e4b9d..4e4e51635 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index e0ff5f7e7..b28898470 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index 575dcf12b..1a47fecd9 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -7258,6 +7258,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index 735554838..5cb3a8894 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -6565,6 +6565,13 @@ 49 + + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index f4e75b333..2c7c1e47c 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -7259,6 +7259,14 @@ 280 + + Oops! Could not find any assets. + Oops! Could not find any assets. + + libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html + 16 + + diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html index 2a2f98d7d..cac15c346 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.html @@ -31,6 +31,12 @@ } + } @empty { + @if (control.value?.length > 1) { + Oops! Could not find any assets. + + } } } diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts index 8e07ed674..da97aac05 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts @@ -117,17 +117,17 @@ export class GfSymbolAutocompleteComponent this.control.valueChanges .pipe( - debounceTime(400), - distinctUntilChanged(), filter((query) => { return isString(query) && query.length > 1; }), - takeUntil(this.unsubscribeSubject), tap(() => { this.isLoading = true; this.changeDetectorRef.markForCheck(); }), + debounceTime(400), + distinctUntilChanged(), + takeUntil(this.unsubscribeSubject), switchMap((query: string) => { return this.dataService.fetchSymbols({ query,