diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-17 18:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-17 18:09:28 +0300 |
commit | 6535cf9c79362862c31ea7d26c61541b84db18d9 (patch) | |
tree | 6d646edcf11d38e8ac23bceed1340ff8907b850d /app/assets/javascripts/notes | |
parent | 9a8f801d7352b7965fe690a599410fb50005ce67 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r-- | app/assets/javascripts/notes/components/note_header.vue | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index 1a97756c689..cacf209ed81 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -1,7 +1,8 @@ <script> /* eslint-disable vue/no-v-html */ import { mapActions } from 'vuex'; -import { GlIcon, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlIcon, GlLoadingIcon, GlTooltipDirective, GlSprintf } from '@gitlab/ui'; +import { isUserBusy } from '~/set_status_modal/utils'; import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; export default { @@ -11,6 +12,7 @@ export default { import('ee_component/vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue'), GlIcon, GlLoadingIcon, + GlSprintf, }, directives: { GlTooltip: GlTooltipDirective, @@ -85,9 +87,16 @@ export default { authorStatus() { return this.author.status_tooltip_html; }, + authorIsBusy() { + const { status } = this.author; + return status?.availability && isUserBusy(status.availability); + }, emojiElement() { return this.$refs?.authorStatus?.querySelector('gl-emoji'); }, + authorName() { + return this.author.name; + }, }, mounted() { this.emojiTitle = this.emojiElement ? this.emojiElement.getAttribute('title') : ''; @@ -146,7 +155,12 @@ export default { :data-username="author.username" > <slot name="note-header-info"></slot> - <span class="note-header-author-name bold">{{ author.name }}</span> + <span class="note-header-author-name gl-font-weight-bold"> + <gl-sprintf v-if="authorIsBusy" :message="s__('UserAvailability|%{author} (Busy)')"> + <template #author>{{ authorName }}</template> + </gl-sprintf> + <template v-else>{{ authorName }}</template> + </span> </a> <span v-if="authorStatus" |