@atlaskit/profilecard 25.7.5 → 25.7.6

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 (42) hide show
  1. package/CHANGELOG.md +8 -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/util/analytics.js +2 -2
  19. package/dist/cjs/util/useProfileInfo.js +11 -11
  20. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  21. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  22. package/dist/es2019/components/User/ProfileCardTrigger.js +1 -1
  23. package/dist/es2019/util/analytics.js +2 -2
  24. package/dist/esm/client/ProfileCardClient.js +27 -26
  25. package/dist/esm/client/RovoAgentCardClient.js +19 -19
  26. package/dist/esm/client/TeamCentralCardClient.js +27 -26
  27. package/dist/esm/client/UserProfileCardClient.js +8 -8
  28. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +12 -12
  29. package/dist/esm/client/getTeamFromAGG.js +5 -5
  30. package/dist/esm/client/graphqlUtils.js +12 -12
  31. package/dist/esm/components/Agent/Actions.js +4 -4
  32. package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +5 -5
  33. package/dist/esm/components/Agent/AgentProfileCard.js +27 -26
  34. package/dist/esm/components/Agent/AgentProfileCardResourced.js +27 -27
  35. package/dist/esm/components/Agent/AgentProfileCardTrigger.js +31 -31
  36. package/dist/esm/components/Agent/hooks/duplicateFetch.js +36 -36
  37. package/dist/esm/components/Agent/hooks/useAgentActions.js +14 -14
  38. package/dist/esm/components/User/ProfileCardTrigger.js +15 -15
  39. package/dist/esm/components/common/ProfileCardTrigger.js +2 -2
  40. package/dist/esm/util/analytics.js +2 -2
  41. package/dist/esm/util/useProfileInfo.js +11 -11
  42. package/package.json +3 -6
@@ -11,12 +11,12 @@ var GRAPHQL_ENDPOINT = '/gateway/api/graphql';
11
11
  */
12
12
  export var fetchHasVersionCapability = /*#__PURE__*/function () {
13
13
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(cloudId) {
14
- var _json$data, response, json, result;
15
- return _regeneratorRuntime.wrap(function _callee$(_context) {
14
+ var _json$data, response, json, result, _t;
15
+ return _regeneratorRuntime.wrap(function (_context) {
16
16
  while (1) switch (_context.prev = _context.next) {
17
17
  case 0:
18
18
  _context.prev = 0;
19
- _context.next = 3;
19
+ _context.next = 1;
20
20
  return fetch(GRAPHQL_ENDPOINT, {
21
21
  method: 'POST',
22
22
  credentials: 'include',
@@ -30,23 +30,23 @@ export var fetchHasVersionCapability = /*#__PURE__*/function () {
30
30
  }
31
31
  })
32
32
  });
33
- case 3:
33
+ case 1:
34
34
  response = _context.sent;
35
- _context.next = 6;
35
+ _context.next = 2;
36
36
  return response.json();
37
- case 6:
37
+ case 2:
38
38
  json = _context.sent;
39
39
  result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_hasVersionCapability;
40
40
  return _context.abrupt("return", (result === null || result === void 0 ? void 0 : result.__typename) === 'AgentStudioHasVersionCapability' ? Boolean(result.hasVersionCapability) : false);
41
- case 11:
42
- _context.prev = 11;
43
- _context.t0 = _context["catch"](0);
41
+ case 3:
42
+ _context.prev = 3;
43
+ _t = _context["catch"](0);
44
44
  return _context.abrupt("return", false);
45
- case 14:
45
+ case 4:
46
46
  case "end":
47
47
  return _context.stop();
48
48
  }
49
- }, _callee, null, [[0, 11]]);
49
+ }, _callee, null, [[0, 3]]);
50
50
  }));
51
51
  return function fetchHasVersionCapability(_x) {
52
52
  return _ref.apply(this, arguments);
@@ -59,12 +59,12 @@ export var fetchHasVersionCapability = /*#__PURE__*/function () {
59
59
  */
60
60
  export var fetchActivationId = /*#__PURE__*/function () {
61
61
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId) {
62
- var _json$data$tenantCont, _json$data2, response, json;
63
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
62
+ var _json$data$tenantCont, _json$data2, response, json, _t2;
63
+ return _regeneratorRuntime.wrap(function (_context2) {
64
64
  while (1) switch (_context2.prev = _context2.next) {
65
65
  case 0:
66
66
  _context2.prev = 0;
67
- _context2.next = 3;
67
+ _context2.next = 1;
68
68
  return fetch(GRAPHQL_ENDPOINT, {
69
69
  method: 'POST',
70
70
  credentials: 'include',
@@ -79,22 +79,22 @@ export var fetchActivationId = /*#__PURE__*/function () {
79
79
  }
80
80
  })
81
81
  });
82
- case 3:
82
+ case 1:
83
83
  response = _context2.sent;
84
- _context2.next = 6;
84
+ _context2.next = 2;
85
85
  return response.json();
86
- case 6:
86
+ case 2:
87
87
  json = _context2.sent;
88
88
  return _context2.abrupt("return", (_json$data$tenantCont = json === null || json === void 0 || (_json$data2 = json.data) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.tenantContexts) === null || _json$data2 === void 0 || (_json$data2 = _json$data2[0]) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.activationIdByProduct) === null || _json$data2 === void 0 ? void 0 : _json$data2.active) !== null && _json$data$tenantCont !== void 0 ? _json$data$tenantCont : null);
89
- case 10:
90
- _context2.prev = 10;
91
- _context2.t0 = _context2["catch"](0);
89
+ case 3:
90
+ _context2.prev = 3;
91
+ _t2 = _context2["catch"](0);
92
92
  return _context2.abrupt("return", null);
93
- case 13:
93
+ case 4:
94
94
  case "end":
95
95
  return _context2.stop();
96
96
  }
97
- }, _callee2, null, [[0, 10]]);
97
+ }, _callee2, null, [[0, 3]]);
98
98
  }));
99
99
  return function fetchActivationId(_x2) {
100
100
  return _ref2.apply(this, arguments);
@@ -109,12 +109,12 @@ export var fetchActivationId = /*#__PURE__*/function () {
109
109
  */
110
110
  export var fetchDuplicateAgentMutation = /*#__PURE__*/function () {
111
111
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(agentAri) {
112
- var _json$data3, _result$agent, _result$errors$0$mess, _result$errors, response, json, result;
113
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
112
+ var _json$data3, _result$agent, _result$errors$0$mess, _result$errors, response, json, result, _t3;
113
+ return _regeneratorRuntime.wrap(function (_context3) {
114
114
  while (1) switch (_context3.prev = _context3.next) {
115
115
  case 0:
116
116
  _context3.prev = 0;
117
- _context3.next = 3;
117
+ _context3.next = 1;
118
118
  return fetch(GRAPHQL_ENDPOINT, {
119
119
  method: 'POST',
120
120
  credentials: 'include',
@@ -128,38 +128,38 @@ export var fetchDuplicateAgentMutation = /*#__PURE__*/function () {
128
128
  }
129
129
  })
130
130
  });
131
- case 3:
131
+ case 1:
132
132
  response = _context3.sent;
133
- _context3.next = 6;
133
+ _context3.next = 2;
134
134
  return response.json();
135
- case 6:
135
+ case 2:
136
136
  json = _context3.sent;
137
137
  result = json === null || json === void 0 || (_json$data3 = json.data) === null || _json$data3 === void 0 ? void 0 : _json$data3.agentStudio_duplicateAgent;
138
138
  if (!(result !== null && result !== void 0 && result.success && result !== null && result !== void 0 && (_result$agent = result.agent) !== null && _result$agent !== void 0 && _result$agent.id)) {
139
- _context3.next = 10;
139
+ _context3.next = 3;
140
140
  break;
141
141
  }
142
142
  return _context3.abrupt("return", {
143
143
  success: true,
144
144
  newAgentAri: result.agent.id
145
145
  });
146
- case 10:
146
+ case 3:
147
147
  return _context3.abrupt("return", {
148
148
  success: false,
149
149
  errorMessage: (_result$errors$0$mess = result === null || result === void 0 || (_result$errors = result.errors) === null || _result$errors === void 0 || (_result$errors = _result$errors[0]) === null || _result$errors === void 0 ? void 0 : _result$errors.message) !== null && _result$errors$0$mess !== void 0 ? _result$errors$0$mess : 'Duplicate agent mutation failed'
150
150
  });
151
- case 13:
152
- _context3.prev = 13;
153
- _context3.t0 = _context3["catch"](0);
151
+ case 4:
152
+ _context3.prev = 4;
153
+ _t3 = _context3["catch"](0);
154
154
  return _context3.abrupt("return", {
155
155
  success: false,
156
- errorMessage: _context3.t0 instanceof Error ? _context3.t0.message : 'Network error during duplication'
156
+ errorMessage: _t3 instanceof Error ? _t3.message : 'Network error during duplication'
157
157
  });
158
- case 16:
158
+ case 5:
159
159
  case "end":
160
160
  return _context3.stop();
161
161
  }
162
- }, _callee3, null, [[0, 13]]);
162
+ }, _callee3, null, [[0, 4]]);
163
163
  }));
164
164
  return function fetchDuplicateAgentMutation(_x3) {
165
165
  return _ref3.apply(this, arguments);
@@ -57,7 +57,7 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
57
57
  var onDuplicateAgent = useCallback( /*#__PURE__*/function () {
58
58
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(agentId) {
59
59
  var legacyDuplicateUrl, hasVersionCapability, activationId, agentAri, result;
60
- return _regeneratorRuntime.wrap(function _callee$(_context) {
60
+ return _regeneratorRuntime.wrap(function (_context) {
61
61
  while (1) switch (_context.prev = _context.next) {
62
62
  case 0:
63
63
  fireEvent('ui.button.clicked.duplicateAgentButton', {
@@ -66,40 +66,40 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
66
66
  });
67
67
  legacyDuplicateUrl = getAtlassianStudioAgentDuplicateUrl(cloudId, agentId, email); // When versioning FG is off, use legacy duplicate flow
68
68
  if (fg('rovo_agent_versioning_enabled')) {
69
- _context.next = 5;
69
+ _context.next = 1;
70
70
  break;
71
71
  }
72
72
  window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
73
73
  return _context.abrupt("return");
74
- case 5:
75
- _context.next = 7;
74
+ case 1:
75
+ _context.next = 2;
76
76
  return fetchHasVersionCapability(cloudId);
77
- case 7:
77
+ case 2:
78
78
  hasVersionCapability = _context.sent;
79
79
  if (hasVersionCapability) {
80
- _context.next = 11;
80
+ _context.next = 3;
81
81
  break;
82
82
  }
83
83
  // Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
84
84
  window.location.assign(legacyDuplicateUrl);
85
85
  return _context.abrupt("return");
86
- case 11:
87
- _context.next = 13;
86
+ case 3:
87
+ _context.next = 4;
88
88
  return fetchActivationId(cloudId);
89
- case 13:
89
+ case 4:
90
90
  activationId = _context.sent;
91
91
  if (activationId) {
92
- _context.next = 17;
92
+ _context.next = 5;
93
93
  break;
94
94
  }
95
95
  // Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
96
96
  window.location.assign(legacyDuplicateUrl);
97
97
  return _context.abrupt("return");
98
- case 17:
98
+ case 5:
99
99
  agentAri = "ari:cloud:rovo::agent/activation/".concat(activationId, "/").concat(agentId); // Call BE mutation to duplicate the agent
100
- _context.next = 20;
100
+ _context.next = 6;
101
101
  return fetchDuplicateAgentMutation(agentAri);
102
- case 20:
102
+ case 6:
103
103
  result = _context.sent;
104
104
  if (result.success && result.newAgentAri) {
105
105
  // Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
@@ -109,7 +109,7 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
109
109
  // Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
110
110
  window.location.assign(legacyDuplicateUrl);
111
111
  }
112
- case 22:
112
+ case 7:
113
113
  case "end":
114
114
  return _context.stop();
115
115
  }
@@ -50,7 +50,7 @@ function ProfileCardContent(_ref) {
50
50
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
51
51
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
52
52
  addFlag: addFlag,
53
- hideMoreActions: fg('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions,
53
+ hideMoreActions: !!hideAgentMoreActions,
54
54
  hideConversationStarters: fg('jira_ai_hide_conversation_starters_profilecard') && !!profilecardProps.hideAgentConversationStarters,
55
55
  hideAiDisclaimer: hideAiDisclaimer
56
56
  });
@@ -235,21 +235,21 @@ export default function ProfilecardTriggerNext(_ref2) {
235
235
  setError(err);
236
236
  }, [setHasError, setIsLoading, setError]);
237
237
  var clientFetchProfile = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
238
- var shouldHideReportingLines, requests, responses;
239
- return _regeneratorRuntime.wrap(function _callee$(_context) {
238
+ var shouldHideReportingLines, requests, responses, _t;
239
+ return _regeneratorRuntime.wrap(function (_context) {
240
240
  while (1) switch (_context.prev = _context.next) {
241
241
  case 0:
242
242
  if (!(isLoading === true)) {
243
- _context.next = 2;
243
+ _context.next = 1;
244
244
  break;
245
245
  }
246
246
  return _context.abrupt("return");
247
- case 2:
247
+ case 1:
248
248
  setIsLoading(true);
249
249
  setHasError(false);
250
250
  setError(null);
251
251
  setData(null);
252
- _context.prev = 6;
252
+ _context.prev = 2;
253
253
  shouldHideReportingLines = fg('jira_ai_profilecard_hide_reportinglines') && hideReportingLines;
254
254
  requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics), shouldHideReportingLines ? Promise.resolve({
255
255
  managers: [],
@@ -258,22 +258,22 @@ export default function ProfilecardTriggerNext(_ref2) {
258
258
  withOrgContext: true,
259
259
  withSiteContext: true
260
260
  })]);
261
- _context.next = 11;
261
+ _context.next = 3;
262
262
  return requests;
263
- case 11:
263
+ case 3:
264
264
  responses = _context.sent;
265
265
  handleClientSuccess.apply(void 0, _toConsumableArray(responses));
266
- _context.next = 18;
266
+ _context.next = 5;
267
267
  break;
268
- case 15:
269
- _context.prev = 15;
270
- _context.t0 = _context["catch"](6);
271
- handleClientError(_context.t0);
272
- case 18:
268
+ case 4:
269
+ _context.prev = 4;
270
+ _t = _context["catch"](2);
271
+ handleClientError(_t);
272
+ case 5:
273
273
  case "end":
274
274
  return _context.stop();
275
275
  }
276
- }, _callee, null, [[6, 15]]);
276
+ }, _callee, null, [[2, 4]]);
277
277
  })), [cloudId, fireAnalytics, isLoading, resourceClient, userId, handleClientSuccess, handleClientError, hideReportingLines]);
278
278
  var showProfilecard = useCallback(function () {
279
279
  clearTimeout(hideTimer.current);
@@ -65,7 +65,7 @@ function ProfileCardTriggerInner(_ref, ref) {
65
65
  };
66
66
  }, [hideProfilecard]);
67
67
  var showProfilecard = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
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
  clearTimeout(hideTimer.current);
@@ -83,7 +83,7 @@ function ProfileCardTriggerInner(_ref, ref) {
83
83
  }
84
84
  }
85
85
  }, showDelay);
86
- case 3:
86
+ case 1:
87
87
  case "end":
88
88
  return _context.stop();
89
89
  }
@@ -5,7 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { getPageTime } from './performance';
6
6
  export var PACKAGE_META_DATA = {
7
7
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
8
- packageVersion: (_process$env$_PACKAGE2 = "25.7.4") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
8
+ packageVersion: (_process$env$_PACKAGE2 = "25.7.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
9
9
  };
10
10
  var TEAM_SUBJECT = 'teamProfileCard';
11
11
  var USER_SUBJECT = 'profilecard';
@@ -24,7 +24,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
24
24
  actionSubjectId: actionSubjectId,
25
25
  attributes: _objectSpread(_objectSpread({
26
26
  packageName: "@atlaskit/profilecard",
27
- packageVersion: "25.7.4"
27
+ packageVersion: "25.7.5"
28
28
  }, attributes), {}, {
29
29
  firedAt: Math.round(getPageTime())
30
30
  })
@@ -18,30 +18,30 @@ export var useProfileInfo = function useProfileInfo(_ref) {
18
18
  setProfileData = _useState6[1];
19
19
  var getProfileData = /*#__PURE__*/function () {
20
20
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
21
- var _profileData;
22
- return _regeneratorRuntime.wrap(function _callee$(_context) {
21
+ var _profileData, _t;
22
+ return _regeneratorRuntime.wrap(function (_context) {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
25
25
  setIsLoading(true);
26
26
  _context.prev = 1;
27
- _context.next = 4;
27
+ _context.next = 2;
28
28
  return fetchUserProfile === null || fetchUserProfile === void 0 ? void 0 : fetchUserProfile();
29
- case 4:
29
+ case 2:
30
30
  _profileData = _context.sent;
31
31
  setProfileData(_profileData);
32
32
  setIsLoading(false);
33
- _context.next = 13;
33
+ _context.next = 4;
34
34
  break;
35
- case 9:
36
- _context.prev = 9;
37
- _context.t0 = _context["catch"](1);
38
- setError(_context.t0);
35
+ case 3:
36
+ _context.prev = 3;
37
+ _t = _context["catch"](1);
38
+ setError(_t);
39
39
  setIsLoading(false);
40
- case 13:
40
+ case 4:
41
41
  case "end":
42
42
  return _context.stop();
43
43
  }
44
- }, _callee, null, [[1, 9]]);
44
+ }, _callee, null, [[1, 3]]);
45
45
  }));
46
46
  return function getProfileData() {
47
47
  return _ref2.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "25.7.5",
3
+ "version": "25.7.6",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -69,12 +69,12 @@
69
69
  "@atlaskit/rovo-triggers": "^6.3.0",
70
70
  "@atlaskit/spinner": "^19.1.0",
71
71
  "@atlaskit/teams-app-config": "^1.12.0",
72
- "@atlaskit/teams-app-internal-analytics": "^1.31.0",
72
+ "@atlaskit/teams-app-internal-analytics": "^1.32.0",
73
73
  "@atlaskit/teams-app-internal-navigation": "^1.9.0",
74
74
  "@atlaskit/teams-avatar": "^2.7.0",
75
75
  "@atlaskit/teams-public": "^1.4.0",
76
76
  "@atlaskit/theme": "^25.0.0",
77
- "@atlaskit/tmp-editor-statsig": "^84.0.0",
77
+ "@atlaskit/tmp-editor-statsig": "^84.3.0",
78
78
  "@atlaskit/tokens": "^13.0.0",
79
79
  "@atlaskit/tooltip": "^22.3.0",
80
80
  "@atlassian/studio-entry-link": "^1.1.0",
@@ -159,9 +159,6 @@
159
159
  "cover-header-image-team-profilecard": {
160
160
  "type": "boolean"
161
161
  },
162
- "jira_ai_profilecard_hide_agent_actions": {
163
- "type": "boolean"
164
- },
165
162
  "jira_ai_profilecard_hide_reportinglines": {
166
163
  "type": "boolean"
167
164
  },