Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue')
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue76
1 files changed, 2 insertions, 74 deletions
diff --git a/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue b/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue
index 2c6eb0e5001..820d2e94016 100644
--- a/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue
@@ -2,46 +2,8 @@
import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import { TYPE_ISSUE, TYPE_MERGE_REQUEST } from '~/issues/constants';
import { isGid, getIdFromGraphQLId } from '~/graphql_shared/utils';
-import { __ } from '~/locale';
-import { isUserBusy } from '~/set_status_modal/utils';
import AssigneeAvatar from './assignee_avatar.vue';
-const I18N = {
- BUSY: __('Busy'),
- CANNOT_MERGE: __('Cannot merge'),
- LC_CANNOT_MERGE: __('cannot merge'),
-};
-
-const paranthesize = (str) => `(${str})`;
-
-const generateAssigneeTooltip = ({
- name,
- availability,
- cannotMerge = true,
- tooltipHasName = false,
-}) => {
- if (!tooltipHasName) {
- return cannotMerge ? I18N.CANNOT_MERGE : '';
- }
-
- const statusInformation = [];
- if (availability && isUserBusy(availability)) {
- statusInformation.push(I18N.BUSY);
- }
-
- if (cannotMerge) {
- statusInformation.push(I18N.LC_CANNOT_MERGE);
- }
-
- if (tooltipHasName && statusInformation.length) {
- const status = statusInformation.map(paranthesize).join(' ');
-
- return `${name} ${status}`;
- }
-
- return name;
-};
-
export default {
components: {
AssigneeAvatar,
@@ -55,16 +17,6 @@ export default {
type: Object,
required: true,
},
- tooltipPlacement: {
- type: String,
- default: 'bottom',
- required: false,
- },
- tooltipHasName: {
- type: Boolean,
- default: true,
- required: false,
- },
issuableType: {
type: String,
default: TYPE_ISSUE,
@@ -79,34 +31,10 @@ export default {
const canMerge = this.user.mergeRequestInteraction?.canMerge || this.user.can_merge;
return this.isMergeRequest && !canMerge;
},
- tooltipTitle() {
- const { name = '', availability = '' } = this.user;
- return generateAssigneeTooltip({
- name,
- availability,
- cannotMerge: this.cannotMerge,
- tooltipHasName: this.tooltipHasName,
- });
- },
- tooltipOption() {
- if (this.isMergeRequest) {
- return null;
- }
-
- return {
- container: 'body',
- placement: this.tooltipPlacement,
- boundary: 'viewport',
- };
- },
assigneeUrl() {
return this.user.web_url || this.user.webUrl;
},
assigneeId() {
- if (this.isMergeRequest) {
- return null;
- }
-
return isGid(this.user.id) ? getIdFromGraphQLId(this.user.id) : this.user.id;
},
},
@@ -116,10 +44,10 @@ export default {
<template>
<!-- must be `d-inline-block` or parent flex-basis causes width issues -->
<gl-link
- v-gl-tooltip="tooltipOption"
:href="assigneeUrl"
- :title="tooltipTitle"
:data-user-id="assigneeId"
+ :data-username="user.username"
+ :data-cannot-merge="cannotMerge"
data-placement="left"
class="gl-display-inline-block js-user-link"
>