mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-26 17:24:45 +00:00
[ACA-1489] Handling cleared searches and searches with no results (#460)
* skip search action when no searchTerm * hide search filters when no results
This commit is contained in:
parent
dd08d1b3a8
commit
e600d437e3
@ -112,8 +112,10 @@ export class SearchInputComponent implements OnInit {
|
||||
*/
|
||||
onSearchSubmit(event: KeyboardEvent) {
|
||||
const searchTerm = (event.target as HTMLInputElement).value;
|
||||
if (searchTerm) {
|
||||
this.store.dispatch(new SearchByTermAction(searchTerm));
|
||||
}
|
||||
}
|
||||
|
||||
onSearchChange(searchTerm: string) {
|
||||
if (this.onSearchResults) {
|
||||
@ -130,7 +132,9 @@ export class SearchInputComponent implements OnInit {
|
||||
}
|
||||
|
||||
this.navigationTimer = setTimeout(() => {
|
||||
if (searchTerm) {
|
||||
this.store.dispatch(new SearchByTermAction(searchTerm));
|
||||
}
|
||||
this.hasOneChange = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -66,7 +66,9 @@
|
||||
<div class="inner-layout__content">
|
||||
<div class="inner-layout__panel">
|
||||
<div class="adf-search-results">
|
||||
<adf-search-filter #searchFilter></adf-search-filter>
|
||||
<adf-search-filter
|
||||
#searchFilter
|
||||
[ngClass]="{ 'adf-search-filter--hidden': !data?.list.entries.length }"></adf-search-filter>
|
||||
|
||||
<div class="adf-search-results__content">
|
||||
<div class="adf-search-results__content-header content" *ngIf="data?.list.entries.length">
|
||||
|
@ -34,6 +34,10 @@
|
||||
padding: 5px;
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
|
||||
&--hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.text--bold {
|
||||
|
@ -87,7 +87,8 @@ export class SearchComponent extends PageComponent implements OnInit {
|
||||
this.queryBuilder.userQuery = query;
|
||||
this.queryBuilder.update();
|
||||
} else {
|
||||
this.onSearchResultLoaded( {list: { pagination: { totalItems: 0 }, entries: []}} );
|
||||
this.queryBuilder.userQuery = null;
|
||||
this.queryBuilder.executed.next( {list: { pagination: { totalItems: 0 }, entries: []}} );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user