To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 52c1946c authored by Hermann's avatar Hermann
Browse files

simplify search state

parent 30b44dd1
......@@ -7,7 +7,6 @@ export default class DatalistController {
constructor(resource, query = {}, searchKeys = false) {
this.handler = new ResourceHandler(resource, searchKeys);
this.query = query || {};
this.search = null;
this.filter = null;
// state pointer that is counted up every time the table is refreshed so
// we can tell infinite scroll that the data-version has changed.
......@@ -90,7 +89,6 @@ export default class DatalistController {
}
setSearch(search) {
this.search = search;
this.query.search = search;
}
......@@ -100,8 +98,7 @@ export default class DatalistController {
}
setQuery(query) {
this.query = query;
this.query.search = this.search;
this.query = Object.assign({}, query, { search: this.query.search });
this.refresh();
}
}
......
......@@ -22,7 +22,6 @@ export default class RelationlistController {
this.secondaryKey = secondary.slice(0, -1);
this.query = query || {};
this.query2 = secondaryQuery || {};
this.search = null;
this.filter = null;
this.filter2 = null;
// state pointer that is counted up every time the table is refreshed so
......@@ -130,7 +129,6 @@ export default class RelationlistController {
}
setSearch(search) {
this.search = search;
this.query.search = search;
this.query2.search = search;
}
......@@ -150,8 +148,7 @@ export default class RelationlistController {
}
setQuery(query) {
this.query = query;
this.query.search = this.search;
this.query = Object.assign({}, query, { search: this.query.search });
this.refresh();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment