-
+
+
+
+
+
+
diff --git a/src/frontend/app/ui/gallery/search/search.gallery.component.ts b/src/frontend/app/ui/gallery/search/search.gallery.component.ts
index ec411981..47113155 100644
--- a/src/frontend/app/ui/gallery/search/search.gallery.component.ts
+++ b/src/frontend/app/ui/gallery/search/search.gallery.component.ts
@@ -9,6 +9,7 @@ import {MetadataSearchQueryTypes, SearchQueryDTO, SearchQueryTypes, TextSearch}
import {BsModalService} from 'ngx-bootstrap/modal';
import {BsModalRef} from 'ngx-bootstrap/modal/bs-modal-ref.service';
import {SearchQueryParserService} from './search-query-parser.service';
+import {AlbumsService} from '../../albums/albums.service';
@Component({
selector: 'app-gallery-search',
@@ -22,13 +23,16 @@ export class GallerySearchComponent implements OnDestroy {
public rawSearchText = '';
mouseOverAutoComplete = false;
readonly SearchQueryTypes: typeof SearchQueryTypes;
- modalRef: BsModalRef;
public readonly MetadataSearchQueryTypes: { value: string; key: SearchQueryTypes }[];
+ private searchModalRef: BsModalRef;
private readonly subscription: Subscription = null;
+ private saveSearchModalRef: BsModalRef;
+ public saveSearchName: string;
constructor(private autoCompleteService: AutoCompleteService,
private searchQueryParserService: SearchQueryParserService,
private galleryService: GalleryService,
+ private albumService: AlbumsService,
private navigationService: NavigationService,
private route: ActivatedRoute,
public router: Router,
@@ -60,14 +64,24 @@ export class GallerySearchComponent implements OnDestroy {
}
}
- public async openModal(template: TemplateRef): Promise {
- this.modalRef = this.modalService.show(template, {class: 'modal-lg'});
+ public async openSearchModal(template: TemplateRef): Promise {
+ this.searchModalRef = this.modalService.show(template, {class: 'modal-lg'});
document.body.style.paddingRight = '0px';
}
- public hideModal(): void {
- this.modalRef.hide();
- this.modalRef = null;
+ public async openSaveSearchModal(template: TemplateRef): Promise {
+ this.saveSearchModalRef = this.modalService.show(template, {class: 'modal-lg'});
+ document.body.style.paddingRight = '0px';
+ }
+
+ public hideSaveSearchModal(): void {
+ this.saveSearchModalRef.hide();
+ this.saveSearchModalRef = null;
+ }
+
+ public hideSearchModal(): void {
+ this.searchModalRef.hide();
+ this.searchModalRef = null;
}
resetQuery(): void {
@@ -92,6 +106,10 @@ export class GallerySearchComponent implements OnDestroy {
}
+ async saveSearch(): Promise {
+ await this.albumService.addSavedSearch(this.saveSearchName, this.searchQueryDTO);
+ this.hideSaveSearchModal();
+ }
}