@atlaskit/user-picker 11.24.0 → 11.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/analytics.js +3 -2
- package/dist/cjs/components/AvatarItemOption.js +31 -2
- package/dist/cjs/components/AvatarOrIcon.js +1 -1
- package/dist/cjs/components/BaseUserPicker.js +69 -39
- package/dist/cjs/components/CustomOption/main.js +1 -1
- package/dist/cjs/components/EmailOption/main.js +1 -1
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/cjs/components/GroupOption/main.js +1 -1
- package/dist/cjs/components/MultiValue.js +48 -44
- package/dist/cjs/components/SingleValue.compiled.css +2 -0
- package/dist/cjs/components/SingleValue.js +12 -2
- package/dist/cjs/components/i18n.js +5 -0
- package/dist/cjs/components/utils.js +1 -1
- package/dist/cjs/util/group-options-by-type/index.js +7 -3
- package/dist/es2019/analytics.js +2 -1
- package/dist/es2019/components/AvatarItemOption.js +31 -2
- package/dist/es2019/components/AvatarOrIcon.js +1 -1
- package/dist/es2019/components/BaseUserPicker.js +30 -1
- package/dist/es2019/components/CustomOption/main.js +1 -1
- package/dist/es2019/components/EmailOption/main.js +1 -1
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/es2019/components/GroupOption/main.js +1 -1
- package/dist/es2019/components/MultiValue.js +43 -35
- package/dist/es2019/components/SingleValue.compiled.css +2 -0
- package/dist/es2019/components/SingleValue.js +11 -2
- package/dist/es2019/components/i18n.js +5 -0
- package/dist/es2019/components/utils.js +1 -1
- package/dist/es2019/util/group-options-by-type/index.js +7 -3
- package/dist/esm/analytics.js +2 -1
- package/dist/esm/components/AvatarItemOption.js +31 -2
- package/dist/esm/components/AvatarOrIcon.js +1 -1
- package/dist/esm/components/BaseUserPicker.js +69 -39
- package/dist/esm/components/CustomOption/main.js +1 -1
- package/dist/esm/components/EmailOption/main.js +1 -1
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/esm/components/GroupOption/main.js +1 -1
- package/dist/esm/components/MultiValue.js +46 -44
- package/dist/esm/components/SingleValue.compiled.css +2 -0
- package/dist/esm/components/SingleValue.js +11 -2
- package/dist/esm/components/i18n.js +5 -0
- package/dist/esm/components/utils.js +1 -1
- package/dist/esm/util/group-options-by-type/index.js +7 -3
- package/dist/types/analytics.d.ts +2 -2
- package/dist/types/components/AvatarItemOption.d.ts +2 -2
- package/dist/types/components/BaseUserPicker.d.ts +4 -1
- package/dist/types/components/ExternalUserOption/index.d.ts +4 -2
- package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
- package/dist/types/components/GroupOption/main.d.ts +2 -2
- package/dist/types/components/PopupUserPicker.d.ts +90 -86
- package/dist/types/components/UserPicker.d.ts +2 -1
- package/dist/types/components/i18n.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types/util/group-options-by-type/index.d.ts +2 -1
- package/dist/types-ts4.5/analytics.d.ts +2 -2
- package/dist/types-ts4.5/components/AvatarItemOption.d.ts +2 -2
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +4 -1
- package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +4 -2
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +3 -2
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -2
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +90 -86
- package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
- package/dist/types-ts4.5/components/i18n.d.ts +5 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +4 -0
- package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +2 -1
- package/package.json +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 11.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e40e50d76e29c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e40e50d76e29c) -
|
|
8
|
+
[ux] Updates user picker to use ADS tags in cases where we see icons in tags, insead of using ADS
|
|
9
|
+
Avatar tags.
|
|
10
|
+
|
|
3
11
|
## 11.24.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -11,9 +11,10 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
|
|
|
11
11
|
var _uuid = require("uuid");
|
|
12
12
|
var _utils = require("./components/utils");
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
15
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
15
16
|
var packageName = "@atlaskit/user-picker";
|
|
16
|
-
var packageVersion = "
|
|
17
|
+
var packageVersion = "0.0.0-development";
|
|
17
18
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
18
19
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
19
20
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -10,6 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
13
|
+
var _tag = _interopRequireDefault(require("@atlaskit/tag"));
|
|
13
14
|
var _utils = require("./utils");
|
|
14
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -17,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } /**
|
|
18
19
|
* @jsxRuntime classic
|
|
19
20
|
* @jsx jsx
|
|
20
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
21
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
21
22
|
var AsyncTooltip = /*#__PURE__*/_react.default.lazy(function () {
|
|
22
23
|
return Promise.resolve().then(function () {
|
|
23
24
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_@atlaskit/tooltip" */'@atlaskit/tooltip'));
|
|
@@ -116,12 +117,40 @@ var textWrapper = exports.textWrapper = function textWrapper(color) {
|
|
|
116
117
|
color: color
|
|
117
118
|
});
|
|
118
119
|
};
|
|
120
|
+
var lozengeAppearanceToTagColor = {
|
|
121
|
+
default: 'standard',
|
|
122
|
+
success: 'lime',
|
|
123
|
+
removed: 'red',
|
|
124
|
+
inprogress: 'blue',
|
|
125
|
+
new: 'purple',
|
|
126
|
+
moved: 'orange'
|
|
127
|
+
};
|
|
119
128
|
var AvatarItemOption = exports.AvatarItemOption = function AvatarItemOption(_ref) {
|
|
120
129
|
var avatar = _ref.avatar,
|
|
121
130
|
isDisabled = _ref.isDisabled,
|
|
122
131
|
lozenge = _ref.lozenge,
|
|
123
132
|
primaryText = _ref.primaryText,
|
|
124
133
|
secondaryText = _ref.secondaryText;
|
|
134
|
+
var renderTag = function renderTag() {
|
|
135
|
+
if ((0, _utils.isLozengeText)(lozenge) && !lozenge.isBold) {
|
|
136
|
+
var color = lozenge.appearance ? lozengeAppearanceToTagColor[lozenge.appearance] : 'standard';
|
|
137
|
+
var tag = (0, _react2.jsx)(_tag.default, {
|
|
138
|
+
text: lozenge.text,
|
|
139
|
+
color: color,
|
|
140
|
+
isRemovable: false,
|
|
141
|
+
migration_fallback: "lozenge"
|
|
142
|
+
});
|
|
143
|
+
if (lozenge.tooltip) {
|
|
144
|
+
return (0, _react2.jsx)(_react.default.Suspense, {
|
|
145
|
+
fallback: tag
|
|
146
|
+
}, (0, _react2.jsx)(AsyncTooltip, {
|
|
147
|
+
content: lozenge.tooltip
|
|
148
|
+
}, tag));
|
|
149
|
+
}
|
|
150
|
+
return tag;
|
|
151
|
+
}
|
|
152
|
+
return renderLozenge();
|
|
153
|
+
};
|
|
125
154
|
var renderLozenge = function renderLozenge() {
|
|
126
155
|
if ((0, _utils.isLozengeText)(lozenge)) {
|
|
127
156
|
if (lozenge !== null && lozenge !== void 0 && lozenge.tooltip) {
|
|
@@ -149,6 +178,6 @@ var AvatarItemOption = exports.AvatarItemOption = function AvatarItemOption(_ref
|
|
|
149
178
|
css: getTextStyle(true)
|
|
150
179
|
}, secondaryText))), lozenge && (0, _react2.jsx)("div", {
|
|
151
180
|
css: additionalInfo
|
|
152
|
-
}, renderLozenge()))
|
|
181
|
+
}, (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? renderTag() : renderLozenge()))
|
|
153
182
|
);
|
|
154
183
|
};
|
|
@@ -12,7 +12,7 @@ var _react = require("@emotion/react");
|
|
|
12
12
|
* @jsx jsx
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
16
16
|
|
|
17
17
|
var iconStyle = (0, _react.css)({
|
|
18
18
|
display: 'flex',
|
|
@@ -13,6 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
17
18
|
var _ufo = require("@atlaskit/ufo");
|
|
18
19
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
@@ -351,7 +352,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
351
352
|
hoveringClearIndicator: hoveringClearIndicator
|
|
352
353
|
});
|
|
353
354
|
});
|
|
354
|
-
(0, _defineProperty2.default)(_this, "
|
|
355
|
+
(0, _defineProperty2.default)(_this, "getOptionsOld", function () {
|
|
355
356
|
var options = (0, _utils.getOptions)(_this.state.options) || [];
|
|
356
357
|
var _this$props2 = _this.props,
|
|
357
358
|
maxOptions = _this$props2.maxOptions,
|
|
@@ -376,6 +377,35 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
376
377
|
}
|
|
377
378
|
return groupByTypeOrder ? (0, _groupOptionsByType.groupOptionsByType)(options, groupByTypeOrder) : options;
|
|
378
379
|
});
|
|
380
|
+
(0, _defineProperty2.default)(_this, "getOptionsNew", function () {
|
|
381
|
+
var options = (0, _utils.getOptions)(_this.state.options) || [];
|
|
382
|
+
var _this$props3 = _this.props,
|
|
383
|
+
maxOptions = _this$props3.maxOptions,
|
|
384
|
+
isMulti = _this$props3.isMulti,
|
|
385
|
+
groupByTypeOrder = _this$props3.groupByTypeOrder,
|
|
386
|
+
customGroupLabels = _this$props3.customGroupLabels;
|
|
387
|
+
if (maxOptions === 0) {
|
|
388
|
+
return [];
|
|
389
|
+
}
|
|
390
|
+
if (maxOptions && maxOptions > 0 && maxOptions < options.length) {
|
|
391
|
+
var _value3 = _this.state.value;
|
|
392
|
+
var filteredOptions = options;
|
|
393
|
+
// Filter out previously selected options
|
|
394
|
+
if (isMulti && Array.isArray(_value3)) {
|
|
395
|
+
var valueIds = _value3.map(function (item) {
|
|
396
|
+
return item.data.id;
|
|
397
|
+
});
|
|
398
|
+
filteredOptions = options.filter(function (option) {
|
|
399
|
+
return valueIds.indexOf(option.data.id) === -1;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
return groupByTypeOrder ? (0, _groupOptionsByType.groupOptionsByType)(filteredOptions.slice(0, maxOptions), groupByTypeOrder, customGroupLabels) : filteredOptions.slice(0, maxOptions);
|
|
403
|
+
}
|
|
404
|
+
return groupByTypeOrder ? (0, _groupOptionsByType.groupOptionsByType)(options, groupByTypeOrder, customGroupLabels) : options;
|
|
405
|
+
});
|
|
406
|
+
(0, _defineProperty2.default)(_this, "getOptions", function () {
|
|
407
|
+
return (0, _platformFeatureFlags.fg)('jsm-wfo-assignee-recommendation-on-queues') ? _this.getOptionsNew() : _this.getOptionsOld();
|
|
408
|
+
});
|
|
379
409
|
(0, _defineProperty2.default)(_this, "getAppearance", function () {
|
|
380
410
|
return _this.props.appearance ? _this.props.appearance : 'normal';
|
|
381
411
|
});
|
|
@@ -441,9 +471,9 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
441
471
|
}, {
|
|
442
472
|
key: "componentDidMount",
|
|
443
473
|
value: function componentDidMount() {
|
|
444
|
-
var _this$
|
|
445
|
-
open = _this$
|
|
446
|
-
search = _this$
|
|
474
|
+
var _this$props4 = this.props,
|
|
475
|
+
open = _this$props4.open,
|
|
476
|
+
search = _this$props4.search;
|
|
447
477
|
// load options when the picker open
|
|
448
478
|
if (open) {
|
|
449
479
|
if (!this.session) {
|
|
@@ -511,41 +541,41 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
511
541
|
}, {
|
|
512
542
|
key: "render",
|
|
513
543
|
value: function render() {
|
|
514
|
-
var _this$
|
|
515
|
-
isMulti = _this$
|
|
516
|
-
isLoading = _this$
|
|
517
|
-
subtle = _this$
|
|
518
|
-
noBorder = _this$
|
|
519
|
-
placeholder = _this$
|
|
520
|
-
isClearable = _this$
|
|
521
|
-
isDisabled = _this$
|
|
522
|
-
isInvalid = _this$
|
|
523
|
-
clearValueLabel = _this$
|
|
524
|
-
menuMinWidth = _this$
|
|
525
|
-
menuPortalTarget = _this$
|
|
526
|
-
loadOptionsErrorMessage = _this$
|
|
527
|
-
addMoreMessage = _this$
|
|
528
|
-
noOptionsMessage = _this$
|
|
529
|
-
footer = _this$
|
|
530
|
-
disableInput = _this$
|
|
531
|
-
components = _this$
|
|
532
|
-
pickerProps = _this$
|
|
533
|
-
SelectComponent = _this$
|
|
534
|
-
styles = _this$
|
|
535
|
-
autoFocus = _this$
|
|
536
|
-
fieldId = _this$
|
|
537
|
-
inputId = _this$
|
|
538
|
-
maxPickerHeight = _this$
|
|
539
|
-
textFieldBackgroundColor = _this$
|
|
540
|
-
ariaLabelledBy = _this$
|
|
541
|
-
ariaDescribedBy = _this$
|
|
542
|
-
ariaLive = _this$
|
|
543
|
-
ariaLabel = _this$
|
|
544
|
-
name = _this$
|
|
545
|
-
header = _this$
|
|
546
|
-
required = _this$
|
|
547
|
-
UNSAFE_hasDraggableParentComponent = _this$
|
|
548
|
-
placeholderAvatar = _this$
|
|
544
|
+
var _this$props5 = this.props,
|
|
545
|
+
isMulti = _this$props5.isMulti,
|
|
546
|
+
isLoading = _this$props5.isLoading,
|
|
547
|
+
subtle = _this$props5.subtle,
|
|
548
|
+
noBorder = _this$props5.noBorder,
|
|
549
|
+
placeholder = _this$props5.placeholder,
|
|
550
|
+
isClearable = _this$props5.isClearable,
|
|
551
|
+
isDisabled = _this$props5.isDisabled,
|
|
552
|
+
isInvalid = _this$props5.isInvalid,
|
|
553
|
+
clearValueLabel = _this$props5.clearValueLabel,
|
|
554
|
+
menuMinWidth = _this$props5.menuMinWidth,
|
|
555
|
+
menuPortalTarget = _this$props5.menuPortalTarget,
|
|
556
|
+
loadOptionsErrorMessage = _this$props5.loadOptionsErrorMessage,
|
|
557
|
+
addMoreMessage = _this$props5.addMoreMessage,
|
|
558
|
+
noOptionsMessage = _this$props5.noOptionsMessage,
|
|
559
|
+
footer = _this$props5.footer,
|
|
560
|
+
disableInput = _this$props5.disableInput,
|
|
561
|
+
components = _this$props5.components,
|
|
562
|
+
pickerProps = _this$props5.pickerProps,
|
|
563
|
+
SelectComponent = _this$props5.SelectComponent,
|
|
564
|
+
styles = _this$props5.styles,
|
|
565
|
+
autoFocus = _this$props5.autoFocus,
|
|
566
|
+
fieldId = _this$props5.fieldId,
|
|
567
|
+
inputId = _this$props5.inputId,
|
|
568
|
+
maxPickerHeight = _this$props5.maxPickerHeight,
|
|
569
|
+
textFieldBackgroundColor = _this$props5.textFieldBackgroundColor,
|
|
570
|
+
ariaLabelledBy = _this$props5.ariaLabelledBy,
|
|
571
|
+
ariaDescribedBy = _this$props5.ariaDescribedBy,
|
|
572
|
+
ariaLive = _this$props5.ariaLive,
|
|
573
|
+
ariaLabel = _this$props5.ariaLabel,
|
|
574
|
+
name = _this$props5.name,
|
|
575
|
+
header = _this$props5.header,
|
|
576
|
+
required = _this$props5.required,
|
|
577
|
+
UNSAFE_hasDraggableParentComponent = _this$props5.UNSAFE_hasDraggableParentComponent,
|
|
578
|
+
placeholderAvatar = _this$props5.placeholderAvatar;
|
|
549
579
|
var _this$state3 = this.state,
|
|
550
580
|
count = _this$state3.count,
|
|
551
581
|
hoveringClearIndicator = _this$state3.hoveringClearIndicator,
|
|
@@ -22,7 +22,7 @@ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0,
|
|
|
22
22
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
23
23
|
* @jsxRuntime classic
|
|
24
24
|
* @jsx jsx
|
|
25
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
25
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
26
26
|
var CustomOption = exports.CustomOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
27
27
|
function CustomOption() {
|
|
28
28
|
var _this;
|
|
@@ -22,7 +22,7 @@ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0,
|
|
|
22
22
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
23
23
|
* @jsxRuntime classic
|
|
24
24
|
* @jsx jsx
|
|
25
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
25
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
26
26
|
var getAddEmailMessage = function getAddEmailMessage(validity) {
|
|
27
27
|
return validity === 'POTENTIAL' ? _i18n.messages.continueToAddEmail : _i18n.messages.selectToAddEmail;
|
|
28
28
|
};
|
|
@@ -12,7 +12,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
13
13
|
* @jsxRuntime classic
|
|
14
14
|
* @jsx jsx
|
|
15
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
15
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
16
16
|
var outerWrapper = function outerWrapper(isDisabled) {
|
|
17
17
|
return (0, _react.css)({
|
|
18
18
|
alignItems: 'center',
|
|
@@ -15,7 +15,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
* @jsx jsx
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
19
19
|
|
|
20
20
|
var wrapper = (0, _react2.css)({
|
|
21
21
|
display: 'flex',
|
|
@@ -25,7 +25,7 @@ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0,
|
|
|
25
25
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
26
26
|
* @jsxRuntime classic
|
|
27
27
|
* @jsx jsx
|
|
28
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
28
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
30
30
|
var groupOptionIconWrapper = exports.groupOptionIconWrapper = (0, _react2.css)({
|
|
31
31
|
padding: "var(--ds-space-025, 2px)",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -19,15 +20,19 @@ var _select = require("@atlaskit/select");
|
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
21
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
21
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
-
var _tag = require("@atlaskit/tag");
|
|
23
|
+
var _tag = _interopRequireWildcard(require("@atlaskit/tag"));
|
|
23
24
|
var _teamsAvatar = _interopRequireDefault(require("@atlaskit/teams-avatar"));
|
|
24
25
|
var _AddOptionAvatar = require("./AddOptionAvatar");
|
|
25
26
|
var _AvatarOrIcon = require("./AvatarOrIcon");
|
|
26
27
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
27
28
|
var _utils = require("./utils");
|
|
29
|
+
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
28
30
|
var _peopleGroup = _interopRequireDefault(require("@atlaskit/icon/core/people-group"));
|
|
29
31
|
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
32
|
+
var _reactIntlNext = require("react-intl-next");
|
|
33
|
+
var _i18n = require("./i18n");
|
|
30
34
|
var _excluded = ["children", "innerProps", "removeProps", "data"];
|
|
35
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
36
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
32
37
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
33
38
|
* @jsxRuntime classic
|
|
@@ -54,6 +59,10 @@ var groupTagContainerOld = (0, _primitives.xcss)({
|
|
|
54
59
|
var groupTagContainer = (0, _primitives.xcss)({
|
|
55
60
|
paddingLeft: 'space.050'
|
|
56
61
|
});
|
|
62
|
+
var archivedLozengeWrapper = (0, _primitives.xcss)({
|
|
63
|
+
display: 'flex',
|
|
64
|
+
paddingLeft: 'space.050'
|
|
65
|
+
});
|
|
57
66
|
var iconStyle = (0, _react2.css)({
|
|
58
67
|
display: 'flex',
|
|
59
68
|
alignItems: 'center',
|
|
@@ -111,11 +120,19 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
111
120
|
});
|
|
112
121
|
(0, _defineProperty2.default)(_this, "getElemAfter", function () {
|
|
113
122
|
var data = _this.props.data.data;
|
|
123
|
+
var canShowArchivedLozenge = (0, _utils.isTeam)(data) && (data === null || data === void 0 ? void 0 : data.state) === 'DISBANDED' && (0, _platformFeatureFlags.fg)('enable-sup-archive-experience');
|
|
114
124
|
if ((0, _utils.isGroup)(data) && data.includeTeamsUpdates || (0, _utils.isTeam)(data) && data.verified) {
|
|
115
125
|
return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
116
126
|
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
117
127
|
});
|
|
118
128
|
}
|
|
129
|
+
if (canShowArchivedLozenge) {
|
|
130
|
+
return (0, _react2.jsx)(_primitives.Box, {
|
|
131
|
+
xcss: archivedLozengeWrapper
|
|
132
|
+
}, (0, _react2.jsx)(_lozenge.default, {
|
|
133
|
+
appearance: "default"
|
|
134
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.archivedLozenge)));
|
|
135
|
+
}
|
|
119
136
|
return null;
|
|
120
137
|
});
|
|
121
138
|
_this.containerRef = /*#__PURE__*/_react.default.createRef();
|
|
@@ -170,6 +187,7 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
170
187
|
var isEmailOption = (0, _utils.isEmail)(data);
|
|
171
188
|
var avatarUrl = (0, _utils.getAvatarUrl)(data);
|
|
172
189
|
var isDisabled = Boolean((_this$props$selectPro = this.props.selectProps) === null || _this$props$selectPro === void 0 ? void 0 : _this$props$selectPro.isDisabled);
|
|
190
|
+
var canShowArchivedLozenge = (0, _utils.isTeam)(data) && (data === null || data === void 0 ? void 0 : data.state) === 'DISBANDED' && (0, _platformFeatureFlags.fg)('enable-sup-archive-experience');
|
|
173
191
|
var avatarProps = avatarUrl ? {
|
|
174
192
|
name: data.name,
|
|
175
193
|
src: avatarUrl
|
|
@@ -181,70 +199,52 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
181
199
|
return true;
|
|
182
200
|
};
|
|
183
201
|
if (isEmailOption) {
|
|
184
|
-
var emailAvatar = function emailAvatar(props) {
|
|
185
|
-
return (0, _react2.jsx)(_avatar.default, (0, _extends2.default)({}, props, {
|
|
186
|
-
children: (0, _react2.jsx)(_AddOptionAvatar.AddOptionAvatar, {
|
|
187
|
-
isLozenge: true,
|
|
188
|
-
isPendingAction: data.isPendingAction
|
|
189
|
-
})
|
|
190
|
-
}));
|
|
191
|
-
};
|
|
192
202
|
return (0, _react2.jsx)("span", {
|
|
193
203
|
ref: this.containerRef,
|
|
194
204
|
css: avatarTagWrapperStyle,
|
|
195
205
|
"data-user-picker-multi-value": true
|
|
196
|
-
}, (0, _react2.jsx)(_tag.
|
|
206
|
+
}, (0, _react2.jsx)(_tag.default, {
|
|
197
207
|
text: label,
|
|
198
|
-
|
|
199
|
-
|
|
208
|
+
elemBefore: (0, _react2.jsx)(_AddOptionAvatar.AddOptionAvatar, {
|
|
209
|
+
isLozenge: true,
|
|
210
|
+
isPendingAction: data.isPendingAction
|
|
211
|
+
}),
|
|
200
212
|
isRemovable: !isDisabled,
|
|
201
213
|
onBeforeRemoveAction: removeAction
|
|
202
214
|
}));
|
|
203
215
|
}
|
|
204
216
|
if (isGroupOption) {
|
|
205
|
-
var groupAvatar = function groupAvatar(props) {
|
|
206
|
-
return (0, _react2.jsx)(_avatar.default, (0, _extends2.default)({}, props, {
|
|
207
|
-
children: (0, _react2.jsx)(_primitives.Box, {
|
|
208
|
-
xcss: groupTagContainer
|
|
209
|
-
}, (0, _react2.jsx)(_peopleGroup.default, {
|
|
210
|
-
color: "currentColor",
|
|
211
|
-
label: "" // This element is a decorative icon and does not require a label
|
|
212
|
-
,
|
|
213
|
-
size: "small"
|
|
214
|
-
}))
|
|
215
|
-
}));
|
|
216
|
-
};
|
|
217
217
|
return (0, _react2.jsx)("span", {
|
|
218
218
|
ref: this.containerRef,
|
|
219
219
|
css: avatarTagWrapperStyle,
|
|
220
220
|
"data-user-picker-multi-value": true
|
|
221
|
-
}, (0, _react2.jsx)(_tag.
|
|
222
|
-
type: "other",
|
|
221
|
+
}, (0, _react2.jsx)(_tag.default, {
|
|
223
222
|
text: label,
|
|
224
|
-
|
|
223
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
224
|
+
xcss: groupTagContainer
|
|
225
|
+
}, (0, _react2.jsx)(_peopleGroup.default, {
|
|
226
|
+
color: "currentColor",
|
|
227
|
+
label: "" // This element is a decorative icon and does not require a label
|
|
228
|
+
,
|
|
229
|
+
size: "small"
|
|
230
|
+
})),
|
|
225
231
|
isRemovable: !isDisabled,
|
|
226
|
-
onBeforeRemoveAction: removeAction
|
|
227
|
-
avatar: groupAvatar
|
|
232
|
+
onBeforeRemoveAction: removeAction
|
|
228
233
|
}));
|
|
229
234
|
}
|
|
230
235
|
if (data.icon) {
|
|
231
|
-
var iconAvatar = function iconAvatar(props) {
|
|
232
|
-
return (0, _react2.jsx)(_avatar.default, (0, _extends2.default)({}, props, {
|
|
233
|
-
children: (0, _react2.jsx)("div", {
|
|
234
|
-
css: iconStyle,
|
|
235
|
-
style: {
|
|
236
|
-
color: data.iconColor
|
|
237
|
-
}
|
|
238
|
-
}, data.icon)
|
|
239
|
-
}));
|
|
240
|
-
};
|
|
241
236
|
return (0, _react2.jsx)("span", {
|
|
237
|
+
ref: this.containerRef,
|
|
242
238
|
css: avatarTagWrapperStyle,
|
|
243
239
|
"data-user-picker-multi-value": true
|
|
244
|
-
}, (0, _react2.jsx)(_tag.
|
|
240
|
+
}, (0, _react2.jsx)(_tag.default, {
|
|
245
241
|
text: label,
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
elemBefore: (0, _react2.jsx)("div", {
|
|
243
|
+
css: iconStyle,
|
|
244
|
+
style: {
|
|
245
|
+
color: data.iconColor
|
|
246
|
+
}
|
|
247
|
+
}, data.icon),
|
|
248
248
|
isRemovable: !isDisabled,
|
|
249
249
|
onBeforeRemoveAction: removeAction
|
|
250
250
|
}));
|
|
@@ -253,7 +253,7 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
253
253
|
ref: this.containerRef,
|
|
254
254
|
css: avatarTagWrapperStyle,
|
|
255
255
|
"data-user-picker-multi-value": true
|
|
256
|
-
}, isTeamOption ? (0, _react2.jsx)(_tag.AvatarTag, {
|
|
256
|
+
}, isTeamOption ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_tag.AvatarTag, {
|
|
257
257
|
type: "other",
|
|
258
258
|
text: label,
|
|
259
259
|
isVerified: isTeamOption ? data.verified : undefined,
|
|
@@ -262,7 +262,11 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
262
262
|
avatar: function avatar(props) {
|
|
263
263
|
return (0, _react2.jsx)(_teamsAvatar.default, (0, _extends2.default)({}, props, avatarProps));
|
|
264
264
|
}
|
|
265
|
-
})
|
|
265
|
+
}), canShowArchivedLozenge ? (0, _react2.jsx)(_primitives.Box, {
|
|
266
|
+
xcss: archivedLozengeWrapper
|
|
267
|
+
}, (0, _react2.jsx)(_lozenge.default, {
|
|
268
|
+
appearance: "default"
|
|
269
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.archivedLozenge))) : null) : (0, _react2.jsx)(_tag.AvatarTag, {
|
|
266
270
|
type: "user",
|
|
267
271
|
text: label,
|
|
268
272
|
isRemovable: !isDisabled,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* SingleValue.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
@@ -10,18 +11,22 @@ require("./SingleValue.compiled.css");
|
|
|
10
11
|
var React = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _runtime = require("@compiled/react/runtime");
|
|
12
13
|
var _select = require("@atlaskit/select");
|
|
14
|
+
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
13
15
|
var _AvatarOrIcon = require("./AvatarOrIcon");
|
|
14
16
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
15
17
|
var _utils = require("./utils");
|
|
16
18
|
var _avatar = require("@atlaskit/avatar");
|
|
17
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
20
|
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
21
|
+
var _reactIntlNext = require("react-intl-next");
|
|
19
22
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
23
|
+
var _i18n = require("./i18n");
|
|
20
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
25
|
var styles = {
|
|
22
26
|
avatarItem: "_1reo15vq _18m915vq _4cvr1h6o _1ul953f4",
|
|
23
27
|
avatarItemTextWrapper: "_16jlkb7n _1o9zkb7n _i0dl1osq _1ul9idpf _p12f1osq _bozgu2gc _vwz419ii",
|
|
24
|
-
avatarItemText: "_syazi7uo _1reo15vq _1bto1l2s _o5721q9c"
|
|
28
|
+
avatarItemText: "_syazi7uo _1reo15vq _1bto1l2s _o5721q9c",
|
|
29
|
+
archivedLozengeWrapper: "_1e0c1txw _19bv1b66"
|
|
25
30
|
};
|
|
26
31
|
var ElementAfter = function ElementAfter(props) {
|
|
27
32
|
var data = props.data.data,
|
|
@@ -41,6 +46,7 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
41
46
|
_props$selectProps = props.selectProps,
|
|
42
47
|
appearance = _props$selectProps.appearance,
|
|
43
48
|
isFocused = _props$selectProps.isFocused;
|
|
49
|
+
var canShowArchivedLozenge = (0, _utils.isTeam)(data) && (data === null || data === void 0 ? void 0 : data.state) === 'DISBANDED' && (0, _platformFeatureFlags.fg)('enable-sup-archive-experience');
|
|
44
50
|
return !isFocused ? /*#__PURE__*/React.createElement(_select.components.SingleValue, props, /*#__PURE__*/React.createElement(_compiled.Flex, {
|
|
45
51
|
xcss: styles.avatarItem
|
|
46
52
|
}, data.icon ? /*#__PURE__*/React.createElement(_AvatarOrIcon.AvatarOrIcon, {
|
|
@@ -63,5 +69,9 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
63
69
|
xcss: styles.avatarItemText
|
|
64
70
|
}, /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
65
71
|
alignBlock: "center"
|
|
66
|
-
}, label, /*#__PURE__*/React.createElement(
|
|
72
|
+
}, label, canShowArchivedLozenge ? /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
73
|
+
xcss: styles.archivedLozengeWrapper
|
|
74
|
+
}, /*#__PURE__*/React.createElement(_lozenge.default, {
|
|
75
|
+
appearance: "default"
|
|
76
|
+
}, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.archivedLozenge))) : null, /*#__PURE__*/React.createElement(ElementAfter, props))))))) : null;
|
|
67
77
|
};
|
|
@@ -176,6 +176,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
176
176
|
defaultMessage: 'Guest groups can only access certain spaces and have limited access to user info.',
|
|
177
177
|
description: 'Tooltip text for lozenge showing that a group is for guests in Confluence'
|
|
178
178
|
},
|
|
179
|
+
archivedLozenge: {
|
|
180
|
+
id: 'fabric.elements.user-picker.archived.lozenge.text',
|
|
181
|
+
defaultMessage: 'Archived',
|
|
182
|
+
description: 'Text within the lozenge when the selected team has been archived/disbanded'
|
|
183
|
+
},
|
|
179
184
|
userTypeLabel: {
|
|
180
185
|
id: 'fabric.elements.user-picker.user.type.label',
|
|
181
186
|
defaultMessage: 'People',
|
|
@@ -19,7 +19,7 @@ var isUser = exports.isUser = function isUser(option) {
|
|
|
19
19
|
return option.type === undefined || option.type === _types.UserType;
|
|
20
20
|
};
|
|
21
21
|
var isTeam = exports.isTeam = function isTeam(option) {
|
|
22
|
-
return option.type === _types.TeamType;
|
|
22
|
+
return (option === null || option === void 0 ? void 0 : option.type) === _types.TeamType;
|
|
23
23
|
};
|
|
24
24
|
var isGroup = exports.isGroup = function isGroup(option) {
|
|
25
25
|
return option.type === _types.GroupType;
|
|
@@ -6,10 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.groupOptionsByType = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
11
12
|
var _i18n = require("../../components/i18n");
|
|
12
|
-
var getLabelForType = function getLabelForType(type) {
|
|
13
|
+
var getLabelForType = function getLabelForType(type, customLabels) {
|
|
14
|
+
if (customLabels && type in customLabels && (0, _platformFeatureFlags.fg)('jsm-wfo-assignee-recommendation-on-queues')) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, customLabels[type]);
|
|
16
|
+
}
|
|
13
17
|
switch (type) {
|
|
14
18
|
case 'user':
|
|
15
19
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.userTypeLabel);
|
|
@@ -25,7 +29,7 @@ var getLabelForType = function getLabelForType(type) {
|
|
|
25
29
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.otherTypeLabel);
|
|
26
30
|
}
|
|
27
31
|
};
|
|
28
|
-
var groupOptionsByType = exports.groupOptionsByType = (0, _memoizeOne.default)(function (options, groupByTypeOrder) {
|
|
32
|
+
var groupOptionsByType = exports.groupOptionsByType = (0, _memoizeOne.default)(function (options, groupByTypeOrder, customGroupLabels) {
|
|
29
33
|
// If groupByTypeOrder is empty, just return the original options
|
|
30
34
|
if (groupByTypeOrder.length === 0) {
|
|
31
35
|
return options;
|
|
@@ -45,7 +49,7 @@ var groupOptionsByType = exports.groupOptionsByType = (0, _memoizeOne.default)(f
|
|
|
45
49
|
groupByTypeOrder.forEach(function (type) {
|
|
46
50
|
if (groupedMap.has(type)) {
|
|
47
51
|
result.push({
|
|
48
|
-
label: getLabelForType(type),
|
|
52
|
+
label: getLabelForType(type, customGroupLabels),
|
|
49
53
|
options: groupedMap.get(type)
|
|
50
54
|
});
|
|
51
55
|
groupedMap.delete(type);
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
1
2
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
2
3
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
3
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
6
|
import { isCustom, isExternalUser } from './components/utils';
|
|
6
7
|
const packageName = "@atlaskit/user-picker";
|
|
7
|
-
const packageVersion = "
|
|
8
|
+
const packageVersion = "0.0.0-development";
|
|
8
9
|
const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
9
10
|
const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
10
11
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|