From 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Feb 2021 10:34:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-9-stable-ee --- app/assets/javascripts/users_select/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'app/assets/javascripts/users_select') diff --git a/app/assets/javascripts/users_select/index.js b/app/assets/javascripts/users_select/index.js index 79dc20fd498..e1a4a74b982 100644 --- a/app/assets/javascripts/users_select/index.js +++ b/app/assets/javascripts/users_select/index.js @@ -8,14 +8,15 @@ import { AJAX_USERS_SELECT_OPTIONS_MAP, AJAX_USERS_SELECT_PARAMS_MAP, } from 'ee_else_ce/users_select/constants'; -import axios from '../lib/utils/axios_utils'; -import { s__, __, sprintf } from '../locale'; -import ModalStore from '../boards/stores/modal_store'; -import { parseBoolean, spriteIcon } from '../lib/utils/common_utils'; -import { getAjaxUsersSelectOptions, getAjaxUsersSelectParams } from './utils'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; +import { isUserBusy } from '~/set_status_modal/utils'; import { fixTitle, dispose } from '~/tooltips'; +import ModalStore from '../boards/stores/modal_store'; +import axios from '../lib/utils/axios_utils'; +import { parseBoolean, spriteIcon } from '../lib/utils/common_utils'; import { loadCSSFile } from '../lib/utils/css_utils'; +import { s__, __, sprintf } from '../locale'; +import { getAjaxUsersSelectOptions, getAjaxUsersSelectParams } from './utils'; // TODO: remove eventHub hack after code splitting refactor window.emitSidebarEvent = window.emitSidebarEvent || $.noop; @@ -795,13 +796,17 @@ UsersSelect.prototype.renderRow = function ( ? `data-container="body" data-placement="left" data-title="${tooltip}"` : ''; + const name = + user?.availability && isUserBusy(user.availability) + ? sprintf(__('%{name} (Busy)'), { name: user.name }) + : user.name; return `
  • ${this.renderRowAvatar(issuableType, user, img)} - ${escape(user.name)} + ${escape(name)} ${ username @@ -834,7 +839,7 @@ UsersSelect.prototype.renderRowAvatar = function (issuableType, user, img) { UsersSelect.prototype.renderApprovalRules = function (elsClassName, approvalRules = []) { const count = approvalRules.length; - if (!gon.features?.reviewerApprovalRules || !elsClassName?.includes('reviewer') || !count) { + if (!elsClassName?.includes('reviewer') || !count) { return ''; } -- cgit v1.2.3