Commit f6147d3e authored by Phil Hughes's avatar Phil Hughes

Sets the boards default milestone in the filter bar

parent 021b781a
...@@ -63,7 +63,15 @@ $(() => { ...@@ -63,7 +63,15 @@ $(() => {
}, },
created () { created () {
if (this.milestoneTitle) { if (this.milestoneTitle) {
this.state.filters.milestone_title = this.milestoneTitle; const milestoneTitleParam = `milestone_title=${this.milestoneTitle}`;
let splitPath = Store.filter.path.split('&').filter((param) => {
return param.match(/^milestone_title=(.*)$/g) === null;
});
splitPath = [milestoneTitleParam].concat(splitPath);
Store.filter.path = splitPath.join('&');
Store.updateFiltersUrl();
} }
gl.boardService = new BoardService(this.endpoint, this.bulkUpdatePath, this.boardId); gl.boardService = new BoardService(this.endpoint, this.bulkUpdatePath, this.boardId);
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
.issues-filters .issues-filters
.issues-details-filters.row-content-block.second-block .issues-details-filters.row-content-block.second-block
- if boards_page && board
#js-multiple-boards-switcher.filter-item.inline.boards-switcher{ "v-cloak" => true }
= render "projects/boards/switcher", board: board
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
- if params[:search].present? - if params[:search].present?
= hidden_field_tag :search, params[:search] = hidden_field_tag :search, params[:search]
......
- type = local_assigns.fetch(:type) - type = local_assigns.fetch(:type)
- board = local_assigns.fetch(:board)
.issues-filters .issues-filters
.issues-details-filters.row-content-block.second-block.filtered-search-block .issues-details-filters.row-content-block.second-block.filtered-search-block
- if type == :boards && board
#js-multiple-boards-switcher.inline.boards-switcher{ "v-cloak" => true }
= render "projects/boards/switcher", board: board
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
- if params[:search].present? - if params[:search].present?
= hidden_field_tag :search, params[:search] = hidden_field_tag :search, params[:search]
...@@ -60,6 +64,7 @@ ...@@ -60,6 +64,7 @@
{{name}} {{name}}
%span.dropdown-light-content %span.dropdown-light-content
@{{username}} @{{username}}
- unless board && board.milestone_id
#js-dropdown-milestone.dropdown-menu{ data: { icon: 'clock-o', hint: 'milestone', tag: '%milestone' } } #js-dropdown-milestone.dropdown-menu{ data: { icon: 'clock-o', hint: 'milestone', tag: '%milestone' } }
%ul{ data: { dropdown: true } } %ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'none' } } %li.filter-dropdown-item{ data: { value: 'none' } }
......
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