diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/assets/javascripts/members/components | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/members/components')
3 files changed, 26 insertions, 3 deletions
diff --git a/app/assets/javascripts/members/components/avatars/user_avatar.vue b/app/assets/javascripts/members/components/avatars/user_avatar.vue index 9687eacb036..ec59f0f681c 100644 --- a/app/assets/javascripts/members/components/avatars/user_avatar.vue +++ b/app/assets/javascripts/members/components/avatars/user_avatar.vue @@ -8,10 +8,14 @@ import { import { generateBadges } from 'ee_else_ce/members/utils'; import { glEmojiTag } from '~/emoji'; import { __ } from '~/locale'; +import { isUserBusy } from '~/set_status_modal/utils'; import { AVATAR_SIZE } from '../../constants'; export default { name: 'UserAvatar', + i18n: { + busy: __('Busy'), + }, avatarSize: AVATAR_SIZE, orphanedUserLabel: __('Orphaned member'), safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, @@ -46,7 +50,10 @@ export default { }).filter((badge) => badge.show); }, statusEmoji() { - return this.user?.status?.emoji; + return this.user?.showStatus && this.user?.status?.emoji; + }, + isUserBusy() { + return isUserBusy(this.user?.availability || ''); }, }, methods: { @@ -73,6 +80,11 @@ export default { :entity-id="user.id" > <template #meta> + <div v-if="isUserBusy" class="gl-p-1"> + <span class="gl-text-gray-500 gl-font-sm gl-font-weight-normal" + >({{ $options.i18n.busy }})</span + > + </div> <div v-if="statusEmoji" class="gl-p-1"> <span v-safe-html:[$options.safeHtmlConfig]="glEmojiTag(statusEmoji)" diff --git a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue index e9329fb1d88..633dee75237 100644 --- a/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue +++ b/app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue @@ -151,6 +151,7 @@ export default { :search-input-placeholder="filteredSearchBar.placeholder" :initial-filter-value="initialFilterValue" data-testid="members-filtered-search-bar" + data-qa-selector="members_filtered_search_bar_content" @onFilter="handleFilter" /> </template> diff --git a/app/assets/javascripts/members/components/table/members_table.vue b/app/assets/javascripts/members/components/table/members_table.vue index e09d16cf680..b4ba9aa36e7 100644 --- a/app/assets/javascripts/members/components/table/members_table.vue +++ b/app/assets/javascripts/members/components/table/members_table.vue @@ -11,7 +11,9 @@ import { ACTIVE_TAB_QUERY_PARAM_NAME, TAB_QUERY_PARAM_VALUES, MEMBER_STATE_AWAITING, + MEMBER_STATE_ACTIVE, USER_STATE_BLOCKED_PENDING_APPROVAL, + BADGE_LABELS_AWAITING_USER_SIGNUP, BADGE_LABELS_PENDING_OWNER_APPROVAL, } from '../../constants'; import RemoveGroupLinkModal from '../modals/remove_group_link_modal.vue'; @@ -154,8 +156,12 @@ export default { * @see {@link ~/app/serializers/member_entity.rb} * @returns {boolean} */ - isNewUser(memberInviteMetadata) { - return memberInviteMetadata && !memberInviteMetadata.userState; + isNewUser(memberInviteMetadata, memberState) { + return ( + memberInviteMetadata && + !memberInviteMetadata.userState && + memberState !== MEMBER_STATE_ACTIVE + ); }, /** * Returns whether the user is awaiting root approval @@ -204,6 +210,10 @@ export default { * @returns {string} */ inviteBadge(memberInviteMetadata, memberState) { + if (this.isNewUser(memberInviteMetadata, memberState)) { + return BADGE_LABELS_AWAITING_USER_SIGNUP; + } + if (this.shouldAddPendingOwnerApprovalBadge(memberInviteMetadata, memberState)) { return BADGE_LABELS_PENDING_OWNER_APPROVAL; } |