diff options
-rw-r--r-- | app/helpers/dashboard_helper.rb | 18 | ||||
-rw-r--r-- | app/views/shared/_filter.html.haml | 2 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_issues.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_merge_requests.rb | 2 |
4 files changed, 9 insertions, 15 deletions
diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index cbc8c336bea..d93eac407b7 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -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 diff --git a/app/views/shared/_filter.html.haml b/app/views/shared/_filter.html.haml index d48a8d6c1dd..13bda305d77 100644 --- a/app/views/shared/_filter.html.haml +++ b/app/views/shared/_filter.html.haml @@ -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 diff --git a/features/steps/dashboard/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb index 47d83f73ed2..9d486bd8156 100644 --- a/features/steps/dashboard/dashboard_issues.rb +++ b/features/steps/dashboard/dashboard_issues.rb @@ -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 diff --git a/features/steps/dashboard/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb index 3c35462a8db..f6fe47470b3 100644 --- a/features/steps/dashboard/dashboard_merge_requests.rb +++ b/features/steps/dashboard/dashboard_merge_requests.rb @@ -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 |