diff --git a/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html b/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html index 53b09728..b1408adc 100644 --- a/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html +++ b/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html @@ -32,19 +32,12 @@
- - - - - - - + (change)="onQueryChange()" > +
diff --git a/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts b/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts index 06ea593f..6308dd18 100644 --- a/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts +++ b/src/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts @@ -20,8 +20,7 @@ import {SearchQueryParserService} from '../search/search-query-parser.service'; }) export class RandomQueryBuilderGalleryComponent implements OnInit, OnDestroy { - public searchQueryDTO: SearchQueryDTO; - public rawSearchText: string; + public searchQueryDTO: SearchQueryDTO = {type: SearchQueryTypes.any_text, text: ''} as TextSearch; enabled = true; url = ''; @@ -37,7 +36,6 @@ export class RandomQueryBuilderGalleryComponent implements OnInit, OnDestroy { private searchQueryParserService: SearchQueryParserService, private route: ActivatedRoute, private modalService: BsModalService) { - this.resetQuery(); this.subscription = this.route.params.subscribe((params: Params) => { if (!params[QueryParams.gallery.search.query]) { @@ -55,17 +53,8 @@ export class RandomQueryBuilderGalleryComponent implements OnInit, OnDestroy { return JSON.stringify(this.searchQueryDTO); } - validateRawSearchText(): void { - try { - this.searchQueryDTO = this.searchQueryParserService.parse(this.rawSearchText); - this.url = NetworkService.buildUrl(Config.Client.publicUrl + '/api/gallery/random/' + this.HTMLSearchQuery); - } catch (e) { - console.error(e); - } - } onQueryChange(): void { - this.rawSearchText = this.searchQueryParserService.stringify(this.searchQueryDTO); this.url = NetworkService.buildUrl(Config.Client.publicUrl + '/api/gallery/random/' + this.HTMLSearchQuery); } @@ -114,9 +103,4 @@ export class RandomQueryBuilderGalleryComponent implements OnInit, OnDestroy { } - resetQuery(): void { - this.searchQueryDTO = {text: '', type: SearchQueryTypes.any_text} as TextSearch; - } - - } diff --git a/src/frontend/app/ui/gallery/search/search.gallery.component.html b/src/frontend/app/ui/gallery/search/search.gallery.component.html index 92257f0a..1b91493d 100644 --- a/src/frontend/app/ui/gallery/search/search.gallery.component.html +++ b/src/frontend/app/ui/gallery/search/search.gallery.component.html @@ -40,7 +40,6 @@ name="search-query-builder" [(ngModel)]="searchQueryDTO" (change)="onQueryChange()" - (ngModelChange)="onQueryChange()" (search)="Search()">