diff --git a/backend/i18n/frontend_de.json b/backend/i18n/frontend_de.json
index 34b4924c9..bf0cd2f87 100644
--- a/backend/i18n/frontend_de.json
+++ b/backend/i18n/frontend_de.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Suchen Sie nach {types} und verwenden Sie das -Symbol im Suchformular, um die Abfrage für alle Mitwirkenden zu speichern.",
"search.queryAllNewestFirst": "Alle (neueste zuerst)",
"search.queryAllOldestFirst": "Alle (älteste zuerst)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Schnellnavigation (Taste 'q' drücken)",
"search.saveQueryMyself": "Die Abfrage nur für mich speichern.",
"search.searchFailed": "Fehler bei der Suche. Bitte neu laden.",
diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json
index f9a73d2a4..b54c5cae2 100644
--- a/backend/i18n/frontend_en.json
+++ b/backend/i18n/frontend_en.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Search for {types} and use icon in search form to save query for all contributors.",
"search.queryAllNewestFirst": "All (newest first)",
"search.queryAllOldestFirst": "All (oldest first)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Quick Nav (Press 'q')",
"search.saveQueryMyself": "Save the query only for myself.",
"search.searchFailed": "Failed to make search. Please reload.",
diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json
index 59110b8c1..b68c18df3 100644
--- a/backend/i18n/frontend_fr.json
+++ b/backend/i18n/frontend_fr.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Recherchez {types} et utilisez icône dans le formulaire de recherche pour enregistrer la requête pour tous les contributeurs.",
"search.queryAllNewestFirst": "Tous (le plus récent en premier)",
"search.queryAllOldestFirst": "Tous (le plus ancien en premier)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Navigation rapide (Appuyez sur 'q')",
"search.saveQueryMyself": "Enregistrer la requête uniquement pour moi-même.",
"search.searchFailed": "Échec de la recherche. Veuillez recharger.",
diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json
index ec34e44e3..fd42379f9 100644
--- a/backend/i18n/frontend_it.json
+++ b/backend/i18n/frontend_it.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Ricerca per {types} e utilizza l'icona nella ricerca per salvare la query per tutti i collaboratori.",
"search.queryAllNewestFirst": "Tutto (prima i più recenti)",
"search.queryAllOldestFirst": "Tutto (prima i meno recenti)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Navigazione veloce (Press 'q')",
"search.saveQueryMyself": "Salva la query solamente per me.",
"search.searchFailed": "Non è stato possibile eseguire la ricerca. Per favore ricarica.",
diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json
index 5f2949b65..c4e5d68e2 100644
--- a/backend/i18n/frontend_nl.json
+++ b/backend/i18n/frontend_nl.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Zoek naar {types} en gebruik icon in het zoekformulier om de zoekopdracht op te slaan voor alle bijdragers.",
"search.queryAllNewestFirst": "Alle (nieuwste eerst)",
"search.queryAllOldestFirst": "Alle (oudste eerst)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Snelle navigatie (druk op 'q')",
"search.saveQueryMyself": "Bewaar de zoekopdracht alleen voor mezelf.",
"search.searchFailed": "Zoeken mislukt. Laad opnieuw.",
diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json
index a4c1a14fb..c388e190a 100644
--- a/backend/i18n/frontend_pt.json
+++ b/backend/i18n/frontend_pt.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Procure por {types} e use ícone em forma de pesquisa para guardar consulta para todos os contribuintes.",
"search.queryAllNewestFirst": "Todos (o mais novo primeiro)",
"search.queryAllOldestFirst": "Todos (o mais velho primeiro)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Quick Nav (Prima 'q')",
"search.saveQueryMyself": "Guarde a consulta apenas para mim.",
"search.searchFailed": "Falhou em fazer uma busca. Por favor, recarregue.",
diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json
index 1c500ae6d..9c92da7e7 100644
--- a/backend/i18n/frontend_zh.json
+++ b/backend/i18n/frontend_zh.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "搜索 {types} 并在搜索表单中使用 图标来保存所有贡献者的查询。",
"search.queryAllNewestFirst": "全部(最新的在前)",
"search.queryAllOldestFirst": "所有(最旧的在前)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "快速导航(按'q')",
"search.saveQueryMyself": "只为我保存查询。",
"search.searchFailed": "搜索失败,请重新加载。",
diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json
index f9a73d2a4..b54c5cae2 100644
--- a/backend/i18n/source/frontend_en.json
+++ b/backend/i18n/source/frontend_en.json
@@ -1130,6 +1130,7 @@
"search.queriesEmpty": "Search for {types} and use icon in search form to save query for all contributors.",
"search.queryAllNewestFirst": "All (newest first)",
"search.queryAllOldestFirst": "All (oldest first)",
+ "search.queryNotUsed": "Run the query before you save it",
"search.quickNavPlaceholder": "Quick Nav (Press 'q')",
"search.saveQueryMyself": "Save the query only for myself.",
"search.searchFailed": "Failed to make search. Please reload.",
diff --git a/frontend/src/app/shared/components/search/search-form.component.html b/frontend/src/app/shared/components/search/search-form.component.html
index 5b567aa0a..87bde604f 100644
--- a/frontend/src/app/shared/components/search/search-form.component.html
+++ b/frontend/src/app/shared/components/search/search-form.component.html
@@ -72,6 +72,8 @@
{{ "search.nameQuery" | sqxTranslate }}
+
+
diff --git a/frontend/src/app/shared/components/search/search-form.component.ts b/frontend/src/app/shared/components/search/search-form.component.ts
index 0f28e292e..4e460dbe0 100644
--- a/frontend/src/app/shared/components/search/search-form.component.ts
+++ b/frontend/src/app/shared/components/search/search-form.component.ts
@@ -10,7 +10,7 @@ import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Inp
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BooleanValue, BootstrapClasses, EMPTY_FILTER_MODEL, FieldComponent, FilterField, Input as FilterInput, FilterModel, FilterOptions, NumberValue, SelectValue, StringValue } from 'ngx-inline-filter';
import { Observable } from 'rxjs';
-import { DateTimeEditorComponent, DropdownComponent, FocusOnInitDirective, FormRowComponent, HighlightPipe, LocalizerService, ModalDialogComponent, ModalDirective, ShortcutComponent, TooltipDirective, TourStepDirective, TranslatePipe, Types } from '@app/framework';
+import { DateTimeEditorComponent, DropdownComponent, FocusOnInitDirective, FormErrorComponent, FormRowComponent, HighlightPipe, LocalizerService, ModalDialogComponent, ModalDirective, ShortcutComponent, TooltipDirective, TourStepDirective, TranslatePipe, Types } from '@app/framework';
import { AppLanguageDto, ContributorsState, DialogModel, Queries, Query, QueryModel, sanitize, SaveQueryForm, TypedSimpleChanges } from '@app/shared/internal';
import { UserDtoPicture } from '../pipes';
import { ReferenceInputComponent } from '../references/reference-input.component';
@@ -40,6 +40,7 @@ import { TourHintDirective } from '../tour-hint.directive';
TourStepDirective,
TranslatePipe,
UserDtoPicture,
+ FormErrorComponent,
],
})
export class SearchFormComponent {
@@ -216,18 +217,20 @@ export class SearchFormComponent {
}
public saveQueryComplete() {
- debugger;
const value = this.saveQueryForm.submit();
- if (!value) {
+ if (!value || !this.queries) {
return;
}
- if (this.queries && this.query) {
- if (value.user) {
- this.queries.addUser(value.name, this.query);
- } else {
- this.queries.addShared(value.name, this.query);
- }
+ if (!this.query) {
+ this.saveQueryForm.submitFailed('i18n:search.queryNotUsed')
+ return;
+ }
+
+ if (value.user) {
+ this.queries.addUser(value.name, this.query);
+ } else {
+ this.queries.addShared(value.name, this.query);
}
this.saveQueryForm.submitCompleted();