@atlaskit/profilecard 24.33.0 → 24.34.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/__tests__/vr-tests/__snapshots__/agent-profilecard/agent-profile-card-with-ai-disclaimer--default--rovo-agent-empty-state-refresh-false-jira-ai-profilecard-display-work-item-disclosure-true.png +0 -0
  3. package/__tests__/vr-tests/__snapshots__/agent-profilecard/agent-profile-card-with-ai-disclaimer--default--rovo-agent-empty-state-refresh-false-rovo-display-ai-disclaimer-on-agent-profile-card-true.png +0 -0
  4. package/__tests__/vr-tests/__snapshots__/agent-profilecard/agent-profile-card-with-ai-disclaimer--default--rovo-agent-empty-state-refresh-true-jira-ai-profilecard-display-work-item-disclosure-true.png +0 -0
  5. package/__tests__/vr-tests/__snapshots__/agent-profilecard/agent-profile-card-with-ai-disclaimer--default--rovo-agent-empty-state-refresh-true-rovo-display-ai-disclaimer-on-agent-profile-card-true.png +0 -0
  6. package/__tests__/vr-tests/agent-profilecard.vr.tsx +8 -0
  7. package/afm-cc/tsconfig.json +3 -0
  8. package/afm-jira/tsconfig.json +3 -0
  9. package/afm-products/tsconfig.json +3 -0
  10. package/dist/cjs/components/Agent/AgentProfileCard.compiled.css +3 -0
  11. package/dist/cjs/components/Agent/AgentProfileCard.js +26 -3
  12. package/dist/cjs/components/Agent/AgentProfileCardResourced.js +88 -26
  13. package/dist/cjs/components/Agent/messages.js +5 -0
  14. package/dist/cjs/components/User/ProfileCardTrigger.js +7 -3
  15. package/dist/cjs/mocks/agent-data.js +2 -2
  16. package/dist/es2019/components/Agent/AgentProfileCard.compiled.css +3 -0
  17. package/dist/es2019/components/Agent/AgentProfileCard.js +26 -4
  18. package/dist/es2019/components/Agent/AgentProfileCardResourced.js +49 -10
  19. package/dist/es2019/components/Agent/messages.js +5 -0
  20. package/dist/es2019/components/User/ProfileCardTrigger.js +7 -3
  21. package/dist/es2019/mocks/agent-data.js +1 -1
  22. package/dist/esm/components/Agent/AgentProfileCard.compiled.css +3 -0
  23. package/dist/esm/components/Agent/AgentProfileCard.js +27 -4
  24. package/dist/esm/components/Agent/AgentProfileCardResourced.js +88 -26
  25. package/dist/esm/components/Agent/messages.js +5 -0
  26. package/dist/esm/components/User/ProfileCardTrigger.js +7 -3
  27. package/dist/esm/mocks/agent-data.js +1 -1
  28. package/dist/types/components/Agent/AgentProfileCard.d.ts +1 -1
  29. package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +2 -0
  30. package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -1
  31. package/dist/types/components/Agent/messages.d.ts +5 -0
  32. package/dist/types/components/User/ProfileCardTrigger.d.ts +1 -1
  33. package/dist/types/mocks/agent-data.d.ts +1 -1
  34. package/dist/types/types.d.ts +4 -1
  35. package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +1 -1
  36. package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +2 -0
  37. package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -1
  38. package/dist/types-ts4.5/components/Agent/messages.d.ts +5 -0
  39. package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +1 -1
  40. package/dist/types-ts4.5/mocks/agent-data.d.ts +1 -1
  41. package/dist/types-ts4.5/types.d.ts +4 -1
  42. package/package.json +9 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`02b328ec2dc7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02b328ec2dc7c) -
8
+ [ux] Bug fix for showing creator information on agent profile cards.
9
+ - Updated dependencies
10
+
11
+ ## 24.34.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`f10295ea8dbb8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f10295ea8dbb8) -
16
+ allow option to display work item disclosure for AgentProfileCard
17
+
3
18
  ## 24.33.0
4
19
 
5
20
  ### Minor Changes
@@ -7,3 +7,11 @@ snapshot(AgentProfileCardExample, {
7
7
  rovo_agent_empty_state_refresh: [true, false],
8
8
  },
9
9
  });
10
+
11
+ snapshot(AgentProfileCardExample, {
12
+ description: 'Agent profile card with AI disclaimer',
13
+ featureFlags: {
14
+ rovo_agent_empty_state_refresh: [true, false],
15
+ rovo_display_ai_disclaimer_on_agent_profile_card: [true],
16
+ },
17
+ });
@@ -60,6 +60,9 @@
60
60
  {
61
61
  "path": "../../../design-system/icon/afm-cc/tsconfig.json"
62
62
  },
63
+ {
64
+ "path": "../../../design-system/link/afm-cc/tsconfig.json"
65
+ },
63
66
  {
64
67
  "path": "../../../design-system/lozenge/afm-cc/tsconfig.json"
65
68
  },
@@ -60,6 +60,9 @@
60
60
  {
61
61
  "path": "../../../design-system/icon/afm-jira/tsconfig.json"
62
62
  },
63
+ {
64
+ "path": "../../../design-system/link/afm-jira/tsconfig.json"
65
+ },
63
66
  {
64
67
  "path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
65
68
  },
@@ -60,6 +60,9 @@
60
60
  {
61
61
  "path": "../../../design-system/icon/afm-products/tsconfig.json"
62
62
  },
63
+ {
64
+ "path": "../../../design-system/link/afm-products/tsconfig.json"
65
+ },
63
66
  {
64
67
  "path": "../../../design-system/lozenge/afm-products/tsconfig.json"
65
68
  },
@@ -1,10 +1,13 @@
1
1
 
2
2
  ._2rko1mok{border-radius:var(--ds-radius-large,8px)}
3
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
3
4
  ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
4
5
  ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}._154i1ejb{top:var(--ds-space-300,24px)}
5
6
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
6
7
  ._1ltvpxbi{left:var(--ds-space-200,1pc)}
7
8
  ._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
9
+ ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
8
10
  ._1q51xy5q{padding-block-start:var(--ds-space-400,2pc)}
11
+ ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
9
12
  ._kqswh2mm{position:relative}
10
13
  ._kqswstnw{position:absolute}
@@ -15,6 +15,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
+ var _informationCircle = _interopRequireDefault(require("@atlaskit/icon/core/information-circle"));
19
+ var _link = _interopRequireDefault(require("@atlaskit/link"));
18
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
21
  var _compiled = require("@atlaskit/primitives/compiled");
20
22
  var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
@@ -37,7 +39,9 @@ var styles = {
37
39
  avatarStyles: "_kqswstnw _154i1ejb _1ltvpxbi",
38
40
  cardContainerStyles: "_2rko1mok _16qs130s _kqswh2mm",
39
41
  agentProfileInfoWrapper: "_18zrpxbi",
40
- conversationStartersWrapper: "_18zrutpp"
42
+ conversationStartersWrapper: "_18zrutpp",
43
+ disclosureWrapperRefresh: "_zulp1b66 _18zrpxbi _1q51utpp _85i5utpp",
44
+ disclosureWrapper: "_85i5utpp"
41
45
  };
42
46
  var AgentProfileCard = function AgentProfileCard(_ref) {
43
47
  var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
@@ -51,7 +55,9 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
51
55
  resourceClient = _ref.resourceClient,
52
56
  addFlag = _ref.addFlag,
53
57
  onDeleteAgent = _ref.onDeleteAgent,
54
- hideMoreActions = _ref.hideMoreActions;
58
+ hideMoreActions = _ref.hideMoreActions,
59
+ _ref$hideAiDisclaimer = _ref.hideAiDisclaimer,
60
+ hideAiDisclaimer = _ref$hideAiDisclaimer === void 0 ? false : _ref$hideAiDisclaimer;
55
61
  var _useAgentUrlActions = (0, _useAgentActions.useAgentUrlActions)({
56
62
  cloudId: cloudId || '',
57
63
  source: 'agentProfileCard'
@@ -218,7 +224,24 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
218
224
  isLoading: false
219
225
  }),
220
226
  agentDescription: agent.description
221
- })), !(isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')) && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
227
+ })), !hideAiDisclaimer && (0, _platformFeatureFlags.fg)('rovo_display_ai_disclaimer_on_agent_profile_card') && /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
228
+ alignItems: "start",
229
+ direction: "column",
230
+ gap: "space.050",
231
+ xcss: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? styles.disclosureWrapperRefresh : styles.disclosureWrapper
232
+ }, /*#__PURE__*/_react.default.createElement(_link.default, {
233
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
234
+ target: "_blank",
235
+ rel: "noopener noreferrer",
236
+ appearance: "subtle"
237
+ }, /*#__PURE__*/_react.default.createElement(_informationCircle.default, {
238
+ color: "var(--ds-icon-subtlest, #6B6E76)",
239
+ label: "",
240
+ size: "small"
241
+ }), " ", /*#__PURE__*/_react.default.createElement(_compiled.Text, {
242
+ size: "small",
243
+ color: "color.text.subtlest"
244
+ }, formatMessage(_messages.messages.aiDisclaimer)))), !(isRovoDev && (0, _platformFeatureFlags.fg)('rovo_dev_themed_identity_card')) && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
222
245
  xcss: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
223
246
  }, /*#__PURE__*/_react.default.createElement(_ConversationStarters.ConversationStarters, {
224
247
  isAgentDefault: agent.is_default,
@@ -12,6 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
15
16
  var _navigation = require("@atlaskit/teams-app-config/navigation");
16
17
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
17
18
  var _rovoAgentUtils = require("../../util/rovoAgentUtils");
@@ -52,7 +53,7 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
52
53
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
53
54
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
54
55
  */
55
- var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
56
+ var getCreatorDeprecated = (0, _react.useCallback)( /*#__PURE__*/function () {
56
57
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
57
58
  var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
58
59
  return _regenerator.default.wrap(function _callee$(_context) {
@@ -121,48 +122,108 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
121
122
  return _ref2.apply(this, arguments);
122
123
  };
123
124
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
124
- var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
125
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, agentCreatorInfo;
126
- return _regenerator.default.wrap(function _callee2$(_context2) {
127
- while (1) switch (_context2.prev = _context2.next) {
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;
133
+ if (!(creatorUserId && props.cloudId)) {
134
+ _context2.next = 6;
135
+ break;
136
+ }
137
+ _context2.next = 5;
138
+ return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
139
+ case 5:
140
+ userCreatorInfo = _context2.sent;
141
+ case 6:
142
+ creatorInfo = (0, _rovoAgentComponents.getAgentCreator)({
143
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
144
+ 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
147
+ } : undefined,
148
+ userCreator: userCreatorInfo ? {
149
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
150
+ profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
151
+ } : undefined,
152
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
153
+ });
154
+ return _context2.abrupt("return", creatorInfo);
155
+ case 10:
156
+ _context2.prev = 10;
157
+ _context2.t0 = _context2["catch"](1);
158
+ return _context2.abrupt("return", undefined);
159
+ case 13:
160
+ case "end":
161
+ return _context2.stop();
162
+ }
163
+ }, _callee2, null, [[1, 10]]);
164
+ }));
165
+ return function (_x2) {
166
+ return _ref4.apply(this, arguments);
167
+ };
168
+ }(), [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) {
128
173
  case 0:
129
174
  setIsLoading(true);
130
- _context2.prev = 1;
131
- _context2.next = 4;
175
+ _context3.prev = 1;
176
+ _context3.next = 4;
132
177
  return props.resourceClient.getRovoAgentProfile({
133
178
  type: 'identity',
134
179
  value: props.accountId
135
180
  }, fireEvent);
136
181
  case 4:
137
- profileResult = _context2.sent;
182
+ profileResult = _context3.sent;
138
183
  profileData = profileResult.restData;
139
- _context2.next = 8;
140
- return getCreator({
184
+ creatorInfoProps = {
141
185
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
142
186
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
143
187
  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
144
- });
145
- case 8:
146
- agentCreatorInfo = _context2.sent;
188
+ };
189
+ if (!(0, _platformFeatureFlags.fg)('rovo_agent_show_creator_on_profile_card_fix')) {
190
+ _context3.next = 14;
191
+ break;
192
+ }
193
+ _context3.next = 10;
194
+ return getCreator(creatorInfoProps);
195
+ case 10:
196
+ agentCreatorInfo = _context3.sent;
147
197
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
148
198
  creatorInfo: agentCreatorInfo
149
199
  }));
150
- _context2.next = 15;
200
+ _context3.next = 18;
151
201
  break;
152
- case 12:
153
- _context2.prev = 12;
154
- _context2.t0 = _context2["catch"](1);
155
- setError(_context2.t0);
156
- case 15:
157
- _context2.prev = 15;
158
- setIsLoading(false);
159
- return _context2.finish(15);
202
+ case 14:
203
+ _context3.next = 16;
204
+ return getCreatorDeprecated(creatorInfoProps);
205
+ case 16:
206
+ agentCreatorInfoDeprecated = _context3.sent;
207
+ setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
208
+ creatorInfo: agentCreatorInfoDeprecated
209
+ }));
160
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;
219
+ setIsLoading(false);
220
+ return _context3.finish(23);
221
+ case 26:
161
222
  case "end":
162
- return _context2.stop();
223
+ return _context3.stop();
163
224
  }
164
- }, _callee2, null, [[1, 12, 15, 18]]);
165
- })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
225
+ }, _callee3, null, [[1, 20, 23, 26]]);
226
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
166
227
  (0, _react.useEffect)(function () {
167
228
  fetchData();
168
229
  }, [fetchData]);
@@ -187,6 +248,7 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
187
248
  resourceClient: props.resourceClient,
188
249
  cloudId: props.cloudId,
189
250
  onDeleteAgent: props.onDeleteAgent,
190
- hideMoreActions: props.hideMoreActions
251
+ hideMoreActions: props.hideMoreActions,
252
+ hideAiDisclaimer: props.hideAiDisclaimer
191
253
  }));
192
254
  };
@@ -25,5 +25,10 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
25
25
  id: 'profilecard.agent-profile-card.delete-agent-error-flag-description',
26
26
  defaultMessage: 'Something went wrong while deleting the agent. Try again in a few moments.',
27
27
  description: 'Flag message description displayed when there is an error deleting agent'
28
+ },
29
+ aiDisclaimer: {
30
+ id: 'profilecard.agent-profile-card.ai-disclaimer',
31
+ defaultMessage: 'Uses AI. Verify results.',
32
+ description: 'Disclaimer text warning users to verify AI-generated content with a link to https://www.atlassian.com/trust/atlassian-intelligence'
28
33
  }
29
34
  });
@@ -46,7 +46,8 @@ function ProfileCardContent(_ref) {
46
46
  errorType = _ref.errorType,
47
47
  agentActions = _ref.agentActions,
48
48
  addFlag = _ref.addFlag,
49
- hideAgentMoreActions = _ref.hideAgentMoreActions;
49
+ hideAgentMoreActions = _ref.hideAgentMoreActions,
50
+ hideAiDisclaimer = _ref.hideAiDisclaimer;
50
51
  if (isAgent) {
51
52
  return /*#__PURE__*/_react.default.createElement(_AgentProfileCardResourced.AgentProfileCardResourced, {
52
53
  accountId: userId,
@@ -56,7 +57,8 @@ function ProfileCardContent(_ref) {
56
57
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
57
58
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
58
59
  addFlag: addFlag,
59
- hideMoreActions: (0, _platformFeatureFlags.fg)('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions
60
+ hideMoreActions: (0, _platformFeatureFlags.fg)('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions,
61
+ hideAiDisclaimer: hideAiDisclaimer
60
62
  });
61
63
  } else {
62
64
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
@@ -94,6 +96,7 @@ function ProfilecardTriggerNext(_ref2) {
94
96
  product = _ref2.product,
95
97
  agentActions = _ref2.agentActions,
96
98
  hideAgentMoreActions = _ref2.hideAgentMoreActions,
99
+ hideAiDisclaimer = _ref2.hideAiDisclaimer,
97
100
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
98
101
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
99
102
  propsIsVisible = _ref2.isVisible,
@@ -391,7 +394,8 @@ function ProfilecardTriggerNext(_ref2) {
391
394
  hasError: hasError,
392
395
  agentActions: agentActions,
393
396
  addFlag: addFlag,
394
- hideAgentMoreActions: hideAgentMoreActions
397
+ hideAgentMoreActions: hideAgentMoreActions,
398
+ hideAiDisclaimer: hideAiDisclaimer
395
399
  }));
396
400
  },
397
401
  trigger: function trigger(triggerProps) {
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.agentAggData = void 0;
7
- var agentData = {
6
+ exports.default = exports.agentData = exports.agentAggData = void 0;
7
+ var agentData = exports.agentData = {
8
8
  id: 'agentId',
9
9
  name: 'Profile card agent',
10
10
  description: 'this is a agent to use in profile card',
@@ -1,10 +1,13 @@
1
1
 
2
2
  ._2rko1mok{border-radius:var(--ds-radius-large,8px)}
3
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
3
4
  ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
4
5
  ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}._154i1ejb{top:var(--ds-space-300,24px)}
5
6
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
6
7
  ._1ltvpxbi{left:var(--ds-space-200,1pc)}
7
8
  ._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
9
+ ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
8
10
  ._1q51xy5q{padding-block-start:var(--ds-space-400,2pc)}
11
+ ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
9
12
  ._kqswh2mm{position:relative}
10
13
  ._kqswstnw{position:absolute}
@@ -3,8 +3,10 @@ import "./AgentProfileCard.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback, useEffect, useState } from 'react';
5
5
  import { useIntl } from 'react-intl-next';
6
+ import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
7
+ import Link from '@atlaskit/link';
6
8
  import { fg } from '@atlaskit/platform-feature-flags';
7
- import { Box, Stack } from '@atlaskit/primitives/compiled';
9
+ import { Box, Flex, Stack, Text } from '@atlaskit/primitives/compiled';
8
10
  import { AgentAvatar, AgentBanner, AgentProfileCreator, AgentProfileInfo, AgentStarCount } from '@atlaskit/rovo-agent-components';
9
11
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
10
12
  import { PACKAGE_META_DATA } from '../../util/analytics';
@@ -22,7 +24,9 @@ const styles = {
22
24
  avatarStyles: "_kqswstnw _154i1ejb _1ltvpxbi",
23
25
  cardContainerStyles: "_2rko1mok _16qs130s _kqswh2mm",
24
26
  agentProfileInfoWrapper: "_18zrpxbi",
25
- conversationStartersWrapper: "_18zrutpp"
27
+ conversationStartersWrapper: "_18zrutpp",
28
+ disclosureWrapperRefresh: "_zulp1b66 _18zrpxbi _1q51utpp _85i5utpp",
29
+ disclosureWrapper: "_85i5utpp"
26
30
  };
27
31
  const AgentProfileCard = ({
28
32
  agent,
@@ -35,7 +39,8 @@ const AgentProfileCard = ({
35
39
  resourceClient,
36
40
  addFlag,
37
41
  onDeleteAgent,
38
- hideMoreActions
42
+ hideMoreActions,
43
+ hideAiDisclaimer = false
39
44
  }) => {
40
45
  var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
41
46
  const {
@@ -172,7 +177,24 @@ const AgentProfileCard = ({
172
177
  isLoading: false
173
178
  }),
174
179
  agentDescription: agent.description
175
- })), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
180
+ })), !hideAiDisclaimer && fg('rovo_display_ai_disclaimer_on_agent_profile_card') && /*#__PURE__*/React.createElement(Flex, {
181
+ alignItems: "start",
182
+ direction: "column",
183
+ gap: "space.050",
184
+ xcss: fg('rovo_agent_empty_state_refresh') ? styles.disclosureWrapperRefresh : styles.disclosureWrapper
185
+ }, /*#__PURE__*/React.createElement(Link, {
186
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
187
+ target: "_blank",
188
+ rel: "noopener noreferrer",
189
+ appearance: "subtle"
190
+ }, /*#__PURE__*/React.createElement(InformationCircleIcon, {
191
+ color: "var(--ds-icon-subtlest, #6B6E76)",
192
+ label: "",
193
+ size: "small"
194
+ }), ` `, /*#__PURE__*/React.createElement(Text, {
195
+ size: "small",
196
+ color: "color.text.subtlest"
197
+ }, formatMessage(messages.aiDisclaimer)))), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
176
198
  xcss: fg('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
177
199
  }, /*#__PURE__*/React.createElement(ConversationStarters, {
178
200
  isAgentDefault: agent.is_default,
@@ -1,5 +1,6 @@
1
1
  import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { getAgentCreator } from '@atlaskit/rovo-agent-components';
3
4
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
4
5
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
5
6
  import { getAAIDFromARI } from '../../util/rovoAgentUtils';
@@ -28,7 +29,7 @@ export const AgentProfileCardResourced = props => {
28
29
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
29
30
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
30
31
  */
31
- const getCreator = useCallback(async ({
32
+ const getCreatorDeprecated = useCallback(async ({
32
33
  creator_type,
33
34
  creator,
34
35
  authoringTeam
@@ -66,13 +67,41 @@ export const AgentProfileCardResourced = props => {
66
67
  profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`,
67
68
  id: creatorUserId
68
69
  };
69
- } catch (error) {
70
+ } catch {
70
71
  return undefined;
71
72
  }
72
73
  default:
73
74
  return undefined;
74
75
  }
75
76
  }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
77
+ const getCreator = useCallback(async ({
78
+ creator_type,
79
+ creator,
80
+ authoringTeam
81
+ }) => {
82
+ try {
83
+ var _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full;
84
+ let userCreatorInfo;
85
+ if (creatorUserId && props.cloudId) {
86
+ userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
87
+ }
88
+ const creatorInfo = getAgentCreator({
89
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
90
+ 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
93
+ } : undefined,
94
+ userCreator: userCreatorInfo ? {
95
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
96
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`
97
+ } : undefined,
98
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
99
+ });
100
+ return creatorInfo;
101
+ } catch {
102
+ return undefined;
103
+ }
104
+ }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
76
105
  const fetchData = useCallback(async () => {
77
106
  setIsLoading(true);
78
107
  try {
@@ -82,21 +111,30 @@ export const AgentProfileCardResourced = props => {
82
111
  value: props.accountId
83
112
  }, fireEvent);
84
113
  const profileData = profileResult.restData;
85
- const agentCreatorInfo = await getCreator({
114
+ const creatorInfoProps = {
86
115
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
87
116
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
88
117
  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
89
- });
90
- setAgentData({
91
- ...profileData,
92
- creatorInfo: agentCreatorInfo
93
- });
118
+ };
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
+ }
94
132
  } catch (err) {
95
133
  setError(err);
96
134
  } finally {
97
135
  setIsLoading(false);
98
136
  }
99
- }, [fireEvent, getCreator, props.accountId, props.resourceClient]);
137
+ }, [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
100
138
  useEffect(() => {
101
139
  fetchData();
102
140
  }, [fetchData]);
@@ -121,6 +159,7 @@ export const AgentProfileCardResourced = props => {
121
159
  resourceClient: props.resourceClient,
122
160
  cloudId: props.cloudId,
123
161
  onDeleteAgent: props.onDeleteAgent,
124
- hideMoreActions: props.hideMoreActions
162
+ hideMoreActions: props.hideMoreActions,
163
+ hideAiDisclaimer: props.hideAiDisclaimer
125
164
  }));
126
165
  };
@@ -19,5 +19,10 @@ export const messages = defineMessages({
19
19
  id: 'profilecard.agent-profile-card.delete-agent-error-flag-description',
20
20
  defaultMessage: 'Something went wrong while deleting the agent. Try again in a few moments.',
21
21
  description: 'Flag message description displayed when there is an error deleting agent'
22
+ },
23
+ aiDisclaimer: {
24
+ id: 'profilecard.agent-profile-card.ai-disclaimer',
25
+ defaultMessage: 'Uses AI. Verify results.',
26
+ description: 'Disclaimer text warning users to verify AI-generated content with a link to https://www.atlassian.com/trust/atlassian-intelligence'
22
27
  }
23
28
  });
@@ -27,7 +27,8 @@ function ProfileCardContent({
27
27
  errorType,
28
28
  agentActions,
29
29
  addFlag,
30
- hideAgentMoreActions
30
+ hideAgentMoreActions,
31
+ hideAiDisclaimer
31
32
  }) {
32
33
  if (isAgent) {
33
34
  return /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
@@ -38,7 +39,8 @@ function ProfileCardContent({
38
39
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
39
40
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
40
41
  addFlag: addFlag,
41
- hideMoreActions: fg('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions
42
+ hideMoreActions: fg('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions,
43
+ hideAiDisclaimer: hideAiDisclaimer
42
44
  });
43
45
  } else {
44
46
  return /*#__PURE__*/React.createElement(Suspense, {
@@ -73,6 +75,7 @@ export default function ProfilecardTriggerNext({
73
75
  product,
74
76
  agentActions,
75
77
  hideAgentMoreActions,
78
+ hideAiDisclaimer,
76
79
  ariaHideProfileTrigger = false,
77
80
  isVisible: propsIsVisible,
78
81
  ssrPlaceholderId,
@@ -320,7 +323,8 @@ export default function ProfilecardTriggerNext({
320
323
  hasError: hasError,
321
324
  agentActions: agentActions,
322
325
  addFlag: addFlag,
323
- hideAgentMoreActions: hideAgentMoreActions
326
+ hideAgentMoreActions: hideAgentMoreActions,
327
+ hideAiDisclaimer: hideAiDisclaimer
324
328
  })),
325
329
  trigger: triggerProps => {
326
330
  const {
@@ -1,4 +1,4 @@
1
- const agentData = {
1
+ export const agentData = {
2
2
  id: 'agentId',
3
3
  name: 'Profile card agent',
4
4
  description: 'this is a agent to use in profile card',
@@ -1,10 +1,13 @@
1
1
 
2
2
  ._2rko1mok{border-radius:var(--ds-radius-large,8px)}
3
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
3
4
  ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
4
5
  ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}._154i1ejb{top:var(--ds-space-300,24px)}
5
6
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
6
7
  ._1ltvpxbi{left:var(--ds-space-200,1pc)}
7
8
  ._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
9
+ ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
8
10
  ._1q51xy5q{padding-block-start:var(--ds-space-400,2pc)}
11
+ ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
9
12
  ._kqswh2mm{position:relative}
10
13
  ._kqswstnw{position:absolute}
@@ -9,8 +9,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
  import React, { useCallback, useEffect, useState } from 'react';
11
11
  import { useIntl } from 'react-intl-next';
12
+ import InformationCircleIcon from '@atlaskit/icon/core/information-circle';
13
+ import Link from '@atlaskit/link';
12
14
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { Box, Stack } from '@atlaskit/primitives/compiled';
15
+ import { Box, Flex, Stack, Text } from '@atlaskit/primitives/compiled';
14
16
  import { AgentAvatar, AgentBanner, AgentProfileCreator, AgentProfileInfo, AgentStarCount } from '@atlaskit/rovo-agent-components';
15
17
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
16
18
  import { PACKAGE_META_DATA } from '../../util/analytics';
@@ -28,7 +30,9 @@ var styles = {
28
30
  avatarStyles: "_kqswstnw _154i1ejb _1ltvpxbi",
29
31
  cardContainerStyles: "_2rko1mok _16qs130s _kqswh2mm",
30
32
  agentProfileInfoWrapper: "_18zrpxbi",
31
- conversationStartersWrapper: "_18zrutpp"
33
+ conversationStartersWrapper: "_18zrutpp",
34
+ disclosureWrapperRefresh: "_zulp1b66 _18zrpxbi _1q51utpp _85i5utpp",
35
+ disclosureWrapper: "_85i5utpp"
32
36
  };
33
37
  var AgentProfileCard = function AgentProfileCard(_ref) {
34
38
  var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
@@ -42,7 +46,9 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
42
46
  resourceClient = _ref.resourceClient,
43
47
  addFlag = _ref.addFlag,
44
48
  onDeleteAgent = _ref.onDeleteAgent,
45
- hideMoreActions = _ref.hideMoreActions;
49
+ hideMoreActions = _ref.hideMoreActions,
50
+ _ref$hideAiDisclaimer = _ref.hideAiDisclaimer,
51
+ hideAiDisclaimer = _ref$hideAiDisclaimer === void 0 ? false : _ref$hideAiDisclaimer;
46
52
  var _useAgentUrlActions = useAgentUrlActions({
47
53
  cloudId: cloudId || '',
48
54
  source: 'agentProfileCard'
@@ -209,7 +215,24 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
209
215
  isLoading: false
210
216
  }),
211
217
  agentDescription: agent.description
212
- })), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
218
+ })), !hideAiDisclaimer && fg('rovo_display_ai_disclaimer_on_agent_profile_card') && /*#__PURE__*/React.createElement(Flex, {
219
+ alignItems: "start",
220
+ direction: "column",
221
+ gap: "space.050",
222
+ xcss: fg('rovo_agent_empty_state_refresh') ? styles.disclosureWrapperRefresh : styles.disclosureWrapper
223
+ }, /*#__PURE__*/React.createElement(Link, {
224
+ href: "https://www.atlassian.com/trust/atlassian-intelligence",
225
+ target: "_blank",
226
+ rel: "noopener noreferrer",
227
+ appearance: "subtle"
228
+ }, /*#__PURE__*/React.createElement(InformationCircleIcon, {
229
+ color: "var(--ds-icon-subtlest, #6B6E76)",
230
+ label: "",
231
+ size: "small"
232
+ }), " ", /*#__PURE__*/React.createElement(Text, {
233
+ size: "small",
234
+ color: "color.text.subtlest"
235
+ }, formatMessage(messages.aiDisclaimer)))), !(isRovoDev && fg('rovo_dev_themed_identity_card')) && /*#__PURE__*/React.createElement(Box, {
213
236
  xcss: fg('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
214
237
  }, /*#__PURE__*/React.createElement(ConversationStarters, {
215
238
  isAgentDefault: agent.is_default,
@@ -6,6 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { getAgentCreator } from '@atlaskit/rovo-agent-components';
9
10
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
10
11
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
11
12
  import { getAAIDFromARI } from '../../util/rovoAgentUtils';
@@ -43,7 +44,7 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
43
44
  * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
44
45
  * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
45
46
  */
46
- var getCreator = useCallback( /*#__PURE__*/function () {
47
+ var getCreatorDeprecated = useCallback( /*#__PURE__*/function () {
47
48
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
48
49
  var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
49
50
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -112,48 +113,108 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
112
113
  return _ref2.apply(this, arguments);
113
114
  };
114
115
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
115
- var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
116
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, agentCreatorInfo;
117
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
118
- while (1) switch (_context2.prev = _context2.next) {
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;
124
+ if (!(creatorUserId && props.cloudId)) {
125
+ _context2.next = 6;
126
+ break;
127
+ }
128
+ _context2.next = 5;
129
+ return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
130
+ case 5:
131
+ userCreatorInfo = _context2.sent;
132
+ case 6:
133
+ creatorInfo = getAgentCreator({
134
+ creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
135
+ 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
138
+ } : undefined,
139
+ userCreator: userCreatorInfo ? {
140
+ name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
141
+ profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId)
142
+ } : undefined,
143
+ forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
144
+ });
145
+ return _context2.abrupt("return", creatorInfo);
146
+ case 10:
147
+ _context2.prev = 10;
148
+ _context2.t0 = _context2["catch"](1);
149
+ return _context2.abrupt("return", undefined);
150
+ case 13:
151
+ case "end":
152
+ return _context2.stop();
153
+ }
154
+ }, _callee2, null, [[1, 10]]);
155
+ }));
156
+ return function (_x2) {
157
+ return _ref4.apply(this, arguments);
158
+ };
159
+ }(), [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) {
119
164
  case 0:
120
165
  setIsLoading(true);
121
- _context2.prev = 1;
122
- _context2.next = 4;
166
+ _context3.prev = 1;
167
+ _context3.next = 4;
123
168
  return props.resourceClient.getRovoAgentProfile({
124
169
  type: 'identity',
125
170
  value: props.accountId
126
171
  }, fireEvent);
127
172
  case 4:
128
- profileResult = _context2.sent;
173
+ profileResult = _context3.sent;
129
174
  profileData = profileResult.restData;
130
- _context2.next = 8;
131
- return getCreator({
175
+ creatorInfoProps = {
132
176
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
133
177
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
134
178
  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
135
- });
136
- case 8:
137
- agentCreatorInfo = _context2.sent;
179
+ };
180
+ if (!fg('rovo_agent_show_creator_on_profile_card_fix')) {
181
+ _context3.next = 14;
182
+ break;
183
+ }
184
+ _context3.next = 10;
185
+ return getCreator(creatorInfoProps);
186
+ case 10:
187
+ agentCreatorInfo = _context3.sent;
138
188
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
139
189
  creatorInfo: agentCreatorInfo
140
190
  }));
141
- _context2.next = 15;
191
+ _context3.next = 18;
142
192
  break;
143
- case 12:
144
- _context2.prev = 12;
145
- _context2.t0 = _context2["catch"](1);
146
- setError(_context2.t0);
147
- case 15:
148
- _context2.prev = 15;
149
- setIsLoading(false);
150
- return _context2.finish(15);
193
+ case 14:
194
+ _context3.next = 16;
195
+ return getCreatorDeprecated(creatorInfoProps);
196
+ case 16:
197
+ agentCreatorInfoDeprecated = _context3.sent;
198
+ setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
199
+ creatorInfo: agentCreatorInfoDeprecated
200
+ }));
151
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;
210
+ setIsLoading(false);
211
+ return _context3.finish(23);
212
+ case 26:
152
213
  case "end":
153
- return _context2.stop();
214
+ return _context3.stop();
154
215
  }
155
- }, _callee2, null, [[1, 12, 15, 18]]);
156
- })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
216
+ }, _callee3, null, [[1, 20, 23, 26]]);
217
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
157
218
  useEffect(function () {
158
219
  fetchData();
159
220
  }, [fetchData]);
@@ -178,6 +239,7 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
178
239
  resourceClient: props.resourceClient,
179
240
  cloudId: props.cloudId,
180
241
  onDeleteAgent: props.onDeleteAgent,
181
- hideMoreActions: props.hideMoreActions
242
+ hideMoreActions: props.hideMoreActions,
243
+ hideAiDisclaimer: props.hideAiDisclaimer
182
244
  }));
183
245
  };
@@ -19,5 +19,10 @@ export var messages = defineMessages({
19
19
  id: 'profilecard.agent-profile-card.delete-agent-error-flag-description',
20
20
  defaultMessage: 'Something went wrong while deleting the agent. Try again in a few moments.',
21
21
  description: 'Flag message description displayed when there is an error deleting agent'
22
+ },
23
+ aiDisclaimer: {
24
+ id: 'profilecard.agent-profile-card.ai-disclaimer',
25
+ defaultMessage: 'Uses AI. Verify results.',
26
+ description: 'Disclaimer text warning users to verify AI-generated content with a link to https://www.atlassian.com/trust/atlassian-intelligence'
22
27
  }
23
28
  });
@@ -37,7 +37,8 @@ function ProfileCardContent(_ref) {
37
37
  errorType = _ref.errorType,
38
38
  agentActions = _ref.agentActions,
39
39
  addFlag = _ref.addFlag,
40
- hideAgentMoreActions = _ref.hideAgentMoreActions;
40
+ hideAgentMoreActions = _ref.hideAgentMoreActions,
41
+ hideAiDisclaimer = _ref.hideAiDisclaimer;
41
42
  if (isAgent) {
42
43
  return /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
43
44
  accountId: userId,
@@ -47,7 +48,8 @@ function ProfileCardContent(_ref) {
47
48
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
48
49
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
49
50
  addFlag: addFlag,
50
- hideMoreActions: fg('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions
51
+ hideMoreActions: fg('jira_ai_profilecard_hide_agent_actions') && !!hideAgentMoreActions,
52
+ hideAiDisclaimer: hideAiDisclaimer
51
53
  });
52
54
  } else {
53
55
  return /*#__PURE__*/React.createElement(Suspense, {
@@ -85,6 +87,7 @@ export default function ProfilecardTriggerNext(_ref2) {
85
87
  product = _ref2.product,
86
88
  agentActions = _ref2.agentActions,
87
89
  hideAgentMoreActions = _ref2.hideAgentMoreActions,
90
+ hideAiDisclaimer = _ref2.hideAiDisclaimer,
88
91
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
89
92
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
90
93
  propsIsVisible = _ref2.isVisible,
@@ -382,7 +385,8 @@ export default function ProfilecardTriggerNext(_ref2) {
382
385
  hasError: hasError,
383
386
  agentActions: agentActions,
384
387
  addFlag: addFlag,
385
- hideAgentMoreActions: hideAgentMoreActions
388
+ hideAgentMoreActions: hideAgentMoreActions,
389
+ hideAiDisclaimer: hideAiDisclaimer
386
390
  }));
387
391
  },
388
392
  trigger: function trigger(triggerProps) {
@@ -1,4 +1,4 @@
1
- var agentData = {
1
+ export var agentData = {
2
2
  id: 'agentId',
3
3
  name: 'Profile card agent',
4
4
  description: 'this is a agent to use in profile card',
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type AgentProfileCardProps } from '../../types';
3
- declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: AgentProfileCardProps) => React.JSX.Element;
3
+ declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, hideAiDisclaimer, }: AgentProfileCardProps) => React.JSX.Element;
4
4
  export default AgentProfileCard;
@@ -12,5 +12,7 @@ export type AgentProfileCardResourcedProps = {
12
12
  };
13
13
  /** Hide the Agent more actions dropdown when true */
14
14
  hideMoreActions?: boolean;
15
+ /** Hide the AI disclaimer. Defaults to false (disclaimer is shown by default). */
16
+ hideAiDisclaimer?: boolean;
15
17
  } & AgentActionsType;
16
18
  export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => React.JSX.Element;
@@ -1 +1 @@
1
- export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
1
+ export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, hideAiDisclaimer, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
@@ -19,4 +19,9 @@ export declare const messages: {
19
19
  defaultMessage: string;
20
20
  description: string;
21
21
  };
22
+ aiDisclaimer: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
22
27
  };
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { type RovoAgent, type RovoAgentAgg } from '../types';
2
- declare const agentData: RovoAgent;
2
+ export declare const agentData: RovoAgent;
3
3
  export declare const agentAggData: RovoAgentAgg;
4
4
  export default agentData;
@@ -92,7 +92,7 @@ export type RovoAgentCardClientResult = {
92
92
  aggData: RovoAgentAgg | null | undefined;
93
93
  };
94
94
  export interface RovoAgentCreatorInfo {
95
- type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
95
+ type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE' | 'OOTB';
96
96
  name?: string;
97
97
  profileLink?: string;
98
98
  id?: string;
@@ -198,6 +198,7 @@ export interface ProfileCardTriggerProps {
198
198
  showDelay?: number;
199
199
  hideDelay?: number;
200
200
  hideAgentMoreActions?: boolean;
201
+ hideAiDisclaimer?: boolean;
201
202
  }
202
203
  export interface ProfileCardTriggerState {
203
204
  visible?: boolean;
@@ -382,6 +383,8 @@ export type AgentProfileCardProps = {
382
383
  };
383
384
  /** Hide the Agent more actions dropdown when true */
384
385
  hideMoreActions?: boolean;
386
+ /** Hide the AI disclaimer. Defaults to false (disclaimer is shown by default). */
387
+ hideAiDisclaimer?: boolean;
385
388
  } & AgentActionsType;
386
389
  export type StatusType = 'active' | 'inactive' | 'closed';
387
390
  export type TriggerType = 'hover' | 'click';
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type AgentProfileCardProps } from '../../types';
3
- declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: AgentProfileCardProps) => React.JSX.Element;
3
+ declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, hideAiDisclaimer, }: AgentProfileCardProps) => React.JSX.Element;
4
4
  export default AgentProfileCard;
@@ -12,5 +12,7 @@ export type AgentProfileCardResourcedProps = {
12
12
  };
13
13
  /** Hide the Agent more actions dropdown when true */
14
14
  hideMoreActions?: boolean;
15
+ /** Hide the AI disclaimer. Defaults to false (disclaimer is shown by default). */
16
+ hideAiDisclaimer?: boolean;
15
17
  } & AgentActionsType;
16
18
  export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => React.JSX.Element;
@@ -1 +1 @@
1
- export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
1
+ export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, hideAiDisclaimer, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
@@ -19,4 +19,9 @@ export declare const messages: {
19
19
  defaultMessage: string;
20
20
  description: string;
21
21
  };
22
+ aiDisclaimer: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
22
27
  };
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { type RovoAgent, type RovoAgentAgg } from '../types';
2
- declare const agentData: RovoAgent;
2
+ export declare const agentData: RovoAgent;
3
3
  export declare const agentAggData: RovoAgentAgg;
4
4
  export default agentData;
@@ -92,7 +92,7 @@ export type RovoAgentCardClientResult = {
92
92
  aggData: RovoAgentAgg | null | undefined;
93
93
  };
94
94
  export interface RovoAgentCreatorInfo {
95
- type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
95
+ type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE' | 'OOTB';
96
96
  name?: string;
97
97
  profileLink?: string;
98
98
  id?: string;
@@ -201,6 +201,7 @@ export interface ProfileCardTriggerProps {
201
201
  showDelay?: number;
202
202
  hideDelay?: number;
203
203
  hideAgentMoreActions?: boolean;
204
+ hideAiDisclaimer?: boolean;
204
205
  }
205
206
  export interface ProfileCardTriggerState {
206
207
  visible?: boolean;
@@ -388,6 +389,8 @@ export type AgentProfileCardProps = {
388
389
  };
389
390
  /** Hide the Agent more actions dropdown when true */
390
391
  hideMoreActions?: boolean;
392
+ /** Hide the AI disclaimer. Defaults to false (disclaimer is shown by default). */
393
+ hideAiDisclaimer?: boolean;
391
394
  } & AgentActionsType;
392
395
  export type StatusType = 'active' | 'inactive' | 'closed';
393
396
  export type TriggerType = 'hover' | 'click';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.33.0",
3
+ "version": "24.34.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,6 +52,7 @@
52
52
  "@atlaskit/give-kudos": "^4.5.0",
53
53
  "@atlaskit/heading": "^5.2.0",
54
54
  "@atlaskit/icon": "^30.0.0",
55
+ "@atlaskit/link": "3.3.1",
55
56
  "@atlaskit/lozenge": "^13.3.0",
56
57
  "@atlaskit/menu": "^8.4.0",
57
58
  "@atlaskit/modal-dialog": "^14.10.0",
@@ -60,7 +61,7 @@
60
61
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
61
62
  "@atlaskit/popup": "^4.13.0",
62
63
  "@atlaskit/primitives": "^17.1.0",
63
- "@atlaskit/rovo-agent-components": "^3.23.0",
64
+ "@atlaskit/rovo-agent-components": "^3.25.0",
64
65
  "@atlaskit/rovo-triggers": "^5.6.0",
65
66
  "@atlaskit/spinner": "^19.0.0",
66
67
  "@atlaskit/teams-app-config": "^1.12.0",
@@ -173,6 +174,12 @@
173
174
  },
174
175
  "people-teams-deprecate-profilecard-teams": {
175
176
  "type": "boolean"
177
+ },
178
+ "rovo_display_ai_disclaimer_on_agent_profile_card": {
179
+ "type": "boolean"
180
+ },
181
+ "rovo_agent_show_creator_on_profile_card_fix": {
182
+ "type": "boolean"
176
183
  }
177
184
  },
178
185
  "sideEffects": [