Skip to content
Snippets Groups Projects
Commit 31fea922 authored by Phil Hughes's avatar Phil Hughes
Browse files

Updated based on Ruby feedback

parent b5ece088
No related branches found
No related tags found
No related merge requests found
Loading
@@ -47,7 +47,7 @@ module IssuablesHelper
Loading
@@ -47,7 +47,7 @@ module IssuablesHelper
end end
end end
   
def milestone_dropdown_label(milestone_title, default_label) def milestone_dropdown_label(milestone_title, default_label = "Milestone")
if milestone_title == Milestone::Upcoming.name if milestone_title == Milestone::Upcoming.name
milestone_title = Milestone::Upcoming.title milestone_title = Milestone::Upcoming.title
end end
Loading
Loading
- if params[:milestone_title] - if params[:milestone_title]
= hidden_field_tag(:milestone_title, params[:milestone_title]) = hidden_field_tag(:milestone_title, params[:milestone_title])
= dropdown_tag(milestone_dropdown_label(params[:milestone_title], "Milestone"), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit', filter: true, dropdown_class: "dropdown-menu-selectable", = dropdown_tag(milestone_dropdown_label(params[:milestone_title]), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit', filter: true, dropdown_class: "dropdown-menu-selectable",
placeholder: "Search milestones", footer_content: @project.present?, data: { show_no: true, show_any: true, show_upcoming: true, field_name: "milestone_title", selected: params[:milestone_title], project_id: @project.try(:id), milestones: milestones_filter_dropdown_path, default_label: "Milestone" } }) do placeholder: "Search milestones", footer_content: @project.present?, data: { show_no: true, show_any: true, show_upcoming: true, field_name: "milestone_title", selected: params[:milestone_title], project_id: @project.try(:id), milestones: milestones_filter_dropdown_path, default_label: "Milestone" } }) do
- if @project - if @project
%ul.dropdown-footer-list %ul.dropdown-footer-list
Loading
Loading
Loading
@@ -11,7 +11,7 @@ feature 'Issue filtering by Milestone', feature: true do
Loading
@@ -11,7 +11,7 @@ feature 'Issue filtering by Milestone', feature: true do
visit_issues(project) visit_issues(project)
filter_by_milestone(Milestone::None.title) filter_by_milestone(Milestone::None.title)
   
expect(page).to have_css('.issue .title', count: 1) expect(page).to have_css('.issue', count: 1)
end end
   
context 'filters by upcoming milestone', js: true do context 'filters by upcoming milestone', js: true do
Loading
@@ -22,7 +22,7 @@ feature 'Issue filtering by Milestone', feature: true do
Loading
@@ -22,7 +22,7 @@ feature 'Issue filtering by Milestone', feature: true do
visit_issues(project) visit_issues(project)
filter_by_milestone(Milestone::Upcoming.title) filter_by_milestone(Milestone::Upcoming.title)
   
expect(page).to have_css('.issue .title', count: 0) expect(page).to have_css('.issue', count: 0)
end end
   
it 'should show issues in future' do it 'should show issues in future' do
Loading
Loading
Loading
@@ -11,7 +11,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
Loading
@@ -11,7 +11,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
visit_merge_requests(project) visit_merge_requests(project)
filter_by_milestone(Milestone::None.title) filter_by_milestone(Milestone::None.title)
   
expect(page).to have_css('.merge-request-title', count: 1) expect(page).to have_css('.merge-request', count: 1)
end end
   
context 'filters by upcoming milestone', js: true do context 'filters by upcoming milestone', js: true do
Loading
@@ -22,7 +22,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
Loading
@@ -22,7 +22,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
visit_merge_requests(project) visit_merge_requests(project)
filter_by_milestone(Milestone::Upcoming.title) filter_by_milestone(Milestone::Upcoming.title)
   
expect(page).to have_css('.merge-request-title', count: 0) expect(page).to have_css('.merge-request', count: 0)
end end
   
it 'should show issues in future' do it 'should show issues in future' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment