Skip to content
Snippets Groups Projects
Commit acda4ee3 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #13271 TIME 0:30 save filters

parent 5f65c4fc
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<img style="max-height: 100vh;" *ngIf="thumbnailUrl !== ''" [src]="thumbnailUrl | secureUrl | async" /> <img style="max-height: 100vh;" *ngIf="thumbnailUrl !== ''" [src]="thumbnailUrl | secureUrl | async" />
</mat-card> </mat-card>
<ng-template #filterTemplate> <ng-template #filterTemplate>
<app-filter-tool-adv-search #appFilterToolAdvSearch [filters]="dataFilters" (filterChanged)="launchSearch()" *ngIf="!hideFilter && initSearch"></app-filter-tool-adv-search> <app-filter-tool-adv-search #appFilterToolAdvSearch [filters]="dataFilters" (filterChanged)="launchSearch()" *ngIf="!hideFilter"></app-filter-tool-adv-search>
</ng-template> </ng-template>
<ng-template #toolTemplate> <ng-template #toolTemplate>
<div *ngIf="initSearch" class="filtersContent"> <div *ngIf="initSearch" class="filtersContent">
......
...@@ -208,6 +208,9 @@ export class SearchResultListComponent implements OnInit, OnDestroy { ...@@ -208,6 +208,9 @@ export class SearchResultListComponent implements OnInit, OnDestroy {
}); });
this.appCriteriaTool.selectSearchTemplate(obj, false); this.appCriteriaTool.selectSearchTemplate(obj, false);
this.criteria = this.listProperties.criteria; this.criteria = this.listProperties.criteria;
if (!this.functions.empty(this.listProperties.filters)) {
this.dataFilters = this.listProperties.filters;
}
this.initResultList(); this.initResultList();
} else if (this.initSearch) { } else if (this.initSearch) {
this.initResultList(); this.initResultList();
...@@ -287,6 +290,7 @@ export class SearchResultListComponent implements OnInit, OnDestroy { ...@@ -287,6 +290,7 @@ export class SearchResultListComponent implements OnInit, OnDestroy {
data = this.processPostData(data); data = this.processPostData(data);
this.templateColumns = data.templateColumns; this.templateColumns = data.templateColumns;
this.dataFilters = data.filters; this.dataFilters = data.filters;
this.criteriaSearchService.updateListsPropertiesFilters(data.filters);
this.resultsLength = data.count; this.resultsLength = data.count;
this.allResInBasket = data.allResources; this.allResInBasket = data.allResources;
return data.resources; return data.resources;
......
...@@ -7,7 +7,7 @@ interface ListProperties { ...@@ -7,7 +7,7 @@ interface ListProperties {
'page': number; 'page': number;
'pageSize': number; 'pageSize': number;
'criteria': any[]; 'criteria': any[];
'filters': any[]; 'filters': any;
'order': string; 'order': string;
'orderDir': string; 'orderDir': string;
} }
...@@ -43,7 +43,7 @@ export class CriteriaSearchService { ...@@ -43,7 +43,7 @@ export class CriteriaSearchService {
order: 'creationDate', order: 'creationDate',
orderDir: 'DESC', orderDir: 'DESC',
criteria: [], criteria: [],
filters: [] filters: {}
}; };
} }
...@@ -65,6 +65,11 @@ export class CriteriaSearchService { ...@@ -65,6 +65,11 @@ export class CriteriaSearchService {
this.saveListsProperties(); this.saveListsProperties();
} }
updateListsPropertiesFilters(filters: any) {
this.listsProperties.filters = filters;
this.saveListsProperties();
}
updateListsProperties(listProperties: ListProperties) { updateListsProperties(listProperties: ListProperties) {
this.listsProperties = listProperties; this.listsProperties = listProperties;
this.saveListsProperties(); this.saveListsProperties();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment