diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 18:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 18:07:48 +0300 |
commit | e46506bcc32de1af076ec8a5d51d405f827dd986 (patch) | |
tree | bb08cb3d53132eef0e8d17e1f6bab9d672454ddd /app/assets/javascripts/sidebar | |
parent | e105f6b881d9341331558c8c42f90391bab2fd19 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sidebar')
3 files changed, 19 insertions, 8 deletions
diff --git a/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue b/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue index a27dbee31ec..558fe8ca2aa 100644 --- a/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue +++ b/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue @@ -114,7 +114,7 @@ export default { class="gl-display-inline-block" > <attention-requested-toggle - v-if="showVerticalList && user.can_update_merge_request" + v-if="showVerticalList" :user="user" type="assignee" @toggle-attention-requested="toggleAttentionRequested" diff --git a/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue b/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue index 42e56906e2c..d11bed4f058 100644 --- a/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue +++ b/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue @@ -8,6 +8,8 @@ export default { attentionRequestedReviewer: __('Request attention to review'), attentionRequestedAssignee: __('Request attention'), removeAttentionRequested: __('Remove attention request'), + attentionRequestedNoPermission: __('Attention requested'), + noAttentionRequestedNoPermission: __('No attention request'), }, components: { GlButton, @@ -33,17 +35,25 @@ export default { computed: { tooltipTitle() { if (this.user.attention_requested) { - return this.$options.i18n.removeAttentionRequested; + if (this.user.can_update_merge_request) { + return this.$options.i18n.removeAttentionRequested; + } + + return this.$options.i18n.attentionRequestedNoPermission; + } + + if (this.user.can_update_merge_request) { + return this.type === 'reviewer' + ? this.$options.i18n.attentionRequestedReviewer + : this.$options.i18n.attentionRequestedAssignee; } - return this.type === 'reviewer' - ? this.$options.i18n.attentionRequestedReviewer - : this.$options.i18n.attentionRequestedAssignee; + return this.$options.i18n.noAttentionRequestedNoPermission; }, }, methods: { toggleAttentionRequired() { - if (this.loading) return; + if (this.loading || !this.user.can_update_merge_request) return; this.$root.$emit(BV_HIDE_TOOLTIP); this.loading = true; @@ -60,12 +70,13 @@ export default { </script> <template> - <span v-gl-tooltip.left.viewport="tooltipTitle"> + <span v-gl-tooltip.left.viewport="tooltipTitle" class="gl-display-inline-block"> <gl-button :loading="loading" :variant="user.attention_requested ? 'warning' : 'default'" :icon="user.attention_requested ? 'attention-solid' : 'attention'" :aria-label="tooltipTitle" + :class="{ 'gl-pointer-events-none': !user.can_update_merge_request }" size="small" category="tertiary" @click="toggleAttentionRequired" diff --git a/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue b/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue index adaf1b65f3f..9485802d3da 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue @@ -98,7 +98,7 @@ export default { data-testid="reviewer" > <attention-requested-toggle - v-if="glFeatures.mrAttentionRequests && user.can_update_merge_request" + v-if="glFeatures.mrAttentionRequests" :user="user" type="reviewer" @toggle-attention-requested="toggleAttentionRequested" |