diff --git a/client/src/app/search/advanced-search.component.ts b/client/src/app/search/advanced-search.component.ts index 3effc3462..acf533416 100644 --- a/client/src/app/search/advanced-search.component.ts +++ b/client/src/app/search/advanced-search.component.ts @@ -36,6 +36,18 @@ const FilterSpec = [ { name: "inactive", label: "general.period-historical" + }, + { + name: "inactive", + label: "attribute.entity_status", + options: [ + { + tlabel: "general.show-inactive", + value: "true" + } + ], + defval: "false", + blank: true } ]; @@ -55,9 +67,8 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy { private _refreshSubject = new BehaviorSubject(false); private _filters = new Filter.FieldSet(FilterSpec); - private _cLoader = new Fetch.ModelListLoader(Model.CredentialFacetSearchResult, { persist: true }); - private _ctLoader = new Fetch.ModelListLoader(Model.CredentialType, { persist: true }); - private _queryParamMap: any = this.route.snapshot.queryParamMap; + private _cLoader = new Fetch.ModelListLoader(Model.CredentialFacetSearchResult, { persist: false }); + private _ctLoader = new Fetch.ModelListLoader(Model.CredentialType, { persist: false }); private _queryParams$: Observable = this.route.queryParams; private _refresh$: Observable = this._refreshSubject.asObservable(); private _searchTriggered: boolean = false; @@ -131,9 +142,9 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy { }))) ); - this.credentials$ = this._cLoader.ready + this.credentials$ = this._cLoader.stream .pipe( - tap(data => this.loadFacets(data)) + tap(stream => stream.data && this.loadFacets(stream)) ); this._filters.stream @@ -144,7 +155,10 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy { combineLatest([ this._refresh$, - this._queryParams$, + this._queryParams$ + .pipe( + tap(() => this.patchForm()) + ) ]) .subscribe(([refresh]) => { if (!refresh) { @@ -162,10 +176,11 @@ export class AdvancedSearchComponent implements OnInit, OnDestroy { } private patchForm(): void { + const queryParamMap: any = this.route.snapshot.queryParamMap; this.fg.patchValue({ - text: this._queryParamMap.get('name') || '', - type: this._queryParamMap.get('topic_credential_type_id') || '', - archived: this._queryParamMap.get('inactive') || 'false' + text: queryParamMap.get('name') || '', + type: queryParamMap.get('topic_credential_type_id') || '', + archived: queryParamMap.get('inactive') || 'false' }); } diff --git a/client/themes/base/search/advanced-search.component.html b/client/themes/base/search/advanced-search.component.html index 2cc0c0ec5..657aa8d22 100644 --- a/client/themes/base/search/advanced-search.component.html +++ b/client/themes/base/search/advanced-search.component.html @@ -25,7 +25,7 @@

What this search type does

-
+
{{ 'search.advanced-prompt' | translate }}
diff --git a/client/themes/base/search/search-result-list.component.html b/client/themes/base/search/search-result-list.component.html index c151bc7ac..bf078b335 100644 --- a/client/themes/base/search/search-result-list.component.html +++ b/client/themes/base/search/search-result-list.component.html @@ -1,25 +1,28 @@
-
- -
- {{ 'search.prompt' | translate }} -
-
- {{ 'search.running' | translate }} -
- + +

{{ 'search.results-title' | translate }}

- + -
- {{ 'search.no-results' | translate }} + +
{{ 'search.no-results' | translate }}
+
+
+
+ +
+
+ +
+ +
+ {{ 'search.prompt' | translate }}
- -
- -
- -
-
+
+ {{ 'search.running' | translate }} +
+
+ +
\ No newline at end of file