@atlaskit/profilecard 23.11.1 → 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 +20 -0
- package/dist/cjs/client/RovoAgentCardClient.js +10 -4
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +12 -113
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/RovoAgentCardClient.js +8 -4
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +4 -106
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/RovoAgentCardClient.js +10 -4
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +13 -114
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/RovoAgentCardClient.d.ts +1 -0
- package/dist/types/components/team-profile-card/main.d.ts +1 -1
- package/dist/types/components/team-profile-card/team-actions/index.d.ts +1 -1
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +1 -0
- package/dist/types-ts4.5/components/team-profile-card/main.d.ts +1 -1
- package/dist/types-ts4.5/components/team-profile-card/team-actions/index.d.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
15
|
+
## 23.11.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#154380](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154380)
|
|
20
|
+
[`d9b89b5a507e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9b89b5a507e5) -
|
|
21
|
+
Migrate rovo endpoints away from assistant-service
|
|
22
|
+
|
|
3
23
|
## 23.11.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _analytics = require("../util/analytics");
|
|
17
18
|
var _performance = require("../util/performance");
|
|
18
19
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
@@ -42,12 +43,17 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
42
43
|
}
|
|
43
44
|
(0, _inherits2.default)(RovoAgentCardClient, _CachingClient);
|
|
44
45
|
return (0, _createClass2.default)(RovoAgentCardClient, [{
|
|
46
|
+
key: "basePath",
|
|
47
|
+
value: function basePath() {
|
|
48
|
+
return (0, _platformFeatureFlags.fg)('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
45
51
|
key: "makeRequest",
|
|
46
52
|
value: function makeRequest(id, cloudId) {
|
|
47
53
|
var product = this.options.productIdentifier || 'rovo';
|
|
48
54
|
var headers = createHeaders(product, this.options.cloudId);
|
|
49
55
|
if (id.type === 'identity') {
|
|
50
|
-
return fetch(new Request("/
|
|
56
|
+
return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
|
|
51
57
|
method: 'GET',
|
|
52
58
|
credentials: 'include',
|
|
53
59
|
mode: 'cors',
|
|
@@ -56,7 +62,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
56
62
|
return response.json();
|
|
57
63
|
});
|
|
58
64
|
}
|
|
59
|
-
return fetch(new Request("/
|
|
65
|
+
return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
|
|
60
66
|
method: 'GET',
|
|
61
67
|
credentials: 'include',
|
|
62
68
|
mode: 'cors',
|
|
@@ -121,7 +127,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
121
127
|
analytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
122
128
|
}
|
|
123
129
|
var headers = createHeaders(product, _this3.options.cloudId);
|
|
124
|
-
fetch(new Request("/
|
|
130
|
+
fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
|
|
125
131
|
method: 'DELETE',
|
|
126
132
|
credentials: 'include',
|
|
127
133
|
mode: 'cors',
|
|
@@ -168,7 +174,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
168
174
|
}
|
|
169
175
|
headers = createHeaders(product, _this4.options.cloudId);
|
|
170
176
|
_context.next = 8;
|
|
171
|
-
return fetch(new Request("/
|
|
177
|
+
return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
|
|
172
178
|
method: requestMethod,
|
|
173
179
|
credentials: 'include',
|
|
174
180
|
mode: 'cors',
|
|
@@ -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.
|
|
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.
|
|
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 =
|
|
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
|
|
56
|
-
var
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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)))))),
|
|
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
|
-
})
|
|
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.
|
|
48
|
+
packageVersion: "23.12.0"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { agentRequestAnalytics } from '../util/analytics';
|
|
2
3
|
import { getPageTime } from '../util/performance';
|
|
3
4
|
import CachingClient from './CachingClient';
|
|
@@ -18,18 +19,21 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
18
19
|
super(options);
|
|
19
20
|
this.options = options;
|
|
20
21
|
}
|
|
22
|
+
basePath() {
|
|
23
|
+
return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
24
|
+
}
|
|
21
25
|
makeRequest(id, cloudId) {
|
|
22
26
|
const product = this.options.productIdentifier || 'rovo';
|
|
23
27
|
const headers = createHeaders(product, this.options.cloudId);
|
|
24
28
|
if (id.type === 'identity') {
|
|
25
|
-
return fetch(new Request(
|
|
29
|
+
return fetch(new Request(`${this.basePath()}/accountid/${id.value}`, {
|
|
26
30
|
method: 'GET',
|
|
27
31
|
credentials: 'include',
|
|
28
32
|
mode: 'cors',
|
|
29
33
|
headers
|
|
30
34
|
})).then(response => response.json());
|
|
31
35
|
}
|
|
32
|
-
return fetch(new Request(
|
|
36
|
+
return fetch(new Request(`${this.basePath()}/${id.value}`, {
|
|
33
37
|
method: 'GET',
|
|
34
38
|
credentials: 'include',
|
|
35
39
|
mode: 'cors',
|
|
@@ -86,7 +90,7 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
86
90
|
analytics(agentRequestAnalytics('triggered'));
|
|
87
91
|
}
|
|
88
92
|
const headers = createHeaders(product, this.options.cloudId);
|
|
89
|
-
fetch(new Request(
|
|
93
|
+
fetch(new Request(`${this.basePath()}/${agentId}`, {
|
|
90
94
|
method: 'DELETE',
|
|
91
95
|
credentials: 'include',
|
|
92
96
|
mode: 'cors',
|
|
@@ -124,7 +128,7 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
124
128
|
analytics(agentRequestAnalytics('triggered', 'actionSubjectId'));
|
|
125
129
|
}
|
|
126
130
|
const headers = createHeaders(product, this.options.cloudId);
|
|
127
|
-
await fetch(new Request(
|
|
131
|
+
await fetch(new Request(`${this.basePath()}/${agentId}/favourite`, {
|
|
128
132
|
method: requestMethod,
|
|
129
133
|
credentials: 'include',
|
|
130
134
|
mode: 'cors',
|
|
@@ -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.
|
|
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.
|
|
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,
|
|
4
|
-
import Button
|
|
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)))))),
|
|
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
|
-
})
|
|
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.
|
|
35
|
+
packageVersion: "23.12.0",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -10,6 +10,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
10
10
|
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; }
|
|
11
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { agentRequestAnalytics } from '../util/analytics';
|
|
14
15
|
import { getPageTime } from '../util/performance';
|
|
15
16
|
import CachingClient from './CachingClient';
|
|
@@ -35,12 +36,17 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
35
36
|
}
|
|
36
37
|
_inherits(RovoAgentCardClient, _CachingClient);
|
|
37
38
|
return _createClass(RovoAgentCardClient, [{
|
|
39
|
+
key: "basePath",
|
|
40
|
+
value: function basePath() {
|
|
41
|
+
return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
38
44
|
key: "makeRequest",
|
|
39
45
|
value: function makeRequest(id, cloudId) {
|
|
40
46
|
var product = this.options.productIdentifier || 'rovo';
|
|
41
47
|
var headers = createHeaders(product, this.options.cloudId);
|
|
42
48
|
if (id.type === 'identity') {
|
|
43
|
-
return fetch(new Request("/
|
|
49
|
+
return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
|
|
44
50
|
method: 'GET',
|
|
45
51
|
credentials: 'include',
|
|
46
52
|
mode: 'cors',
|
|
@@ -49,7 +55,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
49
55
|
return response.json();
|
|
50
56
|
});
|
|
51
57
|
}
|
|
52
|
-
return fetch(new Request("/
|
|
58
|
+
return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
|
|
53
59
|
method: 'GET',
|
|
54
60
|
credentials: 'include',
|
|
55
61
|
mode: 'cors',
|
|
@@ -114,7 +120,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
114
120
|
analytics(agentRequestAnalytics('triggered'));
|
|
115
121
|
}
|
|
116
122
|
var headers = createHeaders(product, _this3.options.cloudId);
|
|
117
|
-
fetch(new Request("/
|
|
123
|
+
fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
|
|
118
124
|
method: 'DELETE',
|
|
119
125
|
credentials: 'include',
|
|
120
126
|
mode: 'cors',
|
|
@@ -161,7 +167,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
161
167
|
}
|
|
162
168
|
headers = createHeaders(product, _this4.options.cloudId);
|
|
163
169
|
_context.next = 8;
|
|
164
|
-
return fetch(new Request("/
|
|
170
|
+
return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
|
|
165
171
|
method: requestMethod,
|
|
166
172
|
credentials: 'include',
|
|
167
173
|
mode: 'cors',
|
|
@@ -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.
|
|
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.
|
|
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,
|
|
9
|
-
import Button
|
|
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
|
|
46
|
-
var
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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)))))),
|
|
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
|
-
})
|
|
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.
|
|
42
|
+
packageVersion: "23.12.0"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
|
|
|
4
4
|
export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
|
|
5
5
|
options: ProfileClientOptions;
|
|
6
6
|
constructor(options: ProfileClientOptions);
|
|
7
|
+
private basePath;
|
|
7
8
|
makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
|
|
8
9
|
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
|
|
9
10
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
|
@@ -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;
|
|
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
|
|
|
4
4
|
export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
|
|
5
5
|
options: ProfileClientOptions;
|
|
6
6
|
constructor(options: ProfileClientOptions);
|
|
7
|
+
private basePath;
|
|
7
8
|
makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
|
|
8
9
|
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
|
|
9
10
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "23.
|
|
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/"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/avatar-group": "^12.0.0",
|
|
57
57
|
"@atlaskit/button": "^23.0.0",
|
|
58
58
|
"@atlaskit/css": "^0.10.0",
|
|
59
|
-
"@atlaskit/dropdown-menu": "^14.
|
|
59
|
+
"@atlaskit/dropdown-menu": "^14.2.0",
|
|
60
60
|
"@atlaskit/empty-state": "^10.0.0",
|
|
61
61
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
62
62
|
"@atlaskit/give-kudos": "^4.1.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@atlaskit/logo": "^18.0.0",
|
|
66
66
|
"@atlaskit/lozenge": "^12.2.0",
|
|
67
67
|
"@atlaskit/menu": "^5.0.0",
|
|
68
|
-
"@atlaskit/modal-dialog": "^14.
|
|
68
|
+
"@atlaskit/modal-dialog": "^14.2.0",
|
|
69
69
|
"@atlaskit/people-teams-ui-public": "^3.1.0",
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
|
-
"@atlaskit/popup": "^4.
|
|
71
|
+
"@atlaskit/popup": "^4.2.0",
|
|
72
72
|
"@atlaskit/primitives": "^14.7.0",
|
|
73
73
|
"@atlaskit/rovo-agent-components": "^2.8.0",
|
|
74
74
|
"@atlaskit/rovo-triggers": "^2.11.0",
|
|
@@ -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
|
},
|
|
@@ -165,6 +162,9 @@
|
|
|
165
162
|
},
|
|
166
163
|
"jfp-a11y-autodev-profile-card-name-heading": {
|
|
167
164
|
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"pt-deprecate-assistance-service": {
|
|
167
|
+
"type": "boolean"
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
"sideEffects": [
|