@atlaskit/smart-user-picker 10.1.0 → 10.2.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 +7 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/SmartUserPicker.js +91 -91
- package/dist/cjs/service/default-value-hydration-client.js +30 -30
- package/dist/cjs/service/users-client.js +4 -4
- package/dist/cjs/util/i18n-util.js +38 -38
- package/dist/es2019/analytics.js +1 -1
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/SmartUserPicker.js +90 -90
- package/dist/esm/service/default-value-hydration-client.js +30 -30
- package/dist/esm/service/users-client.js +4 -4
- package/dist/esm/util/i18n-util.js +37 -37
- package/package.json +4 -2
|
@@ -91,15 +91,15 @@ var isOptionData = function isOptionData(option) {
|
|
|
91
91
|
var hydrateTeamIds = /*#__PURE__*/function () {
|
|
92
92
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(baseUrl, values, siteId) {
|
|
93
93
|
var legionPromises;
|
|
94
|
-
return _regeneratorRuntime.wrap(function
|
|
94
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
95
95
|
while (1) switch (_context.prev = _context.next) {
|
|
96
96
|
case 0:
|
|
97
97
|
if (!(values.length === 0)) {
|
|
98
|
-
_context.next =
|
|
98
|
+
_context.next = 1;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
return _context.abrupt("return", []);
|
|
102
|
-
case
|
|
102
|
+
case 1:
|
|
103
103
|
legionPromises = values.map(function (value) {
|
|
104
104
|
return hydrateTeamFromLegion({
|
|
105
105
|
baseUrl: baseUrl,
|
|
@@ -107,11 +107,11 @@ var hydrateTeamIds = /*#__PURE__*/function () {
|
|
|
107
107
|
siteId: siteId
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
|
-
_context.next =
|
|
110
|
+
_context.next = 2;
|
|
111
111
|
return Promise.all(legionPromises);
|
|
112
|
-
case
|
|
112
|
+
case 2:
|
|
113
113
|
return _context.abrupt("return", _context.sent);
|
|
114
|
-
case
|
|
114
|
+
case 3:
|
|
115
115
|
case "end":
|
|
116
116
|
return _context.stop();
|
|
117
117
|
}
|
|
@@ -123,43 +123,43 @@ var hydrateTeamIds = /*#__PURE__*/function () {
|
|
|
123
123
|
}();
|
|
124
124
|
var hydrateAccountIds = /*#__PURE__*/function () {
|
|
125
125
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(baseUrl, productKey, values, atlAttributes) {
|
|
126
|
-
var accountIds;
|
|
127
|
-
return _regeneratorRuntime.wrap(function
|
|
126
|
+
var accountIds, _t;
|
|
127
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
128
128
|
while (1) switch (_context2.prev = _context2.next) {
|
|
129
129
|
case 0:
|
|
130
130
|
if (!(values.length === 0)) {
|
|
131
|
-
_context2.next =
|
|
131
|
+
_context2.next = 1;
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
134
|
return _context2.abrupt("return", []);
|
|
135
|
-
case
|
|
135
|
+
case 1:
|
|
136
136
|
accountIds = values.map(function (val) {
|
|
137
137
|
return val.id;
|
|
138
138
|
}); //if we are not jira or confluence then use PRS platform hydration
|
|
139
139
|
if (!(productKey === 'jira' || productKey === 'confluence')) {
|
|
140
|
-
_context2.next =
|
|
140
|
+
_context2.next = 3;
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
|
-
_context2.next =
|
|
143
|
+
_context2.next = 2;
|
|
144
144
|
return getHydratedUsersFromProducts({
|
|
145
145
|
baseUrl: baseUrl,
|
|
146
146
|
productKey: productKey,
|
|
147
147
|
accountIds: accountIds
|
|
148
148
|
});
|
|
149
|
-
case
|
|
150
|
-
|
|
151
|
-
_context2.next =
|
|
149
|
+
case 2:
|
|
150
|
+
_t = _context2.sent;
|
|
151
|
+
_context2.next = 5;
|
|
152
152
|
break;
|
|
153
|
-
case
|
|
154
|
-
_context2.next =
|
|
153
|
+
case 3:
|
|
154
|
+
_context2.next = 4;
|
|
155
155
|
return getHydratedUsersFromPrs(baseUrl, accountIds, _objectSpread({
|
|
156
156
|
product: productKey
|
|
157
157
|
}, atlAttributes));
|
|
158
|
-
case
|
|
159
|
-
|
|
160
|
-
case
|
|
161
|
-
return _context2.abrupt("return",
|
|
162
|
-
case
|
|
158
|
+
case 4:
|
|
159
|
+
_t = _context2.sent;
|
|
160
|
+
case 5:
|
|
161
|
+
return _context2.abrupt("return", _t);
|
|
162
|
+
case 6:
|
|
163
163
|
case "end":
|
|
164
164
|
return _context2.stop();
|
|
165
165
|
}
|
|
@@ -175,31 +175,31 @@ function hydrateDefaultValues(_x8, _x9, _x0, _x1, _x10) {
|
|
|
175
175
|
function _hydrateDefaultValues() {
|
|
176
176
|
_hydrateDefaultValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(baseUrl, value, productKey, siteId, atlAttributes) {
|
|
177
177
|
var values, _yield$Promise$all, _yield$Promise$all2, hydratedUsers, hydratedTeams, hydratedOptions;
|
|
178
|
-
return _regeneratorRuntime.wrap(function
|
|
178
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
179
179
|
while (1) switch (_context3.prev = _context3.next) {
|
|
180
180
|
case 0:
|
|
181
181
|
if (!(!value || Array.isArray(value) && value.length === 0)) {
|
|
182
|
-
_context3.next =
|
|
182
|
+
_context3.next = 1;
|
|
183
183
|
break;
|
|
184
184
|
}
|
|
185
185
|
return _context3.abrupt("return", []);
|
|
186
|
-
case
|
|
186
|
+
case 1:
|
|
187
187
|
values = Array.isArray(value) ? value : [value]; // return if all hydrated
|
|
188
188
|
if (values.some(function (val) {
|
|
189
189
|
return !isOptionData(val);
|
|
190
190
|
})) {
|
|
191
|
-
_context3.next =
|
|
191
|
+
_context3.next = 2;
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
194
194
|
return _context3.abrupt("return", value);
|
|
195
|
-
case
|
|
196
|
-
_context3.next =
|
|
195
|
+
case 2:
|
|
196
|
+
_context3.next = 3;
|
|
197
197
|
return Promise.all([hydrateAccountIds(baseUrl, productKey, values.filter(function (val) {
|
|
198
198
|
return !isOptionData(val) && val.type === 'user';
|
|
199
199
|
}), atlAttributes), hydrateTeamIds(baseUrl, values.filter(function (val) {
|
|
200
200
|
return !isOptionData(val) && val.type === 'team';
|
|
201
201
|
}), siteId)]);
|
|
202
|
-
case
|
|
202
|
+
case 3:
|
|
203
203
|
_yield$Promise$all = _context3.sent;
|
|
204
204
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
205
205
|
hydratedUsers = _yield$Promise$all2[0];
|
|
@@ -210,7 +210,7 @@ function _hydrateDefaultValues() {
|
|
|
210
210
|
return val;
|
|
211
211
|
}).concat(hydratedUsers).concat(hydratedTeams);
|
|
212
212
|
return _context3.abrupt("return", sortResults(hydratedOptions, values));
|
|
213
|
-
case
|
|
213
|
+
case 4:
|
|
214
214
|
case "end":
|
|
215
215
|
return _context3.stop();
|
|
216
216
|
}
|
|
@@ -21,15 +21,15 @@ var buildUsersQuery = function buildUsersQuery(accountIds) {
|
|
|
21
21
|
var makeRequest = /*#__PURE__*/function () {
|
|
22
22
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, accountIds, attributionData) {
|
|
23
23
|
var query;
|
|
24
|
-
return _regeneratorRuntime.wrap(function
|
|
24
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
25
25
|
while (1) switch (_context.prev = _context.next) {
|
|
26
26
|
case 0:
|
|
27
27
|
query = buildUsersQuery(accountIds);
|
|
28
|
-
_context.next =
|
|
28
|
+
_context.next = 1;
|
|
29
29
|
return graphqlQuery(url, query, attributionData);
|
|
30
|
-
case
|
|
30
|
+
case 1:
|
|
31
31
|
return _context.abrupt("return", _context.sent);
|
|
32
|
-
case
|
|
32
|
+
case 2:
|
|
33
33
|
case "end":
|
|
34
34
|
return _context.stop();
|
|
35
35
|
}
|
|
@@ -12,141 +12,141 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
12
12
|
*/
|
|
13
13
|
var _getMessagesForLocale = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(locale) {
|
|
15
|
-
var fragments;
|
|
16
|
-
return _regeneratorRuntime.wrap(function
|
|
15
|
+
var fragments, _t;
|
|
16
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
|
-
|
|
20
|
-
_context.next =
|
|
19
|
+
_t = locale;
|
|
20
|
+
_context.next = _t === 'cs' ? 1 : _t === 'da' ? 2 : _t === 'de' ? 3 : _t === 'en' ? 4 : _t === 'en_GB' ? 5 : _t === 'es' ? 6 : _t === 'et' ? 7 : _t === 'fi' ? 8 : _t === 'fr' ? 9 : _t === 'hu' ? 10 : _t === 'is' ? 11 : _t === 'it' ? 12 : _t === 'ja' ? 13 : _t === 'ko' ? 14 : _t === 'nb' ? 15 : _t === 'nl' ? 16 : _t === 'pl' ? 17 : _t === 'pt_BR' ? 18 : _t === 'pt-BR' ? 18 : _t === 'pt_PT' ? 19 : _t === 'pt-PT' ? 19 : _t === 'ro' ? 20 : _t === 'ru' ? 21 : _t === 'sk' ? 22 : _t === 'sv' ? 23 : _t === 'th' ? 24 : _t === 'tr' ? 25 : _t === 'uk' ? 26 : _t === 'vi' ? 27 : _t === 'zh_TW' ? 28 : _t === 'zh' ? 29 : 30;
|
|
21
21
|
break;
|
|
22
|
-
case
|
|
22
|
+
case 1:
|
|
23
23
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-cs" */'../i18n/cs').then(function (mod) {
|
|
24
24
|
return mod.default;
|
|
25
25
|
}));
|
|
26
|
-
case
|
|
26
|
+
case 2:
|
|
27
27
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-da" */'../i18n/da').then(function (mod) {
|
|
28
28
|
return mod.default;
|
|
29
29
|
}));
|
|
30
|
-
case
|
|
30
|
+
case 3:
|
|
31
31
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-de" */'../i18n/de').then(function (mod) {
|
|
32
32
|
return mod.default;
|
|
33
33
|
}));
|
|
34
|
-
case
|
|
34
|
+
case 4:
|
|
35
35
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-en" */'../i18n/en').then(function (mod) {
|
|
36
36
|
return mod.default;
|
|
37
37
|
}));
|
|
38
|
-
case
|
|
38
|
+
case 5:
|
|
39
39
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-en_GB" */'../i18n/en_GB').then(function (mod) {
|
|
40
40
|
return mod.default;
|
|
41
41
|
}));
|
|
42
|
-
case
|
|
42
|
+
case 6:
|
|
43
43
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-es" */'../i18n/es').then(function (mod) {
|
|
44
44
|
return mod.default;
|
|
45
45
|
}));
|
|
46
|
-
case
|
|
46
|
+
case 7:
|
|
47
47
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-et" */'../i18n/et').then(function (mod) {
|
|
48
48
|
return mod.default;
|
|
49
49
|
}));
|
|
50
|
-
case
|
|
50
|
+
case 8:
|
|
51
51
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-fi" */'../i18n/fi').then(function (mod) {
|
|
52
52
|
return mod.default;
|
|
53
53
|
}));
|
|
54
|
-
case
|
|
54
|
+
case 9:
|
|
55
55
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-fr" */'../i18n/fr').then(function (mod) {
|
|
56
56
|
return mod.default;
|
|
57
57
|
}));
|
|
58
|
-
case
|
|
58
|
+
case 10:
|
|
59
59
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-hu" */'../i18n/hu').then(function (mod) {
|
|
60
60
|
return mod.default;
|
|
61
61
|
}));
|
|
62
|
-
case
|
|
62
|
+
case 11:
|
|
63
63
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-is" */'../i18n/is').then(function (mod) {
|
|
64
64
|
return mod.default;
|
|
65
65
|
}));
|
|
66
|
-
case
|
|
66
|
+
case 12:
|
|
67
67
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-it" */'../i18n/it').then(function (mod) {
|
|
68
68
|
return mod.default;
|
|
69
69
|
}));
|
|
70
|
-
case
|
|
70
|
+
case 13:
|
|
71
71
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-ja" */'../i18n/ja').then(function (mod) {
|
|
72
72
|
return mod.default;
|
|
73
73
|
}));
|
|
74
|
-
case
|
|
74
|
+
case 14:
|
|
75
75
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-ko" */'../i18n/ko').then(function (mod) {
|
|
76
76
|
return mod.default;
|
|
77
77
|
}));
|
|
78
|
-
case
|
|
78
|
+
case 15:
|
|
79
79
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-nb" */'../i18n/nb').then(function (mod) {
|
|
80
80
|
return mod.default;
|
|
81
81
|
}));
|
|
82
|
-
case
|
|
82
|
+
case 16:
|
|
83
83
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-nl" */'../i18n/nl').then(function (mod) {
|
|
84
84
|
return mod.default;
|
|
85
85
|
}));
|
|
86
|
-
case
|
|
86
|
+
case 17:
|
|
87
87
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-pl" */'../i18n/pl').then(function (mod) {
|
|
88
88
|
return mod.default;
|
|
89
89
|
}));
|
|
90
|
-
case
|
|
90
|
+
case 18:
|
|
91
91
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-pt_BR" */'../i18n/pt_BR').then(function (mod) {
|
|
92
92
|
return mod.default;
|
|
93
93
|
}));
|
|
94
|
-
case
|
|
94
|
+
case 19:
|
|
95
95
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-pt_PT" */'../i18n/pt_PT').then(function (mod) {
|
|
96
96
|
return mod.default;
|
|
97
97
|
}));
|
|
98
|
-
case
|
|
98
|
+
case 20:
|
|
99
99
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-ro" */'../i18n/ro').then(function (mod) {
|
|
100
100
|
return mod.default;
|
|
101
101
|
}));
|
|
102
|
-
case
|
|
102
|
+
case 21:
|
|
103
103
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-ru" */'../i18n/ru').then(function (mod) {
|
|
104
104
|
return mod.default;
|
|
105
105
|
}));
|
|
106
|
-
case
|
|
106
|
+
case 22:
|
|
107
107
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-sk" */'../i18n/sk').then(function (mod) {
|
|
108
108
|
return mod.default;
|
|
109
109
|
}));
|
|
110
|
-
case
|
|
110
|
+
case 23:
|
|
111
111
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-sv" */'../i18n/sv').then(function (mod) {
|
|
112
112
|
return mod.default;
|
|
113
113
|
}));
|
|
114
|
-
case
|
|
114
|
+
case 24:
|
|
115
115
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-th" */'../i18n/th').then(function (mod) {
|
|
116
116
|
return mod.default;
|
|
117
117
|
}));
|
|
118
|
-
case
|
|
118
|
+
case 25:
|
|
119
119
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-tr" */'../i18n/tr').then(function (mod) {
|
|
120
120
|
return mod.default;
|
|
121
121
|
}));
|
|
122
|
-
case
|
|
122
|
+
case 26:
|
|
123
123
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-uk" */'../i18n/uk').then(function (mod) {
|
|
124
124
|
return mod.default;
|
|
125
125
|
}));
|
|
126
|
-
case
|
|
126
|
+
case 27:
|
|
127
127
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-vi" */'../i18n/vi').then(function (mod) {
|
|
128
128
|
return mod.default;
|
|
129
129
|
}));
|
|
130
|
-
case
|
|
130
|
+
case 28:
|
|
131
131
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-zh_TW" */'../i18n/zh_TW').then(function (mod) {
|
|
132
132
|
return mod.default;
|
|
133
133
|
}));
|
|
134
|
-
case
|
|
134
|
+
case 29:
|
|
135
135
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-zh" */'../i18n/zh').then(function (mod) {
|
|
136
136
|
return mod.default;
|
|
137
137
|
}));
|
|
138
|
-
case
|
|
138
|
+
case 30:
|
|
139
139
|
fragments = locale.split(/[_-]/);
|
|
140
140
|
if (!(fragments.length === 2)) {
|
|
141
|
-
_context.next =
|
|
141
|
+
_context.next = 31;
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
144
|
return _context.abrupt("return", _getMessagesForLocale(fragments[0]));
|
|
145
|
-
case
|
|
145
|
+
case 31:
|
|
146
146
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-en" */'../i18n/en').then(function (mod) {
|
|
147
147
|
return mod.default;
|
|
148
148
|
}));
|
|
149
|
-
case
|
|
149
|
+
case 32:
|
|
150
150
|
case "end":
|
|
151
151
|
return _context.stop();
|
|
152
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-user-picker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/afm-i18n-platform-smart-experiences-smart-user-picker": "2.
|
|
37
|
+
"@atlaskit/afm-i18n-platform-smart-experiences-smart-user-picker": "2.138.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/ufo": "^0.5.0",
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
"fetch-mock": "^8.0.0",
|
|
61
61
|
"graphql-tag": "^2.10.1",
|
|
62
62
|
"mock-apollo-client": "^0.1.0",
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
63
65
|
"react-intl": "^6.6.2"
|
|
64
66
|
},
|
|
65
67
|
"platform-feature-flags": {
|