summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb15
-rw-r--r--app/views/discussions/_jump_to_next.html.haml4
-rw-r--r--app/views/projects/merge_requests/show/_versions.html.haml10
3 files changed, 19 insertions, 10 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ed41bf04fc0..2163a437c48 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -286,8 +286,19 @@ module ApplicationHelper
}
state_title = titles[state] || state.to_s.humanize
- count = records.public_send(state).size
- html = content_tag :span, state_title
+ records_with_state = records.public_send(state)
+
+ # When filtering by multiple labels, the result of query.count is a Hash
+ # of the form { issuable_id1 => N, issuable_id2 => N }, where N is the
+ # number of labels selected. The ugly "trick" is to load the issuables
+ # as an array and get the size of the array...
+ # We should probably try to solve this properly in the future.
+ # See https://gitlab.com/gitlab-org/gitlab-ce/issues/22414
+ label_names = Array(params.fetch(:label_name, []))
+ records_with_state = records_with_state.to_a if label_names.many?
+
+ count = records_with_state.size
+ html = content_tag :span, state_title
if count.present?
html += " "
diff --git a/app/views/discussions/_jump_to_next.html.haml b/app/views/discussions/_jump_to_next.html.haml
index da970792b4d..7ed09dd1a98 100644
--- a/app/views/discussions/_jump_to_next.html.haml
+++ b/app/views/discussions/_jump_to_next.html.haml
@@ -1,4 +1,3 @@
-- diff_notes_disabled = (@merge_request_diff.latest? && !!@start_sha) if @merge_request_diff
- discussion = local_assigns.fetch(:discussion, nil)
- if current_user
%jump-to-discussion{ "inline-template" => true, ":discussion-id" => "'#{discussion.try(:id)}'" }
@@ -6,6 +5,5 @@
%button.btn.btn-default.discussion-next-btn.has-tooltip{ "@click" => "jumpToNextUnresolvedDiscussion",
title: "Jump to next unresolved discussion",
"aria-label" => "Jump to next unresolved discussion",
- data: { container: "body" },
- disabled: diff_notes_disabled }
+ data: { container: "body" }}
= custom_icon("next_discussion")
diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml
index 8f7b5d1543e..33e56d5417f 100644
--- a/app/views/projects/merge_requests/show/_versions.html.haml
+++ b/app/views/projects/merge_requests/show/_versions.html.haml
@@ -12,9 +12,9 @@
%span.caret
%ul.dropdown-menu.dropdown-menu-selectable
.dropdown-title
- %span Version:
+ %span Version
%button.dropdown-title-button.dropdown-menu-close
- %i.fa.fa-times.dropdown-menu-close-icon
+ = icon('times', class: 'dropdown-menu-close-icon')
- @merge_request_diffs.each do |merge_request_diff|
%li
= link_to merge_request_version_path(@project, @merge_request, merge_request_diff), class: ('is-active' if merge_request_diff == @merge_request_diff) do
@@ -40,9 +40,9 @@
%span.caret
%ul.dropdown-menu.dropdown-menu-selectable
.dropdown-title
- %span Compared with:
+ %span Compared with
%button.dropdown-title-button.dropdown-menu-close
- %i.fa.fa-times.dropdown-menu-close-icon
+ = icon('times', class: 'dropdown-menu-close-icon')
- @comparable_diffs.each do |merge_request_diff|
%li
= link_to merge_request_version_path(@project, @merge_request, @merge_request_diff, merge_request_diff.head_commit_sha), class: ('is-active' if merge_request_diff == @start_version) do
@@ -67,4 +67,4 @@
Comments are disabled because you're comparing two versions of this merge request.
- else
Comments are disabled because you're viewing an old version of this merge request.
- = link_to 'Show latest version', merge_request_version_path(@project, @merge_request, @merge_request_diff), class: 'btn btn-sm'
+ = link_to 'Show latest version', diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-sm'