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
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
......
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