Improvements to issues/mr filters:
* use filter_params variable when set filter values * fix project issues spinach tests Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
016981c009
commit
7b792af872
3 changed files with 18 additions and 12 deletions
|
@ -263,11 +263,11 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def set_filter_values(collection)
|
||||
assignee_id = params[:assignee_id]
|
||||
author_id = params[:author_id]
|
||||
milestone_id = params[:milestone_id]
|
||||
assignee_id = @filter_params[:assignee_id]
|
||||
author_id = @filter_params[:author_id]
|
||||
milestone_id = @filter_params[:milestone_id]
|
||||
|
||||
@sort = params[:sort].try(:humanize)
|
||||
@sort = @filter_params[:sort].try(:humanize)
|
||||
@assignees = User.where(id: collection.pluck(:assignee_id))
|
||||
@authors = User.where(id: collection.pluck(:author_id))
|
||||
@milestones = Milestone.where(id: collection.pluck(:milestone_id))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
%i.fa.fa-compass
|
||||
All
|
||||
|
||||
.dropdown.inline
|
||||
.dropdown.inline.assignee-filter
|
||||
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
|
||||
%i.fa.fa-user
|
||||
%span.light assignee:
|
||||
|
@ -37,7 +37,7 @@
|
|||
= image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
|
||||
= user.name
|
||||
|
||||
.dropdown.inline.prepend-left-10
|
||||
.dropdown.inline.prepend-left-10.author-filter
|
||||
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
|
||||
%i.fa.fa-user
|
||||
%span.light author:
|
||||
|
@ -60,7 +60,7 @@
|
|||
= image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
|
||||
= user.name
|
||||
|
||||
.dropdown.inline.prepend-left-10
|
||||
.dropdown.inline.prepend-left-10.milestone-filter
|
||||
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
|
||||
%i.fa.fa-clock-o
|
||||
%span.light milestone:
|
||||
|
@ -84,7 +84,7 @@
|
|||
%small.light= milestone.expires_at
|
||||
|
||||
- if @project
|
||||
.dropdown.inline.prepend-left-10
|
||||
.dropdown.inline.prepend-left-10.labels-filter
|
||||
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
|
||||
%i.fa.fa-tags
|
||||
%span.light label:
|
||||
|
|
|
@ -35,14 +35,20 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
step 'I click "Authored by me" link' do
|
||||
within ".scope-filter" do
|
||||
click_link 'Created by me'
|
||||
within ".assignee-filter" do
|
||||
click_link "Any"
|
||||
end
|
||||
within ".author-filter" do
|
||||
click_link current_user.name
|
||||
end
|
||||
end
|
||||
|
||||
step 'I click "All" link' do
|
||||
within ".scope-filter" do
|
||||
click_link "Everyone's"
|
||||
within ".author-filter" do
|
||||
click_link "Any"
|
||||
end
|
||||
within ".assignee-filter" do
|
||||
click_link "Any"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue