Commit 05bd6e61 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'tor/feature/mr-list-attention-requests' into 'master'

Add Attention Request icon to MR List users

See merge request gitlab-org/gitlab!77136
parents f066c8fd 735603d3
......@@ -890,3 +890,13 @@
}
}
}
.icon-overlap-and-shadow {
filter:
drop-shadow(0 1px 0.5px #fff)
drop-shadow(1px 0 0.5px #fff)
drop-shadow(0 -1px 0.5px #fff)
drop-shadow(-1px 0 0.5px #fff);
margin-right: -7px;
z-index: 1;
}
......@@ -62,10 +62,10 @@ module ProjectsHelper
name: author.name
}
inject_classes = ["author-link"]
inject_classes = ["author-link", opts[:extra_class]]
if opts[:name]
inject_classes.concat(["js-user-link", opts[:extra_class], opts[:mobile_classes]])
inject_classes.concat(["js-user-link", opts[:mobile_classes]])
else
inject_classes.append( "has-tooltip" )
end
......
......@@ -3,8 +3,11 @@
- render_count = assignees_rendering_overflow ? max_render - 1 : max_render
- more_assignees_count = issuable.assignees.size - render_count
- issuable.assignees.take(render_count).each do |assignee| # rubocop: disable CodeReuse/ActiveRecord
= link_to_member(@project, assignee, name: false, title: _("Assigned to %{name}") % { name: assignee.name})
- if issuable.instance_of?(MergeRequest) && Feature.enabled?(:mr_attention_requests, default_enabled: :yaml)
= render 'shared/issuable/merge_request_assignees', issuable: issuable, count: render_count
- else
- issuable.assignees.take(render_count).each do |assignee| # rubocop: disable CodeReuse/ActiveRecord
= link_to_member(@project, assignee, name: false, title: s_("MrList|Assigned to %{name}, go to their profile.") % { name: assignee.name})
- if more_assignees_count > 0
%span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old', qa_selector: 'avatar_counter_content' }, title: _("+%{more_assignees_count} more assignees") % { more_assignees_count: more_assignees_count} }
......
- issuable.merge_request_assignees.take(count).each do |merge_request_assignee| # rubocop: disable CodeReuse/ActiveRecord
- assignee = merge_request_assignee.assignee
- assignee_tooltip = ( merge_request_assignee.attention_requested? ? s_("MrList|Attention requested from assignee %{name}, go to their profile.") : s_("MrList|Assigned to %{name}, go to their profile.") ) % { name: assignee.name}
= link_to_member(@project, assignee, name: false, title: assignee_tooltip, extra_class: "gl-flex-direction-row-reverse") do
- if merge_request_assignee.attention_requested?
%span.gl-display-inline-flex
= sprite_icon('attention-solid-sm', css_class: 'gl-text-orange-500 icon-overlap-and-shadow')
- issuable.merge_request_reviewers.take(count).each do |merge_request_reviewer| # rubocop: disable CodeReuse/ActiveRecord
- reviewer = merge_request_reviewer.reviewer
- reviewer_tooltip = ( merge_request_reviewer.attention_requested? ? s_("MrList|Attention requested from reviewer %{name}, go to their profile.") : s_("MrList|Review requested from %{name}, go to their profile.") ) % { name: reviewer.name}
= link_to_member(@project, reviewer, name: false, title: reviewer_tooltip, extra_class: "gl-flex-direction-row-reverse") do
- if merge_request_reviewer.attention_requested?
%span.gl-display-inline-flex
= sprite_icon('attention-solid-sm', css_class: 'gl-text-orange-500 icon-overlap-and-shadow')
......@@ -3,8 +3,11 @@
- render_count = reviewers_rendering_overflow ? max_render - 1 : max_render
- more_reviewers_count = issuable.reviewers.size - render_count
- issuable.reviewers.take(render_count).each do |reviewer| # rubocop: disable CodeReuse/ActiveRecord
= link_to_member(@project, reviewer, name: false, title: _("Review requested from %{name}") % { name: reviewer.name})
- if issuable.instance_of?(MergeRequest) && Feature.enabled?(:mr_attention_requests, default_enabled: :yaml)
= render 'shared/issuable/merge_request_reviewers', issuable: issuable, count: render_count
- else
- issuable.reviewers.take(render_count).each do |reviewer| # rubocop: disable CodeReuse/ActiveRecord
= link_to_member(@project, reviewer, name: false, title: s_("MrList|Review requested from %{name}, go to their profile.") % { name: reviewer.name})
- if more_reviewers_count > 0
%span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old' }, title: _("+%{more_reviewers_count} more reviewers") % { more_reviewers_count: more_reviewers_count} }
......
......@@ -4918,9 +4918,6 @@ msgstr ""
msgid "Assigned to %{assignee_name}"
msgstr ""
msgid "Assigned to %{name}"
msgstr ""
msgid "Assigned to me"
msgstr ""
......@@ -23494,6 +23491,18 @@ msgstr ""
msgid "MrDeploymentActions|Stop environment"
msgstr ""
msgid "MrList|Assigned to %{name}, go to their profile."
msgstr ""
msgid "MrList|Attention requested from assignee %{name}, go to their profile."
msgstr ""
msgid "MrList|Attention requested from reviewer %{name}, go to their profile."
msgstr ""
msgid "MrList|Review requested from %{name}, go to their profile."
msgstr ""
msgid "Multi-project"
msgstr ""
......@@ -30777,9 +30786,6 @@ msgstr ""
msgid "Review changes"
msgstr ""
msgid "Review requested from %{name}"
msgstr ""
msgid "Review requests for you"
msgstr ""
......
......@@ -8,6 +8,8 @@ RSpec.describe 'Merge requests > User mass updates', :js do
let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
before do
stub_feature_flags(mr_attention_requests: false)
project.add_maintainer(user)
sign_in(user)
end
......@@ -59,6 +61,18 @@ RSpec.describe 'Merge requests > User mass updates', :js do
expect(find('.merge-request')).to have_link "Assigned to #{user.name}"
end
describe 'with attention requests feature flag on' do
before do
stub_feature_flags(mr_attention_requests: true)
end
it 'updates merge request with assignee' do
change_assignee(user.name)
expect(find('.issuable-meta a.author-link')[:title]).to eq "Attention requested from assignee #{user.name}, go to their profile."
end
end
end
describe 'remove assignee' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment