diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 18:09:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 18:09:32 +0300 |
commit | 739467f1fa4d5d4042b47ff6637a567d1ad6a4a4 (patch) | |
tree | e9b13550a7f6373c8580b7a0eda499ad2bb9e81d /app/assets/javascripts/vue_merge_request_widget/components | |
parent | fd27e4f95b3ea8668e1e67f5a88dfb061909c893 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/components')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue index 730d11b1208..319df090ff1 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue @@ -1,5 +1,5 @@ <script> -import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; +import { GlSafeHtmlDirective as SafeHtml, GlLink } from '@gitlab/ui'; import { s__, n__ } from '~/locale'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; @@ -8,6 +8,9 @@ export default { directives: { SafeHtml, }, + components: { + GlLink, + }, mixins: [glFeatureFlagMixin()], props: { relatedLinks: { @@ -37,6 +40,17 @@ export default { return n__('mrWidget|Closes issue', 'mrWidget|Closes issues', this.relatedLinks.closingCount); }, + assignIssueText() { + if (this.relatedLinks.unassignedCount > 1) { + return s__('mrWidget|Assign yourself to these issues'); + } + return s__('mrWidget|Assign yourself to this issue'); + }, + shouldShowAssignToMeLink() { + return ( + this.relatedLinks.unassignedCount && this.relatedLinks.assignToMe && this.showAssignToMe + ); + }, }, }; </script> @@ -57,10 +71,14 @@ export default { <span v-safe-html="relatedLinks.mentioned"></span> </p> <p - v-if="relatedLinks.assignToMe && showAssignToMe" + v-if="shouldShowAssignToMeLink" :class="{ 'gl-display-line gl-m-0': glFeatures.restructuredMrWidget }" > - <span v-html="relatedLinks.assignToMe /* eslint-disable-line vue/no-v-html */"></span> + <span> + <gl-link rel="nofollow" data-method="post" :href="relatedLinks.assignToMe">{{ + assignIssueText + }}</gl-link> + </span> </p> </section> </template> |