summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-02-17 12:28:29 +0000
committerSean McGivern <sean@gitlab.com>2017-02-17 12:44:10 +0000
commitbf93a9f50c9fa3c1133d24af701829879eba2f44 (patch)
tree27fc1af2c2fe9f6ec9f4f2299a1e1ede38206e42
parent35824650433c319a817428029b096743a18caa6f (diff)
downloadgitlab-ce-remove-issue-and-mr-counts-from-labels-page.tar.gz
Remove issue and MR counts from labels indexremove-issue-and-mr-counts-from-labels-page
We were performing two (quite slow, because of the need to do access checks) queries for each label on the page: one to get the count of issues with that label, and one to get the count of merge requests with that label. Until we have a performant way of doing this, remove the counts.
-rw-r--r--app/views/shared/_label.html.haml10
-rw-r--r--changelogs/unreleased/remove-issue-and-mr-counts-from-labels-page.yml4
2 files changed, 8 insertions, 6 deletions
diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml
index ead9b84b991..1744a597c51 100644
--- a/app/views/shared/_label.html.haml
+++ b/app/views/shared/_label.html.haml
@@ -1,6 +1,4 @@
- label_css_id = dom_id(label)
-- open_issues_count = label.open_issues_count(current_user)
-- open_merge_requests_count = label.open_merge_requests_count(current_user)
- status = label_subscription_status(label, @project).inquiry if current_user
- subject = local_assigns[:subject]
@@ -15,10 +13,10 @@
%ul
%li
= link_to_label(label, subject: subject, type: :merge_request) do
- = pluralize open_merge_requests_count, 'merge request'
+ view merge requests
%li
= link_to_label(label, subject: subject) do
- = pluralize open_issues_count, 'open issue'
+ view open issues
- if current_user && defined?(@project)
%li.label-subscription
- if label.is_a?(ProjectLabel)
@@ -40,9 +38,9 @@
.pull-right.hidden-xs.hidden-sm.hidden-md
= link_to_label(label, subject: subject, type: :merge_request, css_class: 'btn btn-transparent btn-action') do
- = pluralize open_merge_requests_count, 'merge request'
+ view merge requests
= link_to_label(label, subject: subject, css_class: 'btn btn-transparent btn-action') do
- = pluralize open_issues_count, 'open issue'
+ view open issues
- if current_user && defined?(@project)
.label-subscription.inline
diff --git a/changelogs/unreleased/remove-issue-and-mr-counts-from-labels-page.yml b/changelogs/unreleased/remove-issue-and-mr-counts-from-labels-page.yml
new file mode 100644
index 00000000000..b75b4644ba3
--- /dev/null
+++ b/changelogs/unreleased/remove-issue-and-mr-counts-from-labels-page.yml
@@ -0,0 +1,4 @@
+---
+title: Remove issue and MR counts from labels index
+merge_request:
+author: