Commit b31b3f16 authored by peterhegman's avatar peterhegman

Rename `GitLab` variables to `Gitlab`

To better follow Vue naming conventions
parent 5138606b
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import timeAgoTooltip from '../../vue_shared/components/time_ago_tooltip.vue'; import timeAgoTooltip from '../../vue_shared/components/time_ago_tooltip.vue';
import GitLabTeamMemberBadge from '../../vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue'; import GitlabTeamMemberBadge from '../../vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue';
export default { export default {
components: { components: {
timeAgoTooltip, timeAgoTooltip,
'gitlab-team-member-badge': GitLabTeamMemberBadge, GitlabTeamMemberBadge,
}, },
props: { props: {
author: { author: {
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
hasAuthor() { hasAuthor() {
return this.author && Object.keys(this.author).length; return this.author && Object.keys(this.author).length;
}, },
showGitLabTeamMemberBadge() { showGitlabTeamMemberBadge() {
return this.author?.is_gitlab_employee; return this.author?.is_gitlab_employee;
}, },
}, },
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
<span v-if="author.status_tooltip_html" v-html="author.status_tooltip_html"></span> <span v-if="author.status_tooltip_html" v-html="author.status_tooltip_html"></span>
<span class="note-headline-light">@{{ author.username }}</span> <span class="note-headline-light">@{{ author.username }}</span>
</a> </a>
<gitlab-team-member-badge v-if="showGitLabTeamMemberBadge" /> <gitlab-team-member-badge v-if="showGitlabTeamMemberBadge" />
</template> </template>
<span v-else>{{ __('A deleted user') }}</span> <span v-else>{{ __('A deleted user') }}</span>
<span class="note-headline-light note-headline-meta"> <span class="note-headline-light note-headline-meta">
......
...@@ -2,26 +2,24 @@ ...@@ -2,26 +2,24 @@
import { GlTooltipDirective, GlIcon } from '@gitlab/ui'; import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
const GITLAB_TEAM_MEMBER = __('GitLab Team Member'); const GITLAB_TEAM_MEMBER_LABEL = __('GitLab Team Member');
export default { export default {
name: 'GitLabTeamMemberBadge', name: 'GitlabTeamMemberBadge',
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
components: { GlIcon }, components: { GlIcon },
created() { gitlabTeamMemberLabel: GITLAB_TEAM_MEMBER_LABEL,
this.GITLAB_TEAM_MEMBER = GITLAB_TEAM_MEMBER;
},
}; };
</script> </script>
<template> <template>
<span <span
v-gl-tooltip.hover v-gl-tooltip.hover
:title="GITLAB_TEAM_MEMBER" :title="$options.gitlabTeamMemberLabel"
role="img" role="img"
:aria-label="GITLAB_TEAM_MEMBER" :aria-label="$options.gitlabTeamMemberLabel"
class="d-inline-block align-middle" class="d-inline-block align-middle"
> >
<gl-icon name="tanuki-verified" class="gl-text-purple d-block" /> <gl-icon name="tanuki-verified" class="gl-text-purple d-block" />
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import NoteHeader from '~/notes/components/note_header.vue'; import NoteHeader from '~/notes/components/note_header.vue';
import GitLabTeamMemberBadge from '~/vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue'; import GitlabTeamMemberBadge from '~/vue_shared/components/user_avatar/badges/gitlab_team_member_badge.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -150,7 +150,7 @@ describe('NoteHeader component', () => { ...@@ -150,7 +150,7 @@ describe('NoteHeader component', () => {
({ props, expected }) => { ({ props, expected }) => {
createComponent(props); createComponent(props);
expect(wrapper.find(GitLabTeamMemberBadge).exists()).toBe(expected); expect(wrapper.find(GitlabTeamMemberBadge).exists()).toBe(expected);
}, },
); );
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment