Commit f6289d49 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Add epic state dropdown in roadmap view

parent 20b65ceb
......@@ -54,6 +54,7 @@ export default () => {
filterQueryString,
presetType,
timeframe,
state: dataset.epicsState
});
const store = new RoadmapStore(parseInt(dataset.groupId, 0), timeframe, presetType);
......
......@@ -15,6 +15,7 @@ module Groups
@sort = set_sort_order
@epics_count = EpicsFinder.new(current_user, group_id: @group.id).execute.count
@epics_state = params[:state] || 'all'
end
private
......
......@@ -77,4 +77,16 @@ module EpicsHelper
opts
end
def epic_state_dropdown_link(state, selected_state)
link_to epic_state_title(state), page_filter_path(state: state), class: state == selected_state ? 'is-active' : ''
end
def epic_state_title(state)
titles = {
"opened" => "Open"
}
_("%{state} epics") % { state: (titles[state.to_s] || state.to_s.humanize) }
end
end
......@@ -9,6 +9,6 @@
- if @epics_count != 0
= render 'shared/epic/search_bar', type: :epics, show_roadmap_presets: true
#js-roadmap{ data: { epics_path: group_epics_path(@group, format: :json), group_id: @group.id, empty_state_illustration: image_path('illustrations/epics/roadmap.svg'), has_filters_applied: "#{has_filters_applied}", new_epic_endpoint: group_epics_path(@group), preset_type: roadmap_layout } }
#js-roadmap{ data: { epics_path: group_epics_path(@group, format: :json), group_id: @group.id, empty_state_illustration: image_path('illustrations/epics/roadmap.svg'), has_filters_applied: "#{has_filters_applied}", new_epic_endpoint: group_epics_path(@group), preset_type: roadmap_layout, epics_state: @epics_state } }
- else
= render 'shared/empty_states/roadmap'
......@@ -19,6 +19,8 @@
%label.btn.btn-default.btn-roadmap-preset{ class: ("active" if is_weeks) }
%input{ type: 'radio', name: 'presetType', autocomplete: 'off', checked: ("checked" if is_weeks), value: 'WEEKS' }
= _('Weeks')
.filter-dropdown-container.append-right-default
= render 'shared/epic/state_dropdown'
= form_tag page_filter_path(without: [:author_id, :search]), method: :get, class: 'flex-fill filter-form js-filter-form' do
- if params[:search].present?
= hidden_field_tag :search, params[:search]
......
.dropdown.inline
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' } }
= epic_state_title(@epics_state)
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-selectable
%li
= epic_state_dropdown_link('all', @epics_state)
.dropdown-divider
%li
= epic_state_dropdown_link('opened', @epics_state)
%li
= epic_state_dropdown_link('closed', @epics_state)
......@@ -171,6 +171,9 @@ msgstr ""
msgid "%{percent}%% complete"
msgstr ""
msgid "%{state} epics"
msgstr ""
msgid "%{text} %{files}"
msgid_plural "%{text} %{files} files"
msgstr[0] ""
......
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