Commit 7b792af8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improvements to issues/mr filters:

* use filter_params variable when set filter values
* fix project issues spinach tests
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 016981c0
...@@ -263,11 +263,11 @@ class ApplicationController < ActionController::Base ...@@ -263,11 +263,11 @@ class ApplicationController < ActionController::Base
end end
def set_filter_values(collection) def set_filter_values(collection)
assignee_id = params[:assignee_id] assignee_id = @filter_params[:assignee_id]
author_id = params[:author_id] author_id = @filter_params[:author_id]
milestone_id = params[:milestone_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)) @assignees = User.where(id: collection.pluck(:assignee_id))
@authors = User.where(id: collection.pluck(:author_id)) @authors = User.where(id: collection.pluck(:author_id))
@milestones = Milestone.where(id: collection.pluck(:milestone_id)) @milestones = Milestone.where(id: collection.pluck(:milestone_id))
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%i.fa.fa-compass %i.fa.fa-compass
All All
.dropdown.inline .dropdown.inline.assignee-filter
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.fa.fa-user %i.fa.fa-user
%span.light assignee: %span.light assignee:
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
= image_tag avatar_icon(user.email), class: "avatar s16", alt: '' = image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
= user.name = user.name
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10.author-filter
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.fa.fa-user %i.fa.fa-user
%span.light author: %span.light author:
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
= image_tag avatar_icon(user.email), class: "avatar s16", alt: '' = image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
= user.name = user.name
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10.milestone-filter
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.fa.fa-clock-o %i.fa.fa-clock-o
%span.light milestone: %span.light milestone:
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
%small.light= milestone.expires_at %small.light= milestone.expires_at
- if @project - if @project
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10.labels-filter
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.fa.fa-tags %i.fa.fa-tags
%span.light label: %span.light label:
......
...@@ -35,14 +35,20 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps ...@@ -35,14 +35,20 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end end
step 'I click "Authored by me" link' do step 'I click "Authored by me" link' do
within ".scope-filter" do within ".assignee-filter" do
click_link 'Created by me' click_link "Any"
end
within ".author-filter" do
click_link current_user.name
end end
end end
step 'I click "All" link' do step 'I click "All" link' do
within ".scope-filter" do within ".author-filter" do
click_link "Everyone's" click_link "Any"
end
within ".assignee-filter" do
click_link "Any"
end end
end end
......
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