@atlaskit/smart-user-picker 9.1.0 → 9.2.1

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlassian/smart-user-picker
2
2
 
3
+ ## 9.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7eb1025a50079`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7eb1025a50079) -
8
+ Added Archive Lozenge when a team state is DISBANDED
9
+
10
+ ## 9.2.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`bdbcc02f31ffe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bdbcc02f31ffe) -
15
+ [ux] Block viewers adding followers that don't have access to private projects
16
+
3
17
  ## 9.1.0
4
18
 
5
19
  ### Minor Changes
@@ -261,15 +261,11 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
261
261
 
262
262
  // Track if email search found matches for conditional allowEmail logic
263
263
  if (isEmail) {
264
- if ((0, _platformFeatureFlags.fg)('smart_user_picker_allow_email_if_team_is_found')) {
265
- // Only count user/external user matches, not teams or groups
266
- userMatches = recommendedUsers.filter(function (user) {
267
- return (0, _userPicker.isUser)(user) || (0, _userPicker.isExternalUser)(user);
268
- });
269
- _this.lastEmailSearchFoundMatches = userMatches.length > 0;
270
- } else {
271
- _this.lastEmailSearchFoundMatches = recommendedUsers.length > 0;
272
- }
264
+ // Only count user/external user matches, not teams or groups
265
+ userMatches = recommendedUsers.filter(function (user) {
266
+ return (0, _userPicker.isUser)(user) || (0, _userPicker.isExternalUser)(user);
267
+ });
268
+ _this.lastEmailSearchFoundMatches = userMatches.length > 0;
273
269
  } else {
274
270
  _this.lastEmailSearchFoundMatches = false;
275
271
  }
@@ -586,15 +582,10 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
586
582
  var shouldAllowEmail = allowEmail;
587
583
  if (allowEmail && enableEmailSearch && !allowEmailSelectionWhenEmailMatched) {
588
584
  var isCurrentQueryEmail = isEmailQuery(this.state.query);
589
- if ((0, _platformFeatureFlags.fg)('smart_user_picker_allow_email_if_team_is_found')) {
590
- // Only allow email selection when:
591
- // 1. The query matches email format (validated by regex)
592
- // 2. No user/external user matches were found (only teams/groups suggested)
593
- shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
594
- } else {
595
- // Only allow email selection if we're in an email search that found no matches
596
- shouldAllowEmail = !isCurrentQueryEmail || !this.lastEmailSearchFoundMatches;
597
- }
585
+ // Only allow email selection when:
586
+ // 1. The query matches email format (validated by regex)
587
+ // 2. No user/external user matches were found (only teams/groups suggested)
588
+ shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
598
589
  }
599
590
  return /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null, /*#__PURE__*/_react.default.createElement(_userPicker.default, (0, _extends2.default)({}, restProps, {
600
591
  allowEmail: shouldAllowEmail,
@@ -11,12 +11,14 @@ var _constants = require("./constants");
11
11
  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; }
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
  var transformTeam = function transformTeam(team, id) {
14
- return {
14
+ return _objectSpread({
15
15
  id: id,
16
16
  name: team.displayName,
17
17
  type: 'team',
18
18
  avatarUrl: team.smallAvatarImageUrl
19
- };
19
+ }, team.state && {
20
+ state: team.state
21
+ });
20
22
  };
21
23
  var hydrateTeamFromLegion = function hydrateTeamFromLegion(request) {
22
24
  var url = _config.config.getTeamsUrl(request.id, request.baseUrl, request.siteId);
@@ -60,7 +60,8 @@ var transformUser = function transformUser(item, intl) {
60
60
  avatarUrl: team.largeAvatarImageUrl || team.smallAvatarImageUrl,
61
61
  tooltip: team.displayName,
62
62
  verified: team.verified,
63
- teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name
63
+ teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name,
64
+ state: team.state
64
65
  };
65
66
  }
66
67
  if (type === _types.EntityType.GROUP) {
@@ -212,13 +212,9 @@ export class SmartUserPickerWithoutAnalytics extends React.Component {
212
212
 
213
213
  // Track if email search found matches for conditional allowEmail logic
214
214
  if (isEmail) {
215
- if (fg('smart_user_picker_allow_email_if_team_is_found')) {
216
- // Only count user/external user matches, not teams or groups
217
- const userMatches = recommendedUsers.filter(user => isUser(user) || isExternalUser(user));
218
- this.lastEmailSearchFoundMatches = userMatches.length > 0;
219
- } else {
220
- this.lastEmailSearchFoundMatches = recommendedUsers.length > 0;
221
- }
215
+ // Only count user/external user matches, not teams or groups
216
+ const userMatches = recommendedUsers.filter(user => isUser(user) || isExternalUser(user));
217
+ this.lastEmailSearchFoundMatches = userMatches.length > 0;
222
218
  } else {
223
219
  this.lastEmailSearchFoundMatches = false;
224
220
  }
@@ -430,15 +426,10 @@ export class SmartUserPickerWithoutAnalytics extends React.Component {
430
426
  let shouldAllowEmail = allowEmail;
431
427
  if (allowEmail && enableEmailSearch && !allowEmailSelectionWhenEmailMatched) {
432
428
  const isCurrentQueryEmail = isEmailQuery(this.state.query);
433
- if (fg('smart_user_picker_allow_email_if_team_is_found')) {
434
- // Only allow email selection when:
435
- // 1. The query matches email format (validated by regex)
436
- // 2. No user/external user matches were found (only teams/groups suggested)
437
- shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
438
- } else {
439
- // Only allow email selection if we're in an email search that found no matches
440
- shouldAllowEmail = !isCurrentQueryEmail || !this.lastEmailSearchFoundMatches;
441
- }
429
+ // Only allow email selection when:
430
+ // 1. The query matches email format (validated by regex)
431
+ // 2. No user/external user matches were found (only teams/groups suggested)
432
+ shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
442
433
  }
443
434
  return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(UserPicker, _extends({}, restProps, {
444
435
  allowEmail: shouldAllowEmail,
@@ -5,7 +5,10 @@ const transformTeam = (team, id) => {
5
5
  id,
6
6
  name: team.displayName,
7
7
  type: 'team',
8
- avatarUrl: team.smallAvatarImageUrl
8
+ avatarUrl: team.smallAvatarImageUrl,
9
+ ...(team.state && {
10
+ state: team.state
11
+ }) // State to determine if the team is active/disbanded
9
12
  };
10
13
  };
11
14
  const hydrateTeamFromLegion = request => {
@@ -54,7 +54,8 @@ const transformUser = (item, intl) => {
54
54
  avatarUrl: team.largeAvatarImageUrl || team.smallAvatarImageUrl,
55
55
  tooltip: team.displayName,
56
56
  verified: team.verified,
57
- teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name
57
+ teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name,
58
+ state: team.state
58
59
  };
59
60
  }
60
61
  if (type === EntityType.GROUP) {
@@ -253,15 +253,11 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
253
253
 
254
254
  // Track if email search found matches for conditional allowEmail logic
255
255
  if (isEmail) {
256
- if (fg('smart_user_picker_allow_email_if_team_is_found')) {
257
- // Only count user/external user matches, not teams or groups
258
- userMatches = recommendedUsers.filter(function (user) {
259
- return isUser(user) || isExternalUser(user);
260
- });
261
- _this.lastEmailSearchFoundMatches = userMatches.length > 0;
262
- } else {
263
- _this.lastEmailSearchFoundMatches = recommendedUsers.length > 0;
264
- }
256
+ // Only count user/external user matches, not teams or groups
257
+ userMatches = recommendedUsers.filter(function (user) {
258
+ return isUser(user) || isExternalUser(user);
259
+ });
260
+ _this.lastEmailSearchFoundMatches = userMatches.length > 0;
265
261
  } else {
266
262
  _this.lastEmailSearchFoundMatches = false;
267
263
  }
@@ -578,15 +574,10 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
578
574
  var shouldAllowEmail = allowEmail;
579
575
  if (allowEmail && enableEmailSearch && !allowEmailSelectionWhenEmailMatched) {
580
576
  var isCurrentQueryEmail = isEmailQuery(this.state.query);
581
- if (fg('smart_user_picker_allow_email_if_team_is_found')) {
582
- // Only allow email selection when:
583
- // 1. The query matches email format (validated by regex)
584
- // 2. No user/external user matches were found (only teams/groups suggested)
585
- shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
586
- } else {
587
- // Only allow email selection if we're in an email search that found no matches
588
- shouldAllowEmail = !isCurrentQueryEmail || !this.lastEmailSearchFoundMatches;
589
- }
577
+ // Only allow email selection when:
578
+ // 1. The query matches email format (validated by regex)
579
+ // 2. No user/external user matches were found (only teams/groups suggested)
580
+ shouldAllowEmail = isCurrentQueryEmail && !this.lastEmailSearchFoundMatches;
590
581
  }
591
582
  return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(UserPicker, _extends({}, restProps, {
592
583
  allowEmail: shouldAllowEmail,
@@ -4,12 +4,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { config } from '../config';
5
5
  import { UNKNOWN_TEAM } from './constants';
6
6
  var transformTeam = function transformTeam(team, id) {
7
- return {
7
+ return _objectSpread({
8
8
  id: id,
9
9
  name: team.displayName,
10
10
  type: 'team',
11
11
  avatarUrl: team.smallAvatarImageUrl
12
- };
12
+ }, team.state && {
13
+ state: team.state
14
+ });
13
15
  };
14
16
  var hydrateTeamFromLegion = function hydrateTeamFromLegion(request) {
15
17
  var url = config.getTeamsUrl(request.id, request.baseUrl, request.siteId);
@@ -54,7 +54,8 @@ var transformUser = function transformUser(item, intl) {
54
54
  avatarUrl: team.largeAvatarImageUrl || team.smallAvatarImageUrl,
55
55
  tooltip: team.displayName,
56
56
  verified: team.verified,
57
- teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name
57
+ teamTypeName: (_team$type = team.type) === null || _team$type === void 0 ? void 0 : _team$type.name,
58
+ state: team.state
58
59
  };
59
60
  }
60
61
  if (type === EntityType.GROUP) {
@@ -1,5 +1,5 @@
1
1
  export { default } from './components';
2
2
  export { getUserRecommendations, hydrateDefaultValues } from './service';
3
- export type { RecommendationRequest, Props, State } from './types';
3
+ export type { RecommendationRequest, Props, State, RestrictionFilter } from './types';
4
4
  export { isEmail, isTeam, isUser, isExternalUser, isValidEmail, isGroup, EmailType, GroupType, TeamType, UserType, } from '@atlaskit/user-picker';
5
5
  export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, EmailValidationResponse, EmailValidator, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamHighlight, TeamMember, User, UserHighlight, ExternalUser, UserSource, } from '@atlaskit/user-picker';
@@ -4,10 +4,12 @@ type LegionRequest = {
4
4
  id: string;
5
5
  siteId?: string;
6
6
  };
7
+ export type LegionTeamState = 'ACTIVE' | 'DISBANDED' | 'PURGED';
7
8
  export type LegionResponse = {
8
9
  id: string;
9
10
  displayName: string;
10
11
  smallAvatarImageUrl: string;
12
+ state?: LegionTeamState;
11
13
  };
12
14
  declare const hydrateTeamFromLegion: (request: LegionRequest) => Promise<Team>;
13
15
  export default hydrateTeamFromLegion;
@@ -1,5 +1,5 @@
1
1
  export { default } from './components';
2
2
  export { getUserRecommendations, hydrateDefaultValues } from './service';
3
- export type { RecommendationRequest, Props, State } from './types';
3
+ export type { RecommendationRequest, Props, State, RestrictionFilter } from './types';
4
4
  export { isEmail, isTeam, isUser, isExternalUser, isValidEmail, isGroup, EmailType, GroupType, TeamType, UserType, } from '@atlaskit/user-picker';
5
5
  export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, EmailValidationResponse, EmailValidator, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamHighlight, TeamMember, User, UserHighlight, ExternalUser, UserSource, } from '@atlaskit/user-picker';
@@ -4,10 +4,12 @@ type LegionRequest = {
4
4
  id: string;
5
5
  siteId?: string;
6
6
  };
7
+ export type LegionTeamState = 'ACTIVE' | 'DISBANDED' | 'PURGED';
7
8
  export type LegionResponse = {
8
9
  id: string;
9
10
  displayName: string;
10
11
  smallAvatarImageUrl: string;
12
+ state?: LegionTeamState;
11
13
  };
12
14
  declare const hydrateTeamFromLegion: (request: LegionRequest) => Promise<Team>;
13
15
  export default hydrateTeamFromLegion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-user-picker",
3
- "version": "9.1.0",
3
+ "version": "9.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@atlaskit/afm-i18n-platform-smart-experiences-smart-user-picker": "2.7.0",
38
- "@atlaskit/analytics-next": "^11.1.0",
38
+ "@atlaskit/analytics-next": "^11.2.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/ufo": "^0.4.0",
41
- "@atlaskit/user-picker": "^11.23.0",
41
+ "@atlaskit/user-picker": "^11.25.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "lodash": "^4.17.21",
44
44
  "memoize-one": "^6.0.0",
@@ -50,7 +50,7 @@
50
50
  "react-dom": "^18.2.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@atlaskit/select": "^21.7.0",
53
+ "@atlaskit/select": "^21.8.0",
54
54
  "@atlaskit/util-data-test": "^18.5.0",
55
55
  "@atlassian/a11y-jest-testing": "^0.10.0",
56
56
  "@testing-library/dom": "^10.1.0",
@@ -71,9 +71,6 @@
71
71
  "smart-user-picker-restrict-to-gate": {
72
72
  "type": "boolean"
73
73
  },
74
- "smart_user_picker_allow_email_if_team_is_found": {
75
- "type": "boolean"
76
- },
77
74
  "smart-user-picker-attribution-header": {
78
75
  "type": "boolean"
79
76
  },