diff options
Diffstat (limited to 'app/assets/javascripts/sidebar/components/reviewers')
3 files changed, 24 insertions, 1 deletions
diff --git a/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue b/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue index 5729b958b5d..b07fd944ff9 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue @@ -49,6 +49,9 @@ export default { requestReview(data) { this.$emit('request-review', data); }, + toggleAttentionRequested(data) { + this.$emit('toggle-attention-requested', data); + }, }, }; </script> @@ -70,6 +73,7 @@ export default { :root-path="rootPath" :issuable-type="issuableType" @request-review="requestReview" + @toggle-attention-requested="toggleAttentionRequested" /> </div> </div> diff --git a/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue b/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue index e414aaf719b..2ea63219e92 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue @@ -88,6 +88,9 @@ export default { requestReview(data) { this.mediator.requestReview(data); }, + toggleAttentionRequested(data) { + this.mediator.toggleAttentionRequested('reviewer', data); + }, }, }; </script> @@ -106,6 +109,7 @@ export default { :editable="store.editable" :issuable-type="issuableType" @request-review="requestReview" + @toggle-attention-requested="toggleAttentionRequested" /> </div> </template> 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 2922008cfb2..adaf1b65f3f 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue @@ -1,6 +1,8 @@ <script> import { GlButton, GlTooltipDirective, GlIcon } from '@gitlab/ui'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { __, sprintf, s__ } from '~/locale'; +import AttentionRequestedToggle from '../attention_requested_toggle.vue'; import ReviewerAvatarLink from './reviewer_avatar_link.vue'; const LOADING_STATE = 'loading'; @@ -14,10 +16,12 @@ export default { GlButton, GlIcon, ReviewerAvatarLink, + AttentionRequestedToggle, }, directives: { GlTooltip: GlTooltipDirective, }, + mixins: [glFeatureFlagsMixin()], props: { users: { type: Array, @@ -76,6 +80,9 @@ export default { this.loadingStates[userId] = null; } }, + toggleAttentionRequested(data) { + this.$emit('toggle-attention-requested', data); + }, }, LOADING_STATE, SUCCESS_STATE, @@ -90,6 +97,12 @@ export default { :class="{ 'gl-mb-3': index !== users.length - 1 }" data-testid="reviewer" > + <attention-requested-toggle + v-if="glFeatures.mrAttentionRequests && user.can_update_merge_request" + :user="user" + type="reviewer" + @toggle-attention-requested="toggleAttentionRequested" + /> <reviewer-avatar-link :user="user" :root-path="rootPath" :issuable-type="issuableType"> <div class="gl-ml-3 gl-line-height-normal gl-display-grid"> <span>{{ user.name }}</span> @@ -113,7 +126,9 @@ export default { data-testid="re-request-success" /> <gl-button - v-else-if="user.can_update_merge_request && user.reviewed" + v-else-if=" + user.can_update_merge_request && user.reviewed && !glFeatures.mrAttentionRequests + " v-gl-tooltip.left :title="$options.i18n.reRequestReview" :aria-label="$options.i18n.reRequestReview" |