@atlaskit/profilecard 25.7.5 → 25.7.7

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/client/ProfileCardClient.js +27 -26
  3. package/dist/cjs/client/RovoAgentCardClient.js +19 -19
  4. package/dist/cjs/client/TeamCentralCardClient.js +27 -26
  5. package/dist/cjs/client/UserProfileCardClient.js +8 -8
  6. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +12 -12
  7. package/dist/cjs/client/getTeamFromAGG.js +5 -5
  8. package/dist/cjs/client/graphqlUtils.js +12 -12
  9. package/dist/cjs/components/Agent/Actions.js +4 -4
  10. package/dist/cjs/components/Agent/AgentDeleteConfirmationModal.js +5 -5
  11. package/dist/cjs/components/Agent/AgentProfileCard.js +28 -27
  12. package/dist/cjs/components/Agent/AgentProfileCardResourced.js +28 -28
  13. package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +32 -32
  14. package/dist/cjs/components/Agent/hooks/duplicateFetch.js +36 -36
  15. package/dist/cjs/components/Agent/hooks/useAgentActions.js +14 -14
  16. package/dist/cjs/components/User/ProfileCardTrigger.js +16 -16
  17. package/dist/cjs/components/common/ProfileCardTrigger.js +2 -2
  18. package/dist/cjs/styled/Card.compiled.css +1 -1
  19. package/dist/cjs/styled/Card.js +1 -1
  20. package/dist/cjs/util/analytics.js +2 -2
  21. package/dist/cjs/util/useProfileInfo.js +11 -11
  22. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  23. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  24. package/dist/es2019/components/User/ProfileCardTrigger.js +1 -1
  25. package/dist/es2019/styled/Card.compiled.css +1 -1
  26. package/dist/es2019/styled/Card.js +1 -1
  27. package/dist/es2019/util/analytics.js +2 -2
  28. package/dist/esm/client/ProfileCardClient.js +27 -26
  29. package/dist/esm/client/RovoAgentCardClient.js +19 -19
  30. package/dist/esm/client/TeamCentralCardClient.js +27 -26
  31. package/dist/esm/client/UserProfileCardClient.js +8 -8
  32. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +12 -12
  33. package/dist/esm/client/getTeamFromAGG.js +5 -5
  34. package/dist/esm/client/graphqlUtils.js +12 -12
  35. package/dist/esm/components/Agent/Actions.js +4 -4
  36. package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +5 -5
  37. package/dist/esm/components/Agent/AgentProfileCard.js +27 -26
  38. package/dist/esm/components/Agent/AgentProfileCardResourced.js +27 -27
  39. package/dist/esm/components/Agent/AgentProfileCardTrigger.js +31 -31
  40. package/dist/esm/components/Agent/hooks/duplicateFetch.js +36 -36
  41. package/dist/esm/components/Agent/hooks/useAgentActions.js +14 -14
  42. package/dist/esm/components/User/ProfileCardTrigger.js +15 -15
  43. package/dist/esm/components/common/ProfileCardTrigger.js +2 -2
  44. package/dist/esm/styled/Card.compiled.css +1 -1
  45. package/dist/esm/styled/Card.js +1 -1
  46. package/dist/esm/util/analytics.js +2 -2
  47. package/dist/esm/util/useProfileInfo.js +11 -11
  48. package/package.json +7 -10
@@ -118,22 +118,22 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
118
118
  value: (function () {
119
119
  var _makeRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(userId) {
120
120
  var query, response;
121
- return _regeneratorRuntime.wrap(function _callee$(_context) {
121
+ return _regeneratorRuntime.wrap(function (_context) {
122
122
  while (1) switch (_context.prev = _context.next) {
123
123
  case 0:
124
124
  if (!(this.options.teamCentralDisabled === true)) {
125
- _context.next = 2;
125
+ _context.next = 1;
126
126
  break;
127
127
  }
128
128
  throw new Error('makeRequest cannot be called when the client has been disabled');
129
- case 2:
129
+ case 1:
130
130
  query = buildReportingLinesQuery(userId);
131
- _context.next = 5;
131
+ _context.next = 2;
132
132
  return directoryGraphqlQuery('/gateway/api/watermelon/graphql?operationName=ReportingLines', query);
133
- case 5:
133
+ case 2:
134
134
  response = _context.sent;
135
135
  return _context.abrupt("return", response.reportingLines);
136
- case 7:
136
+ case 3:
137
137
  case "end":
138
138
  return _context.stop();
139
139
  }
@@ -149,7 +149,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
149
149
  value: function () {
150
150
  var _checkWorkspaceExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
151
151
  var workspaceExistsPromise;
152
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
152
+ return _regeneratorRuntime.wrap(function (_context2) {
153
153
  while (1) switch (_context2.prev = _context2.next) {
154
154
  case 0:
155
155
  workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(function (workspaceExistsWithType) {
@@ -163,7 +163,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
163
163
  }, function () {
164
164
  return Promise.resolve(false);
165
165
  }));
166
- case 2:
166
+ case 1:
167
167
  case "end":
168
168
  return _context2.stop();
169
169
  }
@@ -178,15 +178,16 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
178
178
  key: "getIsGlobalExperienceWorkspace",
179
179
  value: function () {
180
180
  var _getIsGlobalExperienceWorkspace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
181
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
181
+ var _t;
182
+ return _regeneratorRuntime.wrap(function (_context3) {
182
183
  while (1) switch (_context3.prev = _context3.next) {
183
184
  case 0:
184
- _context3.next = 2;
185
+ _context3.next = 1;
185
186
  return this.workspaceExistsWithTypePromise;
187
+ case 1:
188
+ _t = _context3.sent;
189
+ return _context3.abrupt("return", _t === 'GLOBAL_EXPERIENCE');
186
190
  case 2:
187
- _context3.t0 = _context3.sent;
188
- return _context3.abrupt("return", _context3.t0 === 'GLOBAL_EXPERIENCE');
189
- case 4:
190
191
  case "end":
191
192
  return _context3.stop();
192
193
  }
@@ -231,37 +232,37 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
231
232
  key: "getWorkspaceExistsWithType",
232
233
  value: function () {
233
234
  var _getWorkspaceExistsWithType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(cloudId) {
234
- var response, workspaceType;
235
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
235
+ var response, workspaceType, _t2;
236
+ return _regeneratorRuntime.wrap(function (_context4) {
236
237
  while (1) switch (_context4.prev = _context4.next) {
237
238
  case 0:
238
239
  _context4.prev = 0;
239
- _context4.next = 3;
240
+ _context4.next = 1;
240
241
  return fetch("".concat(this.getShardedApiPath(cloudId), "/workspace/existsWithWorkspaceType?cloudId=").concat(cloudId), {
241
242
  credentials: 'include'
242
243
  });
243
- case 3:
244
+ case 1:
244
245
  response = _context4.sent;
245
246
  if (!response.ok) {
246
- _context4.next = 9;
247
+ _context4.next = 3;
247
248
  break;
248
249
  }
249
- _context4.next = 7;
250
+ _context4.next = 2;
250
251
  return response.text();
251
- case 7:
252
+ case 2:
252
253
  workspaceType = _context4.sent;
253
254
  return _context4.abrupt("return", workspaceType);
254
- case 9:
255
+ case 3:
255
256
  return _context4.abrupt("return", undefined);
256
- case 12:
257
- _context4.prev = 12;
258
- _context4.t0 = _context4["catch"](0);
257
+ case 4:
258
+ _context4.prev = 4;
259
+ _t2 = _context4["catch"](0);
259
260
  return _context4.abrupt("return", undefined);
260
- case 15:
261
+ case 5:
261
262
  case "end":
262
263
  return _context4.stop();
263
264
  }
264
- }, _callee4, this, [[0, 12]]);
265
+ }, _callee4, this, [[0, 4]]);
265
266
  }));
266
267
  function getWorkspaceExistsWithType(_x2) {
267
268
  return _getWorkspaceExistsWithType.apply(this, arguments);
@@ -65,17 +65,17 @@ export var buildAggUserQuery = function buildAggUserQuery(userId) {
65
65
  var queryAGGUser = /*#__PURE__*/function () {
66
66
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, userId) {
67
67
  var query, _yield$AGGQuery, user;
68
- return _regeneratorRuntime.wrap(function _callee$(_context) {
68
+ return _regeneratorRuntime.wrap(function (_context) {
69
69
  while (1) switch (_context.prev = _context.next) {
70
70
  case 0:
71
71
  query = buildAggUserQuery(userId);
72
- _context.next = 3;
72
+ _context.next = 1;
73
73
  return AGGQuery(url, query);
74
- case 3:
74
+ case 1:
75
75
  _yield$AGGQuery = _context.sent;
76
76
  user = _yield$AGGQuery.user;
77
77
  return _context.abrupt("return", user);
78
- case 6:
78
+ case 2:
79
79
  case "end":
80
80
  return _context.stop();
81
81
  }
@@ -100,15 +100,15 @@ var UserProfileCardClient = /*#__PURE__*/function (_CachingClient) {
100
100
  var _makeRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_cloudId, userId) {
101
101
  var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5;
102
102
  var gatewayGraphqlUrl, urlWithOperationName, userQueryPromise, user, timestring, localWeekdayIndex, timeFormat;
103
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
103
+ return _regeneratorRuntime.wrap(function (_context2) {
104
104
  while (1) switch (_context2.prev = _context2.next) {
105
105
  case 0:
106
106
  gatewayGraphqlUrl = this.options.gatewayGraphqlUrl || '/gateway/api/graphql';
107
107
  urlWithOperationName = "".concat(gatewayGraphqlUrl, "?operationName=aggUserQuery");
108
108
  userQueryPromise = queryAGGUser(urlWithOperationName, userId);
109
- _context2.next = 5;
109
+ _context2.next = 1;
110
110
  return userQueryPromise;
111
- case 5:
111
+ case 1:
112
112
  user = _context2.sent;
113
113
  localWeekdayIndex = new Date().getDay().toString();
114
114
  timeFormat = 'h:mmaaa';
@@ -134,7 +134,7 @@ var UserProfileCardClient = /*#__PURE__*/function (_CachingClient) {
134
134
  companyName: (_user$extendedProfile5 = user.extendedProfile) === null || _user$extendedProfile5 === void 0 ? void 0 : _user$extendedProfile5.organization,
135
135
  timestring: timestring
136
136
  }));
137
- case 10:
137
+ case 2:
138
138
  case "end":
139
139
  return _context2.stop();
140
140
  }
@@ -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', "25.7.4");
7
+ headers.append('atl-client-version', "25.7.6");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -12,8 +12,8 @@ export function getOrgIdForCloudIdFromAGG(_x, _x2) {
12
12
  }
13
13
  function _getOrgIdForCloudIdFromAGG() {
14
14
  _getOrgIdForCloudIdFromAGG = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, cloudId) {
15
- var query, _yield$AGGQuery, tenantContexts;
16
- return _regeneratorRuntime.wrap(function _callee$(_context) {
15
+ var query, _yield$AGGQuery, tenantContexts, _t;
16
+ return _regeneratorRuntime.wrap(function (_context) {
17
17
  while (1) switch (_context.prev = _context.next) {
18
18
  case 0:
19
19
  query = {
@@ -23,27 +23,27 @@ function _getOrgIdForCloudIdFromAGG() {
23
23
  }
24
24
  };
25
25
  _context.prev = 1;
26
- _context.next = 4;
26
+ _context.next = 2;
27
27
  return AGGQuery(url, query, addHeaders);
28
- case 4:
28
+ case 2:
29
29
  _yield$AGGQuery = _context.sent;
30
30
  tenantContexts = _yield$AGGQuery.tenantContexts;
31
31
  if (!(!tenantContexts || tenantContexts.length === 0 || tenantContexts[0] === null)) {
32
- _context.next = 8;
32
+ _context.next = 3;
33
33
  break;
34
34
  }
35
35
  return _context.abrupt("return", null);
36
- case 8:
36
+ case 3:
37
37
  return _context.abrupt("return", tenantContexts[0].orgId);
38
- case 11:
39
- _context.prev = 11;
40
- _context.t0 = _context["catch"](1);
38
+ case 4:
39
+ _context.prev = 4;
40
+ _t = _context["catch"](1);
41
41
  return _context.abrupt("return", null);
42
- case 14:
42
+ case 5:
43
43
  case "end":
44
44
  return _context.stop();
45
45
  }
46
- }, _callee, null, [[1, 11]]);
46
+ }, _callee, null, [[1, 4]]);
47
47
  }));
48
48
  return _getOrgIdForCloudIdFromAGG.apply(this, arguments);
49
49
  }
@@ -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', "25.7.4");
62
+ headers.append('atl-client-version', "25.7.6");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -68,20 +68,20 @@ export function getTeamFromAGG(_x, _x2, _x3) {
68
68
  function _getTeamFromAGG() {
69
69
  _getTeamFromAGG = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, teamId, siteId) {
70
70
  var query, _yield$AGGQuery, Team;
71
- return _regeneratorRuntime.wrap(function _callee$(_context) {
71
+ return _regeneratorRuntime.wrap(function (_context) {
72
72
  while (1) switch (_context.prev = _context.next) {
73
73
  case 0:
74
74
  query = buildGatewayQuery({
75
75
  teamId: teamId,
76
76
  siteId: siteId
77
77
  });
78
- _context.next = 3;
78
+ _context.next = 1;
79
79
  return AGGQuery(url, query, addHeaders);
80
- case 3:
80
+ case 1:
81
81
  _yield$AGGQuery = _context.sent;
82
82
  Team = _yield$AGGQuery.Team;
83
83
  return _context.abrupt("return", convertTeam(Team));
84
- case 6:
84
+ case 2:
85
85
  case "end":
86
86
  return _context.stop();
87
87
  }
@@ -29,12 +29,12 @@ function _directoryGraphqlQuery() {
29
29
  _directoryGraphqlQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(serviceUrl, query) {
30
30
  var processHeaders,
31
31
  _args = arguments;
32
- return _regeneratorRuntime.wrap(function _callee$(_context) {
32
+ return _regeneratorRuntime.wrap(function (_context) {
33
33
  while (1) switch (_context.prev = _context.next) {
34
34
  case 0:
35
35
  processHeaders = _args.length > 2 && _args[2] !== undefined ? _args[2] : id;
36
36
  return _context.abrupt("return", graphQLQuery(serviceUrl, query, processHeaders, handleDirectoryGraphQLErrors));
37
- case 2:
37
+ case 1:
38
38
  case "end":
39
39
  return _context.stop();
40
40
  }
@@ -49,12 +49,12 @@ function _AGGQuery() {
49
49
  _AGGQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(serviceUrl, query) {
50
50
  var processHeaders,
51
51
  _args2 = arguments;
52
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
52
+ return _regeneratorRuntime.wrap(function (_context2) {
53
53
  while (1) switch (_context2.prev = _context2.next) {
54
54
  case 0:
55
55
  processHeaders = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : id;
56
56
  return _context2.abrupt("return", graphQLQuery(serviceUrl, query, processHeaders, handleAGGErrors));
57
- case 2:
57
+ case 1:
58
58
  case "end":
59
59
  return _context2.stop();
60
60
  }
@@ -77,13 +77,13 @@ function _graphQLQuery() {
77
77
  _json$extensions$gate,
78
78
  _json$extensions,
79
79
  _args3 = arguments;
80
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
80
+ return _regeneratorRuntime.wrap(function (_context3) {
81
81
  while (1) switch (_context3.prev = _context3.next) {
82
82
  case 0:
83
83
  processHeaders = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : id;
84
84
  handleErrors = _args3.length > 3 ? _args3[3] : undefined;
85
85
  headers = processHeaders(buildHeaders());
86
- _context3.next = 5;
86
+ _context3.next = 1;
87
87
  return fetch(new Request(serviceUrl, {
88
88
  method: 'POST',
89
89
  credentials: 'include',
@@ -91,24 +91,24 @@ function _graphQLQuery() {
91
91
  headers: headers,
92
92
  body: JSON.stringify(query)
93
93
  }));
94
- case 5:
94
+ case 1:
95
95
  response = _context3.sent;
96
96
  traceIdFromHeaders = response === null || response === void 0 || (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('atl-traceid');
97
97
  if (response.ok) {
98
- _context3.next = 9;
98
+ _context3.next = 2;
99
99
  break;
100
100
  }
101
101
  throw new HttpError(response.status, response.statusText, traceIdFromHeaders);
102
- case 9:
103
- _context3.next = 11;
102
+ case 2:
103
+ _context3.next = 3;
104
104
  return response.json();
105
- case 11:
105
+ case 3:
106
106
  json = _context3.sent;
107
107
  if (json.errors) {
108
108
  handleErrors(json.errors, (_json$extensions$gate = (_json$extensions = json.extensions) === null || _json$extensions === void 0 || (_json$extensions = _json$extensions.gateway) === null || _json$extensions === void 0 ? void 0 : _json$extensions.request_id) !== null && _json$extensions$gate !== void 0 ? _json$extensions$gate : traceIdFromHeaders);
109
109
  }
110
110
  return _context3.abrupt("return", json.data);
111
- case 14:
111
+ case 4:
112
112
  case "end":
113
113
  return _context3.stop();
114
114
  }
@@ -38,12 +38,12 @@ export var AgentActions = function AgentActions(_ref) {
38
38
  var isForgeAgent = agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY';
39
39
  var loadAgentPermissions = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
40
40
  var _yield$resourceClient, _yield$resourceClient2, AGENT_CREATE, AGENT_UPDATE, AGENT_DEACTIVATE;
41
- return _regeneratorRuntime.wrap(function _callee$(_context) {
41
+ return _regeneratorRuntime.wrap(function (_context) {
42
42
  while (1) switch (_context.prev = _context.next) {
43
43
  case 0:
44
- _context.next = 2;
44
+ _context.next = 1;
45
45
  return resourceClient.getRovoAgentPermissions(agent.id);
46
- case 2:
46
+ case 1:
47
47
  _yield$resourceClient = _context.sent;
48
48
  _yield$resourceClient2 = _yield$resourceClient.permissions;
49
49
  AGENT_CREATE = _yield$resourceClient2.AGENT_CREATE;
@@ -54,7 +54,7 @@ export var AgentActions = function AgentActions(_ref) {
54
54
  isEditEnabled: AGENT_UPDATE.permitted,
55
55
  isDeleteEnabled: AGENT_DEACTIVATE.permitted
56
56
  });
57
- case 8:
57
+ case 2:
58
58
  case "end":
59
59
  return _context.stop();
60
60
  }
@@ -14,18 +14,18 @@ export var AgentDeleteConfirmationModal = function AgentDeleteConfirmationModal(
14
14
  var _useIntl = useIntl(),
15
15
  formatMessage = _useIntl.formatMessage;
16
16
  var handleDeleteAgent = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
17
- return _regeneratorRuntime.wrap(function _callee$(_context) {
17
+ return _regeneratorRuntime.wrap(function (_context) {
18
18
  while (1) switch (_context.prev = _context.next) {
19
19
  case 0:
20
20
  if (!agentId) {
21
- _context.next = 4;
21
+ _context.next = 2;
22
22
  break;
23
23
  }
24
- _context.next = 3;
24
+ _context.next = 1;
25
25
  return onSubmit();
26
- case 3:
26
+ case 1:
27
27
  onClose();
28
- case 4:
28
+ case 2:
29
29
  case "end":
30
30
  return _context.stop();
31
31
  }
@@ -91,49 +91,50 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
91
91
  setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
92
92
  }, [agent === null || agent === void 0 ? void 0 : agent.favourite, agent === null || agent === void 0 ? void 0 : agent.favourite_count]);
93
93
  var handleSetFavourite = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
94
- return _regeneratorRuntime.wrap(function _callee$(_context) {
94
+ var _t;
95
+ return _regeneratorRuntime.wrap(function (_context) {
95
96
  while (1) switch (_context.prev = _context.next) {
96
97
  case 0:
97
98
  if (!(agent !== null && agent !== void 0 && agent.id)) {
98
- _context.next = 10;
99
+ _context.next = 4;
99
100
  break;
100
101
  }
101
102
  _context.prev = 1;
102
- _context.next = 4;
103
+ _context.next = 2;
103
104
  return resourceClient.setFavouriteAgent(agent.id, !isStarred, fireEvent);
104
- case 4:
105
+ case 2:
105
106
  if (isStarred) {
106
107
  setStarCount(starCount ? starCount - 1 : 0);
107
108
  } else {
108
109
  setStarCount((starCount || 0) + 1);
109
110
  }
110
111
  setIsStarred(!isStarred);
111
- _context.next = 10;
112
+ _context.next = 4;
112
113
  break;
113
- case 8:
114
- _context.prev = 8;
115
- _context.t0 = _context["catch"](1);
116
- case 10:
114
+ case 3:
115
+ _context.prev = 3;
116
+ _t = _context["catch"](1);
117
+ case 4:
117
118
  case "end":
118
119
  return _context.stop();
119
120
  }
120
- }, _callee, null, [[1, 8]]);
121
+ }, _callee, null, [[1, 3]]);
121
122
  })), [agent === null || agent === void 0 ? void 0 : agent.id, fireEvent, isStarred, resourceClient, starCount]);
122
123
  var handleOnDelete = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
123
- var _onDeleteAgent, restore;
124
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
124
+ var _onDeleteAgent, restore, _t2;
125
+ return _regeneratorRuntime.wrap(function (_context2) {
125
126
  while (1) switch (_context2.prev = _context2.next) {
126
127
  case 0:
127
128
  if (!(agent && onDeleteAgent)) {
128
- _context2.next = 12;
129
+ _context2.next = 4;
129
130
  break;
130
131
  }
131
132
  // Optimistically remove from cache
132
133
  _onDeleteAgent = onDeleteAgent(agent.id), restore = _onDeleteAgent.restore;
133
- _context2.prev = 2;
134
- _context2.next = 5;
134
+ _context2.prev = 1;
135
+ _context2.next = 2;
135
136
  return resourceClient.deleteAgent(agent.id, fireEvent);
136
- case 5:
137
+ case 2:
137
138
  addFlag === null || addFlag === void 0 || addFlag({
138
139
  title: formatMessage(messages.agentDeletedSuccessFlagTitle),
139
140
  description: formatMessage(messages.agentDeletedSuccessFlagDescription, {
@@ -142,11 +143,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
142
143
  type: 'success',
143
144
  id: 'ptc-directory.agent-profile.delete-agent-success'
144
145
  });
145
- _context2.next = 12;
146
+ _context2.next = 4;
146
147
  break;
147
- case 8:
148
- _context2.prev = 8;
149
- _context2.t0 = _context2["catch"](2);
148
+ case 3:
149
+ _context2.prev = 3;
150
+ _t2 = _context2["catch"](1);
150
151
  // Restore agent to cache on error
151
152
  restore();
152
153
  addFlag === null || addFlag === void 0 || addFlag({
@@ -155,11 +156,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
155
156
  type: 'error',
156
157
  id: 'ptc-directory.agent-profile.delete-agent-error'
157
158
  });
158
- case 12:
159
+ case 4:
159
160
  case "end":
160
161
  return _context2.stop();
161
162
  }
162
- }, _callee2, null, [[2, 8]]);
163
+ }, _callee2, null, [[1, 3]]);
163
164
  })), [addFlag, agent, formatMessage, onDeleteAgent, resourceClient, fireEvent]);
164
165
  useEffect(function () {
165
166
  if (!isLoading && agent) {
@@ -271,14 +272,14 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
271
272
  return _onCopyAgent(agent.id);
272
273
  },
273
274
  onDuplicateAgent: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
274
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
275
+ return _regeneratorRuntime.wrap(function (_context3) {
275
276
  while (1) switch (_context3.prev = _context3.next) {
276
277
  case 0:
277
- _context3.next = 2;
278
+ _context3.next = 1;
278
279
  return onDuplicateAgent(agent.id);
279
- case 2:
280
+ case 1:
280
281
  return _context3.abrupt("return", _context3.sent);
281
- case 3:
282
+ case 2:
282
283
  case "end":
283
284
  return _context3.stop();
284
285
  }
@@ -43,20 +43,20 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
43
43
  var profileHref = navResult.href;
44
44
  var getCreator = useCallback( /*#__PURE__*/function () {
45
45
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
46
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo;
47
- return _regeneratorRuntime.wrap(function _callee$(_context) {
46
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo, _t;
47
+ return _regeneratorRuntime.wrap(function (_context) {
48
48
  while (1) switch (_context.prev = _context.next) {
49
49
  case 0:
50
50
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
51
51
  _context.prev = 1;
52
52
  currentCreatorUserId = fg('jira_ai_fix_agent_profile_card_flashing') ? creator_type === 'CUSTOMER' && creator ? getAAIDFromARI(creator) : undefined : creatorUserId;
53
53
  if (!(currentCreatorUserId && props.cloudId)) {
54
- _context.next = 8;
54
+ _context.next = 3;
55
55
  break;
56
56
  }
57
- _context.next = 6;
57
+ _context.next = 2;
58
58
  return props.resourceClient.getProfile(props.cloudId, currentCreatorUserId, fireEvent);
59
- case 6:
59
+ case 2:
60
60
  userCreatorInfo = _context.sent;
61
61
  if (fg('jira_ai_fix_agent_profile_card_flashing')) {
62
62
  profileHref = navigateToTeamsApp({
@@ -67,7 +67,7 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
67
67
  cloudId: props.cloudId
68
68
  }).href;
69
69
  }
70
- case 8:
70
+ case 3:
71
71
  creatorInfo = getAgentCreator({
72
72
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
73
73
  authoringTeam: authoringTeam ? {
@@ -81,33 +81,33 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
81
81
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
82
82
  });
83
83
  return _context.abrupt("return", creatorInfo);
84
- case 12:
85
- _context.prev = 12;
86
- _context.t0 = _context["catch"](1);
84
+ case 4:
85
+ _context.prev = 4;
86
+ _t = _context["catch"](1);
87
87
  return _context.abrupt("return", undefined);
88
- case 15:
88
+ case 5:
89
89
  case "end":
90
90
  return _context.stop();
91
91
  }
92
- }, _callee, null, [[1, 12]]);
92
+ }, _callee, null, [[1, 4]]);
93
93
  }));
94
94
  return function (_x) {
95
95
  return _ref2.apply(this, arguments);
96
96
  };
97
97
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
98
98
  var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
99
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo;
100
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
99
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, _t2;
100
+ return _regeneratorRuntime.wrap(function (_context2) {
101
101
  while (1) switch (_context2.prev = _context2.next) {
102
102
  case 0:
103
103
  setIsLoading(true);
104
104
  _context2.prev = 1;
105
- _context2.next = 4;
105
+ _context2.next = 2;
106
106
  return props.resourceClient.getRovoAgentProfile({
107
107
  type: 'identity',
108
108
  value: props.accountId
109
109
  }, fireEvent);
110
- case 4:
110
+ case 2:
111
111
  profileResult = _context2.sent;
112
112
  profileData = profileResult.restData;
113
113
  creatorInfoProps = {
@@ -115,28 +115,28 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
115
115
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
116
116
  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
117
117
  };
118
- _context2.next = 9;
118
+ _context2.next = 3;
119
119
  return getCreator(creatorInfoProps);
120
- case 9:
120
+ case 3:
121
121
  agentCreatorInfo = _context2.sent;
122
122
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
123
123
  creatorInfo: agentCreatorInfo
124
124
  }));
125
- _context2.next = 16;
125
+ _context2.next = 5;
126
126
  break;
127
- case 13:
128
- _context2.prev = 13;
129
- _context2.t0 = _context2["catch"](1);
130
- setError(_context2.t0);
131
- case 16:
132
- _context2.prev = 16;
127
+ case 4:
128
+ _context2.prev = 4;
129
+ _t2 = _context2["catch"](1);
130
+ setError(_t2);
131
+ case 5:
132
+ _context2.prev = 5;
133
133
  setIsLoading(false);
134
- return _context2.finish(16);
135
- case 19:
134
+ return _context2.finish(5);
135
+ case 6:
136
136
  case "end":
137
137
  return _context2.stop();
138
138
  }
139
- }, _callee2, null, [[1, 13, 16, 19]]);
139
+ }, _callee2, null, [[1, 4, 5, 6]]);
140
140
  })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
141
141
 
142
142
  // Depend on accountId rather than fetchData to avoid a re-fetch loop: