@atlaskit/smart-user-picker 9.0.1 → 9.1.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlassian/smart-user-picker
2
2
 
3
+ ## 9.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cd870c596ec95`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd870c596ec95) -
8
+ Add support for Jira guest user lozenges via user_picker_guest_lozenges feature flag
9
+
3
10
  ## 9.0.1
4
11
 
5
12
  ### Patch Changes
@@ -7,8 +7,9 @@ exports.transformUsers = void 0;
7
7
  var _userPicker = require("@atlaskit/user-picker");
8
8
  var _i18n = require("../i18n");
9
9
  var _types = require("../types");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
11
- var _entity$attributes, _entity$attributes2;
12
+ var _entity$attributes, _entity$attributes2, _entity$attributes3;
12
13
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
13
14
  return intl.formatMessage(_i18n.messages.memberLozengeText);
14
15
  }
@@ -20,6 +21,10 @@ var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
20
21
  appearance: 'default'
21
22
  };
22
23
  }
24
+ var isJiraGuestUser = (0, _platformFeatureFlags.fg)('user_picker_guest_lozenges') && ((_entity$attributes3 = entity.attributes) === null || _entity$attributes3 === void 0 ? void 0 : _entity$attributes3.isJiraGuest);
25
+ if (isJiraGuestUser) {
26
+ return intl.formatMessage(_i18n.messages.guestLozengeText);
27
+ }
23
28
  return undefined;
24
29
  };
25
30
  var transformUser = function transformUser(item, intl) {
@@ -1,8 +1,9 @@
1
1
  import { ExternalUserType, GroupType, TeamType, UserType } from '@atlaskit/user-picker';
2
2
  import { messages } from '../i18n';
3
3
  import { EntityType } from '../types';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  const getLozenzeProperties = (entity, intl) => {
5
- var _entity$attributes, _entity$attributes2;
6
+ var _entity$attributes, _entity$attributes2, _entity$attributes3;
6
7
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
7
8
  return intl.formatMessage(messages.memberLozengeText);
8
9
  }
@@ -14,6 +15,10 @@ const getLozenzeProperties = (entity, intl) => {
14
15
  appearance: 'default'
15
16
  };
16
17
  }
18
+ const isJiraGuestUser = fg('user_picker_guest_lozenges') && ((_entity$attributes3 = entity.attributes) === null || _entity$attributes3 === void 0 ? void 0 : _entity$attributes3.isJiraGuest);
19
+ if (isJiraGuestUser) {
20
+ return intl.formatMessage(messages.guestLozengeText);
21
+ }
17
22
  return undefined;
18
23
  };
19
24
  const transformUser = (item, intl) => {
@@ -1,8 +1,9 @@
1
1
  import { ExternalUserType, GroupType, TeamType, UserType } from '@atlaskit/user-picker';
2
2
  import { messages } from '../i18n';
3
3
  import { EntityType } from '../types';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
5
- var _entity$attributes, _entity$attributes2;
6
+ var _entity$attributes, _entity$attributes2, _entity$attributes3;
6
7
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
7
8
  return intl.formatMessage(messages.memberLozengeText);
8
9
  }
@@ -14,6 +15,10 @@ var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
14
15
  appearance: 'default'
15
16
  };
16
17
  }
18
+ var isJiraGuestUser = fg('user_picker_guest_lozenges') && ((_entity$attributes3 = entity.attributes) === null || _entity$attributes3 === void 0 ? void 0 : _entity$attributes3.isJiraGuest);
19
+ if (isJiraGuestUser) {
20
+ return intl.formatMessage(messages.guestLozengeText);
21
+ }
17
22
  return undefined;
18
23
  };
19
24
  var transformUser = function transformUser(item, intl) {
@@ -49,7 +49,7 @@ export interface State {
49
49
  defaultValue?: DefaultValue;
50
50
  bootstrapOptions: OptionData[];
51
51
  }
52
- export type ProductAttributes = BitbucketAttributes | ConfluenceAttributes;
52
+ export type ProductAttributes = BitbucketAttributes | ConfluenceAttributes | JiraAttributes;
53
53
  export type FilterOptions = (options: OptionData[], query: string) => OptionData[];
54
54
  export interface BitbucketAttributes {
55
55
  /**
@@ -71,6 +71,12 @@ export interface ConfluenceAttributes {
71
71
  */
72
72
  isEntitledConfluenceExternalCollaborator?: boolean;
73
73
  }
74
+ export interface JiraAttributes {
75
+ /**
76
+ * Identifies whether this user is part of a Jira site that is entitled for guests
77
+ */
78
+ isEntitledJiraGuest?: boolean;
79
+ }
74
80
  export declare enum EntityType {
75
81
  USER = "USER",
76
82
  TEAM = "TEAM",
@@ -49,7 +49,7 @@ export interface State {
49
49
  defaultValue?: DefaultValue;
50
50
  bootstrapOptions: OptionData[];
51
51
  }
52
- export type ProductAttributes = BitbucketAttributes | ConfluenceAttributes;
52
+ export type ProductAttributes = BitbucketAttributes | ConfluenceAttributes | JiraAttributes;
53
53
  export type FilterOptions = (options: OptionData[], query: string) => OptionData[];
54
54
  export interface BitbucketAttributes {
55
55
  /**
@@ -71,6 +71,12 @@ export interface ConfluenceAttributes {
71
71
  */
72
72
  isEntitledConfluenceExternalCollaborator?: boolean;
73
73
  }
74
+ export interface JiraAttributes {
75
+ /**
76
+ * Identifies whether this user is part of a Jira site that is entitled for guests
77
+ */
78
+ isEntitledJiraGuest?: boolean;
79
+ }
74
80
  export declare enum EntityType {
75
81
  USER = "USER",
76
82
  TEAM = "TEAM",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-user-picker",
3
- "version": "9.0.1",
3
+ "version": "9.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -76,6 +76,9 @@
76
76
  },
77
77
  "smart-user-picker-attribution-header": {
78
78
  "type": "boolean"
79
+ },
80
+ "user_picker_guest_lozenges": {
81
+ "type": "boolean"
79
82
  }
80
83
  }
81
84
  }