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,19 +64,20 @@ ...@@ -60,19 +64,20 @@
{{name}} {{name}}
%span.dropdown-light-content %span.dropdown-light-content
@{{username}} @{{username}}
#js-dropdown-milestone.dropdown-menu{ data: { icon: 'clock-o', hint: 'milestone', tag: '%milestone' } } - unless board && board.milestone_id
%ul{ data: { dropdown: true } } #js-dropdown-milestone.dropdown-menu{ data: { icon: 'clock-o', hint: 'milestone', tag: '%milestone' } }
%li.filter-dropdown-item{ data: { value: 'none' } } %ul{ data: { dropdown: true } }
%button.btn.btn-link %li.filter-dropdown-item{ data: { value: 'none' } }
No Milestone %button.btn.btn-link
%li.filter-dropdown-item{ data: { value: 'upcoming' } } No Milestone
%button.btn.btn-link %li.filter-dropdown-item{ data: { value: 'upcoming' } }
Upcoming %button.btn.btn-link
%li.divider Upcoming
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.divider
%li.filter-dropdown-item %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%button.btn.btn-link.js-data-value %li.filter-dropdown-item
{{title}} %button.btn.btn-link.js-data-value
{{title}}
#js-dropdown-label.dropdown-menu{ data: { icon: 'tag', hint: 'label', tag: '~label' } } #js-dropdown-label.dropdown-menu{ data: { icon: 'tag', hint: 'label', tag: '~label' } }
%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