diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /app/assets/javascripts/sidebar/components/attention_requested_toggle.vue | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/sidebar/components/attention_requested_toggle.vue')
-rw-r--r-- | app/assets/javascripts/sidebar/components/attention_requested_toggle.vue | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue b/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue deleted file mode 100644 index 974ad189f32..00000000000 --- a/app/assets/javascripts/sidebar/components/attention_requested_toggle.vue +++ /dev/null @@ -1,105 +0,0 @@ -<script> -import { GlButton, GlTooltipDirective } from '@gitlab/ui'; -import { __ } from '~/locale'; -import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants'; - -export default { - i18n: { - addAttentionRequest: __('Add attention request'), - removeAttentionRequest: __('Remove attention request'), - attentionRequestedNoPermission: __('Attention requested'), - noAttentionRequestedNoPermission: __('No attention request'), - }, - components: { - GlButton, - }, - directives: { - GlTooltip: GlTooltipDirective, - }, - props: { - type: { - type: String, - required: true, - }, - user: { - type: Object, - required: true, - }, - }, - data() { - return { - loading: false, - }; - }, - computed: { - tooltipTitle() { - if (this.user.attention_requested) { - if (this.user.can_update_merge_request) { - return this.$options.i18n.removeAttentionRequest; - } - - return this.$options.i18n.attentionRequestedNoPermission; - } - - if (this.user.can_update_merge_request) { - return this.$options.i18n.addAttentionRequest; - } - - return this.$options.i18n.noAttentionRequestedNoPermission; - }, - request() { - const state = { - selected: false, - icon: 'attention', - direction: 'add', - }; - - if (this.user.attention_requested) { - Object.assign(state, { - selected: true, - icon: 'attention-solid', - direction: 'remove', - }); - } - - return state; - }, - }, - methods: { - toggleAttentionRequired() { - if (this.loading || !this.user.can_update_merge_request) return; - - this.$root.$emit(BV_HIDE_TOOLTIP); - this.loading = true; - this.$emit('toggle-attention-requested', { - user: this.user, - callback: this.toggleAttentionRequiredComplete, - direction: this.request.direction, - }); - }, - toggleAttentionRequiredComplete() { - this.loading = false; - }, - }, -}; -</script> - -<template> - <div> - <span - v-gl-tooltip.left.viewport="tooltipTitle" - class="gl-display-inline-block js-attention-request-toggle" - > - <gl-button - :loading="loading" - :selected="request.selected" - :icon="request.icon" - :aria-label="tooltipTitle" - :class="{ 'gl-pointer-events-none': !user.can_update_merge_request }" - size="small" - category="tertiary" - @click="toggleAttentionRequired" - /> - </span> - </div> -</template> |