Skip to content
Snippets Groups Projects
Verified Commit 1a2e11c8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix per-project counters for Dashboard filters

parent f6a4e563
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,17 +14,11 @@ module DashboardHelper
end
 
def entities_per_project(project, entity)
items = project.items_for(entity)
items = case params[:status]
when 'closed'
items.closed
when 'all'
items
else
items.opened
end
items.cared(current_user).count
case entity.to_sym
when :issue then @issues.where(project_id: project.id)
when :merge_request then @merge_requests.where(target_project_id: project.id)
else
[]
end.count
end
end
Loading
Loading
@@ -6,7 +6,7 @@
Assigned to me
%li{class: ("active" if params[:scope] == 'authored')}
= link_to filter_path(entity, scope: 'authored') do
Authored by me
Created by me
%li{class: ("active" if params[:scope] == 'all')}
= link_to filter_path(entity, scope: 'all') do
All
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ class DashboardIssues < Spinach::FeatureSteps
 
step 'I click "Authored by me" link' do
within ".scope-filter" do
click_link 'Authored by me'
click_link 'Created by me'
end
end
 
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ class DashboardMergeRequests < Spinach::FeatureSteps
 
step 'I click "Authored by me" link' do
within ".scope-filter" do
click_link 'Authored by me'
click_link 'Created by me'
end
end
 
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