Skip to content

Commit 78f94dc

Browse files
authored
feat: add url persistent list filters (#110)
1 parent e5d5f0b commit 78f94dc

File tree

1 file changed

+20
-0
lines changed
  • src/Resources/app/administration/src/module/frosh-mail-archive/page/frosh-mail-archive-index

1 file changed

+20
-0
lines changed

src/Resources/app/administration/src/module/frosh-mail-archive/page/frosh-mail-archive-index/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,25 @@ Component.register('frosh-mail-archive-index', {
100100
return this.$tc(`frosh-mail-archive.state.${state}`);
101101
},
102102

103+
updateData(query) {
104+
for (const filter in this.filter) {
105+
this.filter[filter] = query[filter] ?? null;
106+
}
107+
},
108+
109+
saveFilters() {
110+
this.updateRoute({
111+
limit: this.limit,
112+
page: this.page,
113+
term: this.term,
114+
sortBy: this.sortBy,
115+
sortDirection: this.sortDirection,
116+
naturalSorting: this.naturalSorting,
117+
},
118+
this.filter
119+
);
120+
},
121+
103122
getList() {
104123
this.isLoading = true;
105124

@@ -129,6 +148,7 @@ Component.register('frosh-mail-archive-index', {
129148
this.items = searchResult;
130149
this.total = searchResult.total;
131150
this.isLoading = false;
151+
this.saveFilters();
132152
});
133153
},
134154

0 commit comments

Comments
 (0)