Commit a87ccd29 authored by Simon Knox's avatar Simon Knox

keep existing filters when refreshing page

filter.path isn't updated until board.create has been called
parent 63b7cdc6
......@@ -12,17 +12,21 @@ class BoardsStoreEE {
this.removePromotion();
};
if (this.$boardApp) {
this.store.boardConfig = {
milestoneId: parseInt(this.$boardApp.dataset.boardMilestoneId, 10),
milestoneTitle: this.$boardApp.dataset.boardMilestoneTitle,
assigneeUsername: this.$boardApp.dataset.boardAssigneeUsername,
labels: JSON.parse(this.$boardApp.dataset.labels || []),
weight: parseInt(this.$boardApp.dataset.boardWeight, 10),
};
this.store.cantEdit = [];
this.initBoardFilters();
}
const baseCreate = this.store.create.bind(this.store);
this.store.create = () => {
baseCreate();
if (this.$boardApp) {
this.store.boardConfig = {
milestoneId: parseInt(this.$boardApp.dataset.boardMilestoneId, 10),
milestoneTitle: this.$boardApp.dataset.boardMilestoneTitle,
assigneeUsername: this.$boardApp.dataset.boardAssigneeUsername,
labels: JSON.parse(this.$boardApp.dataset.labels || []),
weight: parseInt(this.$boardApp.dataset.boardWeight, 10),
};
this.store.cantEdit = [];
this.initBoardFilters();
}
};
}
initBoardFilters() {
......@@ -30,7 +34,7 @@ class BoardsStoreEE {
if (!value) return;
const querystring = `${key}=${value}`;
this.store.filter.path = [querystring].concat(
this.store.filter.path.split('&').filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null)
this.store.filter.path.split('&').filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null),
).join('&');
};
......
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