Commit b80403a3 authored by Simon Knox's avatar Simon Knox

add weight param to filter bar

parent 4d2315a3
......@@ -69,6 +69,7 @@ $(() => {
bulkUpdatePath: $boardApp.dataset.bulkUpdatePath,
detailIssue: Store.detail,
milestoneTitle: $boardApp.dataset.boardMilestoneTitle,
weight: $boardApp.dataset.boardWeight,
defaultAvatar: $boardApp.dataset.defaultAvatar,
},
computed: {
......@@ -77,6 +78,7 @@ $(() => {
},
},
created () {
const cantEdit = [];
if (this.milestoneTitle) {
const milestoneTitleParam = `milestone_title=${this.milestoneTitle}`;
......@@ -84,9 +86,21 @@ $(() => {
Store.filter.path.split('&').filter(param => param.match(/^milestone_title=(.*)$/g) === null)
).join('&');
Store.updateFiltersUrl(true);
cantEdit.push('milestone');
}
if (this.weight) {
const weightParam = `weight=${this.weight}`;
Store.filter.path = [weightParam].concat(
Store.filter.path.split('&').filter(param => param.match(/^weight=(.*)$/g) === null)
).join('&');
cantEdit.push('weight');
}
Store.updateFiltersUrl(true);
gl.boardService = new BoardService({
boardsEndpoint: this.boardsEndpoint,
listsEndpoint: this.listsEndpoint,
......@@ -95,7 +109,7 @@ $(() => {
});
Store.rootPath = this.boardsEndpoint;
this.filterManager = new FilteredSearchBoards(Store.filter, true, [(this.milestoneTitle ? 'milestone' : null)]);
this.filterManager = new FilteredSearchBoards(Store.filter, true, cantEdit);
this.filterManager.setup();
// Listen for updateTokens event
......
......@@ -7,6 +7,7 @@ module EE
def board_data
data = {
board_milestone_title: board&.milestone&.title,
board_weight: board&.weight,
focus_mode_available: parent.feature_available?(:issue_board_focus_mode).to_s,
show_promotion: (@project && show_promotions? && (!@project.feature_available?(:multiple_issue_boards) || !@project.feature_available?(:scoped_issue_board) || !@project.feature_available?(:issue_board_focus_mode))).to_s
......
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