@atlaskit/profilecard 23.11.2 → 23.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 23.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#140885](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140885)
8
+ [`e8f0bc1586879`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8f0bc1586879) -
9
+ Cleanup FF rovo_use_agent_permissions
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 23.11.2
4
16
 
5
17
  ### Patch Changes
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "23.11.2");
14
+ headers.append('atl-client-version', "23.12.0");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
66
66
  headers.append('X-ExperimentalApi', 'teams-beta');
67
67
  headers.append('X-ExperimentalApi', 'team-members-beta');
68
68
  headers.append('atl-client-name', "@atlaskit/profilecard");
69
- headers.append('atl-client-version', "23.11.2");
69
+ headers.append('atl-client-version', "23.12.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -6,21 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.AgentActions = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
14
12
  var _react = _interopRequireWildcard(require("react"));
15
13
  var _reactIntlNext = require("react-intl-next");
16
- var _new = _interopRequireWildcard(require("@atlaskit/button/new"));
17
- var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
18
- var _showMoreHorizontalMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--more"));
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
20
15
  var _primitives = require("@atlaskit/primitives");
21
16
  var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
22
17
  var _AgentDeleteConfirmationModal = require("./AgentDeleteConfirmationModal");
23
- var _excluded = ["triggerRef"];
24
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
20
  var chatToAgentButtonContainer = (0, _primitives.xcss)({
@@ -52,42 +46,16 @@ var actionsWrapperStyles = (0, _primitives.xcss)({
52
46
  marginBlockStart: 'space.200',
53
47
  color: 'color.text'
54
48
  });
55
- var buildAgentActions = function buildAgentActions(_ref) {
56
- var onDuplicateAgent = _ref.onDuplicateAgent,
49
+ var AgentActions = exports.AgentActions = function AgentActions(_ref) {
50
+ var isAgentCreatedByCurrentUser = _ref.isAgentCreatedByCurrentUser,
51
+ onEditAgent = _ref.onEditAgent,
52
+ onDeleteAgent = _ref.onDeleteAgent,
53
+ onDuplicateAgent = _ref.onDuplicateAgent,
57
54
  onCopyAgent = _ref.onCopyAgent,
58
- isForgeAgent = _ref.isForgeAgent;
59
- return isForgeAgent ? [{
60
- text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionCopyLink),
61
- onClick: onCopyAgent
62
- }] : [{
63
- text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionDuplicate),
64
- onClick: onDuplicateAgent
65
- }, {
66
- text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionCopyLink),
67
- onClick: onCopyAgent
68
- }];
69
- };
70
- var buildAgentSettings = function buildAgentSettings(_ref2) {
71
- var onEditAgent = _ref2.onEditAgent,
72
- onDeleteAgent = _ref2.onDeleteAgent;
73
- return [{
74
- text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionEdit),
75
- onClick: onEditAgent
76
- }, {
77
- text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.actionDelete),
78
- onClick: onDeleteAgent
79
- }];
80
- };
81
- var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
82
- var isAgentCreatedByCurrentUser = _ref3.isAgentCreatedByCurrentUser,
83
- onEditAgent = _ref3.onEditAgent,
84
- onDeleteAgent = _ref3.onDeleteAgent,
85
- onDuplicateAgent = _ref3.onDuplicateAgent,
86
- onCopyAgent = _ref3.onCopyAgent,
87
- onChatClick = _ref3.onChatClick,
88
- onViewFullProfileClick = _ref3.onViewFullProfileClick,
89
- agent = _ref3.agent,
90
- resourceClient = _ref3.resourceClient;
55
+ onChatClick = _ref.onChatClick,
56
+ onViewFullProfileClick = _ref.onViewFullProfileClick,
57
+ agent = _ref.agent,
58
+ resourceClient = _ref.resourceClient;
91
59
  var _useIntl = (0, _reactIntlNext.useIntl)(),
92
60
  formatMessage = _useIntl.formatMessage;
93
61
  var _useState = (0, _react.useState)(false),
@@ -117,17 +85,6 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
117
85
  }
118
86
  }, _callee);
119
87
  })), [agent.id, resourceClient]);
120
- var agentActions = buildAgentActions({
121
- onDuplicateAgent: onDuplicateAgent,
122
- onCopyAgent: onCopyAgent,
123
- isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
124
- });
125
- var agentSetting = buildAgentSettings({
126
- onEditAgent: onEditAgent,
127
- onDeleteAgent: function onDeleteAgent() {
128
- setIsDeleteModalOpen(true);
129
- }
130
- });
131
88
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
132
89
  space: "space.100",
133
90
  xcss: actionsWrapperStyles
@@ -148,7 +105,7 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
148
105
  xcss: chatPillIconWrapper
149
106
  }, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.ChatPillIcon, null)), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
150
107
  xcss: chatPillTextStyles
151
- }, formatMessage(messages.actionChatToAgent)))))), (0, _platformFeatureFlags.fg)('rovo_use_agent_permissions') ? /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentDropdownMenu, {
108
+ }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentDropdownMenu, {
152
109
  agentId: agent.id,
153
110
  isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
154
111
  onDeleteAgent: function onDeleteAgent() {
@@ -163,45 +120,7 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
163
120
  onViewAgentFullProfileClick: onViewFullProfileClick,
164
121
  doesAgentHaveIdentityAccountId: !!agent.identity_account_id,
165
122
  shouldTriggerStopPropagation: true
166
- }) : /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
167
- trigger: function trigger(_ref5) {
168
- var triggerRef = _ref5.triggerRef,
169
- props = (0, _objectWithoutProperties2.default)(_ref5, _excluded);
170
- return /*#__PURE__*/_react.default.createElement(_primitives.Box, null, /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({}, props, {
171
- icon: _showMoreHorizontalMore.default,
172
- label: "more",
173
- ref: triggerRef,
174
- onClick: function onClick(e) {
175
- var _props$onClick;
176
- e.stopPropagation();
177
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
178
- }
179
- })));
180
- },
181
- placement: "bottom-end"
182
- }, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, agentActions.map(function (_ref6, idx) {
183
- var text = _ref6.text,
184
- _onClick = _ref6.onClick;
185
- return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
186
- key: idx,
187
- onClick: function onClick(e) {
188
- e.stopPropagation();
189
- _onClick === null || _onClick === void 0 || _onClick();
190
- }
191
- }, text);
192
- })), isAgentCreatedByCurrentUser && /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, {
193
- hasSeparator: true
194
- }, agentSetting.map(function (_ref7, idx) {
195
- var text = _ref7.text,
196
- _onClick2 = _ref7.onClick;
197
- return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
198
- key: idx,
199
- onClick: function onClick(e) {
200
- e.stopPropagation();
201
- _onClick2 === null || _onClick2 === void 0 || _onClick2();
202
- }
203
- }, text);
204
- })))), /*#__PURE__*/_react.default.createElement(_AgentDeleteConfirmationModal.AgentDeleteConfirmationModal, {
123
+ })), /*#__PURE__*/_react.default.createElement(_AgentDeleteConfirmationModal.AgentDeleteConfirmationModal, {
205
124
  isOpen: isDeleteModalOpen,
206
125
  onClose: function onClose() {
207
126
  setIsDeleteModalOpen(false);
@@ -216,25 +135,5 @@ var messages = (0, _reactIntlNext.defineMessages)({
216
135
  id: 'ptc-directory.agent-profile.action.dropdown.chat-to-agent.nonfinal',
217
136
  defaultMessage: 'Chat to Agent',
218
137
  description: 'Text for the "chat to agent" action to chat to the agent'
219
- },
220
- actionDelete: {
221
- id: 'ptc-directory.agent-profile.action.dropdown.delete.nonfinal',
222
- defaultMessage: 'Delete Agent',
223
- description: 'Text for the "Delete" action to delete an agent'
224
- },
225
- actionEdit: {
226
- id: 'ptc-directory.agent-profile.action.dropdown.edit.nonfinal',
227
- defaultMessage: 'Edit Agent',
228
- description: 'Text for the "Edit" action to edit an agent'
229
- },
230
- actionCopyLink: {
231
- id: 'ptc-directory.agent-profile.action.dropdown.copy-link.nonfinal',
232
- defaultMessage: 'Copy link',
233
- description: 'Text for the Copy link of an agent'
234
- },
235
- actionDuplicate: {
236
- id: 'ptc-directory.agent-profile.action.dropdown.duplicate.nonfinal',
237
- defaultMessage: 'Duplicate Agent',
238
- description: 'Text for the Duplicate Agent action to create a duplicate'
239
138
  }
240
139
  });
@@ -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.11.2"
48
+ packageVersion: "23.12.0"
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.11.2");
9
+ headers.append('atl-client-version', "23.12.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
75
75
  headers.append('X-ExperimentalApi', 'teams-beta');
76
76
  headers.append('X-ExperimentalApi', 'team-members-beta');
77
77
  headers.append('atl-client-name', "@atlaskit/profilecard");
78
- headers.append('atl-client-version', "23.11.2");
78
+ headers.append('atl-client-version', "23.12.0");
79
79
  return headers;
80
80
  };
81
81
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -1,10 +1,6 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React, { useCallback, useState } from 'react';
3
- import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
4
- import Button, { IconButton } from '@atlaskit/button/new';
5
- import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
6
- import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
7
- import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { defineMessages, useIntl } from 'react-intl-next';
3
+ import Button from '@atlaskit/button/new';
8
4
  import { Box, Inline, xcss } from '@atlaskit/primitives';
9
5
  import { AgentDropdownMenu, ChatPillIcon } from '@atlaskit/rovo-agent-components';
10
6
  import { AgentDeleteConfirmationModal } from './AgentDeleteConfirmationModal';
@@ -37,34 +33,6 @@ const actionsWrapperStyles = xcss({
37
33
  marginBlockStart: 'space.200',
38
34
  color: 'color.text'
39
35
  });
40
- const buildAgentActions = ({
41
- onDuplicateAgent,
42
- onCopyAgent,
43
- isForgeAgent
44
- }) => {
45
- return isForgeAgent ? [{
46
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
47
- onClick: onCopyAgent
48
- }] : [{
49
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDuplicate),
50
- onClick: onDuplicateAgent
51
- }, {
52
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
53
- onClick: onCopyAgent
54
- }];
55
- };
56
- const buildAgentSettings = ({
57
- onEditAgent,
58
- onDeleteAgent
59
- }) => {
60
- return [{
61
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionEdit),
62
- onClick: onEditAgent
63
- }, {
64
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDelete),
65
- onClick: onDeleteAgent
66
- }];
67
- };
68
36
  export const AgentActions = ({
69
37
  isAgentCreatedByCurrentUser,
70
38
  onEditAgent,
@@ -93,17 +61,6 @@ export const AgentActions = ({
93
61
  isDeleteEnabled: AGENT_DEACTIVATE.permitted
94
62
  };
95
63
  }, [agent.id, resourceClient]);
96
- const agentActions = buildAgentActions({
97
- onDuplicateAgent,
98
- onCopyAgent,
99
- isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
100
- });
101
- const agentSetting = buildAgentSettings({
102
- onEditAgent,
103
- onDeleteAgent: () => {
104
- setIsDeleteModalOpen(true);
105
- }
106
- });
107
64
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
108
65
  space: "space.100",
109
66
  xcss: actionsWrapperStyles
@@ -124,7 +81,7 @@ export const AgentActions = ({
124
81
  xcss: chatPillIconWrapper
125
82
  }, /*#__PURE__*/React.createElement(ChatPillIcon, null)), /*#__PURE__*/React.createElement(Box, {
126
83
  xcss: chatPillTextStyles
127
- }, formatMessage(messages.actionChatToAgent)))))), fg('rovo_use_agent_permissions') ? /*#__PURE__*/React.createElement(AgentDropdownMenu, {
84
+ }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/React.createElement(AgentDropdownMenu, {
128
85
  agentId: agent.id,
129
86
  isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
130
87
  onDeleteAgent: () => setIsDeleteModalOpen(true),
@@ -137,46 +94,7 @@ export const AgentActions = ({
137
94
  onViewAgentFullProfileClick: onViewFullProfileClick,
138
95
  doesAgentHaveIdentityAccountId: !!agent.identity_account_id,
139
96
  shouldTriggerStopPropagation: true
140
- }) : /*#__PURE__*/React.createElement(DropdownMenu, {
141
- trigger: ({
142
- triggerRef,
143
- ...props
144
- }) => /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
145
- icon: MoreIcon,
146
- label: "more",
147
- ref: triggerRef,
148
- onClick: e => {
149
- var _props$onClick;
150
- e.stopPropagation();
151
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
152
- }
153
- }))),
154
- placement: "bottom-end"
155
- }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, agentActions.map(({
156
- text,
157
- onClick
158
- }, idx) => {
159
- return /*#__PURE__*/React.createElement(DropdownItem, {
160
- key: idx,
161
- onClick: e => {
162
- e.stopPropagation();
163
- onClick === null || onClick === void 0 ? void 0 : onClick();
164
- }
165
- }, text);
166
- })), isAgentCreatedByCurrentUser && /*#__PURE__*/React.createElement(DropdownItemGroup, {
167
- hasSeparator: true
168
- }, agentSetting.map(({
169
- text,
170
- onClick
171
- }, idx) => {
172
- return /*#__PURE__*/React.createElement(DropdownItem, {
173
- key: idx,
174
- onClick: e => {
175
- e.stopPropagation();
176
- onClick === null || onClick === void 0 ? void 0 : onClick();
177
- }
178
- }, text);
179
- })))), /*#__PURE__*/React.createElement(AgentDeleteConfirmationModal, {
97
+ })), /*#__PURE__*/React.createElement(AgentDeleteConfirmationModal, {
180
98
  isOpen: isDeleteModalOpen,
181
99
  onClose: () => {
182
100
  setIsDeleteModalOpen(false);
@@ -191,25 +109,5 @@ const messages = defineMessages({
191
109
  id: 'ptc-directory.agent-profile.action.dropdown.chat-to-agent.nonfinal',
192
110
  defaultMessage: 'Chat to Agent',
193
111
  description: 'Text for the "chat to agent" action to chat to the agent'
194
- },
195
- actionDelete: {
196
- id: 'ptc-directory.agent-profile.action.dropdown.delete.nonfinal',
197
- defaultMessage: 'Delete Agent',
198
- description: 'Text for the "Delete" action to delete an agent'
199
- },
200
- actionEdit: {
201
- id: 'ptc-directory.agent-profile.action.dropdown.edit.nonfinal',
202
- defaultMessage: 'Edit Agent',
203
- description: 'Text for the "Edit" action to edit an agent'
204
- },
205
- actionCopyLink: {
206
- id: 'ptc-directory.agent-profile.action.dropdown.copy-link.nonfinal',
207
- defaultMessage: 'Copy link',
208
- description: 'Text for the Copy link of an agent'
209
- },
210
- actionDuplicate: {
211
- id: 'ptc-directory.agent-profile.action.dropdown.duplicate.nonfinal',
212
- defaultMessage: 'Duplicate Agent',
213
- description: 'Text for the Duplicate Agent action to create a duplicate'
214
112
  }
215
113
  });
@@ -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.11.2",
35
+ packageVersion: "23.12.0",
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.11.2");
7
+ headers.append('atl-client-version', "23.12.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -57,7 +57,7 @@ export var addHeaders = function addHeaders(headers) {
57
57
  headers.append('X-ExperimentalApi', 'teams-beta');
58
58
  headers.append('X-ExperimentalApi', 'team-members-beta');
59
59
  headers.append('atl-client-name', "@atlaskit/profilecard");
60
- headers.append('atl-client-version', "23.11.2");
60
+ headers.append('atl-client-version', "23.12.0");
61
61
  return headers;
62
62
  };
63
63
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -1,15 +1,9 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
- var _excluded = ["triggerRef"];
6
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
4
  import React, { useCallback, useState } from 'react';
8
- import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
9
- import Button, { IconButton } from '@atlaskit/button/new';
10
- import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
11
- import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
12
- import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { defineMessages, useIntl } from 'react-intl-next';
6
+ import Button from '@atlaskit/button/new';
13
7
  import { Box, Inline, xcss } from '@atlaskit/primitives';
14
8
  import { AgentDropdownMenu, ChatPillIcon } from '@atlaskit/rovo-agent-components';
15
9
  import { AgentDeleteConfirmationModal } from './AgentDeleteConfirmationModal';
@@ -42,42 +36,16 @@ var actionsWrapperStyles = xcss({
42
36
  marginBlockStart: 'space.200',
43
37
  color: 'color.text'
44
38
  });
45
- var buildAgentActions = function buildAgentActions(_ref) {
46
- var onDuplicateAgent = _ref.onDuplicateAgent,
39
+ export var AgentActions = function AgentActions(_ref) {
40
+ var isAgentCreatedByCurrentUser = _ref.isAgentCreatedByCurrentUser,
41
+ onEditAgent = _ref.onEditAgent,
42
+ onDeleteAgent = _ref.onDeleteAgent,
43
+ onDuplicateAgent = _ref.onDuplicateAgent,
47
44
  onCopyAgent = _ref.onCopyAgent,
48
- isForgeAgent = _ref.isForgeAgent;
49
- return isForgeAgent ? [{
50
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
51
- onClick: onCopyAgent
52
- }] : [{
53
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDuplicate),
54
- onClick: onDuplicateAgent
55
- }, {
56
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionCopyLink),
57
- onClick: onCopyAgent
58
- }];
59
- };
60
- var buildAgentSettings = function buildAgentSettings(_ref2) {
61
- var onEditAgent = _ref2.onEditAgent,
62
- onDeleteAgent = _ref2.onDeleteAgent;
63
- return [{
64
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionEdit),
65
- onClick: onEditAgent
66
- }, {
67
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.actionDelete),
68
- onClick: onDeleteAgent
69
- }];
70
- };
71
- export var AgentActions = function AgentActions(_ref3) {
72
- var isAgentCreatedByCurrentUser = _ref3.isAgentCreatedByCurrentUser,
73
- onEditAgent = _ref3.onEditAgent,
74
- onDeleteAgent = _ref3.onDeleteAgent,
75
- onDuplicateAgent = _ref3.onDuplicateAgent,
76
- onCopyAgent = _ref3.onCopyAgent,
77
- onChatClick = _ref3.onChatClick,
78
- onViewFullProfileClick = _ref3.onViewFullProfileClick,
79
- agent = _ref3.agent,
80
- resourceClient = _ref3.resourceClient;
45
+ onChatClick = _ref.onChatClick,
46
+ onViewFullProfileClick = _ref.onViewFullProfileClick,
47
+ agent = _ref.agent,
48
+ resourceClient = _ref.resourceClient;
81
49
  var _useIntl = useIntl(),
82
50
  formatMessage = _useIntl.formatMessage;
83
51
  var _useState = useState(false),
@@ -107,17 +75,6 @@ export var AgentActions = function AgentActions(_ref3) {
107
75
  }
108
76
  }, _callee);
109
77
  })), [agent.id, resourceClient]);
110
- var agentActions = buildAgentActions({
111
- onDuplicateAgent: onDuplicateAgent,
112
- onCopyAgent: onCopyAgent,
113
- isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY'
114
- });
115
- var agentSetting = buildAgentSettings({
116
- onEditAgent: onEditAgent,
117
- onDeleteAgent: function onDeleteAgent() {
118
- setIsDeleteModalOpen(true);
119
- }
120
- });
121
78
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
122
79
  space: "space.100",
123
80
  xcss: actionsWrapperStyles
@@ -138,7 +95,7 @@ export var AgentActions = function AgentActions(_ref3) {
138
95
  xcss: chatPillIconWrapper
139
96
  }, /*#__PURE__*/React.createElement(ChatPillIcon, null)), /*#__PURE__*/React.createElement(Box, {
140
97
  xcss: chatPillTextStyles
141
- }, formatMessage(messages.actionChatToAgent)))))), fg('rovo_use_agent_permissions') ? /*#__PURE__*/React.createElement(AgentDropdownMenu, {
98
+ }, formatMessage(messages.actionChatToAgent)))))), /*#__PURE__*/React.createElement(AgentDropdownMenu, {
142
99
  agentId: agent.id,
143
100
  isAgentCreatedByUser: isAgentCreatedByCurrentUser !== null && isAgentCreatedByCurrentUser !== void 0 ? isAgentCreatedByCurrentUser : false,
144
101
  onDeleteAgent: function onDeleteAgent() {
@@ -153,45 +110,7 @@ export var AgentActions = function AgentActions(_ref3) {
153
110
  onViewAgentFullProfileClick: onViewFullProfileClick,
154
111
  doesAgentHaveIdentityAccountId: !!agent.identity_account_id,
155
112
  shouldTriggerStopPropagation: true
156
- }) : /*#__PURE__*/React.createElement(DropdownMenu, {
157
- trigger: function trigger(_ref5) {
158
- var triggerRef = _ref5.triggerRef,
159
- props = _objectWithoutProperties(_ref5, _excluded);
160
- return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
161
- icon: MoreIcon,
162
- label: "more",
163
- ref: triggerRef,
164
- onClick: function onClick(e) {
165
- var _props$onClick;
166
- e.stopPropagation();
167
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
168
- }
169
- })));
170
- },
171
- placement: "bottom-end"
172
- }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, agentActions.map(function (_ref6, idx) {
173
- var text = _ref6.text,
174
- _onClick = _ref6.onClick;
175
- return /*#__PURE__*/React.createElement(DropdownItem, {
176
- key: idx,
177
- onClick: function onClick(e) {
178
- e.stopPropagation();
179
- _onClick === null || _onClick === void 0 || _onClick();
180
- }
181
- }, text);
182
- })), isAgentCreatedByCurrentUser && /*#__PURE__*/React.createElement(DropdownItemGroup, {
183
- hasSeparator: true
184
- }, agentSetting.map(function (_ref7, idx) {
185
- var text = _ref7.text,
186
- _onClick2 = _ref7.onClick;
187
- return /*#__PURE__*/React.createElement(DropdownItem, {
188
- key: idx,
189
- onClick: function onClick(e) {
190
- e.stopPropagation();
191
- _onClick2 === null || _onClick2 === void 0 || _onClick2();
192
- }
193
- }, text);
194
- })))), /*#__PURE__*/React.createElement(AgentDeleteConfirmationModal, {
113
+ })), /*#__PURE__*/React.createElement(AgentDeleteConfirmationModal, {
195
114
  isOpen: isDeleteModalOpen,
196
115
  onClose: function onClose() {
197
116
  setIsDeleteModalOpen(false);
@@ -206,25 +125,5 @@ var messages = defineMessages({
206
125
  id: 'ptc-directory.agent-profile.action.dropdown.chat-to-agent.nonfinal',
207
126
  defaultMessage: 'Chat to Agent',
208
127
  description: 'Text for the "chat to agent" action to chat to the agent'
209
- },
210
- actionDelete: {
211
- id: 'ptc-directory.agent-profile.action.dropdown.delete.nonfinal',
212
- defaultMessage: 'Delete Agent',
213
- description: 'Text for the "Delete" action to delete an agent'
214
- },
215
- actionEdit: {
216
- id: 'ptc-directory.agent-profile.action.dropdown.edit.nonfinal',
217
- defaultMessage: 'Edit Agent',
218
- description: 'Text for the "Edit" action to edit an agent'
219
- },
220
- actionCopyLink: {
221
- id: 'ptc-directory.agent-profile.action.dropdown.copy-link.nonfinal',
222
- defaultMessage: 'Copy link',
223
- description: 'Text for the Copy link of an agent'
224
- },
225
- actionDuplicate: {
226
- id: 'ptc-directory.agent-profile.action.dropdown.duplicate.nonfinal',
227
- defaultMessage: 'Duplicate Agent',
228
- description: 'Text for the Duplicate Agent action to create a duplicate'
229
128
  }
230
129
  });
@@ -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.11.2"
42
+ packageVersion: "23.12.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
- import { ButtonSectionProps } from './team-actions';
3
+ import { type ButtonSectionProps } from './team-actions';
4
4
  type TeamProfileCardProps = {
5
5
  containerId: string;
6
6
  teamId: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ActionItem } from './more-actions';
2
+ import { type ActionItem } from './more-actions';
3
3
  type BaseButtonSectionProps = {
4
4
  teamProfileUrl?: string;
5
5
  otherActions?: ActionItem[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
- import { ButtonSectionProps } from './team-actions';
3
+ import { type ButtonSectionProps } from './team-actions';
4
4
  type TeamProfileCardProps = {
5
5
  containerId: string;
6
6
  teamId: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ActionItem } from './more-actions';
2
+ import { type ActionItem } from './more-actions';
3
3
  type BaseButtonSectionProps = {
4
4
  teamProfileUrl?: string;
5
5
  otherActions?: ActionItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "23.11.2",
3
+ "version": "23.12.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -136,9 +136,6 @@
136
136
  "platform_agg_user_query_doc_change": {
137
137
  "type": "boolean"
138
138
  },
139
- "rovo_use_agent_permissions": {
140
- "type": "boolean"
141
- },
142
139
  "team_id_to_ari_safe": {
143
140
  "type": "boolean"
144
141
  },