@atlaskit/smart-user-picker 11.3.3 → 11.5.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 +20 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/SmartUserPicker.js +31 -18
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/SmartUserPicker.js +11 -1
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/SmartUserPicker.js +31 -18
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlassian/smart-user-picker
|
|
2
2
|
|
|
3
|
+
## 11.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`30c27895b9040`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/30c27895b9040) -
|
|
8
|
+
Behind the smart-user-picker-fetch-error-fix gate, a failed user lookup no longer clears the
|
|
9
|
+
suggestions or fails the UFO experience when the query has already moved on, so a slow or failing
|
|
10
|
+
request for an earlier keystroke cannot wipe the results of the current one.
|
|
11
|
+
|
|
12
|
+
## 11.4.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`83e8f4f813800`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/83e8f4f813800) -
|
|
17
|
+
Clean up a feature gate. The restrictTo prop is now always applied to user recommendations.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 11.3.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
13
13
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
14
14
|
var packageName = "@atlaskit/smart-user-picker";
|
|
15
|
-
var packageVersion = "11.
|
|
15
|
+
var packageVersion = "11.4.0";
|
|
16
16
|
var startSession = exports.startSession = function startSession() {
|
|
17
17
|
return {
|
|
18
18
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
@@ -163,7 +163,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
163
163
|
Further ref: https://developer.atlassian.com/platform/user-recommendations/guides/frequently-asked-questions/#filter-behavior
|
|
164
164
|
*/
|
|
165
165
|
searchQueryFilter: isEmail && !searchQueryFilter ? '(NOT not_mentionable:true) AND (account_status:active) AND (NOT account_type:app)' : searchQueryFilter
|
|
166
|
-
}, restrictTo &&
|
|
166
|
+
}, restrictTo && {
|
|
167
167
|
restrictTo: restrictTo
|
|
168
168
|
}), isTeamSyncedToGroupDirectoryFilter === true && {
|
|
169
169
|
isTeamSyncedToGroupDirectoryFilter: true
|
|
@@ -343,11 +343,24 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
343
343
|
loading: loading
|
|
344
344
|
};
|
|
345
345
|
});
|
|
346
|
-
_context.next =
|
|
346
|
+
_context.next = 24;
|
|
347
347
|
break;
|
|
348
348
|
case 15:
|
|
349
349
|
_context.prev = 15;
|
|
350
350
|
_t6 = _context["catch"](1);
|
|
351
|
+
if (!(_this.state.query !== query && (0, _platformFeatureFlags.fg)('smart-user-picker-fetch-error-fix'))) {
|
|
352
|
+
_context.next = 16;
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
356
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
357
|
+
// experience that belong to the newer query.
|
|
358
|
+
_this.fireEvent(_analytics.failedRequestUsersEvent, {
|
|
359
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
360
|
+
productAttributes: productAttributes
|
|
361
|
+
});
|
|
362
|
+
return _context.abrupt("return");
|
|
363
|
+
case 16:
|
|
351
364
|
is5xxEvent = checkIf500Event(_t6.statusCode);
|
|
352
365
|
if (!closed && !onError && is5xxEvent) {
|
|
353
366
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
|
@@ -359,35 +372,35 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
359
372
|
});
|
|
360
373
|
onErrorProducedError = false;
|
|
361
374
|
defaultUsers = [];
|
|
362
|
-
_context.prev =
|
|
375
|
+
_context.prev = 17;
|
|
363
376
|
if (!onError) {
|
|
364
|
-
_context.next =
|
|
377
|
+
_context.next = 20;
|
|
365
378
|
break;
|
|
366
379
|
}
|
|
367
|
-
_context.next =
|
|
380
|
+
_context.next = 18;
|
|
368
381
|
return onError(_t6, recommendationsRequest);
|
|
369
|
-
case
|
|
382
|
+
case 18:
|
|
370
383
|
_t8 = _context.sent;
|
|
371
384
|
if (_t8) {
|
|
372
|
-
_context.next =
|
|
385
|
+
_context.next = 19;
|
|
373
386
|
break;
|
|
374
387
|
}
|
|
375
388
|
_t8 = [];
|
|
376
|
-
case
|
|
389
|
+
case 19:
|
|
377
390
|
_t7 = _t8;
|
|
378
|
-
_context.next =
|
|
391
|
+
_context.next = 21;
|
|
379
392
|
break;
|
|
380
|
-
case 19:
|
|
381
|
-
_t7 = [];
|
|
382
393
|
case 20:
|
|
394
|
+
_t7 = [];
|
|
395
|
+
case 21:
|
|
383
396
|
defaultUsers = _t7;
|
|
384
|
-
_context.next =
|
|
397
|
+
_context.next = 23;
|
|
385
398
|
break;
|
|
386
|
-
case 21:
|
|
387
|
-
_context.prev = 21;
|
|
388
|
-
_t9 = _context["catch"](16);
|
|
389
|
-
onErrorProducedError = true;
|
|
390
399
|
case 22:
|
|
400
|
+
_context.prev = 22;
|
|
401
|
+
_t9 = _context["catch"](17);
|
|
402
|
+
onErrorProducedError = true;
|
|
403
|
+
case 23:
|
|
391
404
|
if (onErrorProducedError && is5xxEvent) {
|
|
392
405
|
// Log error from fallback data source `onError` to UFO
|
|
393
406
|
_this.optionsShownUfoExperienceInstance.failure(ufoEndStateConfig(_this.props.fieldId));
|
|
@@ -404,11 +417,11 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
404
417
|
elapsedTimeMilli: _elapsedTimeMilli,
|
|
405
418
|
productAttributes: productAttributes
|
|
406
419
|
});
|
|
407
|
-
case
|
|
420
|
+
case 24:
|
|
408
421
|
case "end":
|
|
409
422
|
return _context.stop();
|
|
410
423
|
}
|
|
411
|
-
}, _callee, null, [[1, 15], [
|
|
424
|
+
}, _callee, null, [[1, 15], [17, 22]]);
|
|
412
425
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
413
426
|
(0, _defineProperty2.default)(_this, "onInputChange", function (newQuery, sessionId) {
|
|
414
427
|
var query = newQuery || '';
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import { v4 as uuid } from 'uuid';
|
|
5
5
|
const packageName = "@atlaskit/smart-user-picker";
|
|
6
|
-
const packageVersion = "11.
|
|
6
|
+
const packageVersion = "11.4.0";
|
|
7
7
|
export const startSession = () => ({
|
|
8
8
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
9
9
|
id: uuid(),
|
|
@@ -158,7 +158,7 @@ export class SmartUserPickerWithoutAnalytics extends React.Component {
|
|
|
158
158
|
Further ref: https://developer.atlassian.com/platform/user-recommendations/guides/frequently-asked-questions/#filter-behavior
|
|
159
159
|
*/
|
|
160
160
|
searchQueryFilter: isEmail && !searchQueryFilter ? '(NOT not_mentionable:true) AND (account_status:active) AND (NOT account_type:app)' : searchQueryFilter,
|
|
161
|
-
...(restrictTo &&
|
|
161
|
+
...(restrictTo && {
|
|
162
162
|
restrictTo
|
|
163
163
|
}),
|
|
164
164
|
...(isTeamSyncedToGroupDirectoryFilter === true && {
|
|
@@ -260,6 +260,16 @@ export class SmartUserPickerWithoutAnalytics extends React.Component {
|
|
|
260
260
|
};
|
|
261
261
|
});
|
|
262
262
|
} catch (e) {
|
|
263
|
+
if (this.state.query !== query && fg('smart-user-picker-fetch-error-fix')) {
|
|
264
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
265
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
266
|
+
// experience that belong to the newer query.
|
|
267
|
+
this.fireEvent(failedRequestUsersEvent, {
|
|
268
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
269
|
+
productAttributes
|
|
270
|
+
});
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
263
273
|
const is5xxEvent = checkIf500Event(e.statusCode);
|
|
264
274
|
if (!closed && !onError && is5xxEvent) {
|
|
265
275
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
package/dist/esm/analytics.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
7
7
|
import { v4 as uuid } from 'uuid';
|
|
8
8
|
var packageName = "@atlaskit/smart-user-picker";
|
|
9
|
-
var packageVersion = "11.
|
|
9
|
+
var packageVersion = "11.4.0";
|
|
10
10
|
export var startSession = function startSession() {
|
|
11
11
|
return {
|
|
12
12
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
@@ -155,7 +155,7 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
155
155
|
Further ref: https://developer.atlassian.com/platform/user-recommendations/guides/frequently-asked-questions/#filter-behavior
|
|
156
156
|
*/
|
|
157
157
|
searchQueryFilter: isEmail && !searchQueryFilter ? '(NOT not_mentionable:true) AND (account_status:active) AND (NOT account_type:app)' : searchQueryFilter
|
|
158
|
-
}, restrictTo &&
|
|
158
|
+
}, restrictTo && {
|
|
159
159
|
restrictTo: restrictTo
|
|
160
160
|
}), isTeamSyncedToGroupDirectoryFilter === true && {
|
|
161
161
|
isTeamSyncedToGroupDirectoryFilter: true
|
|
@@ -335,11 +335,24 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
335
335
|
loading: loading
|
|
336
336
|
};
|
|
337
337
|
});
|
|
338
|
-
_context.next =
|
|
338
|
+
_context.next = 24;
|
|
339
339
|
break;
|
|
340
340
|
case 15:
|
|
341
341
|
_context.prev = 15;
|
|
342
342
|
_t6 = _context["catch"](1);
|
|
343
|
+
if (!(_this.state.query !== query && fg('smart-user-picker-fetch-error-fix'))) {
|
|
344
|
+
_context.next = 16;
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
348
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
349
|
+
// experience that belong to the newer query.
|
|
350
|
+
_this.fireEvent(failedRequestUsersEvent, {
|
|
351
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
352
|
+
productAttributes: productAttributes
|
|
353
|
+
});
|
|
354
|
+
return _context.abrupt("return");
|
|
355
|
+
case 16:
|
|
343
356
|
is5xxEvent = checkIf500Event(_t6.statusCode);
|
|
344
357
|
if (!closed && !onError && is5xxEvent) {
|
|
345
358
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
|
@@ -351,35 +364,35 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
351
364
|
});
|
|
352
365
|
onErrorProducedError = false;
|
|
353
366
|
defaultUsers = [];
|
|
354
|
-
_context.prev =
|
|
367
|
+
_context.prev = 17;
|
|
355
368
|
if (!onError) {
|
|
356
|
-
_context.next =
|
|
369
|
+
_context.next = 20;
|
|
357
370
|
break;
|
|
358
371
|
}
|
|
359
|
-
_context.next =
|
|
372
|
+
_context.next = 18;
|
|
360
373
|
return onError(_t6, recommendationsRequest);
|
|
361
|
-
case
|
|
374
|
+
case 18:
|
|
362
375
|
_t8 = _context.sent;
|
|
363
376
|
if (_t8) {
|
|
364
|
-
_context.next =
|
|
377
|
+
_context.next = 19;
|
|
365
378
|
break;
|
|
366
379
|
}
|
|
367
380
|
_t8 = [];
|
|
368
|
-
case
|
|
381
|
+
case 19:
|
|
369
382
|
_t7 = _t8;
|
|
370
|
-
_context.next =
|
|
383
|
+
_context.next = 21;
|
|
371
384
|
break;
|
|
372
|
-
case 19:
|
|
373
|
-
_t7 = [];
|
|
374
385
|
case 20:
|
|
386
|
+
_t7 = [];
|
|
387
|
+
case 21:
|
|
375
388
|
defaultUsers = _t7;
|
|
376
|
-
_context.next =
|
|
389
|
+
_context.next = 23;
|
|
377
390
|
break;
|
|
378
|
-
case 21:
|
|
379
|
-
_context.prev = 21;
|
|
380
|
-
_t9 = _context["catch"](16);
|
|
381
|
-
onErrorProducedError = true;
|
|
382
391
|
case 22:
|
|
392
|
+
_context.prev = 22;
|
|
393
|
+
_t9 = _context["catch"](17);
|
|
394
|
+
onErrorProducedError = true;
|
|
395
|
+
case 23:
|
|
383
396
|
if (onErrorProducedError && is5xxEvent) {
|
|
384
397
|
// Log error from fallback data source `onError` to UFO
|
|
385
398
|
_this.optionsShownUfoExperienceInstance.failure(ufoEndStateConfig(_this.props.fieldId));
|
|
@@ -396,11 +409,11 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
396
409
|
elapsedTimeMilli: _elapsedTimeMilli,
|
|
397
410
|
productAttributes: productAttributes
|
|
398
411
|
});
|
|
399
|
-
case
|
|
412
|
+
case 24:
|
|
400
413
|
case "end":
|
|
401
414
|
return _context.stop();
|
|
402
415
|
}
|
|
403
|
-
}, _callee, null, [[1, 15], [
|
|
416
|
+
}, _callee, null, [[1, 15], [17, 22]]);
|
|
404
417
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
405
418
|
_defineProperty(_this, "onInputChange", function (newQuery, sessionId) {
|
|
406
419
|
var query = newQuery || '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-user-picker",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@atlaskit/select": "^22.6.0",
|
|
46
46
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
47
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
47
|
+
"@atlassian/a11y-jest-testing": "^0.15.0",
|
|
48
48
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
49
49
|
"@testing-library/dom": "^10.1.0",
|
|
50
50
|
"@testing-library/react": "^16.3.0",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"smart_user_picker_suggest_emails_for_domain": {
|
|
62
62
|
"type": "boolean"
|
|
63
63
|
},
|
|
64
|
-
"smart-user-picker-
|
|
64
|
+
"smart-user-picker-fetch-error-fix": {
|
|
65
65
|
"type": "boolean"
|
|
66
66
|
},
|
|
67
|
-
"smart-user-picker-
|
|
67
|
+
"smart-user-picker-load-options-gate": {
|
|
68
68
|
"type": "boolean"
|
|
69
69
|
},
|
|
70
70
|
"user_picker_guest_lozenges": {
|