Commit 603a6be9 authored by Lukas Eipert's avatar Lukas Eipert

resolve conflict in app/assets/javascripts/boards/stores/boards_store.js

parent 1195c217
...@@ -162,19 +162,9 @@ gl.issueBoards.BoardsStore = { ...@@ -162,19 +162,9 @@ gl.issueBoards.BoardsStore = {
}); });
return filteredList[0]; return filteredList[0];
}, },
<<<<<<< HEAD
updateFiltersUrl (replaceState = false) {
if (replaceState) {
window.history.replaceState(null, null, `?${this.filter.path}`);
} else {
window.history.pushState(null, null, `?${this.filter.path}`);
}
},
=======
updateFiltersUrl () { updateFiltersUrl () {
window.history.pushState(null, null, `?${this.filter.path}`); window.history.pushState(null, null, `?${this.filter.path}`);
} }
>>>>>>> upstream/master
}; };
boardsStoreEE.initEESpecific(gl.issueBoards.BoardsStore); boardsStoreEE.initEESpecific(gl.issueBoards.BoardsStore);
...@@ -28,15 +28,27 @@ class BoardsStoreEE { ...@@ -28,15 +28,27 @@ class BoardsStoreEE {
this.initBoardFilters(); this.initBoardFilters();
} }
}; };
this.store.updateFiltersUrl = (replaceState = false) => {
if (replaceState) {
window.history.replaceState(null, null, `?${this.store.filter.path}`);
} else {
window.history.pushState(null, null, `?${this.store.filter.path}`);
}
};
} }
initBoardFilters() { initBoardFilters() {
const updateFilterPath = (key, value) => { const updateFilterPath = (key, value) => {
if (!value) return; if (!value) return;
const querystring = `${key}=${value}`; const querystring = `${key}=${value}`;
this.store.filter.path = [querystring].concat( this.store.filter.path = [querystring]
this.store.filter.path.split('&').filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null), .concat(
).join('&'); this.store.filter.path
.split('&')
.filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null),
)
.join('&');
}; };
let milestoneTitle = this.store.boardConfig.milestoneTitle; let milestoneTitle = this.store.boardConfig.milestoneTitle;
...@@ -64,7 +76,7 @@ class BoardsStoreEE { ...@@ -64,7 +76,7 @@ class BoardsStoreEE {
} }
const filterPath = this.store.filter.path.split('&'); const filterPath = this.store.filter.path.split('&');
this.store.boardConfig.labels.forEach((label) => { this.store.boardConfig.labels.forEach(label => {
const labelTitle = encodeURIComponent(label.title); const labelTitle = encodeURIComponent(label.title);
const param = `label_name[]=${labelTitle}`; const param = `label_name[]=${labelTitle}`;
const labelIndex = filterPath.indexOf(param); const labelIndex = filterPath.indexOf(param);
...@@ -85,7 +97,12 @@ class BoardsStoreEE { ...@@ -85,7 +97,12 @@ class BoardsStoreEE {
} }
addPromotion() { addPromotion() {
if (!this.$boardApp.hasAttribute('data-show-promotion') || this.promotionIsHidden() || this.store.disabled) return; if (
!this.$boardApp.hasAttribute('data-show-promotion') ||
this.promotionIsHidden() ||
this.store.disabled
)
return;
this.store.addList({ this.store.addList({
id: 'promotion', id: 'promotion',
......
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