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/notes/components/note_header.vue')
-rw-r--r--app/assets/javascripts/notes/components/note_header.vue67
1 files changed, 8 insertions, 59 deletions
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue
index f700802d6bc..f3530344181 100644
--- a/app/assets/javascripts/notes/components/note_header.vue
+++ b/app/assets/javascripts/notes/components/note_header.vue
@@ -9,8 +9,6 @@ import {
import { mapActions } from 'vuex';
import { __, s__ } from '~/locale';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
-import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue';
-import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
@@ -21,13 +19,11 @@ export default {
GlIcon,
GlBadge,
GlLoadingIcon,
- UserNameWithStatus,
},
directives: {
SafeHtml,
GlTooltip: GlTooltipDirective,
},
- mixins: [glFeatureFlagsMixin()],
props: {
author: {
type: Object,
@@ -74,12 +70,15 @@ export default {
required: false,
default: false,
},
+ isSystemNote: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
data() {
return {
isUsernameLinkHovered: false,
- emojiTitle: '',
- authorStatusHasTooltip: false,
};
},
computed: {
@@ -100,15 +99,6 @@ export default {
'js-user-link': true,
};
},
- authorStatus() {
- if (this.author?.show_status) {
- return this.author.status_tooltip_html;
- }
- return false;
- },
- emojiElement() {
- return this.$refs?.authorStatus?.querySelector('gl-emoji');
- },
authorName() {
return this.author.name;
},
@@ -116,14 +106,6 @@ export default {
return s__('Notes|This internal note will always remain confidential');
},
},
- mounted() {
- this.emojiTitle = this.emojiElement ? this.emojiElement.getAttribute('title') : '';
-
- const authorStatusTitle = this.$refs?.authorStatus
- ?.querySelector('.user-status-emoji')
- ?.getAttribute('title');
- this.authorStatusHasTooltip = authorStatusTitle && authorStatusTitle !== '';
- },
methods: {
...mapActions(['setTargetNoteHash']),
handleToggle() {
@@ -134,12 +116,6 @@ export default {
this.setTargetNoteHash(this.noteTimestampLink);
}
},
- removeEmojiTitle() {
- this.emojiElement.removeAttribute('title');
- },
- addEmojiTitle() {
- this.emojiElement.setAttribute('title', this.emojiTitle);
- },
handleUsernameMouseEnter() {
this.$refs.authorNameLink.dispatchEvent(new Event('mouseenter'));
this.isUsernameLinkHovered = true;
@@ -148,9 +124,6 @@ export default {
this.$refs.authorNameLink.dispatchEvent(new Event('mouseleave'));
this.isUsernameLinkHovered = false;
},
- userAvailability(selectedAuthor) {
- return selectedAuthor?.availability || '';
- },
},
i18n: {
showThread: __('Show thread'),
@@ -185,35 +158,11 @@ export default {
:data-user-id="author.id"
:data-username="author.username"
>
- <span
- v-if="glFeatures.removeUserAttributesProjects || glFeatures.removeUserAttributesGroups"
- class="note-header-author-name gl-font-weight-bold"
- >
+ <span class="note-header-author-name gl-font-weight-bold">
{{ authorName }}
</span>
- <user-name-with-status
- v-else
- :name="authorName"
- :availability="userAvailability(author)"
- container-classes="note-header-author-name gl-font-weight-bold"
- />
</a>
- <span
- v-if="
- authorStatus &&
- !glFeatures.removeUserAttributesProjects &&
- !glFeatures.removeUserAttributesGroups
- "
- ref="authorStatus"
- v-safe-html:[$options.safeHtmlConfig]="authorStatus"
- v-on="
- authorStatusHasTooltip ? { mouseenter: removeEmojiTitle, mouseleave: addEmojiTitle } : {}
- "
- ></span>
- <span
- v-if="!glFeatures.removeUserAttributesProjects && !glFeatures.removeUserAttributesGroups"
- class="text-nowrap author-username"
- >
+ <span v-if="!isSystemNote" class="text-nowrap author-username">
<a
ref="authorUsernameLink"
class="author-username-link"
@@ -252,7 +201,7 @@ export default {
data-testid="internalNoteIndicator"
variant="warning"
size="sm"
- class="gl-mb-3 gl-ml-2"
+ class="gl-ml-2"
:title="internalNoteTooltip"
>
{{ __('Internal note') }}