@atlaskit/user-picker 11.12.0 → 11.13.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 +12 -0
- package/dist/cjs/analytics.js +3 -2
- package/dist/cjs/components/BaseUserPicker.js +4 -2
- package/dist/cjs/components/GroupOption/main.js +22 -1
- package/dist/cjs/components/TeamOption/main.js +38 -8
- package/dist/cjs/components/UserPicker.js +2 -1
- package/dist/cjs/components/i18n.js +35 -0
- package/dist/es2019/analytics.js +3 -1
- package/dist/es2019/components/BaseUserPicker.js +4 -1
- package/dist/es2019/components/GroupOption/main.js +22 -1
- package/dist/es2019/components/TeamOption/main.js +38 -8
- package/dist/es2019/components/UserPicker.js +2 -0
- package/dist/es2019/components/i18n.js +35 -0
- package/dist/esm/analytics.js +3 -1
- package/dist/esm/components/BaseUserPicker.js +4 -1
- package/dist/esm/components/GroupOption/main.js +22 -1
- package/dist/esm/components/TeamOption/main.js +38 -8
- package/dist/esm/components/UserPicker.js +2 -0
- package/dist/esm/components/i18n.js +35 -0
- package/dist/types/components/GroupOption/main.d.ts +1 -0
- package/dist/types/components/TeamOption/main.d.ts +1 -0
- package/dist/types/components/i18n.d.ts +35 -0
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +1 -0
- package/dist/types-ts4.5/components/TeamOption/main.d.ts +1 -0
- package/dist/types-ts4.5/components/i18n.d.ts +35 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 11.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b98b0340b08c0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b98b0340b08c0) -
|
|
8
|
+
[ux] Updating verified team icon to surface for all groups and verified teams. Updated bylines for
|
|
9
|
+
team and group principals to "Official team" and "Admin group".
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 11.12.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -10,14 +10,15 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
10
10
|
var _uuid = require("uuid");
|
|
11
11
|
var _utils = require("./components/utils");
|
|
12
12
|
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; }
|
|
13
|
-
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
|
+
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 @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
14
14
|
var packageName = "@atlaskit/user-picker";
|
|
15
|
-
var packageVersion = "11.
|
|
15
|
+
var packageVersion = "11.12.0";
|
|
16
16
|
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}$/;
|
|
17
17
|
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}$/;
|
|
18
18
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
19
19
|
var startSession = exports.startSession = function startSession() {
|
|
20
20
|
return {
|
|
21
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
21
22
|
id: (0, _uuid.v4)(),
|
|
22
23
|
start: Date.now(),
|
|
23
24
|
inputChangeTime: Date.now(),
|
|
@@ -33,7 +33,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
33
33
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
34
34
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
35
35
|
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)); }
|
|
36
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
36
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
37
37
|
var loadingMessage = function loadingMessage() {
|
|
38
38
|
return null;
|
|
39
39
|
};
|
|
@@ -394,7 +394,9 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
394
394
|
showError: false,
|
|
395
395
|
initialFocusHandled: false
|
|
396
396
|
};
|
|
397
|
-
_this.optionsShownUfoExperienceInstance =
|
|
397
|
+
_this.optionsShownUfoExperienceInstance =
|
|
398
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
399
|
+
_ufoExperiences.userPickerOptionsShownUfoExperience.getInstance((0, _uuid.v4)());
|
|
398
400
|
if (_this.props.forwardedRef) {
|
|
399
401
|
var refValue = {
|
|
400
402
|
focus: _this.focus,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.groupOptionIconWrapper = exports.GroupOption = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -16,6 +17,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
16
17
|
var _react2 = require("@emotion/react");
|
|
17
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
19
|
var _peopleGroupPeople = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group--people"));
|
|
20
|
+
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
22
|
var _AvatarItemOption = require("../AvatarItemOption");
|
|
20
23
|
var _i18n = require("../i18n");
|
|
21
24
|
var _HighlightText = require("../HighlightText");
|
|
@@ -67,15 +70,33 @@ var GroupOption = exports.GroupOption = /*#__PURE__*/function (_React$PureCompon
|
|
|
67
70
|
spacing: "spacious"
|
|
68
71
|
}));
|
|
69
72
|
});
|
|
73
|
+
(0, _defineProperty2.default)(_this, "renderVerifiedIcon", function () {
|
|
74
|
+
return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
75
|
+
label: "",
|
|
76
|
+
size: "small",
|
|
77
|
+
spacing: "none"
|
|
78
|
+
});
|
|
79
|
+
});
|
|
70
80
|
(0, _defineProperty2.default)(_this, "renderByline", function () {
|
|
71
81
|
var _this$props2 = _this.props,
|
|
72
82
|
isSelected = _this$props2.isSelected,
|
|
73
83
|
group = _this$props2.group;
|
|
84
|
+
var getGroupByline = function getGroupByline() {
|
|
85
|
+
if ((0, _platformFeatureFlags.fg)('confluence_frontend_perms_exp_teams_as_principals')) {
|
|
86
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.adminManagedGroupByline, {
|
|
87
|
+
values: {
|
|
88
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
} else {
|
|
92
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.groupByline);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
74
95
|
return (0, _react2.jsx)("span", {
|
|
75
96
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
76
97
|
css: (0, _AvatarItemOption.textWrapper)(isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")")),
|
|
77
98
|
"data-testid": "user-picker-group-secondary-text"
|
|
78
|
-
}, group.byline ? group.byline : (
|
|
99
|
+
}, group.byline ? group.byline : getGroupByline());
|
|
79
100
|
});
|
|
80
101
|
(0, _defineProperty2.default)(_this, "getLozengeProps", function () {
|
|
81
102
|
return typeof _this.props.group.lozenge === 'string' ? {
|
|
@@ -15,6 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
17
|
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _react = require("@emotion/react");
|
|
19
20
|
var _react2 = _interopRequireDefault(require("react"));
|
|
20
21
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -38,8 +39,7 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
38
39
|
(0, _defineProperty2.default)(_this, "getPrimaryText", function () {
|
|
39
40
|
var _this$props$team = _this.props.team,
|
|
40
41
|
name = _this$props$team.name,
|
|
41
|
-
highlight = _this$props$team.highlight
|
|
42
|
-
verified = _this$props$team.verified;
|
|
42
|
+
highlight = _this$props$team.highlight;
|
|
43
43
|
return [(0, _react.jsx)("span", {
|
|
44
44
|
key: "name"
|
|
45
45
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -49,14 +49,16 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
49
49
|
alignBlock: "center"
|
|
50
50
|
}, (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
51
51
|
highlights: highlight && highlight.name
|
|
52
|
-
}, name),
|
|
52
|
+
}, name), !(0, _platformFeatureFlags.fg)('confluence_frontend_perms_exp_teams_as_principals') && _this.renderVerifiedIcon()))];
|
|
53
53
|
});
|
|
54
54
|
(0, _defineProperty2.default)(_this, "renderByline", function () {
|
|
55
55
|
var _this$props = _this.props,
|
|
56
56
|
isSelected = _this$props.isSelected,
|
|
57
57
|
_this$props$team2 = _this$props.team,
|
|
58
58
|
memberCount = _this$props$team2.memberCount,
|
|
59
|
-
includesYou = _this$props$team2.includesYou
|
|
59
|
+
includesYou = _this$props$team2.includesYou,
|
|
60
|
+
verified = _this$props$team2.verified;
|
|
61
|
+
var isVerified = (0, _platformFeatureFlags.fg)('confluence_frontend_perms_exp_teams_as_principals') && verified;
|
|
60
62
|
|
|
61
63
|
// if Member count is missing, do not show the byline, regardless of the availability of includesYou
|
|
62
64
|
if (memberCount === null || typeof memberCount === 'undefined') {
|
|
@@ -64,9 +66,18 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
64
66
|
} else {
|
|
65
67
|
if (includesYou === true) {
|
|
66
68
|
if (memberCount > 50) {
|
|
67
|
-
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.
|
|
69
|
+
return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialPlus50MembersWithYou, {
|
|
70
|
+
values: {
|
|
71
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
72
|
+
}
|
|
73
|
+
})) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithYou));
|
|
68
74
|
} else {
|
|
69
|
-
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.
|
|
75
|
+
return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialMemberCountWithYou, {
|
|
76
|
+
values: {
|
|
77
|
+
verifiedIcon: _this.renderVerifiedIcon(),
|
|
78
|
+
count: memberCount
|
|
79
|
+
}
|
|
80
|
+
})) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithYou, {
|
|
70
81
|
values: {
|
|
71
82
|
count: memberCount
|
|
72
83
|
}
|
|
@@ -74,9 +85,18 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
74
85
|
}
|
|
75
86
|
} else {
|
|
76
87
|
if (memberCount > 50) {
|
|
77
|
-
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.
|
|
88
|
+
return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialPlus50MembersWithoutYou, {
|
|
89
|
+
values: {
|
|
90
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
91
|
+
}
|
|
92
|
+
})) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithoutYou));
|
|
78
93
|
} else {
|
|
79
|
-
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.
|
|
94
|
+
return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialMemberCountWithoutYou, {
|
|
95
|
+
values: {
|
|
96
|
+
verifiedIcon: _this.renderVerifiedIcon(),
|
|
97
|
+
count: memberCount
|
|
98
|
+
}
|
|
99
|
+
})) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithoutYou, {
|
|
80
100
|
values: {
|
|
81
101
|
count: memberCount
|
|
82
102
|
}
|
|
@@ -100,6 +120,16 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
100
120
|
type: "team"
|
|
101
121
|
});
|
|
102
122
|
});
|
|
123
|
+
(0, _defineProperty2.default)(_this, "renderVerifiedIcon", function () {
|
|
124
|
+
if (_this.props.team.verified) {
|
|
125
|
+
return (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
126
|
+
label: "",
|
|
127
|
+
size: "small",
|
|
128
|
+
spacing: "none"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
});
|
|
103
133
|
(0, _defineProperty2.default)(_this, "getLozengeProps", function () {
|
|
104
134
|
return typeof _this.props.team.lozenge === 'string' ? {
|
|
105
135
|
text: _this.props.team.lozenge
|
|
@@ -33,12 +33,13 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
33
33
|
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; }
|
|
34
34
|
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; }
|
|
35
35
|
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)); }
|
|
36
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
36
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
37
37
|
var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
38
38
|
function UserPickerWithoutAnalytics(props) {
|
|
39
39
|
var _this;
|
|
40
40
|
(0, _classCallCheck2.default)(this, UserPickerWithoutAnalytics);
|
|
41
41
|
_this = _callSuper(this, UserPickerWithoutAnalytics, [props]);
|
|
42
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
42
43
|
_this.ufoId = (0, _uuid.v4)();
|
|
43
44
|
var experienceForId = _ufoExperiences.userPickerRenderedUfoExperience.getInstance(_this.ufoId);
|
|
44
45
|
if (![_ufo.UFOExperienceState.IN_PROGRESS.id, _ufo.UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
|
|
@@ -31,6 +31,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
31
31
|
defaultMessage: 'Something went wrong',
|
|
32
32
|
description: 'Error message to display when options fail to load.'
|
|
33
33
|
},
|
|
34
|
+
teamByline: {
|
|
35
|
+
id: 'fabric.elements.user-picker.team.byline',
|
|
36
|
+
defaultMessage: 'Team',
|
|
37
|
+
description: 'Byline for team'
|
|
38
|
+
},
|
|
39
|
+
officialTeamByline: {
|
|
40
|
+
id: 'fabric.elements.user-picker.team.byline.official',
|
|
41
|
+
defaultMessage: 'Official team {verifiedIcon}',
|
|
42
|
+
description: 'Byline for official team'
|
|
43
|
+
},
|
|
44
|
+
officialMemberCountWithoutYou: {
|
|
45
|
+
id: 'fabric.elements.user-picker.team.member.count.official',
|
|
46
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}',
|
|
47
|
+
description: 'Byline to show the number of members in the team when the current user is not a member of the team'
|
|
48
|
+
},
|
|
49
|
+
officialMemberCountWithYou: {
|
|
50
|
+
id: 'fabric.elements.user-picker.team.member.count.official.including.you',
|
|
51
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}, including you',
|
|
52
|
+
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
53
|
+
},
|
|
34
54
|
memberCountWithoutYou: {
|
|
35
55
|
id: 'fabric.elements.user-picker.team.member.count',
|
|
36
56
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}',
|
|
@@ -41,6 +61,16 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
41
61
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}, including you',
|
|
42
62
|
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
43
63
|
},
|
|
64
|
+
officialPlus50MembersWithoutYou: {
|
|
65
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official',
|
|
66
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members',
|
|
67
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50'
|
|
68
|
+
},
|
|
69
|
+
officialPlus50MembersWithYou: {
|
|
70
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official.including.you',
|
|
71
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members, including you',
|
|
72
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50 and also includes the current user'
|
|
73
|
+
},
|
|
44
74
|
plus50MembersWithoutYou: {
|
|
45
75
|
id: 'fabric.elements.user-picker.team.member.50plus',
|
|
46
76
|
defaultMessage: 'Team • 50+ members',
|
|
@@ -66,6 +96,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
66
96
|
defaultMessage: 'Enter an email address',
|
|
67
97
|
description: 'Byline for a potentially valid email option.'
|
|
68
98
|
},
|
|
99
|
+
adminManagedGroupByline: {
|
|
100
|
+
id: 'fabric.elements.user-picker.group.byline.admin-managed',
|
|
101
|
+
defaultMessage: 'Admin group {verifiedIcon}',
|
|
102
|
+
description: 'Byline for admin-managed groups with verified icon'
|
|
103
|
+
},
|
|
69
104
|
groupByline: {
|
|
70
105
|
id: 'fabric.elements.user-picker.group.byline',
|
|
71
106
|
defaultMessage: 'Admin-managed group',
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
4
|
import { isCustom, isExternalUser } from './components/utils';
|
|
4
5
|
const packageName = "@atlaskit/user-picker";
|
|
5
|
-
const packageVersion = "11.
|
|
6
|
+
const packageVersion = "11.12.0";
|
|
6
7
|
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}$/;
|
|
7
8
|
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}$/;
|
|
8
9
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
9
10
|
export const startSession = () => ({
|
|
11
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
10
12
|
id: uuidv4(),
|
|
11
13
|
start: Date.now(),
|
|
12
14
|
inputChangeTime: Date.now(),
|
|
@@ -5,6 +5,7 @@ import { UFOExperienceState } from '@atlaskit/ufo';
|
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
8
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import { cancelEvent, clearEvent, createAndFireEventInElementsChannel, deleteEvent, failedEvent, focusEvent, searchedEvent, selectEvent, startSession } from '../analytics';
|
|
10
11
|
import { batchByKey } from './batch';
|
|
@@ -378,7 +379,9 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
378
379
|
showError: false,
|
|
379
380
|
initialFocusHandled: false
|
|
380
381
|
};
|
|
381
|
-
this.optionsShownUfoExperienceInstance =
|
|
382
|
+
this.optionsShownUfoExperienceInstance =
|
|
383
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
384
|
+
userPickerOptionsShownUfoExperience.getInstance(uuidv4());
|
|
382
385
|
if (this.props.forwardedRef) {
|
|
383
386
|
const refValue = {
|
|
384
387
|
focus: this.focus,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
/**
|
|
3
4
|
* @jsxRuntime classic
|
|
@@ -9,6 +10,8 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
9
10
|
import { css, jsx } from '@emotion/react';
|
|
10
11
|
import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
11
12
|
import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
|
|
13
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
15
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
13
16
|
import { messages } from '../i18n';
|
|
14
17
|
import { HighlightText } from '../HighlightText';
|
|
@@ -51,16 +54,34 @@ export class GroupOption extends React.PureComponent {
|
|
|
51
54
|
LEGACY_size: "medium",
|
|
52
55
|
spacing: "spacious"
|
|
53
56
|
})));
|
|
57
|
+
_defineProperty(this, "renderVerifiedIcon", () => {
|
|
58
|
+
return jsx(VerifiedTeamIcon, {
|
|
59
|
+
label: "",
|
|
60
|
+
size: "small",
|
|
61
|
+
spacing: "none"
|
|
62
|
+
});
|
|
63
|
+
});
|
|
54
64
|
_defineProperty(this, "renderByline", () => {
|
|
55
65
|
const {
|
|
56
66
|
isSelected,
|
|
57
67
|
group
|
|
58
68
|
} = this.props;
|
|
69
|
+
const getGroupByline = () => {
|
|
70
|
+
if (fg('confluence_frontend_perms_exp_teams_as_principals')) {
|
|
71
|
+
return jsx(FormattedMessage, _extends({}, messages.adminManagedGroupByline, {
|
|
72
|
+
values: {
|
|
73
|
+
verifiedIcon: this.renderVerifiedIcon()
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
} else {
|
|
77
|
+
return jsx(FormattedMessage, messages.groupByline);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
59
80
|
return jsx("span", {
|
|
60
81
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
61
82
|
css: textWrapper(isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text-subtlest, ${N200})`),
|
|
62
83
|
"data-testid": "user-picker-group-secondary-text"
|
|
63
|
-
}, group.byline ? group.byline :
|
|
84
|
+
}, group.byline ? group.byline : getGroupByline());
|
|
64
85
|
});
|
|
65
86
|
_defineProperty(this, "getLozengeProps", () => typeof this.props.group.lozenge === 'string' ? {
|
|
66
87
|
text: this.props.group.lozenge
|
|
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { Inline } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
12
|
import { jsx } from '@emotion/react';
|
|
12
13
|
import React from 'react';
|
|
@@ -22,8 +23,7 @@ export class TeamOption extends React.PureComponent {
|
|
|
22
23
|
const {
|
|
23
24
|
team: {
|
|
24
25
|
name,
|
|
25
|
-
highlight
|
|
26
|
-
verified
|
|
26
|
+
highlight
|
|
27
27
|
}
|
|
28
28
|
} = this.props;
|
|
29
29
|
return [jsx("span", {
|
|
@@ -35,16 +35,18 @@ export class TeamOption extends React.PureComponent {
|
|
|
35
35
|
alignBlock: "center"
|
|
36
36
|
}, jsx(HighlightText, {
|
|
37
37
|
highlights: highlight && highlight.name
|
|
38
|
-
}, name),
|
|
38
|
+
}, name), !fg('confluence_frontend_perms_exp_teams_as_principals') && this.renderVerifiedIcon()))];
|
|
39
39
|
});
|
|
40
40
|
_defineProperty(this, "renderByline", () => {
|
|
41
41
|
const {
|
|
42
42
|
isSelected,
|
|
43
43
|
team: {
|
|
44
44
|
memberCount,
|
|
45
|
-
includesYou
|
|
45
|
+
includesYou,
|
|
46
|
+
verified
|
|
46
47
|
}
|
|
47
48
|
} = this.props;
|
|
49
|
+
const isVerified = fg('confluence_frontend_perms_exp_teams_as_principals') && verified;
|
|
48
50
|
|
|
49
51
|
// if Member count is missing, do not show the byline, regardless of the availability of includesYou
|
|
50
52
|
if (memberCount === null || typeof memberCount === 'undefined') {
|
|
@@ -52,9 +54,18 @@ export class TeamOption extends React.PureComponent {
|
|
|
52
54
|
} else {
|
|
53
55
|
if (includesYou === true) {
|
|
54
56
|
if (memberCount > 50) {
|
|
55
|
-
return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.
|
|
57
|
+
return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithYou, {
|
|
58
|
+
values: {
|
|
59
|
+
verifiedIcon: this.renderVerifiedIcon()
|
|
60
|
+
}
|
|
61
|
+
})) : jsx(FormattedMessage, messages.plus50MembersWithYou));
|
|
56
62
|
} else {
|
|
57
|
-
return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.
|
|
63
|
+
return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithYou, {
|
|
64
|
+
values: {
|
|
65
|
+
verifiedIcon: this.renderVerifiedIcon(),
|
|
66
|
+
count: memberCount
|
|
67
|
+
}
|
|
68
|
+
})) : jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
|
|
58
69
|
values: {
|
|
59
70
|
count: memberCount
|
|
60
71
|
}
|
|
@@ -62,9 +73,18 @@ export class TeamOption extends React.PureComponent {
|
|
|
62
73
|
}
|
|
63
74
|
} else {
|
|
64
75
|
if (memberCount > 50) {
|
|
65
|
-
return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.
|
|
76
|
+
return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithoutYou, {
|
|
77
|
+
values: {
|
|
78
|
+
verifiedIcon: this.renderVerifiedIcon()
|
|
79
|
+
}
|
|
80
|
+
})) : jsx(FormattedMessage, messages.plus50MembersWithoutYou));
|
|
66
81
|
} else {
|
|
67
|
-
return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.
|
|
82
|
+
return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithoutYou, {
|
|
83
|
+
values: {
|
|
84
|
+
verifiedIcon: this.renderVerifiedIcon(),
|
|
85
|
+
count: memberCount
|
|
86
|
+
}
|
|
87
|
+
})) : jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
|
|
68
88
|
values: {
|
|
69
89
|
count: memberCount
|
|
70
90
|
}
|
|
@@ -90,6 +110,16 @@ export class TeamOption extends React.PureComponent {
|
|
|
90
110
|
type: "team"
|
|
91
111
|
});
|
|
92
112
|
});
|
|
113
|
+
_defineProperty(this, "renderVerifiedIcon", () => {
|
|
114
|
+
if (this.props.team.verified) {
|
|
115
|
+
return jsx(VerifiedTeamIcon, {
|
|
116
|
+
label: "",
|
|
117
|
+
size: "small",
|
|
118
|
+
spacing: "none"
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
});
|
|
93
123
|
_defineProperty(this, "getLozengeProps", () => typeof this.props.team.lozenge === 'string' ? {
|
|
94
124
|
text: this.props.team.lozenge
|
|
95
125
|
} : this.props.team.lozenge);
|
|
@@ -14,11 +14,13 @@ import { getCreatableSuggestedEmailProps } from './creatableEmailSuggestion';
|
|
|
14
14
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
15
15
|
import { ExusUserSourceProvider } from '../clients/UserSourceProvider';
|
|
16
16
|
import { userPickerRenderedUfoExperience as experience, UfoErrorBoundary } from '../util/ufoExperiences';
|
|
17
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
17
18
|
import { v4 as uuidv4 } from 'uuid';
|
|
18
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
export class UserPickerWithoutAnalytics extends React.Component {
|
|
20
21
|
constructor(props) {
|
|
21
22
|
super(props);
|
|
23
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
22
24
|
this.ufoId = uuidv4();
|
|
23
25
|
const experienceForId = experience.getInstance(this.ufoId);
|
|
24
26
|
if (![UFOExperienceState.IN_PROGRESS.id, UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
|
|
@@ -25,6 +25,26 @@ export const messages = defineMessages({
|
|
|
25
25
|
defaultMessage: 'Something went wrong',
|
|
26
26
|
description: 'Error message to display when options fail to load.'
|
|
27
27
|
},
|
|
28
|
+
teamByline: {
|
|
29
|
+
id: 'fabric.elements.user-picker.team.byline',
|
|
30
|
+
defaultMessage: 'Team',
|
|
31
|
+
description: 'Byline for team'
|
|
32
|
+
},
|
|
33
|
+
officialTeamByline: {
|
|
34
|
+
id: 'fabric.elements.user-picker.team.byline.official',
|
|
35
|
+
defaultMessage: 'Official team {verifiedIcon}',
|
|
36
|
+
description: 'Byline for official team'
|
|
37
|
+
},
|
|
38
|
+
officialMemberCountWithoutYou: {
|
|
39
|
+
id: 'fabric.elements.user-picker.team.member.count.official',
|
|
40
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}',
|
|
41
|
+
description: 'Byline to show the number of members in the team when the current user is not a member of the team'
|
|
42
|
+
},
|
|
43
|
+
officialMemberCountWithYou: {
|
|
44
|
+
id: 'fabric.elements.user-picker.team.member.count.official.including.you',
|
|
45
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}, including you',
|
|
46
|
+
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
47
|
+
},
|
|
28
48
|
memberCountWithoutYou: {
|
|
29
49
|
id: 'fabric.elements.user-picker.team.member.count',
|
|
30
50
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}',
|
|
@@ -35,6 +55,16 @@ export const messages = defineMessages({
|
|
|
35
55
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}, including you',
|
|
36
56
|
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
37
57
|
},
|
|
58
|
+
officialPlus50MembersWithoutYou: {
|
|
59
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official',
|
|
60
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members',
|
|
61
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50'
|
|
62
|
+
},
|
|
63
|
+
officialPlus50MembersWithYou: {
|
|
64
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official.including.you',
|
|
65
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members, including you',
|
|
66
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50 and also includes the current user'
|
|
67
|
+
},
|
|
38
68
|
plus50MembersWithoutYou: {
|
|
39
69
|
id: 'fabric.elements.user-picker.team.member.50plus',
|
|
40
70
|
defaultMessage: 'Team • 50+ members',
|
|
@@ -60,6 +90,11 @@ export const messages = defineMessages({
|
|
|
60
90
|
defaultMessage: 'Enter an email address',
|
|
61
91
|
description: 'Byline for a potentially valid email option.'
|
|
62
92
|
},
|
|
93
|
+
adminManagedGroupByline: {
|
|
94
|
+
id: 'fabric.elements.user-picker.group.byline.admin-managed',
|
|
95
|
+
defaultMessage: 'Admin group {verifiedIcon}',
|
|
96
|
+
description: 'Byline for admin-managed groups with verified icon'
|
|
97
|
+
},
|
|
63
98
|
groupByline: {
|
|
64
99
|
id: 'fabric.elements.user-picker.group.byline',
|
|
65
100
|
defaultMessage: 'Admin-managed group',
|
package/dist/esm/analytics.js
CHANGED
|
@@ -2,15 +2,17 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
4
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
5
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { isCustom, isExternalUser } from './components/utils';
|
|
7
8
|
var packageName = "@atlaskit/user-picker";
|
|
8
|
-
var packageVersion = "11.
|
|
9
|
+
var packageVersion = "11.12.0";
|
|
9
10
|
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}$/;
|
|
10
11
|
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}$/;
|
|
11
12
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
12
13
|
export var startSession = function startSession() {
|
|
13
14
|
return {
|
|
15
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
14
16
|
id: uuidv4(),
|
|
15
17
|
start: Date.now(),
|
|
16
18
|
inputChangeTime: Date.now(),
|
|
@@ -19,6 +19,7 @@ import { UFOExperienceState } from '@atlaskit/ufo';
|
|
|
19
19
|
import debounce from 'lodash/debounce';
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import { FormattedMessage } from 'react-intl-next';
|
|
22
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
22
23
|
import { v4 as uuidv4 } from 'uuid';
|
|
23
24
|
import { cancelEvent, clearEvent, createAndFireEventInElementsChannel, deleteEvent, failedEvent, focusEvent, searchedEvent, selectEvent, startSession } from '../analytics';
|
|
24
25
|
import { batchByKey } from './batch';
|
|
@@ -387,7 +388,9 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
387
388
|
showError: false,
|
|
388
389
|
initialFocusHandled: false
|
|
389
390
|
};
|
|
390
|
-
_this.optionsShownUfoExperienceInstance =
|
|
391
|
+
_this.optionsShownUfoExperienceInstance =
|
|
392
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
393
|
+
userPickerOptionsShownUfoExperience.getInstance(uuidv4());
|
|
391
394
|
if (_this.props.forwardedRef) {
|
|
392
395
|
var refValue = {
|
|
393
396
|
focus: _this.focus,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -16,6 +17,8 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
16
17
|
import { css, jsx } from '@emotion/react';
|
|
17
18
|
import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
18
19
|
import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
|
|
20
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
21
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
22
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
20
23
|
import { messages } from '../i18n';
|
|
21
24
|
import { HighlightText } from '../HighlightText';
|
|
@@ -63,15 +66,33 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
63
66
|
spacing: "spacious"
|
|
64
67
|
}));
|
|
65
68
|
});
|
|
69
|
+
_defineProperty(_this, "renderVerifiedIcon", function () {
|
|
70
|
+
return jsx(VerifiedTeamIcon, {
|
|
71
|
+
label: "",
|
|
72
|
+
size: "small",
|
|
73
|
+
spacing: "none"
|
|
74
|
+
});
|
|
75
|
+
});
|
|
66
76
|
_defineProperty(_this, "renderByline", function () {
|
|
67
77
|
var _this$props2 = _this.props,
|
|
68
78
|
isSelected = _this$props2.isSelected,
|
|
69
79
|
group = _this$props2.group;
|
|
80
|
+
var getGroupByline = function getGroupByline() {
|
|
81
|
+
if (fg('confluence_frontend_perms_exp_teams_as_principals')) {
|
|
82
|
+
return jsx(FormattedMessage, _extends({}, messages.adminManagedGroupByline, {
|
|
83
|
+
values: {
|
|
84
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
} else {
|
|
88
|
+
return jsx(FormattedMessage, messages.groupByline);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
70
91
|
return jsx("span", {
|
|
71
92
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
72
93
|
css: textWrapper(isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text-subtlest, ".concat(N200, ")")),
|
|
73
94
|
"data-testid": "user-picker-group-secondary-text"
|
|
74
|
-
}, group.byline ? group.byline :
|
|
95
|
+
}, group.byline ? group.byline : getGroupByline());
|
|
75
96
|
});
|
|
76
97
|
_defineProperty(_this, "getLozengeProps", function () {
|
|
77
98
|
return typeof _this.props.group.lozenge === 'string' ? {
|
|
@@ -14,6 +14,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
14
14
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { Inline } from '@atlaskit/primitives/compiled';
|
|
16
16
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
19
|
import { jsx } from '@emotion/react';
|
|
19
20
|
import React from 'react';
|
|
@@ -33,8 +34,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
33
34
|
_defineProperty(_this, "getPrimaryText", function () {
|
|
34
35
|
var _this$props$team = _this.props.team,
|
|
35
36
|
name = _this$props$team.name,
|
|
36
|
-
highlight = _this$props$team.highlight
|
|
37
|
-
verified = _this$props$team.verified;
|
|
37
|
+
highlight = _this$props$team.highlight;
|
|
38
38
|
return [jsx("span", {
|
|
39
39
|
key: "name"
|
|
40
40
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -44,14 +44,16 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
44
44
|
alignBlock: "center"
|
|
45
45
|
}, jsx(HighlightText, {
|
|
46
46
|
highlights: highlight && highlight.name
|
|
47
|
-
}, name),
|
|
47
|
+
}, name), !fg('confluence_frontend_perms_exp_teams_as_principals') && _this.renderVerifiedIcon()))];
|
|
48
48
|
});
|
|
49
49
|
_defineProperty(_this, "renderByline", function () {
|
|
50
50
|
var _this$props = _this.props,
|
|
51
51
|
isSelected = _this$props.isSelected,
|
|
52
52
|
_this$props$team2 = _this$props.team,
|
|
53
53
|
memberCount = _this$props$team2.memberCount,
|
|
54
|
-
includesYou = _this$props$team2.includesYou
|
|
54
|
+
includesYou = _this$props$team2.includesYou,
|
|
55
|
+
verified = _this$props$team2.verified;
|
|
56
|
+
var isVerified = fg('confluence_frontend_perms_exp_teams_as_principals') && verified;
|
|
55
57
|
|
|
56
58
|
// if Member count is missing, do not show the byline, regardless of the availability of includesYou
|
|
57
59
|
if (memberCount === null || typeof memberCount === 'undefined') {
|
|
@@ -59,9 +61,18 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
61
|
} else {
|
|
60
62
|
if (includesYou === true) {
|
|
61
63
|
if (memberCount > 50) {
|
|
62
|
-
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.
|
|
64
|
+
return _this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithYou, {
|
|
65
|
+
values: {
|
|
66
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
67
|
+
}
|
|
68
|
+
})) : jsx(FormattedMessage, messages.plus50MembersWithYou));
|
|
63
69
|
} else {
|
|
64
|
-
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.
|
|
70
|
+
return _this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithYou, {
|
|
71
|
+
values: {
|
|
72
|
+
verifiedIcon: _this.renderVerifiedIcon(),
|
|
73
|
+
count: memberCount
|
|
74
|
+
}
|
|
75
|
+
})) : jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
|
|
65
76
|
values: {
|
|
66
77
|
count: memberCount
|
|
67
78
|
}
|
|
@@ -69,9 +80,18 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
69
80
|
}
|
|
70
81
|
} else {
|
|
71
82
|
if (memberCount > 50) {
|
|
72
|
-
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.
|
|
83
|
+
return _this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithoutYou, {
|
|
84
|
+
values: {
|
|
85
|
+
verifiedIcon: _this.renderVerifiedIcon()
|
|
86
|
+
}
|
|
87
|
+
})) : jsx(FormattedMessage, messages.plus50MembersWithoutYou));
|
|
73
88
|
} else {
|
|
74
|
-
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.
|
|
89
|
+
return _this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithoutYou, {
|
|
90
|
+
values: {
|
|
91
|
+
verifiedIcon: _this.renderVerifiedIcon(),
|
|
92
|
+
count: memberCount
|
|
93
|
+
}
|
|
94
|
+
})) : jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
|
|
75
95
|
values: {
|
|
76
96
|
count: memberCount
|
|
77
97
|
}
|
|
@@ -95,6 +115,16 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
95
115
|
type: "team"
|
|
96
116
|
});
|
|
97
117
|
});
|
|
118
|
+
_defineProperty(_this, "renderVerifiedIcon", function () {
|
|
119
|
+
if (_this.props.team.verified) {
|
|
120
|
+
return jsx(VerifiedTeamIcon, {
|
|
121
|
+
label: "",
|
|
122
|
+
size: "small",
|
|
123
|
+
spacing: "none"
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
});
|
|
98
128
|
_defineProperty(_this, "getLozengeProps", function () {
|
|
99
129
|
return typeof _this.props.team.lozenge === 'string' ? {
|
|
100
130
|
text: _this.props.team.lozenge
|
|
@@ -23,6 +23,7 @@ import { getCreatableSuggestedEmailProps } from './creatableEmailSuggestion';
|
|
|
23
23
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
24
24
|
import { ExusUserSourceProvider } from '../clients/UserSourceProvider';
|
|
25
25
|
import { userPickerRenderedUfoExperience as experience, UfoErrorBoundary } from '../util/ufoExperiences';
|
|
26
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
26
27
|
import { v4 as uuidv4 } from 'uuid';
|
|
27
28
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
29
|
export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
@@ -30,6 +31,7 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
30
31
|
var _this;
|
|
31
32
|
_classCallCheck(this, UserPickerWithoutAnalytics);
|
|
32
33
|
_this = _callSuper(this, UserPickerWithoutAnalytics, [props]);
|
|
34
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
33
35
|
_this.ufoId = uuidv4();
|
|
34
36
|
var experienceForId = experience.getInstance(_this.ufoId);
|
|
35
37
|
if (![UFOExperienceState.IN_PROGRESS.id, UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
|
|
@@ -25,6 +25,26 @@ export var messages = defineMessages({
|
|
|
25
25
|
defaultMessage: 'Something went wrong',
|
|
26
26
|
description: 'Error message to display when options fail to load.'
|
|
27
27
|
},
|
|
28
|
+
teamByline: {
|
|
29
|
+
id: 'fabric.elements.user-picker.team.byline',
|
|
30
|
+
defaultMessage: 'Team',
|
|
31
|
+
description: 'Byline for team'
|
|
32
|
+
},
|
|
33
|
+
officialTeamByline: {
|
|
34
|
+
id: 'fabric.elements.user-picker.team.byline.official',
|
|
35
|
+
defaultMessage: 'Official team {verifiedIcon}',
|
|
36
|
+
description: 'Byline for official team'
|
|
37
|
+
},
|
|
38
|
+
officialMemberCountWithoutYou: {
|
|
39
|
+
id: 'fabric.elements.user-picker.team.member.count.official',
|
|
40
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}',
|
|
41
|
+
description: 'Byline to show the number of members in the team when the current user is not a member of the team'
|
|
42
|
+
},
|
|
43
|
+
officialMemberCountWithYou: {
|
|
44
|
+
id: 'fabric.elements.user-picker.team.member.count.official.including.you',
|
|
45
|
+
defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}, including you',
|
|
46
|
+
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
47
|
+
},
|
|
28
48
|
memberCountWithoutYou: {
|
|
29
49
|
id: 'fabric.elements.user-picker.team.member.count',
|
|
30
50
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}',
|
|
@@ -35,6 +55,16 @@ export var messages = defineMessages({
|
|
|
35
55
|
defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}, including you',
|
|
36
56
|
description: 'Byline to show the number of members in the team when the current user is also a member of the team'
|
|
37
57
|
},
|
|
58
|
+
officialPlus50MembersWithoutYou: {
|
|
59
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official',
|
|
60
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members',
|
|
61
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50'
|
|
62
|
+
},
|
|
63
|
+
officialPlus50MembersWithYou: {
|
|
64
|
+
id: 'fabric.elements.user-picker.team.member.50plus.official.including.you',
|
|
65
|
+
defaultMessage: 'Official team {verifiedIcon} • 50+ members, including you',
|
|
66
|
+
description: 'Byline to show the number of members in the team when the number exceeds 50 and also includes the current user'
|
|
67
|
+
},
|
|
38
68
|
plus50MembersWithoutYou: {
|
|
39
69
|
id: 'fabric.elements.user-picker.team.member.50plus',
|
|
40
70
|
defaultMessage: 'Team • 50+ members',
|
|
@@ -60,6 +90,11 @@ export var messages = defineMessages({
|
|
|
60
90
|
defaultMessage: 'Enter an email address',
|
|
61
91
|
description: 'Byline for a potentially valid email option.'
|
|
62
92
|
},
|
|
93
|
+
adminManagedGroupByline: {
|
|
94
|
+
id: 'fabric.elements.user-picker.group.byline.admin-managed',
|
|
95
|
+
defaultMessage: 'Admin group {verifiedIcon}',
|
|
96
|
+
description: 'Byline for admin-managed groups with verified icon'
|
|
97
|
+
},
|
|
63
98
|
groupByline: {
|
|
64
99
|
id: 'fabric.elements.user-picker.group.byline',
|
|
65
100
|
defaultMessage: 'Admin-managed group',
|
|
@@ -13,6 +13,7 @@ export type GroupOptionProps = {
|
|
|
13
13
|
export declare class GroupOption extends React.PureComponent<GroupOptionProps> {
|
|
14
14
|
private getPrimaryText;
|
|
15
15
|
private renderAvatar;
|
|
16
|
+
private renderVerifiedIcon;
|
|
16
17
|
private renderByline;
|
|
17
18
|
private getLozengeProps;
|
|
18
19
|
render(): jsx.JSX.Element;
|
|
@@ -10,6 +10,7 @@ export declare class TeamOption extends React.PureComponent<TeamOptionProps> {
|
|
|
10
10
|
private renderByline;
|
|
11
11
|
private getBylineComponent;
|
|
12
12
|
private renderAvatar;
|
|
13
|
+
private renderVerifiedIcon;
|
|
13
14
|
private getLozengeProps;
|
|
14
15
|
private renderCustomByLine;
|
|
15
16
|
render(): jsx.JSX.Element;
|
|
@@ -24,6 +24,26 @@ export declare const messages: {
|
|
|
24
24
|
defaultMessage: string;
|
|
25
25
|
description: string;
|
|
26
26
|
};
|
|
27
|
+
teamByline: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
officialTeamByline: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
officialMemberCountWithoutYou: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
officialMemberCountWithYou: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
27
47
|
memberCountWithoutYou: {
|
|
28
48
|
id: string;
|
|
29
49
|
defaultMessage: string;
|
|
@@ -34,6 +54,16 @@ export declare const messages: {
|
|
|
34
54
|
defaultMessage: string;
|
|
35
55
|
description: string;
|
|
36
56
|
};
|
|
57
|
+
officialPlus50MembersWithoutYou: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
officialPlus50MembersWithYou: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
37
67
|
plus50MembersWithoutYou: {
|
|
38
68
|
id: string;
|
|
39
69
|
defaultMessage: string;
|
|
@@ -59,6 +89,11 @@ export declare const messages: {
|
|
|
59
89
|
defaultMessage: string;
|
|
60
90
|
description: string;
|
|
61
91
|
};
|
|
92
|
+
adminManagedGroupByline: {
|
|
93
|
+
id: string;
|
|
94
|
+
defaultMessage: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
62
97
|
groupByline: {
|
|
63
98
|
id: string;
|
|
64
99
|
defaultMessage: string;
|
|
@@ -13,6 +13,7 @@ export type GroupOptionProps = {
|
|
|
13
13
|
export declare class GroupOption extends React.PureComponent<GroupOptionProps> {
|
|
14
14
|
private getPrimaryText;
|
|
15
15
|
private renderAvatar;
|
|
16
|
+
private renderVerifiedIcon;
|
|
16
17
|
private renderByline;
|
|
17
18
|
private getLozengeProps;
|
|
18
19
|
render(): jsx.JSX.Element;
|
|
@@ -10,6 +10,7 @@ export declare class TeamOption extends React.PureComponent<TeamOptionProps> {
|
|
|
10
10
|
private renderByline;
|
|
11
11
|
private getBylineComponent;
|
|
12
12
|
private renderAvatar;
|
|
13
|
+
private renderVerifiedIcon;
|
|
13
14
|
private getLozengeProps;
|
|
14
15
|
private renderCustomByLine;
|
|
15
16
|
render(): jsx.JSX.Element;
|
|
@@ -24,6 +24,26 @@ export declare const messages: {
|
|
|
24
24
|
defaultMessage: string;
|
|
25
25
|
description: string;
|
|
26
26
|
};
|
|
27
|
+
teamByline: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
officialTeamByline: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
officialMemberCountWithoutYou: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
officialMemberCountWithYou: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
27
47
|
memberCountWithoutYou: {
|
|
28
48
|
id: string;
|
|
29
49
|
defaultMessage: string;
|
|
@@ -34,6 +54,16 @@ export declare const messages: {
|
|
|
34
54
|
defaultMessage: string;
|
|
35
55
|
description: string;
|
|
36
56
|
};
|
|
57
|
+
officialPlus50MembersWithoutYou: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
officialPlus50MembersWithYou: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
37
67
|
plus50MembersWithoutYou: {
|
|
38
68
|
id: string;
|
|
39
69
|
defaultMessage: string;
|
|
@@ -59,6 +89,11 @@ export declare const messages: {
|
|
|
59
89
|
defaultMessage: string;
|
|
60
90
|
description: string;
|
|
61
91
|
};
|
|
92
|
+
adminManagedGroupByline: {
|
|
93
|
+
id: string;
|
|
94
|
+
defaultMessage: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
62
97
|
groupByline: {
|
|
63
98
|
id: string;
|
|
64
99
|
defaultMessage: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.13.0",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/icon": "^28.5.0",
|
|
49
49
|
"@atlaskit/logo": "^19.9.0",
|
|
50
50
|
"@atlaskit/lozenge": "^13.0.0",
|
|
51
|
-
"@atlaskit/people-teams-ui-public": "^3.
|
|
51
|
+
"@atlaskit/people-teams-ui-public": "^3.6.0",
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
53
|
"@atlaskit/popper": "^7.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^16.1.0",
|
|
@@ -118,6 +118,9 @@
|
|
|
118
118
|
},
|
|
119
119
|
"user_picker_migrate_aria_label_description": {
|
|
120
120
|
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"confluence_frontend_perms_exp_teams_as_principals": {
|
|
123
|
+
"type": "boolean"
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
}
|