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,7 +112,9 @@ export class SearchInputComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
onSearchSubmit(event: KeyboardEvent) {
|
onSearchSubmit(event: KeyboardEvent) {
|
||||||
const searchTerm = (event.target as HTMLInputElement).value;
|
const searchTerm = (event.target as HTMLInputElement).value;
|
||||||
this.store.dispatch(new SearchByTermAction(searchTerm));
|
if (searchTerm) {
|
||||||
|
this.store.dispatch(new SearchByTermAction(searchTerm));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearchChange(searchTerm: string) {
|
onSearchChange(searchTerm: string) {
|
||||||
@ -130,7 +132,9 @@ export class SearchInputComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.navigationTimer = setTimeout(() => {
|
this.navigationTimer = setTimeout(() => {
|
||||||
this.store.dispatch(new SearchByTermAction(searchTerm));
|
if (searchTerm) {
|
||||||
|
this.store.dispatch(new SearchByTermAction(searchTerm));
|
||||||
|
}
|
||||||
this.hasOneChange = false;
|
this.hasOneChange = false;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,9 @@
|
|||||||
<div class="inner-layout__content">
|
<div class="inner-layout__content">
|
||||||
<div class="inner-layout__panel">
|
<div class="inner-layout__panel">
|
||||||
<div class="adf-search-results">
|
<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">
|
||||||
<div class="adf-search-results__content-header content" *ngIf="data?.list.entries.length">
|
<div class="adf-search-results__content-header content" *ngIf="data?.list.entries.length">
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
|
|
||||||
|
&--hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text--bold {
|
.text--bold {
|
||||||
|
@ -87,7 +87,8 @@ export class SearchComponent extends PageComponent implements OnInit {
|
|||||||
this.queryBuilder.userQuery = query;
|
this.queryBuilder.userQuery = query;
|
||||||
this.queryBuilder.update();
|
this.queryBuilder.update();
|
||||||
} else {
|
} 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