@atlaskit/profilecard 24.37.3 → 24.38.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,17 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.38.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6162db4501346`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6162db4501346) -
8
+ [ux] Removes feature gate rovo_agent_show_creator_on_profile_card_fix and deprecated function to
9
+ get creator details.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 24.37.3
4
16
 
5
17
  ### Patch Changes
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "24.37.2");
14
+ headers.append('atl-client-version', "24.37.3");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
66
66
  headers.append('X-ExperimentalApi', 'teams-beta');
67
67
  headers.append('X-ExperimentalApi', 'team-members-beta');
68
68
  headers.append('atl-client-name', "@atlaskit/profilecard");
69
- headers.append('atl-client-version', "24.37.2");
69
+ headers.append('atl-client-version', "24.37.3");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -48,102 +48,28 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
48
48
  cloudId: props.cloudId
49
49
  }),
50
50
  profileHref = _navigateToTeamsApp.href;
51
-
52
- /**
53
- * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
54
- * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
55
- */
56
- var getCreatorDeprecated = (0, _react.useCallback)( /*#__PURE__*/function () {
51
+ var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
57
52
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
58
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
53
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
59
54
  return _regenerator.default.wrap(function _callee$(_context) {
60
55
  while (1) switch (_context.prev = _context.next) {
61
56
  case 0:
62
57
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
63
- if (creator) {
64
- _context.next = 3;
65
- break;
66
- }
67
- return _context.abrupt("return", undefined);
68
- case 3:
69
- _context.t0 = creator_type;
70
- _context.next = _context.t0 === 'SYSTEM' ? 6 : _context.t0 === 'THIRD_PARTY' ? 7 : _context.t0 === 'CUSTOMER' ? 8 : 22;
71
- break;
72
- case 6:
73
- return _context.abrupt("return", {
74
- type: 'SYSTEM'
75
- });
76
- case 7:
77
- return _context.abrupt("return", {
78
- type: 'THIRD_PARTY',
79
- name: creator !== null && creator !== void 0 ? creator : ''
80
- });
81
- case 8:
82
- _context.prev = 8;
83
- if (!(!creatorUserId || !props.cloudId)) {
84
- _context.next = 11;
85
- break;
86
- }
87
- return _context.abrupt("return", undefined);
88
- case 11:
89
- if (!authoringTeam) {
90
- _context.next = 13;
91
- break;
92
- }
93
- return _context.abrupt("return", {
94
- type: 'CUSTOMER',
95
- name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
96
- profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
97
- });
98
- case 13:
99
- _context.next = 15;
100
- return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
101
- case 15:
102
- creatorInfo = _context.sent;
103
- return _context.abrupt("return", {
104
- type: 'CUSTOMER',
105
- name: creatorInfo.fullName,
106
- profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId),
107
- id: creatorUserId
108
- });
109
- case 19:
110
- _context.prev = 19;
111
- _context.t1 = _context["catch"](8);
112
- return _context.abrupt("return", undefined);
113
- case 22:
114
- return _context.abrupt("return", undefined);
115
- case 23:
116
- case "end":
117
- return _context.stop();
118
- }
119
- }, _callee, null, [[8, 19]]);
120
- }));
121
- return function (_x) {
122
- return _ref2.apply(this, arguments);
123
- };
124
- }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
125
- var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
126
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
127
- var creator_type, creator, authoringTeam, _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
128
- return _regenerator.default.wrap(function _callee2$(_context2) {
129
- while (1) switch (_context2.prev = _context2.next) {
130
- case 0:
131
- creator_type = _ref3.creator_type, creator = _ref3.creator, authoringTeam = _ref3.authoringTeam;
132
- _context2.prev = 1;
58
+ _context.prev = 1;
133
59
  if (!(creatorUserId && props.cloudId)) {
134
- _context2.next = 6;
60
+ _context.next = 6;
135
61
  break;
136
62
  }
137
- _context2.next = 5;
63
+ _context.next = 5;
138
64
  return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
139
65
  case 5:
140
- userCreatorInfo = _context2.sent;
66
+ userCreatorInfo = _context.sent;
141
67
  case 6:
142
68
  creatorInfo = (0, _AgentProfileInfo.getAgentCreator)({
143
69
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
144
70
  authoringTeam: authoringTeam ? {
145
- displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
146
- profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
71
+ displayName: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
72
+ profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : undefined
147
73
  } : undefined,
148
74
  userCreator: userCreatorInfo ? {
149
75
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
@@ -151,79 +77,64 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
151
77
  } : undefined,
152
78
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
153
79
  });
154
- return _context2.abrupt("return", creatorInfo);
80
+ return _context.abrupt("return", creatorInfo);
155
81
  case 10:
156
- _context2.prev = 10;
157
- _context2.t0 = _context2["catch"](1);
158
- return _context2.abrupt("return", undefined);
82
+ _context.prev = 10;
83
+ _context.t0 = _context["catch"](1);
84
+ return _context.abrupt("return", undefined);
159
85
  case 13:
160
86
  case "end":
161
- return _context2.stop();
87
+ return _context.stop();
162
88
  }
163
- }, _callee2, null, [[1, 10]]);
89
+ }, _callee, null, [[1, 10]]);
164
90
  }));
165
- return function (_x2) {
166
- return _ref4.apply(this, arguments);
91
+ return function (_x) {
92
+ return _ref2.apply(this, arguments);
167
93
  };
168
94
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
169
- var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
170
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, agentCreatorInfoDeprecated;
171
- return _regenerator.default.wrap(function _callee3$(_context3) {
172
- while (1) switch (_context3.prev = _context3.next) {
95
+ var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
96
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo;
97
+ return _regenerator.default.wrap(function _callee2$(_context2) {
98
+ while (1) switch (_context2.prev = _context2.next) {
173
99
  case 0:
174
100
  setIsLoading(true);
175
- _context3.prev = 1;
176
- _context3.next = 4;
101
+ _context2.prev = 1;
102
+ _context2.next = 4;
177
103
  return props.resourceClient.getRovoAgentProfile({
178
104
  type: 'identity',
179
105
  value: props.accountId
180
106
  }, fireEvent);
181
107
  case 4:
182
- profileResult = _context3.sent;
108
+ profileResult = _context2.sent;
183
109
  profileData = profileResult.restData;
184
110
  creatorInfoProps = {
185
111
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
186
112
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
187
113
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
188
114
  };
189
- if (!(0, _platformFeatureFlags.fg)('rovo_agent_show_creator_on_profile_card_fix')) {
190
- _context3.next = 14;
191
- break;
192
- }
193
- _context3.next = 10;
115
+ _context2.next = 9;
194
116
  return getCreator(creatorInfoProps);
195
- case 10:
196
- agentCreatorInfo = _context3.sent;
117
+ case 9:
118
+ agentCreatorInfo = _context2.sent;
197
119
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
198
120
  creatorInfo: agentCreatorInfo
199
121
  }));
200
- _context3.next = 18;
122
+ _context2.next = 16;
201
123
  break;
202
- case 14:
203
- _context3.next = 16;
204
- return getCreatorDeprecated(creatorInfoProps);
124
+ case 13:
125
+ _context2.prev = 13;
126
+ _context2.t0 = _context2["catch"](1);
127
+ setError(_context2.t0);
205
128
  case 16:
206
- agentCreatorInfoDeprecated = _context3.sent;
207
- setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
208
- creatorInfo: agentCreatorInfoDeprecated
209
- }));
210
- case 18:
211
- _context3.next = 23;
212
- break;
213
- case 20:
214
- _context3.prev = 20;
215
- _context3.t0 = _context3["catch"](1);
216
- setError(_context3.t0);
217
- case 23:
218
- _context3.prev = 23;
129
+ _context2.prev = 16;
219
130
  setIsLoading(false);
220
- return _context3.finish(23);
221
- case 26:
131
+ return _context2.finish(16);
132
+ case 19:
222
133
  case "end":
223
- return _context3.stop();
134
+ return _context2.stop();
224
135
  }
225
- }, _callee3, null, [[1, 20, 23, 26]]);
226
- })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
136
+ }, _callee2, null, [[1, 13, 16, 19]]);
137
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
227
138
  (0, _react.useEffect)(function () {
228
139
  fetchData();
229
140
  }, [fetchData]);
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  var ANALYTICS_CHANNEL = 'peopleTeams';
14
14
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
15
15
  packageName: "@atlaskit/profilecard",
16
- packageVersion: "24.37.2"
16
+ packageVersion: "24.37.3"
17
17
  };
18
18
  var runItLater = function runItLater(cb) {
19
19
  var requestIdleCallback = window.requestIdleCallback;
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
58
58
  actionSubjectId: actionSubjectId,
59
59
  attributes: _objectSpread(_objectSpread({
60
60
  packageName: "@atlaskit/profilecard",
61
- packageVersion: "24.37.2"
61
+ packageVersion: "24.37.3"
62
62
  }, attributes), {}, {
63
63
  firedAt: Math.round((0, _performance.getPageTime)())
64
64
  })
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
6
6
  }`;
7
7
  const addHeaders = headers => {
8
8
  headers.append('atl-client-name', "@atlaskit/profilecard");
9
- headers.append('atl-client-version', "24.37.2");
9
+ headers.append('atl-client-version', "24.37.3");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
78
78
  headers.append('X-ExperimentalApi', 'teams-beta');
79
79
  headers.append('X-ExperimentalApi', 'team-members-beta');
80
80
  headers.append('atl-client-name', "@atlaskit/profilecard");
81
- headers.append('atl-client-version', "24.37.2");
81
+ headers.append('atl-client-version', "24.37.3");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -24,63 +24,13 @@ export const AgentProfileCardResourced = props => {
24
24
  },
25
25
  cloudId: props.cloudId
26
26
  });
27
-
28
- /**
29
- * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
30
- * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
31
- */
32
- const getCreatorDeprecated = useCallback(async ({
33
- creator_type,
34
- creator,
35
- authoringTeam
36
- }) => {
37
- if (!creator) {
38
- return undefined;
39
- }
40
- switch (creator_type) {
41
- case 'SYSTEM':
42
- return {
43
- type: 'SYSTEM'
44
- };
45
- case 'THIRD_PARTY':
46
- return {
47
- type: 'THIRD_PARTY',
48
- name: creator !== null && creator !== void 0 ? creator : ''
49
- };
50
- case 'CUSTOMER':
51
- try {
52
- if (!creatorUserId || !props.cloudId) {
53
- return undefined;
54
- }
55
- if (authoringTeam) {
56
- var _authoringTeam$displa, _authoringTeam$profil;
57
- return {
58
- type: 'CUSTOMER',
59
- name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
60
- profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
61
- };
62
- }
63
- const creatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
64
- return {
65
- type: 'CUSTOMER',
66
- name: creatorInfo.fullName,
67
- profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`,
68
- id: creatorUserId
69
- };
70
- } catch {
71
- return undefined;
72
- }
73
- default:
74
- return undefined;
75
- }
76
- }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
77
27
  const getCreator = useCallback(async ({
78
28
  creator_type,
79
29
  creator,
80
30
  authoringTeam
81
31
  }) => {
82
32
  try {
83
- var _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full;
33
+ var _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full;
84
34
  let userCreatorInfo;
85
35
  if (creatorUserId && props.cloudId) {
86
36
  userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
@@ -88,8 +38,8 @@ export const AgentProfileCardResourced = props => {
88
38
  const creatorInfo = getAgentCreator({
89
39
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
90
40
  authoringTeam: authoringTeam ? {
91
- displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
92
- profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
41
+ displayName: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
42
+ profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : undefined
93
43
  } : undefined,
94
44
  userCreator: userCreatorInfo ? {
95
45
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
@@ -116,25 +66,17 @@ export const AgentProfileCardResourced = props => {
116
66
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
117
67
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
118
68
  };
119
- if (fg('rovo_agent_show_creator_on_profile_card_fix')) {
120
- const agentCreatorInfo = await getCreator(creatorInfoProps);
121
- setAgentData({
122
- ...profileData,
123
- creatorInfo: agentCreatorInfo
124
- });
125
- } else {
126
- const agentCreatorInfoDeprecated = await getCreatorDeprecated(creatorInfoProps);
127
- setAgentData({
128
- ...profileData,
129
- creatorInfo: agentCreatorInfoDeprecated
130
- });
131
- }
69
+ const agentCreatorInfo = await getCreator(creatorInfoProps);
70
+ setAgentData({
71
+ ...profileData,
72
+ creatorInfo: agentCreatorInfo
73
+ });
132
74
  } catch (err) {
133
75
  setError(err);
134
76
  } finally {
135
77
  setIsLoading(false);
136
78
  }
137
- }, [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
79
+ }, [fireEvent, getCreator, props.accountId, props.resourceClient]);
138
80
  useEffect(() => {
139
81
  fetchData();
140
82
  }, [fetchData]);
@@ -4,7 +4,7 @@ import { getPageTime } from './performance';
4
4
  const ANALYTICS_CHANNEL = 'peopleTeams';
5
5
  export const PACKAGE_META_DATA = {
6
6
  packageName: "@atlaskit/profilecard",
7
- packageVersion: "24.37.2"
7
+ packageVersion: "24.37.3"
8
8
  };
9
9
  const runItLater = cb => {
10
10
  const requestIdleCallback = window.requestIdleCallback;
@@ -45,7 +45,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
45
45
  actionSubjectId,
46
46
  attributes: {
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "24.37.2",
48
+ packageVersion: "24.37.3",
49
49
  ...attributes,
50
50
  firedAt: Math.round(getPageTime())
51
51
  }
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
4
4
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
5
5
  var addHeaders = function addHeaders(headers) {
6
6
  headers.append('atl-client-name', "@atlaskit/profilecard");
7
- headers.append('atl-client-version', "24.37.2");
7
+ headers.append('atl-client-version', "24.37.3");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
59
59
  headers.append('X-ExperimentalApi', 'teams-beta');
60
60
  headers.append('X-ExperimentalApi', 'team-members-beta');
61
61
  headers.append('atl-client-name', "@atlaskit/profilecard");
62
- headers.append('atl-client-version', "24.37.2");
62
+ headers.append('atl-client-version', "24.37.3");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -39,102 +39,28 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
39
39
  cloudId: props.cloudId
40
40
  }),
41
41
  profileHref = _navigateToTeamsApp.href;
42
-
43
- /**
44
- * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
45
- * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
46
- */
47
- var getCreatorDeprecated = useCallback( /*#__PURE__*/function () {
42
+ var getCreator = useCallback( /*#__PURE__*/function () {
48
43
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
49
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
44
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
50
45
  return _regeneratorRuntime.wrap(function _callee$(_context) {
51
46
  while (1) switch (_context.prev = _context.next) {
52
47
  case 0:
53
48
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
54
- if (creator) {
55
- _context.next = 3;
56
- break;
57
- }
58
- return _context.abrupt("return", undefined);
59
- case 3:
60
- _context.t0 = creator_type;
61
- _context.next = _context.t0 === 'SYSTEM' ? 6 : _context.t0 === 'THIRD_PARTY' ? 7 : _context.t0 === 'CUSTOMER' ? 8 : 22;
62
- break;
63
- case 6:
64
- return _context.abrupt("return", {
65
- type: 'SYSTEM'
66
- });
67
- case 7:
68
- return _context.abrupt("return", {
69
- type: 'THIRD_PARTY',
70
- name: creator !== null && creator !== void 0 ? creator : ''
71
- });
72
- case 8:
73
- _context.prev = 8;
74
- if (!(!creatorUserId || !props.cloudId)) {
75
- _context.next = 11;
76
- break;
77
- }
78
- return _context.abrupt("return", undefined);
79
- case 11:
80
- if (!authoringTeam) {
81
- _context.next = 13;
82
- break;
83
- }
84
- return _context.abrupt("return", {
85
- type: 'CUSTOMER',
86
- name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
87
- profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
88
- });
89
- case 13:
90
- _context.next = 15;
91
- return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
92
- case 15:
93
- creatorInfo = _context.sent;
94
- return _context.abrupt("return", {
95
- type: 'CUSTOMER',
96
- name: creatorInfo.fullName,
97
- profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId),
98
- id: creatorUserId
99
- });
100
- case 19:
101
- _context.prev = 19;
102
- _context.t1 = _context["catch"](8);
103
- return _context.abrupt("return", undefined);
104
- case 22:
105
- return _context.abrupt("return", undefined);
106
- case 23:
107
- case "end":
108
- return _context.stop();
109
- }
110
- }, _callee, null, [[8, 19]]);
111
- }));
112
- return function (_x) {
113
- return _ref2.apply(this, arguments);
114
- };
115
- }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
116
- var getCreator = useCallback( /*#__PURE__*/function () {
117
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
118
- var creator_type, creator, authoringTeam, _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
119
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
120
- while (1) switch (_context2.prev = _context2.next) {
121
- case 0:
122
- creator_type = _ref3.creator_type, creator = _ref3.creator, authoringTeam = _ref3.authoringTeam;
123
- _context2.prev = 1;
49
+ _context.prev = 1;
124
50
  if (!(creatorUserId && props.cloudId)) {
125
- _context2.next = 6;
51
+ _context.next = 6;
126
52
  break;
127
53
  }
128
- _context2.next = 5;
54
+ _context.next = 5;
129
55
  return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
130
56
  case 5:
131
- userCreatorInfo = _context2.sent;
57
+ userCreatorInfo = _context.sent;
132
58
  case 6:
133
59
  creatorInfo = getAgentCreator({
134
60
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
135
61
  authoringTeam: authoringTeam ? {
136
- displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
137
- profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
62
+ displayName: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
63
+ profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : undefined
138
64
  } : undefined,
139
65
  userCreator: userCreatorInfo ? {
140
66
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
@@ -142,79 +68,64 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
142
68
  } : undefined,
143
69
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
144
70
  });
145
- return _context2.abrupt("return", creatorInfo);
71
+ return _context.abrupt("return", creatorInfo);
146
72
  case 10:
147
- _context2.prev = 10;
148
- _context2.t0 = _context2["catch"](1);
149
- return _context2.abrupt("return", undefined);
73
+ _context.prev = 10;
74
+ _context.t0 = _context["catch"](1);
75
+ return _context.abrupt("return", undefined);
150
76
  case 13:
151
77
  case "end":
152
- return _context2.stop();
78
+ return _context.stop();
153
79
  }
154
- }, _callee2, null, [[1, 10]]);
80
+ }, _callee, null, [[1, 10]]);
155
81
  }));
156
- return function (_x2) {
157
- return _ref4.apply(this, arguments);
82
+ return function (_x) {
83
+ return _ref2.apply(this, arguments);
158
84
  };
159
85
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
160
- var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
161
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, agentCreatorInfoDeprecated;
162
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
163
- while (1) switch (_context3.prev = _context3.next) {
86
+ var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo;
88
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
89
+ while (1) switch (_context2.prev = _context2.next) {
164
90
  case 0:
165
91
  setIsLoading(true);
166
- _context3.prev = 1;
167
- _context3.next = 4;
92
+ _context2.prev = 1;
93
+ _context2.next = 4;
168
94
  return props.resourceClient.getRovoAgentProfile({
169
95
  type: 'identity',
170
96
  value: props.accountId
171
97
  }, fireEvent);
172
98
  case 4:
173
- profileResult = _context3.sent;
99
+ profileResult = _context2.sent;
174
100
  profileData = profileResult.restData;
175
101
  creatorInfoProps = {
176
102
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
177
103
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
178
104
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
179
105
  };
180
- if (!fg('rovo_agent_show_creator_on_profile_card_fix')) {
181
- _context3.next = 14;
182
- break;
183
- }
184
- _context3.next = 10;
106
+ _context2.next = 9;
185
107
  return getCreator(creatorInfoProps);
186
- case 10:
187
- agentCreatorInfo = _context3.sent;
108
+ case 9:
109
+ agentCreatorInfo = _context2.sent;
188
110
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
189
111
  creatorInfo: agentCreatorInfo
190
112
  }));
191
- _context3.next = 18;
113
+ _context2.next = 16;
192
114
  break;
193
- case 14:
194
- _context3.next = 16;
195
- return getCreatorDeprecated(creatorInfoProps);
115
+ case 13:
116
+ _context2.prev = 13;
117
+ _context2.t0 = _context2["catch"](1);
118
+ setError(_context2.t0);
196
119
  case 16:
197
- agentCreatorInfoDeprecated = _context3.sent;
198
- setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
199
- creatorInfo: agentCreatorInfoDeprecated
200
- }));
201
- case 18:
202
- _context3.next = 23;
203
- break;
204
- case 20:
205
- _context3.prev = 20;
206
- _context3.t0 = _context3["catch"](1);
207
- setError(_context3.t0);
208
- case 23:
209
- _context3.prev = 23;
120
+ _context2.prev = 16;
210
121
  setIsLoading(false);
211
- return _context3.finish(23);
212
- case 26:
122
+ return _context2.finish(16);
123
+ case 19:
213
124
  case "end":
214
- return _context3.stop();
125
+ return _context2.stop();
215
126
  }
216
- }, _callee3, null, [[1, 20, 23, 26]]);
217
- })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
127
+ }, _callee2, null, [[1, 13, 16, 19]]);
128
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
218
129
  useEffect(function () {
219
130
  fetchData();
220
131
  }, [fetchData]);
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
7
7
  var ANALYTICS_CHANNEL = 'peopleTeams';
8
8
  export var PACKAGE_META_DATA = {
9
9
  packageName: "@atlaskit/profilecard",
10
- packageVersion: "24.37.2"
10
+ packageVersion: "24.37.3"
11
11
  };
12
12
  var runItLater = function runItLater(cb) {
13
13
  var requestIdleCallback = window.requestIdleCallback;
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
52
52
  actionSubjectId: actionSubjectId,
53
53
  attributes: _objectSpread(_objectSpread({
54
54
  packageName: "@atlaskit/profilecard",
55
- packageVersion: "24.37.2"
55
+ packageVersion: "24.37.3"
56
56
  }, attributes), {}, {
57
57
  firedAt: Math.round(getPageTime())
58
58
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.37.3",
3
+ "version": "24.38.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -175,9 +175,6 @@
175
175
  "rovo_display_ai_disclaimer_on_agent_profile_card": {
176
176
  "type": "boolean"
177
177
  },
178
- "rovo_agent_show_creator_on_profile_card_fix": {
179
- "type": "boolean"
180
- },
181
178
  "new_team_profile_fedramp": {
182
179
  "type": "boolean"
183
180
  },