summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-01-15 11:37:08 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-01-15 11:37:08 +0000
commitcc18608d24bc84fd7e51c256fb24325cb84ea9b5 (patch)
treebd4c260413f9c8582056cc0624850d641c3db48a /app/views/layouts
parentf402762d2c315f462fb3c805990b9842953bc8dc (diff)
parentb9f0883bc5a735f2168bddb9239dcaa2aa16c306 (diff)
downloadgitlab-ce-cc18608d24bc84fd7e51c256fb24325cb84ea9b5.tar.gz
Merge branch '41546-count-query-for-issues-and-mrs-runs-twice-on-group-index' into 'master'
Resolve "Count query for issues and MRs runs twice on group index" Closes #41546 See merge request gitlab-org/gitlab-ce!16314
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/nav/sidebar/_group.html.haml12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml
index 0c27b09f7b1..96aae06a9df 100644
--- a/app/views/layouts/nav/sidebar/_group.html.haml
+++ b/app/views/layouts/nav/sidebar/_group.html.haml
@@ -1,5 +1,5 @@
-- issues = IssuesFinder.new(current_user, group_id: @group.id, state: 'opened').execute
-- merge_requests = MergeRequestsFinder.new(current_user, group_id: @group.id, state: 'opened', non_archived: true).execute
+- issues_count = IssuesFinder.new(current_user, group_id: @group.id, state: 'opened').execute.count
+- merge_requests_count = MergeRequestsFinder.new(current_user, group_id: @group.id, state: 'opened', non_archived: true).execute.count
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
@@ -39,14 +39,14 @@
= sprite_icon('issues')
%span.nav-item-name
Issues
- %span.badge.count= number_with_delimiter(issues.count)
+ %span.badge.count= number_with_delimiter(issues_count)
%ul.sidebar-sub-level-items
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index'], html_options: { class: "fly-out-top-item" } ) do
= link_to issues_group_path(@group) do
%strong.fly-out-top-item-name
#{ _('Issues') }
- %span.badge.count.issue_counter.fly-out-badge= number_with_delimiter(issues.count)
+ %span.badge.count.issue_counter.fly-out-badge= number_with_delimiter(issues_count)
%li.divider.fly-out-top-item
= nav_link(path: 'groups#issues', html_options: { class: 'home' }) do
= link_to issues_group_path(@group), title: 'List' do
@@ -69,13 +69,13 @@
= sprite_icon('git-merge')
%span.nav-item-name
Merge Requests
- %span.badge.count= number_with_delimiter(merge_requests.count)
+ %span.badge.count= number_with_delimiter(merge_requests_count)
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'groups#merge_requests', html_options: { class: "fly-out-top-item" } ) do
= link_to merge_requests_group_path(@group) do
%strong.fly-out-top-item-name
#{ _('Merge Requests') }
- %span.badge.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(merge_requests.count)
+ %span.badge.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(merge_requests_count)
= nav_link(path: 'group_members#index') do
= link_to group_group_members_path(@group) do
.nav-icon-container