@atlaskit/profilecard 23.21.20 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/afm-cc/tsconfig.json +8 -2
  3. package/afm-jira/tsconfig.json +7 -1
  4. package/afm-post-office/tsconfig.json +7 -1
  5. package/afm-rovo-extension/tsconfig.json +7 -1
  6. package/afm-townsquare/tsconfig.json +7 -1
  7. package/build/tsconfig.json +8 -2
  8. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
  9. package/dist/cjs/client/getTeamFromAGG.js +1 -1
  10. package/dist/cjs/components/Agent/Actions.js +18 -6
  11. package/dist/cjs/components/Agent/AgentProfileCard.js +2 -5
  12. package/dist/cjs/components/Agent/AgentProfileCardResourced.js +0 -2
  13. package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +0 -3
  14. package/dist/cjs/components/Agent/hooks/useAgentActions.js +44 -3
  15. package/dist/cjs/components/User/ProfileCardTrigger.js +0 -4
  16. package/dist/cjs/components/team-profile-card/team-connections/main.js +2 -2
  17. package/dist/cjs/util/analytics.js +1 -1
  18. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  19. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  20. package/dist/es2019/components/Agent/Actions.js +18 -3
  21. package/dist/es2019/components/Agent/AgentProfileCard.js +2 -4
  22. package/dist/es2019/components/Agent/AgentProfileCardResourced.js +0 -2
  23. package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +0 -3
  24. package/dist/es2019/components/Agent/hooks/useAgentActions.js +45 -3
  25. package/dist/es2019/components/User/ProfileCardTrigger.js +0 -4
  26. package/dist/es2019/components/team-profile-card/team-connections/main.js +2 -2
  27. package/dist/es2019/util/analytics.js +1 -1
  28. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
  29. package/dist/esm/client/getTeamFromAGG.js +1 -1
  30. package/dist/esm/components/Agent/Actions.js +18 -6
  31. package/dist/esm/components/Agent/AgentProfileCard.js +2 -5
  32. package/dist/esm/components/Agent/AgentProfileCardResourced.js +0 -2
  33. package/dist/esm/components/Agent/AgentProfileCardTrigger.js +0 -3
  34. package/dist/esm/components/Agent/hooks/useAgentActions.js +44 -3
  35. package/dist/esm/components/User/ProfileCardTrigger.js +0 -4
  36. package/dist/esm/components/team-profile-card/team-connections/main.js +2 -2
  37. package/dist/esm/util/analytics.js +1 -1
  38. package/dist/types/components/Agent/Actions.d.ts +1 -2
  39. package/dist/types/components/Agent/AgentProfileCard.d.ts +1 -1
  40. package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +0 -2
  41. package/dist/types/components/Agent/hooks/useAgentActions.d.ts +2 -1
  42. package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -1
  43. package/dist/types/types.d.ts +0 -2
  44. package/dist/types-ts4.5/components/Agent/Actions.d.ts +1 -2
  45. package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +1 -1
  46. package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +0 -2
  47. package/dist/types-ts4.5/components/Agent/hooks/useAgentActions.d.ts +2 -1
  48. package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -1
  49. package/dist/types-ts4.5/types.d.ts +0 -2
  50. package/package.json +3 -6
  51. package/tsconfig.json +8 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#193947](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193947)
8
+ [`c6101121ae1df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6101121ae1df) -
9
+ Removed unused component props in response to the removal of `isAgentCreatedByUser` from the agent
10
+ dropdown actions component. Changes:
11
+
12
+ - `AgentProfileCard`: removed `isCreatedByViewingUser` / `product` props. `isCreatedByViewingUser`
13
+ is no longer needed for action dropdown permission checks, and `product` is an unused prop
14
+ - `AgentProfileCardResourced`: removed `viewingUserId` / `product` props. `viewingUserId` is no
15
+ longer needed for action dropdown permission checks, and `product` is an unused prop
16
+
17
+ Also updated consumer components to remove these props.
18
+
19
+ ### Patch Changes
20
+
21
+ - [`49ad6b3374d93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/49ad6b3374d93) -
22
+ Clean up enable_web_links_in_team_containers feature gate
23
+ - Updated dependencies
24
+
25
+ ## 23.21.21
26
+
27
+ ### Patch Changes
28
+
29
+ - [#192008](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192008)
30
+ [`191a9be1b1ba0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/191a9be1b1ba0) -
31
+ added agent edit/duplicate/delete/view/copy action analytics
32
+ - Updated dependencies
33
+
3
34
  ## 23.21.20
4
35
 
5
36
  ### Patch Changes
@@ -14,7 +14,13 @@
14
14
  "exclude": [
15
15
  "../src/**/__tests__/*",
16
16
  "../src/**/*.test.*",
17
- "../src/**/test.*"
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
18
24
  ],
19
25
  "references": [
20
26
  {
@@ -108,4 +114,4 @@
108
114
  "path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
109
115
  }
110
116
  ]
111
- }
117
+ }
@@ -14,7 +14,13 @@
14
14
  "exclude": [
15
15
  "../src/**/__tests__/*",
16
16
  "../src/**/*.test.*",
17
- "../src/**/test.*"
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
18
24
  ],
19
25
  "references": [
20
26
  {
@@ -14,7 +14,13 @@
14
14
  "exclude": [
15
15
  "../src/**/__tests__/*",
16
16
  "../src/**/*.test.*",
17
- "../src/**/test.*"
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
18
24
  ],
19
25
  "references": [
20
26
  {
@@ -14,7 +14,13 @@
14
14
  "exclude": [
15
15
  "../src/**/__tests__/*",
16
16
  "../src/**/*.test.*",
17
- "../src/**/test.*"
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
18
24
  ],
19
25
  "references": [
20
26
  {
@@ -14,7 +14,13 @@
14
14
  "exclude": [
15
15
  "../src/**/__tests__/*",
16
16
  "../src/**/*.test.*",
17
- "../src/**/test.*"
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
18
24
  ],
19
25
  "references": [
20
26
  {
@@ -12,6 +12,12 @@
12
12
  "exclude": [
13
13
  "../src/**/__tests__/*",
14
14
  "../src/**/*.test.*",
15
- "../src/**/test.*"
15
+ "../src/**/test.*",
16
+ "../src/**/examples.*",
17
+ "../src/**/examples/*",
18
+ "../src/**/examples/**/*",
19
+ "../src/**/*.stories.*",
20
+ "../src/**/stories/*",
21
+ "../src/**/stories/**/*"
16
22
  ]
17
- }
23
+ }
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "23.21.19");
14
+ headers.append('atl-client-version', "23.21.21");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -65,7 +65,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
65
65
  headers.append('X-ExperimentalApi', 'teams-beta');
66
66
  headers.append('X-ExperimentalApi', 'team-members-beta');
67
67
  headers.append('atl-client-name', "@atlaskit/profilecard");
68
- headers.append('atl-client-version', "23.21.19");
68
+ headers.append('atl-client-version', "23.21.21");
69
69
  return headers;
70
70
  };
71
71
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -11,9 +11,11 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
+ var _analyticsNext = require("@atlaskit/analytics-next");
14
15
  var _new = _interopRequireDefault(require("@atlaskit/button/new"));
15
16
  var _primitives = require("@atlaskit/primitives");
16
17
  var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
18
+ var _analytics = require("../../util/analytics");
17
19
  var _AgentDeleteConfirmationModal = require("./AgentDeleteConfirmationModal");
18
20
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
21
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
@@ -48,8 +50,7 @@ var actionsWrapperStyles = (0, _primitives.xcss)({
48
50
  color: 'color.text'
49
51
  });
50
52
  var AgentActions = exports.AgentActions = function AgentActions(_ref) {
51
- var isAgentCreatedByCurrentUser = _ref.isAgentCreatedByCurrentUser,
52
- onEditAgent = _ref.onEditAgent,
53
+ var onEditAgent = _ref.onEditAgent,
53
54
  onDeleteAgent = _ref.onDeleteAgent,
54
55
  onDuplicateAgent = _ref.onDuplicateAgent,
55
56
  onCopyAgent = _ref.onCopyAgent,
@@ -59,6 +60,8 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref) {
59
60
  resourceClient = _ref.resourceClient;
60
61
  var _useIntl = (0, _reactIntlNext.useIntl)(),
61
62
  formatMessage = _useIntl.formatMessage;
63
+ var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
64
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
62
65
  var _useState = (0, _react.useState)(false),
63
66
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
64
67
  isDeleteModalOpen = _useState2[0],
@@ -86,6 +89,18 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref) {
86
89
  }
87
90
  }, _callee);
88
91
  })), [agent.id, resourceClient]);
92
+ var handleDeleteAgent = (0, _react.useCallback)(function () {
93
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
94
+ action: 'clicked',
95
+ actionSubject: 'button',
96
+ actionSubjectId: 'deleteAgentButton',
97
+ attributes: {
98
+ agentId: agent.id,
99
+ source: 'agentProfileCard'
100
+ }
101
+ });
102
+ setIsDeleteModalOpen(true);
103
+ }, [agent.id, createAnalyticsEvent]);
89
104
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
90
105
  space: "space.100",
91
106
  xcss: actionsWrapperStyles
@@ -108,10 +123,7 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref) {
108
123
  xcss: chatPillTextStyles
109
124
  }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentDropdownMenu, {
110
125
  agentId: agent.id,
111
- isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
112
- onDeleteAgent: function onDeleteAgent() {
113
- return setIsDeleteModalOpen(true);
114
- },
126
+ onDeleteAgent: handleDeleteAgent,
115
127
  onEditAgent: onEditAgent,
116
128
  onDuplicateAgent: onDuplicateAgent,
117
129
  onCopyAgent: onCopyAgent,
@@ -43,18 +43,16 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
43
43
  var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
44
44
  var agent = _ref.agent,
45
45
  isLoading = _ref.isLoading,
46
- isCreatedByViewingUser = _ref.isCreatedByViewingUser,
47
46
  cloudId = _ref.cloudId,
48
47
  _onChatClick = _ref.onChatClick,
49
- _ref$product = _ref.product,
50
- product = _ref$product === void 0 ? 'rovo' : _ref$product,
51
48
  hasError = _ref.hasError,
52
49
  errorType = _ref.errorType,
53
50
  onConversationStartersClick = _ref.onConversationStartersClick,
54
51
  resourceClient = _ref.resourceClient,
55
52
  addFlag = _ref.addFlag;
56
53
  var _useAgentUrlActions = (0, _useAgentActions.useAgentUrlActions)({
57
- cloudId: cloudId || ''
54
+ cloudId: cloudId || '',
55
+ source: 'agentProfileCard'
58
56
  }),
59
57
  _onEditAgent = _useAgentUrlActions.onEditAgent,
60
58
  _onCopyAgent = _useAgentUrlActions.onCopyAgent,
@@ -221,7 +219,6 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
221
219
  }
222
220
  })), /*#__PURE__*/_react.default.createElement(_Actions.AgentActions, {
223
221
  agent: agent,
224
- isAgentCreatedByCurrentUser: isCreatedByViewingUser,
225
222
  onEditAgent: function onEditAgent() {
226
223
  return _onEditAgent(agent.id);
227
224
  },
@@ -166,8 +166,6 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
166
166
  agent: agentData,
167
167
  isLoading: isLoading,
168
168
  hasError: !!error,
169
- isCreatedByViewingUser: creatorUserId === props.viewingUserId,
170
- product: props.product,
171
169
  onConversationStartersClick: props.onConversationStartersClick,
172
170
  onChatClick: props.onChatClick,
173
171
  addFlag: props.addFlag,
@@ -141,7 +141,6 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = function AgentPr
141
141
  };
142
142
  }();
143
143
  var renderProfileCard = function renderProfileCard(_ref4) {
144
- var _profileData$creatorI;
145
144
  var profileData = _ref4.profileData,
146
145
  error = _ref4.error;
147
146
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
@@ -149,9 +148,7 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = function AgentPr
149
148
  }, /*#__PURE__*/_react.default.createElement(_lazyAgentProfileCard.AgentProfileCardLazy, {
150
149
  agent: profileData,
151
150
  hasError: !!error,
152
- isCreatedByViewingUser: (profileData === null || profileData === void 0 ? void 0 : profileData.creatorInfo) && (profileData === null || profileData === void 0 || (_profileData$creatorI = profileData.creatorInfo) === null || _profileData$creatorI === void 0 ? void 0 : _profileData$creatorI.id) === viewingUserId,
153
151
  cloudId: props.cloudId,
154
- product: product,
155
152
  errorType: error,
156
153
  onChatClick: props.onChatClick,
157
154
  onConversationStartersClick: props.onConversationStartersClick,
@@ -8,10 +8,12 @@ exports.useAgentUrlActions = exports.firstCharUpper = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = require("react");
11
+ var _analyticsNext = require("@atlaskit/analytics-next");
11
12
  var _atlassianContext = require("@atlaskit/atlassian-context");
12
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _rovoTriggers = require("@atlaskit/rovo-triggers");
14
15
  var _navigation = require("@atlaskit/teams-app-config/navigation");
16
+ var _analytics = require("../../../util/analytics");
15
17
  var _url = require("../../../util/url");
16
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -30,9 +32,12 @@ var createRovoParams = function createRovoParams(params) {
30
32
  return rovoParams;
31
33
  };
32
34
  var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlActions(_ref3) {
33
- var cloudId = _ref3.cloudId;
35
+ var cloudId = _ref3.cloudId,
36
+ source = _ref3.source;
34
37
  var _useRovoPostMessageTo = (0, _rovoTriggers.useRovoPostMessageToPubsub)(),
35
38
  publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
39
+ var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
40
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
36
41
  var onEditAgent = (0, _react.useCallback)(function (agentId) {
37
42
  var url = "".concat((0, _atlassianContext.getATLContextUrl)('home'), "/chat/agents/").concat(agentId, "/edit");
38
43
  var urlWithParams = (0, _url.encodeParamsToUrl)(url, _objectSpread({
@@ -41,9 +46,27 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
41
46
  cloudId: cloudId
42
47
  })));
43
48
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
44
- }, [cloudId]);
49
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
50
+ action: 'clicked',
51
+ actionSubject: 'button',
52
+ actionSubjectId: 'editAgentButton',
53
+ attributes: {
54
+ agentId: agentId,
55
+ source: source
56
+ }
57
+ });
58
+ }, [cloudId, createAnalyticsEvent, source]);
45
59
  var onCopyAgent = function onCopyAgent(agentId) {
46
60
  navigator.clipboard.writeText("".concat(window.location.origin, "/people/agent/").concat(agentId));
61
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
62
+ action: 'clicked',
63
+ actionSubject: 'button',
64
+ actionSubjectId: 'copyAgentLinkButton',
65
+ attributes: {
66
+ agentId: agentId,
67
+ source: source
68
+ }
69
+ });
47
70
  };
48
71
  var onDuplicateAgent = (0, _react.useCallback)(function (agentId) {
49
72
  var baseUrl = "".concat((0, _atlassianContext.getATLContextUrl)('home'), "/chat/agents/new");
@@ -55,7 +78,16 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
55
78
  pathway: 'agents-create'
56
79
  })));
57
80
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
58
- }, [cloudId]);
81
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
82
+ action: 'clicked',
83
+ actionSubject: 'button',
84
+ actionSubjectId: 'duplicateAgentButton',
85
+ attributes: {
86
+ agentId: agentId,
87
+ source: source
88
+ }
89
+ });
90
+ }, [cloudId, createAnalyticsEvent, source]);
59
91
  var onConversationStarter = function onConversationStarter(_ref4) {
60
92
  var agentId = _ref4.agentId,
61
93
  prompt = _ref4.prompt;
@@ -130,6 +162,15 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
130
162
  } else {
131
163
  window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
132
164
  }
165
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
166
+ action: 'clicked',
167
+ actionSubject: 'button',
168
+ actionSubjectId: 'viewAgentFullProfileButton',
169
+ attributes: {
170
+ agentId: agentId,
171
+ source: source
172
+ }
173
+ });
133
174
  };
134
175
  return {
135
176
  onEditAgent: onEditAgent,
@@ -38,9 +38,7 @@ function ProfileCardContent(_ref) {
38
38
  userId = _ref.userId,
39
39
  cloudId = _ref.cloudId,
40
40
  resourceClient = _ref.resourceClient,
41
- viewingUserId = _ref.viewingUserId,
42
41
  trigger = _ref.trigger,
43
- product = _ref.product,
44
42
  isAgent = _ref.isAgent,
45
43
  profileCardAction = _ref.profileCardAction,
46
44
  hasError = _ref.hasError,
@@ -52,9 +50,7 @@ function ProfileCardContent(_ref) {
52
50
  accountId: userId,
53
51
  cloudId: cloudId,
54
52
  resourceClient: resourceClient,
55
- viewingUserId: viewingUserId,
56
53
  trigger: trigger,
57
- product: product,
58
54
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
59
55
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
60
56
  addFlag: addFlag
@@ -29,7 +29,7 @@ var TeamConnections = exports.TeamConnections = function TeamConnections(_ref) {
29
29
  title = _ref.title,
30
30
  containerIcon = _ref.containerIcon,
31
31
  link = _ref.link;
32
- var isContainerIconEnabled = (0, _platformFeatureFlags.fg)('enable_web_links_in_team_containers') || (0, _platformFeatureFlags.fg)('loom_tab_in_container_linker_team_profile_page');
32
+ var isContainerIconEnabled = (0, _platformFeatureFlags.fg)('loom_tab_in_container_linker_team_profile_page');
33
33
  var _getContainerProperti = (0, _teamsPublic.getContainerProperties)({
34
34
  containerType: containerType,
35
35
  iconSize: 'medium',
@@ -91,7 +91,7 @@ var NewTeamConnections = exports.NewTeamConnections = function NewTeamConnection
91
91
  title = _ref2.title,
92
92
  containerIcon = _ref2.containerIcon,
93
93
  link = _ref2.link;
94
- var isContainerIconEnabled = (0, _platformFeatureFlags.fg)('enable_web_links_in_team_containers') || (0, _platformFeatureFlags.fg)('loom_tab_in_container_linker_team_profile_page');
94
+ var isContainerIconEnabled = (0, _platformFeatureFlags.fg)('loom_tab_in_container_linker_team_profile_page');
95
95
  var _getContainerProperti2 = (0, _teamsPublic.getContainerProperties)({
96
96
  containerType: containerType,
97
97
  iconSize: 'medium',
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "23.21.19"
48
+ packageVersion: "23.21.21"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
6
6
  }`;
7
7
  const addHeaders = headers => {
8
8
  headers.append('atl-client-name', "@atlaskit/profilecard");
9
- headers.append('atl-client-version', "23.21.19");
9
+ headers.append('atl-client-version', "23.21.21");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -74,7 +74,7 @@ export const addHeaders = headers => {
74
74
  headers.append('X-ExperimentalApi', 'teams-beta');
75
75
  headers.append('X-ExperimentalApi', 'team-members-beta');
76
76
  headers.append('atl-client-name', "@atlaskit/profilecard");
77
- headers.append('atl-client-version', "23.21.19");
77
+ headers.append('atl-client-version', "23.21.21");
78
78
  return headers;
79
79
  };
80
80
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -1,9 +1,11 @@
1
1
  import React, { useCallback, useState } from 'react';
2
2
  import { defineMessages, useIntl } from 'react-intl-next';
3
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
4
  import Button from '@atlaskit/button/new';
4
5
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
5
6
  import { Box, Inline, xcss } from '@atlaskit/primitives';
6
7
  import { AgentDropdownMenu, ChatPillIcon } from '@atlaskit/rovo-agent-components';
8
+ import { fireEvent } from '../../util/analytics';
7
9
  import { AgentDeleteConfirmationModal } from './AgentDeleteConfirmationModal';
8
10
  const chatToAgentButtonContainer = xcss({
9
11
  width: '100%'
@@ -35,7 +37,6 @@ const actionsWrapperStyles = xcss({
35
37
  color: 'color.text'
36
38
  });
37
39
  export const AgentActions = ({
38
- isAgentCreatedByCurrentUser,
39
40
  onEditAgent,
40
41
  onDeleteAgent,
41
42
  onDuplicateAgent,
@@ -48,6 +49,9 @@ export const AgentActions = ({
48
49
  const {
49
50
  formatMessage
50
51
  } = useIntl();
52
+ const {
53
+ createAnalyticsEvent
54
+ } = useAnalyticsEvents();
51
55
  const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
52
56
  const isForgeAgent = agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY';
53
57
  const loadAgentPermissions = useCallback(async () => {
@@ -62,6 +66,18 @@ export const AgentActions = ({
62
66
  isDeleteEnabled: AGENT_DEACTIVATE.permitted
63
67
  };
64
68
  }, [agent.id, resourceClient]);
69
+ const handleDeleteAgent = useCallback(() => {
70
+ fireEvent(createAnalyticsEvent, {
71
+ action: 'clicked',
72
+ actionSubject: 'button',
73
+ actionSubjectId: 'deleteAgentButton',
74
+ attributes: {
75
+ agentId: agent.id,
76
+ source: 'agentProfileCard'
77
+ }
78
+ });
79
+ setIsDeleteModalOpen(true);
80
+ }, [agent.id, createAnalyticsEvent]);
65
81
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
66
82
  space: "space.100",
67
83
  xcss: actionsWrapperStyles
@@ -84,8 +100,7 @@ export const AgentActions = ({
84
100
  xcss: chatPillTextStyles
85
101
  }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/React.createElement(AgentDropdownMenu, {
86
102
  agentId: agent.id,
87
- isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
88
- onDeleteAgent: () => setIsDeleteModalOpen(true),
103
+ onDeleteAgent: handleDeleteAgent,
89
104
  onEditAgent: onEditAgent,
90
105
  onDuplicateAgent: onDuplicateAgent,
91
106
  onCopyAgent: onCopyAgent,
@@ -29,10 +29,8 @@ const cardContainerStyles = xcss({
29
29
  const AgentProfileCard = ({
30
30
  agent,
31
31
  isLoading,
32
- isCreatedByViewingUser,
33
32
  cloudId,
34
33
  onChatClick,
35
- product = 'rovo',
36
34
  hasError,
37
35
  errorType,
38
36
  onConversationStartersClick,
@@ -48,7 +46,8 @@ const AgentProfileCard = ({
48
46
  onConversationStarter,
49
47
  onViewFullProfile
50
48
  } = useAgentUrlActions({
51
- cloudId: cloudId || ''
49
+ cloudId: cloudId || '',
50
+ source: 'agentProfileCard'
52
51
  });
53
52
  const [isStarred, setIsStarred] = useState(false);
54
53
  const [starCount, setStarCount] = useState();
@@ -174,7 +173,6 @@ const AgentProfileCard = ({
174
173
  }
175
174
  })), /*#__PURE__*/React.createElement(AgentActions, {
176
175
  agent: agent,
177
- isAgentCreatedByCurrentUser: isCreatedByViewingUser,
178
176
  onEditAgent: () => onEditAgent(agent.id),
179
177
  onCopyAgent: () => onCopyAgent(agent.id),
180
178
  onDuplicateAgent: () => onDuplicateAgent(agent.id),
@@ -98,8 +98,6 @@ export const AgentProfileCardResourced = props => {
98
98
  agent: agentData,
99
99
  isLoading: isLoading,
100
100
  hasError: !!error,
101
- isCreatedByViewingUser: creatorUserId === props.viewingUserId,
102
- product: props.product,
103
101
  onConversationStartersClick: props.onConversationStartersClick,
104
102
  onChatClick: props.onChatClick,
105
103
  addFlag: props.addFlag,
@@ -89,15 +89,12 @@ export const AgentProfileCardTrigger = ({
89
89
  profileData,
90
90
  error
91
91
  }) => {
92
- var _profileData$creatorI;
93
92
  return /*#__PURE__*/React.createElement(Suspense, {
94
93
  fallback: null
95
94
  }, /*#__PURE__*/React.createElement(AgentProfileCardLazy, {
96
95
  agent: profileData,
97
96
  hasError: !!error,
98
- isCreatedByViewingUser: (profileData === null || profileData === void 0 ? void 0 : profileData.creatorInfo) && (profileData === null || profileData === void 0 ? void 0 : (_profileData$creatorI = profileData.creatorInfo) === null || _profileData$creatorI === void 0 ? void 0 : _profileData$creatorI.id) === viewingUserId,
99
97
  cloudId: props.cloudId,
100
- product: product,
101
98
  errorType: error,
102
99
  onChatClick: props.onChatClick,
103
100
  onConversationStartersClick: props.onConversationStartersClick,
@@ -1,8 +1,10 @@
1
1
  import { useCallback } from 'react';
2
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
2
3
  import { getATLContextUrl } from '@atlaskit/atlassian-context';
3
4
  import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers';
5
6
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
7
+ import { fireEvent } from '../../../util/analytics';
6
8
  import { encodeParamsToUrl } from '../../../util/url';
7
9
  export const firstCharUpper = str => str.charAt(0).toUpperCase() + str.slice(1);
8
10
  const ROVO_PARAM_PREFIX = 'rovoChat';
@@ -14,11 +16,15 @@ const createRovoParams = params => {
14
16
  return rovoParams;
15
17
  };
16
18
  export const useAgentUrlActions = ({
17
- cloudId
19
+ cloudId,
20
+ source
18
21
  }) => {
19
22
  const {
20
23
  publishWithPostMessage
21
24
  } = useRovoPostMessageToPubsub();
25
+ const {
26
+ createAnalyticsEvent
27
+ } = useAnalyticsEvents();
22
28
  const onEditAgent = useCallback(agentId => {
23
29
  const url = `${getATLContextUrl('home')}/chat/agents/${agentId}/edit`;
24
30
  const urlWithParams = encodeParamsToUrl(url, {
@@ -28,9 +34,27 @@ export const useAgentUrlActions = ({
28
34
  })
29
35
  });
30
36
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
31
- }, [cloudId]);
37
+ fireEvent(createAnalyticsEvent, {
38
+ action: 'clicked',
39
+ actionSubject: 'button',
40
+ actionSubjectId: 'editAgentButton',
41
+ attributes: {
42
+ agentId,
43
+ source
44
+ }
45
+ });
46
+ }, [cloudId, createAnalyticsEvent, source]);
32
47
  const onCopyAgent = agentId => {
33
48
  navigator.clipboard.writeText(`${window.location.origin}/people/agent/${agentId}`);
49
+ fireEvent(createAnalyticsEvent, {
50
+ action: 'clicked',
51
+ actionSubject: 'button',
52
+ actionSubjectId: 'copyAgentLinkButton',
53
+ attributes: {
54
+ agentId,
55
+ source
56
+ }
57
+ });
34
58
  };
35
59
  const onDuplicateAgent = useCallback(agentId => {
36
60
  const baseUrl = `${getATLContextUrl('home')}/chat/agents/new`;
@@ -43,7 +67,16 @@ export const useAgentUrlActions = ({
43
67
  })
44
68
  });
45
69
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
46
- }, [cloudId]);
70
+ fireEvent(createAnalyticsEvent, {
71
+ action: 'clicked',
72
+ actionSubject: 'button',
73
+ actionSubjectId: 'duplicateAgentButton',
74
+ attributes: {
75
+ agentId,
76
+ source
77
+ }
78
+ });
79
+ }, [cloudId, createAnalyticsEvent, source]);
47
80
  const onConversationStarter = ({
48
81
  agentId,
49
82
  prompt
@@ -122,6 +155,15 @@ export const useAgentUrlActions = ({
122
155
  } else {
123
156
  window.open(`${window.location.origin}/people/agent/${agentId}`, '_blank', 'noopener, noreferrer');
124
157
  }
158
+ fireEvent(createAnalyticsEvent, {
159
+ action: 'clicked',
160
+ actionSubject: 'button',
161
+ actionSubjectId: 'viewAgentFullProfileButton',
162
+ attributes: {
163
+ agentId,
164
+ source
165
+ }
166
+ });
125
167
  };
126
168
  return {
127
169
  onEditAgent,
@@ -19,9 +19,7 @@ function ProfileCardContent({
19
19
  userId,
20
20
  cloudId,
21
21
  resourceClient,
22
- viewingUserId,
23
22
  trigger,
24
- product,
25
23
  isAgent,
26
24
  profileCardAction,
27
25
  hasError,
@@ -34,9 +32,7 @@ function ProfileCardContent({
34
32
  accountId: userId,
35
33
  cloudId: cloudId,
36
34
  resourceClient: resourceClient,
37
- viewingUserId: viewingUserId,
38
35
  trigger: trigger,
39
- product: product,
40
36
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
41
37
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
42
38
  addFlag: addFlag
@@ -21,7 +21,7 @@ export const TeamConnections = ({
21
21
  containerIcon,
22
22
  link
23
23
  }) => {
24
- const isContainerIconEnabled = fg('enable_web_links_in_team_containers') || fg('loom_tab_in_container_linker_team_profile_page');
24
+ const isContainerIconEnabled = fg('loom_tab_in_container_linker_team_profile_page');
25
25
  const {
26
26
  description,
27
27
  icon,
@@ -86,7 +86,7 @@ export const NewTeamConnections = ({
86
86
  containerIcon,
87
87
  link
88
88
  }) => {
89
- const isContainerIconEnabled = fg('enable_web_links_in_team_containers') || fg('loom_tab_in_container_linker_team_profile_page');
89
+ const isContainerIconEnabled = fg('loom_tab_in_container_linker_team_profile_page');
90
90
  const {
91
91
  description,
92
92
  icon,
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "23.21.19",
35
+ packageVersion: "23.21.21",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -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', "23.21.19");
7
+ headers.append('atl-client-version', "23.21.21");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -56,7 +56,7 @@ export var addHeaders = function addHeaders(headers) {
56
56
  headers.append('X-ExperimentalApi', 'teams-beta');
57
57
  headers.append('X-ExperimentalApi', 'team-members-beta');
58
58
  headers.append('atl-client-name', "@atlaskit/profilecard");
59
- headers.append('atl-client-version', "23.21.19");
59
+ headers.append('atl-client-version', "23.21.21");
60
60
  return headers;
61
61
  };
62
62
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -3,10 +3,12 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useCallback, useState } from 'react';
5
5
  import { defineMessages, useIntl } from 'react-intl-next';
6
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
7
  import Button from '@atlaskit/button/new';
7
8
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
8
9
  import { Box, Inline, xcss } from '@atlaskit/primitives';
9
10
  import { AgentDropdownMenu, ChatPillIcon } from '@atlaskit/rovo-agent-components';
11
+ import { fireEvent } from '../../util/analytics';
10
12
  import { AgentDeleteConfirmationModal } from './AgentDeleteConfirmationModal';
11
13
  var chatToAgentButtonContainer = xcss({
12
14
  width: '100%'
@@ -38,8 +40,7 @@ var actionsWrapperStyles = xcss({
38
40
  color: 'color.text'
39
41
  });
40
42
  export var AgentActions = function AgentActions(_ref) {
41
- var isAgentCreatedByCurrentUser = _ref.isAgentCreatedByCurrentUser,
42
- onEditAgent = _ref.onEditAgent,
43
+ var onEditAgent = _ref.onEditAgent,
43
44
  onDeleteAgent = _ref.onDeleteAgent,
44
45
  onDuplicateAgent = _ref.onDuplicateAgent,
45
46
  onCopyAgent = _ref.onCopyAgent,
@@ -49,6 +50,8 @@ export var AgentActions = function AgentActions(_ref) {
49
50
  resourceClient = _ref.resourceClient;
50
51
  var _useIntl = useIntl(),
51
52
  formatMessage = _useIntl.formatMessage;
53
+ var _useAnalyticsEvents = useAnalyticsEvents(),
54
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
52
55
  var _useState = useState(false),
53
56
  _useState2 = _slicedToArray(_useState, 2),
54
57
  isDeleteModalOpen = _useState2[0],
@@ -76,6 +79,18 @@ export var AgentActions = function AgentActions(_ref) {
76
79
  }
77
80
  }, _callee);
78
81
  })), [agent.id, resourceClient]);
82
+ var handleDeleteAgent = useCallback(function () {
83
+ fireEvent(createAnalyticsEvent, {
84
+ action: 'clicked',
85
+ actionSubject: 'button',
86
+ actionSubjectId: 'deleteAgentButton',
87
+ attributes: {
88
+ agentId: agent.id,
89
+ source: 'agentProfileCard'
90
+ }
91
+ });
92
+ setIsDeleteModalOpen(true);
93
+ }, [agent.id, createAnalyticsEvent]);
79
94
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
80
95
  space: "space.100",
81
96
  xcss: actionsWrapperStyles
@@ -98,10 +113,7 @@ export var AgentActions = function AgentActions(_ref) {
98
113
  xcss: chatPillTextStyles
99
114
  }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/React.createElement(AgentDropdownMenu, {
100
115
  agentId: agent.id,
101
- isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
102
- onDeleteAgent: function onDeleteAgent() {
103
- return setIsDeleteModalOpen(true);
104
- },
116
+ onDeleteAgent: handleDeleteAgent,
105
117
  onEditAgent: onEditAgent,
106
118
  onDuplicateAgent: onDuplicateAgent,
107
119
  onCopyAgent: onCopyAgent,
@@ -33,18 +33,16 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
33
33
  var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
34
34
  var agent = _ref.agent,
35
35
  isLoading = _ref.isLoading,
36
- isCreatedByViewingUser = _ref.isCreatedByViewingUser,
37
36
  cloudId = _ref.cloudId,
38
37
  _onChatClick = _ref.onChatClick,
39
- _ref$product = _ref.product,
40
- product = _ref$product === void 0 ? 'rovo' : _ref$product,
41
38
  hasError = _ref.hasError,
42
39
  errorType = _ref.errorType,
43
40
  onConversationStartersClick = _ref.onConversationStartersClick,
44
41
  resourceClient = _ref.resourceClient,
45
42
  addFlag = _ref.addFlag;
46
43
  var _useAgentUrlActions = useAgentUrlActions({
47
- cloudId: cloudId || ''
44
+ cloudId: cloudId || '',
45
+ source: 'agentProfileCard'
48
46
  }),
49
47
  _onEditAgent = _useAgentUrlActions.onEditAgent,
50
48
  _onCopyAgent = _useAgentUrlActions.onCopyAgent,
@@ -211,7 +209,6 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
211
209
  }
212
210
  })), /*#__PURE__*/React.createElement(AgentActions, {
213
211
  agent: agent,
214
- isAgentCreatedByCurrentUser: isCreatedByViewingUser,
215
212
  onEditAgent: function onEditAgent() {
216
213
  return _onEditAgent(agent.id);
217
214
  },
@@ -157,8 +157,6 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
157
157
  agent: agentData,
158
158
  isLoading: isLoading,
159
159
  hasError: !!error,
160
- isCreatedByViewingUser: creatorUserId === props.viewingUserId,
161
- product: props.product,
162
160
  onConversationStartersClick: props.onConversationStartersClick,
163
161
  onChatClick: props.onChatClick,
164
162
  addFlag: props.addFlag,
@@ -132,7 +132,6 @@ export var AgentProfileCardTrigger = function AgentProfileCardTrigger(_ref) {
132
132
  };
133
133
  }();
134
134
  var renderProfileCard = function renderProfileCard(_ref4) {
135
- var _profileData$creatorI;
136
135
  var profileData = _ref4.profileData,
137
136
  error = _ref4.error;
138
137
  return /*#__PURE__*/React.createElement(Suspense, {
@@ -140,9 +139,7 @@ export var AgentProfileCardTrigger = function AgentProfileCardTrigger(_ref) {
140
139
  }, /*#__PURE__*/React.createElement(AgentProfileCardLazy, {
141
140
  agent: profileData,
142
141
  hasError: !!error,
143
- isCreatedByViewingUser: (profileData === null || profileData === void 0 ? void 0 : profileData.creatorInfo) && (profileData === null || profileData === void 0 || (_profileData$creatorI = profileData.creatorInfo) === null || _profileData$creatorI === void 0 ? void 0 : _profileData$creatorI.id) === viewingUserId,
144
142
  cloudId: props.cloudId,
145
- product: product,
146
143
  errorType: error,
147
144
  onChatClick: props.onChatClick,
148
145
  onConversationStartersClick: props.onConversationStartersClick,
@@ -3,10 +3,12 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import { useCallback } from 'react';
6
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
7
  import { getATLContextUrl } from '@atlaskit/atlassian-context';
7
8
  import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers';
9
10
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
11
+ import { fireEvent } from '../../../util/analytics';
10
12
  import { encodeParamsToUrl } from '../../../util/url';
11
13
  export var firstCharUpper = function firstCharUpper(str) {
12
14
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -23,9 +25,12 @@ var createRovoParams = function createRovoParams(params) {
23
25
  return rovoParams;
24
26
  };
25
27
  export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
26
- var cloudId = _ref3.cloudId;
28
+ var cloudId = _ref3.cloudId,
29
+ source = _ref3.source;
27
30
  var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
28
31
  publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
32
+ var _useAnalyticsEvents = useAnalyticsEvents(),
33
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
29
34
  var onEditAgent = useCallback(function (agentId) {
30
35
  var url = "".concat(getATLContextUrl('home'), "/chat/agents/").concat(agentId, "/edit");
31
36
  var urlWithParams = encodeParamsToUrl(url, _objectSpread({
@@ -34,9 +39,27 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
34
39
  cloudId: cloudId
35
40
  })));
36
41
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
37
- }, [cloudId]);
42
+ fireEvent(createAnalyticsEvent, {
43
+ action: 'clicked',
44
+ actionSubject: 'button',
45
+ actionSubjectId: 'editAgentButton',
46
+ attributes: {
47
+ agentId: agentId,
48
+ source: source
49
+ }
50
+ });
51
+ }, [cloudId, createAnalyticsEvent, source]);
38
52
  var onCopyAgent = function onCopyAgent(agentId) {
39
53
  navigator.clipboard.writeText("".concat(window.location.origin, "/people/agent/").concat(agentId));
54
+ fireEvent(createAnalyticsEvent, {
55
+ action: 'clicked',
56
+ actionSubject: 'button',
57
+ actionSubjectId: 'copyAgentLinkButton',
58
+ attributes: {
59
+ agentId: agentId,
60
+ source: source
61
+ }
62
+ });
40
63
  };
41
64
  var onDuplicateAgent = useCallback(function (agentId) {
42
65
  var baseUrl = "".concat(getATLContextUrl('home'), "/chat/agents/new");
@@ -48,7 +71,16 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
48
71
  pathway: 'agents-create'
49
72
  })));
50
73
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
51
- }, [cloudId]);
74
+ fireEvent(createAnalyticsEvent, {
75
+ action: 'clicked',
76
+ actionSubject: 'button',
77
+ actionSubjectId: 'duplicateAgentButton',
78
+ attributes: {
79
+ agentId: agentId,
80
+ source: source
81
+ }
82
+ });
83
+ }, [cloudId, createAnalyticsEvent, source]);
52
84
  var onConversationStarter = function onConversationStarter(_ref4) {
53
85
  var agentId = _ref4.agentId,
54
86
  prompt = _ref4.prompt;
@@ -123,6 +155,15 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
123
155
  } else {
124
156
  window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
125
157
  }
158
+ fireEvent(createAnalyticsEvent, {
159
+ action: 'clicked',
160
+ actionSubject: 'button',
161
+ actionSubjectId: 'viewAgentFullProfileButton',
162
+ attributes: {
163
+ agentId: agentId,
164
+ source: source
165
+ }
166
+ });
126
167
  };
127
168
  return {
128
169
  onEditAgent: onEditAgent,
@@ -29,9 +29,7 @@ function ProfileCardContent(_ref) {
29
29
  userId = _ref.userId,
30
30
  cloudId = _ref.cloudId,
31
31
  resourceClient = _ref.resourceClient,
32
- viewingUserId = _ref.viewingUserId,
33
32
  trigger = _ref.trigger,
34
- product = _ref.product,
35
33
  isAgent = _ref.isAgent,
36
34
  profileCardAction = _ref.profileCardAction,
37
35
  hasError = _ref.hasError,
@@ -43,9 +41,7 @@ function ProfileCardContent(_ref) {
43
41
  accountId: userId,
44
42
  cloudId: cloudId,
45
43
  resourceClient: resourceClient,
46
- viewingUserId: viewingUserId,
47
44
  trigger: trigger,
48
- product: product,
49
45
  onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
50
46
  onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
51
47
  addFlag: addFlag
@@ -20,7 +20,7 @@ export var TeamConnections = function TeamConnections(_ref) {
20
20
  title = _ref.title,
21
21
  containerIcon = _ref.containerIcon,
22
22
  link = _ref.link;
23
- var isContainerIconEnabled = fg('enable_web_links_in_team_containers') || fg('loom_tab_in_container_linker_team_profile_page');
23
+ var isContainerIconEnabled = fg('loom_tab_in_container_linker_team_profile_page');
24
24
  var _getContainerProperti = getContainerProperties({
25
25
  containerType: containerType,
26
26
  iconSize: 'medium',
@@ -82,7 +82,7 @@ export var NewTeamConnections = function NewTeamConnections(_ref2) {
82
82
  title = _ref2.title,
83
83
  containerIcon = _ref2.containerIcon,
84
84
  link = _ref2.link;
85
- var isContainerIconEnabled = fg('enable_web_links_in_team_containers') || fg('loom_tab_in_container_linker_team_profile_page');
85
+ var isContainerIconEnabled = fg('loom_tab_in_container_linker_team_profile_page');
86
86
  var _getContainerProperti2 = getContainerProperties({
87
87
  containerType: containerType,
88
88
  iconSize: 'medium',
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "23.21.19"
42
+ packageVersion: "23.21.21"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { type ProfileClient, type RovoAgentProfileCardInfo } from '../../types';
3
3
  type AgentActionsProps = {
4
4
  agent: RovoAgentProfileCardInfo;
5
- isAgentCreatedByCurrentUser?: boolean;
6
5
  onEditAgent: () => void;
7
6
  onCopyAgent: () => void;
8
7
  onDuplicateAgent: () => void;
@@ -11,5 +10,5 @@ type AgentActionsProps = {
11
10
  onViewFullProfileClick: () => void;
12
11
  resourceClient: ProfileClient;
13
12
  };
14
- export declare const AgentActions: ({ isAgentCreatedByCurrentUser, onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, }: AgentActionsProps) => React.JSX.Element;
13
+ export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, }: AgentActionsProps) => React.JSX.Element;
15
14
  export {};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type AgentProfileCardProps } from '../../types';
3
- declare const AgentProfileCard: ({ agent, isLoading, isCreatedByViewingUser, cloudId, onChatClick, product, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: AgentProfileCardProps) => React.JSX.Element;
3
+ declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: AgentProfileCardProps) => React.JSX.Element;
4
4
  export default AgentProfileCard;
@@ -6,8 +6,6 @@ export type AgentProfileCardResourcedProps = {
6
6
  resourceClient: ProfileClient;
7
7
  trigger?: TriggerType;
8
8
  children?: React.ReactNode;
9
- viewingUserId?: string;
10
- product?: string;
11
9
  addFlag?: (flag: Flag) => void;
12
10
  } & AgentActionsType;
13
11
  export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export declare const firstCharUpper: (str: string) => string;
2
- export declare const useAgentUrlActions: ({ cloudId }: {
2
+ export declare const useAgentUrlActions: ({ cloudId, source }: {
3
3
  cloudId: string;
4
+ source: string;
4
5
  }) => {
5
6
  onEditAgent: (agentId: string) => void;
6
7
  onCopyAgent: (agentId: string) => void;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, isCreatedByViewingUser, cloudId, onChatClick, product, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: import("../../types").AgentProfileCardProps) => import("react").JSX.Element>;
2
+ export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: import("../../types").AgentProfileCardProps) => import("react").JSX.Element>;
@@ -356,9 +356,7 @@ export type AgentProfileCardProps = {
356
356
  agent?: RovoAgentProfileCardInfo;
357
357
  isLoading?: boolean;
358
358
  hasError?: boolean;
359
- isCreatedByViewingUser?: boolean;
360
359
  cloudId?: string;
361
- product?: string;
362
360
  errorType?: ProfileCardErrorType;
363
361
  addFlag?: (flag: Flag) => void;
364
362
  } & AgentActionsType;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { type ProfileClient, type RovoAgentProfileCardInfo } from '../../types';
3
3
  type AgentActionsProps = {
4
4
  agent: RovoAgentProfileCardInfo;
5
- isAgentCreatedByCurrentUser?: boolean;
6
5
  onEditAgent: () => void;
7
6
  onCopyAgent: () => void;
8
7
  onDuplicateAgent: () => void;
@@ -11,5 +10,5 @@ type AgentActionsProps = {
11
10
  onViewFullProfileClick: () => void;
12
11
  resourceClient: ProfileClient;
13
12
  };
14
- export declare const AgentActions: ({ isAgentCreatedByCurrentUser, onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, }: AgentActionsProps) => React.JSX.Element;
13
+ export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, }: AgentActionsProps) => React.JSX.Element;
15
14
  export {};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type AgentProfileCardProps } from '../../types';
3
- declare const AgentProfileCard: ({ agent, isLoading, isCreatedByViewingUser, cloudId, onChatClick, product, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: AgentProfileCardProps) => React.JSX.Element;
3
+ declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: AgentProfileCardProps) => React.JSX.Element;
4
4
  export default AgentProfileCard;
@@ -6,8 +6,6 @@ export type AgentProfileCardResourcedProps = {
6
6
  resourceClient: ProfileClient;
7
7
  trigger?: TriggerType;
8
8
  children?: React.ReactNode;
9
- viewingUserId?: string;
10
- product?: string;
11
9
  addFlag?: (flag: Flag) => void;
12
10
  } & AgentActionsType;
13
11
  export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export declare const firstCharUpper: (str: string) => string;
2
- export declare const useAgentUrlActions: ({ cloudId }: {
2
+ export declare const useAgentUrlActions: ({ cloudId, source }: {
3
3
  cloudId: string;
4
+ source: string;
4
5
  }) => {
5
6
  onEditAgent: (agentId: string) => void;
6
7
  onCopyAgent: (agentId: string) => void;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, isCreatedByViewingUser, cloudId, onChatClick, product, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: import("../../types").AgentProfileCardProps) => import("react").JSX.Element>;
2
+ export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, }: import("../../types").AgentProfileCardProps) => import("react").JSX.Element>;
@@ -362,9 +362,7 @@ export type AgentProfileCardProps = {
362
362
  agent?: RovoAgentProfileCardInfo;
363
363
  isLoading?: boolean;
364
364
  hasError?: boolean;
365
- isCreatedByViewingUser?: boolean;
366
365
  cloudId?: string;
367
- product?: string;
368
366
  errorType?: ProfileCardErrorType;
369
367
  addFlag?: (flag: Flag) => void;
370
368
  } & AgentActionsType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "23.21.20",
3
+ "version": "24.0.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -61,7 +61,7 @@
61
61
  "@atlaskit/feature-gate-js-client": "^5.5.0",
62
62
  "@atlaskit/give-kudos": "^4.3.0",
63
63
  "@atlaskit/heading": "^5.2.0",
64
- "@atlaskit/icon": "^27.7.0",
64
+ "@atlaskit/icon": "^27.8.0",
65
65
  "@atlaskit/link": "^3.2.0",
66
66
  "@atlaskit/logo": "^19.6.0",
67
67
  "@atlaskit/lozenge": "^13.0.0",
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/platform-feature-flags": "^1.1.0",
72
72
  "@atlaskit/popup": "^4.3.0",
73
73
  "@atlaskit/primitives": "^14.11.0",
74
- "@atlaskit/rovo-agent-components": "^2.13.0",
74
+ "@atlaskit/rovo-agent-components": "^3.0.0",
75
75
  "@atlaskit/rovo-triggers": "^3.1.0",
76
76
  "@atlaskit/spinner": "^19.0.0",
77
77
  "@atlaskit/teams-app-config": "^1.10.0",
@@ -171,9 +171,6 @@
171
171
  "loom_tab_in_container_linker_team_profile_page": {
172
172
  "type": "boolean"
173
173
  },
174
- "enable_web_links_in_team_containers": {
175
- "type": "boolean"
176
- },
177
174
  "platform-adopt-teams-nav-config": {
178
175
  "type": "boolean"
179
176
  },
package/tsconfig.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.json",
3
- "compilerOptions": {
4
- },
3
+ "compilerOptions": {},
5
4
  "include": [
6
5
  "./src/**/*.ts",
7
6
  "./src/**/*.tsx",
8
7
  "./docs/**/*.ts",
9
8
  "./docs/**/*.tsx",
10
9
  "./examples/**/*.ts",
11
- "./examples/**/*.tsx"
10
+ "./examples/**/*.tsx",
11
+ "**/stories.ts",
12
+ "**/stories.tsx",
13
+ "**/stories/*.ts",
14
+ "**/stories/*.tsx",
15
+ "**/stories/**/*.ts",
16
+ "**/stories/**/*.tsx"
12
17
  ]
13
18
  }