@atlaskit/profilecard 24.23.0 → 24.24.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 +13 -0
- package/__tests__/vr-tests/agent-profilecard.vr.tsx +0 -1
- package/__tests__/vr-tests/user-profilecard.vr.tsx +6 -42
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +28 -49
- package/dist/cjs/components/Agent/AgentProfileCard.js +39 -41
- package/dist/cjs/components/User/ReportingLinesDetails.compiled.css +5 -0
- package/dist/cjs/components/User/ReportingLinesDetails.js +10 -20
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +23 -43
- package/dist/es2019/components/Agent/AgentProfileCard.js +37 -40
- package/dist/es2019/components/User/ReportingLinesDetails.compiled.css +5 -0
- package/dist/es2019/components/User/ReportingLinesDetails.js +8 -19
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +23 -43
- package/dist/esm/components/Agent/AgentProfileCard.js +35 -38
- package/dist/esm/components/User/ReportingLinesDetails.compiled.css +5 -0
- package/dist/esm/components/User/ReportingLinesDetails.js +8 -19
- package/dist/esm/util/analytics.js +2 -2
- package/dist/types/components/Agent/Actions.d.ts +1 -11
- package/dist/types/components/Agent/AgentProfileCard.d.ts +3 -14
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -13
- package/dist/types/components/User/ReportingLinesDetails.d.ts +2 -2
- package/dist/types-ts4.5/components/Agent/Actions.d.ts +1 -11
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +3 -14
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -13
- package/dist/types-ts4.5/components/User/ReportingLinesDetails.d.ts +2 -2
- package/package.json +4 -7
- package/dist/cjs/components/Agent/ActionsCompiled.js +0 -148
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.js +0 -266
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.compiled.css +0 -11
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.js +0 -109
- package/dist/es2019/components/Agent/ActionsCompiled.js +0 -127
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.js +0 -209
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.compiled.css +0 -11
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.js +0 -96
- package/dist/esm/components/Agent/ActionsCompiled.js +0 -139
- package/dist/esm/components/Agent/AgentProfileCardCompiled.js +0 -257
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.compiled.css +0 -11
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.js +0 -102
- package/dist/types/components/Agent/ActionsCompiled.d.ts +0 -15
- package/dist/types/components/Agent/AgentProfileCardCompiled.d.ts +0 -4
- package/dist/types/components/User/ReportingLinesDetailsCompiled.d.ts +0 -5
- package/dist/types-ts4.5/components/Agent/ActionsCompiled.d.ts +0 -15
- package/dist/types-ts4.5/components/Agent/AgentProfileCardCompiled.d.ts +0 -4
- package/dist/types-ts4.5/components/User/ReportingLinesDetailsCompiled.d.ts +0 -5
- /package/dist/cjs/components/Agent/{ActionsCompiled.compiled.css → Actions.compiled.css} +0 -0
- /package/dist/cjs/components/Agent/{AgentProfileCardCompiled.compiled.css → AgentProfileCard.compiled.css} +0 -0
- /package/dist/es2019/components/Agent/{ActionsCompiled.compiled.css → Actions.compiled.css} +0 -0
- /package/dist/es2019/components/Agent/{AgentProfileCardCompiled.compiled.css → AgentProfileCard.compiled.css} +0 -0
- /package/dist/esm/components/Agent/{ActionsCompiled.compiled.css → Actions.compiled.css} +0 -0
- /package/dist/esm/components/Agent/{AgentProfileCardCompiled.compiled.css → AgentProfileCard.compiled.css} +0 -0
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
/* AgentProfileCardCompiled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
import "./AgentProfileCardCompiled.compiled.css";
|
|
6
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
-
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; }
|
|
8
|
-
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; }
|
|
9
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
11
|
-
import { useIntl } from 'react-intl-next';
|
|
12
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
-
import { Box, Stack } from '@atlaskit/primitives/compiled';
|
|
15
|
-
import { AgentAvatar, AgentBanner, AgentProfileCreator, AgentProfileInfo, AgentStarCount } from '@atlaskit/rovo-agent-components';
|
|
16
|
-
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
|
|
17
|
-
import { fireEvent, PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
18
|
-
import { getPageTime } from '../../util/performance';
|
|
19
|
-
import { LoadingState } from '../common/LoadingState';
|
|
20
|
-
import { ErrorMessage } from '../Error';
|
|
21
|
-
import { AgentActions } from './Actions';
|
|
22
|
-
import { AgentProfileCardWrapper } from './AgentProfileCardWrapper';
|
|
23
|
-
import { ConversationStarters } from './ConversationStarters';
|
|
24
|
-
import { useAgentUrlActions } from './hooks/useAgentActions';
|
|
25
|
-
import { messages } from './messages';
|
|
26
|
-
var styles = {
|
|
27
|
-
detailWrapper: "_18zrpxbi _1q51xy5q",
|
|
28
|
-
detailWrapperRefresh: "_1q511ejb",
|
|
29
|
-
avatarStyles: "_kqswstnw _154i1ejb _1ltvpxbi",
|
|
30
|
-
cardContainerStyles: "_2rko1mok _16qs130s _kqswh2mm",
|
|
31
|
-
agentProfileInfoWrapper: "_18zrpxbi",
|
|
32
|
-
conversationStartersWrapper: "_18zrutpp"
|
|
33
|
-
};
|
|
34
|
-
var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
35
|
-
var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
36
|
-
var agent = _ref.agent,
|
|
37
|
-
isLoading = _ref.isLoading,
|
|
38
|
-
cloudId = _ref.cloudId,
|
|
39
|
-
onChatClick = _ref.onChatClick,
|
|
40
|
-
hasError = _ref.hasError,
|
|
41
|
-
errorType = _ref.errorType,
|
|
42
|
-
onConversationStartersClick = _ref.onConversationStartersClick,
|
|
43
|
-
resourceClient = _ref.resourceClient,
|
|
44
|
-
addFlag = _ref.addFlag,
|
|
45
|
-
onDeleteAgent = _ref.onDeleteAgent,
|
|
46
|
-
hideMoreActions = _ref.hideMoreActions;
|
|
47
|
-
var _useAgentUrlActions = useAgentUrlActions({
|
|
48
|
-
cloudId: cloudId || '',
|
|
49
|
-
source: 'agentProfileCard'
|
|
50
|
-
}),
|
|
51
|
-
_onEditAgent = _useAgentUrlActions.onEditAgent,
|
|
52
|
-
_onCopyAgent = _useAgentUrlActions.onCopyAgent,
|
|
53
|
-
_onDuplicateAgent = _useAgentUrlActions.onDuplicateAgent,
|
|
54
|
-
onOpenChatFullScreen = _useAgentUrlActions.onOpenChat,
|
|
55
|
-
onConversationStarter = _useAgentUrlActions.onConversationStarter,
|
|
56
|
-
onViewFullProfile = _useAgentUrlActions.onViewFullProfile;
|
|
57
|
-
var _useState = useState(false),
|
|
58
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
isStarred = _useState2[0],
|
|
60
|
-
setIsStarred = _useState2[1];
|
|
61
|
-
var _useState3 = useState(),
|
|
62
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
starCount = _useState4[0],
|
|
64
|
-
setStarCount = _useState4[1];
|
|
65
|
-
var _useIntl = useIntl(),
|
|
66
|
-
formatMessage = _useIntl.formatMessage;
|
|
67
|
-
var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
|
|
68
|
-
fireAnalyticsNext = _useAnalyticsEventsNe.fireEvent;
|
|
69
|
-
var userDefinedConversationStarters = agent === null || agent === void 0 || (_agent$user_defined_c = agent.user_defined_conversation_starters) === null || _agent$user_defined_c === void 0 ? void 0 : _agent$user_defined_c.map(function (starter) {
|
|
70
|
-
return {
|
|
71
|
-
message: starter,
|
|
72
|
-
type: 'user-defined'
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
setIsStarred(!!(agent !== null && agent !== void 0 && agent.favourite));
|
|
77
|
-
setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
|
|
78
|
-
}, [agent === null || agent === void 0 ? void 0 : agent.favourite, agent === null || agent === void 0 ? void 0 : agent.favourite_count]);
|
|
79
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
80
|
-
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
81
|
-
var fireAnalytics = useCallback(function (payload) {
|
|
82
|
-
if (createAnalyticsEvent) {
|
|
83
|
-
fireEvent(createAnalyticsEvent, payload);
|
|
84
|
-
}
|
|
85
|
-
}, [createAnalyticsEvent]);
|
|
86
|
-
var handleSetFavourite = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
87
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
88
|
-
while (1) switch (_context.prev = _context.next) {
|
|
89
|
-
case 0:
|
|
90
|
-
if (!(agent !== null && agent !== void 0 && agent.id)) {
|
|
91
|
-
_context.next = 10;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
_context.prev = 1;
|
|
95
|
-
_context.next = 4;
|
|
96
|
-
return resourceClient.setFavouriteAgent(agent.id, !isStarred, fireAnalytics, fireAnalyticsNext);
|
|
97
|
-
case 4:
|
|
98
|
-
if (isStarred) {
|
|
99
|
-
setStarCount(starCount ? starCount - 1 : 0);
|
|
100
|
-
} else {
|
|
101
|
-
setStarCount((starCount || 0) + 1);
|
|
102
|
-
}
|
|
103
|
-
setIsStarred(!isStarred);
|
|
104
|
-
_context.next = 10;
|
|
105
|
-
break;
|
|
106
|
-
case 8:
|
|
107
|
-
_context.prev = 8;
|
|
108
|
-
_context.t0 = _context["catch"](1);
|
|
109
|
-
case 10:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context.stop();
|
|
112
|
-
}
|
|
113
|
-
}, _callee, null, [[1, 8]]);
|
|
114
|
-
})), [agent === null || agent === void 0 ? void 0 : agent.id, fireAnalytics, fireAnalyticsNext, isStarred, resourceClient, starCount]);
|
|
115
|
-
var handleOnDelete = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
116
|
-
var _onDeleteAgent, restore;
|
|
117
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
118
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
119
|
-
case 0:
|
|
120
|
-
if (!(agent && onDeleteAgent)) {
|
|
121
|
-
_context2.next = 12;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
// Optimistically remove from cache
|
|
125
|
-
_onDeleteAgent = onDeleteAgent(agent.id), restore = _onDeleteAgent.restore;
|
|
126
|
-
_context2.prev = 2;
|
|
127
|
-
_context2.next = 5;
|
|
128
|
-
return resourceClient.deleteAgent(agent.id, fireAnalytics, fireAnalyticsNext);
|
|
129
|
-
case 5:
|
|
130
|
-
addFlag === null || addFlag === void 0 || addFlag({
|
|
131
|
-
title: formatMessage(messages.agentDeletedSuccessFlagTitle),
|
|
132
|
-
description: formatMessage(messages.agentDeletedSuccessFlagDescription, {
|
|
133
|
-
agentName: agent.name
|
|
134
|
-
}),
|
|
135
|
-
type: 'success',
|
|
136
|
-
id: 'ptc-directory.agent-profile.delete-agent-success'
|
|
137
|
-
});
|
|
138
|
-
_context2.next = 12;
|
|
139
|
-
break;
|
|
140
|
-
case 8:
|
|
141
|
-
_context2.prev = 8;
|
|
142
|
-
_context2.t0 = _context2["catch"](2);
|
|
143
|
-
// Restore agent to cache on error
|
|
144
|
-
restore();
|
|
145
|
-
addFlag === null || addFlag === void 0 || addFlag({
|
|
146
|
-
title: formatMessage(messages.agentDeletedErrorFlagTitle),
|
|
147
|
-
description: formatMessage(messages.agentDeletedErrorFlagDescription),
|
|
148
|
-
type: 'error',
|
|
149
|
-
id: 'ptc-directory.agent-profile.delete-agent-error'
|
|
150
|
-
});
|
|
151
|
-
case 12:
|
|
152
|
-
case "end":
|
|
153
|
-
return _context2.stop();
|
|
154
|
-
}
|
|
155
|
-
}, _callee2, null, [[2, 8]]);
|
|
156
|
-
})), [addFlag, agent, formatMessage, onDeleteAgent, resourceClient, fireAnalytics, fireAnalyticsNext]);
|
|
157
|
-
useEffect(function () {
|
|
158
|
-
if (!isLoading && agent) {
|
|
159
|
-
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
160
|
-
fireAnalyticsNext("ui.rovoAgentProfilecard.rendered.content", _objectSpread(_objectSpread({}, PACKAGE_META_DATA), {}, {
|
|
161
|
-
firedAt: Math.round(getPageTime())
|
|
162
|
-
}));
|
|
163
|
-
} else {
|
|
164
|
-
fireAnalytics(profileCardRendered('agent', 'content'));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, [agent, fireAnalytics, isLoading, fireAnalyticsNext]);
|
|
168
|
-
if (isLoading) {
|
|
169
|
-
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(LoadingState, {
|
|
170
|
-
profileType: "agent",
|
|
171
|
-
fireAnalytics: fireAnalytics,
|
|
172
|
-
fireAnalyticsNext: fireAnalyticsNext
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
if (hasError || !agent) {
|
|
176
|
-
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
177
|
-
fireAnalyticsNext: fireAnalyticsNext,
|
|
178
|
-
errorType: errorType,
|
|
179
|
-
fireAnalytics: fireAnalytics
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(Box, {
|
|
183
|
-
xcss: styles.cardContainerStyles
|
|
184
|
-
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
185
|
-
agentId: agent.id,
|
|
186
|
-
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
187
|
-
height: fg('rovo_agent_empty_state_refresh') ? 48 : 96,
|
|
188
|
-
agentIdentityAccountId: agent.identity_account_id
|
|
189
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
190
|
-
xcss: styles.avatarStyles
|
|
191
|
-
}, /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
192
|
-
agentId: agent.id,
|
|
193
|
-
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
194
|
-
agentIdentityAccountId: agent.identity_account_id,
|
|
195
|
-
size: fg('rovo_agent_empty_state_refresh') ? 'large' : 'xlarge',
|
|
196
|
-
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
197
|
-
forgeAgentIconUrl: agent.icon
|
|
198
|
-
})), /*#__PURE__*/React.createElement(Stack, {
|
|
199
|
-
space: "space.100",
|
|
200
|
-
xcss: fg('rovo_agent_empty_state_refresh') ? styles.detailWrapperRefresh : styles.detailWrapper
|
|
201
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
202
|
-
xcss: fg('rovo_agent_empty_state_refresh') ? styles.agentProfileInfoWrapper : null
|
|
203
|
-
}, /*#__PURE__*/React.createElement(AgentProfileInfo, {
|
|
204
|
-
agentName: agent.name,
|
|
205
|
-
isStarred: isStarred,
|
|
206
|
-
onStarToggle: handleSetFavourite,
|
|
207
|
-
isHidden: agent.visibility === 'PRIVATE',
|
|
208
|
-
creatorRender: ((_agent$creatorInfo = agent.creatorInfo) === null || _agent$creatorInfo === void 0 ? void 0 : _agent$creatorInfo.type) && /*#__PURE__*/React.createElement(AgentProfileCreator, {
|
|
209
|
-
creator: {
|
|
210
|
-
type: (_agent$creatorInfo2 = agent.creatorInfo) === null || _agent$creatorInfo2 === void 0 ? void 0 : _agent$creatorInfo2.type,
|
|
211
|
-
name: ((_agent$creatorInfo3 = agent.creatorInfo) === null || _agent$creatorInfo3 === void 0 ? void 0 : _agent$creatorInfo3.name) || '',
|
|
212
|
-
profileLink: ((_agent$creatorInfo4 = agent.creatorInfo) === null || _agent$creatorInfo4 === void 0 ? void 0 : _agent$creatorInfo4.profileLink) || ''
|
|
213
|
-
},
|
|
214
|
-
isLoading: false,
|
|
215
|
-
onCreatorLinkClick: function onCreatorLinkClick() {}
|
|
216
|
-
}),
|
|
217
|
-
starCountRender: fg('rovo_agent_empty_state_refresh') ? null : /*#__PURE__*/React.createElement(AgentStarCount, {
|
|
218
|
-
starCount: starCount,
|
|
219
|
-
isLoading: false
|
|
220
|
-
}),
|
|
221
|
-
agentDescription: agent.description
|
|
222
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
223
|
-
xcss: fg('rovo_agent_empty_state_refresh') ? styles.conversationStartersWrapper : null
|
|
224
|
-
}, /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
225
|
-
isAgentDefault: agent.is_default,
|
|
226
|
-
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
227
|
-
onConversationStarterClick: function onConversationStarterClick(conversationStarter) {
|
|
228
|
-
onConversationStartersClick ? onConversationStartersClick(conversationStarter) : onConversationStarter({
|
|
229
|
-
agentId: agent.id,
|
|
230
|
-
prompt: conversationStarter.message
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
}))), /*#__PURE__*/React.createElement(AgentActions, {
|
|
234
|
-
agent: agent,
|
|
235
|
-
onEditAgent: function onEditAgent() {
|
|
236
|
-
return _onEditAgent(agent.id);
|
|
237
|
-
},
|
|
238
|
-
onCopyAgent: function onCopyAgent() {
|
|
239
|
-
return _onCopyAgent(agent.id);
|
|
240
|
-
},
|
|
241
|
-
onDuplicateAgent: function onDuplicateAgent() {
|
|
242
|
-
return _onDuplicateAgent(agent.id);
|
|
243
|
-
},
|
|
244
|
-
onDeleteAgent: handleOnDelete,
|
|
245
|
-
onChatClick: onChatClick ? function (event) {
|
|
246
|
-
return onChatClick(event);
|
|
247
|
-
} : function () {
|
|
248
|
-
return onOpenChatFullScreen(agent.id, agent.name);
|
|
249
|
-
},
|
|
250
|
-
resourceClient: resourceClient,
|
|
251
|
-
onViewFullProfileClick: function onViewFullProfileClick() {
|
|
252
|
-
return onViewFullProfile(agent.id);
|
|
253
|
-
},
|
|
254
|
-
hideMoreActions: hideMoreActions
|
|
255
|
-
})));
|
|
256
|
-
};
|
|
257
|
-
export default AgentProfileCard;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
3
|
-
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
4
|
-
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
5
|
-
._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
|
|
6
|
-
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
7
|
-
._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
|
|
8
|
-
._otyrze3t{margin-bottom:var(--ds-space-0,0)}
|
|
9
|
-
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
10
|
-
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
11
|
-
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/* ReportingLinesDetailsCompiled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
-
import "./ReportingLinesDetailsCompiled.compiled.css";
|
|
3
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
6
|
-
import Avatar from '@atlaskit/avatar';
|
|
7
|
-
import AvatarGroup from '@atlaskit/avatar-group';
|
|
8
|
-
import { cx } from '@atlaskit/css';
|
|
9
|
-
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
-
import messages from '../../messages';
|
|
11
|
-
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
12
|
-
import { reportingLinesClicked } from '../../util/analytics';
|
|
13
|
-
function getProfileHref(userId, profileUrl) {
|
|
14
|
-
return profileUrl ? profileUrl + userId : undefined;
|
|
15
|
-
}
|
|
16
|
-
var styles = {
|
|
17
|
-
reportingLinesButton: "_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bfhksm61 _irr31dpa",
|
|
18
|
-
reportingLinesHeadingDefaultStyles: "_11c81vhk _syazi7uo _k48p1pd9 _otyru2gc",
|
|
19
|
-
reportingLinesHeadingStyles: "_otyrze3t"
|
|
20
|
-
};
|
|
21
|
-
var avatarGroupMaxCount = 5;
|
|
22
|
-
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
23
|
-
var _manager$pii, _manager$pii2;
|
|
24
|
-
var _useIntl = useIntl(),
|
|
25
|
-
formatMessage = _useIntl.formatMessage;
|
|
26
|
-
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
27
|
-
_props$reportingLines = props.reportingLines,
|
|
28
|
-
reportingLines = _props$reportingLines === void 0 ? {} : _props$reportingLines,
|
|
29
|
-
reportingLinesProfileUrl = props.reportingLinesProfileUrl,
|
|
30
|
-
onReportingLinesClick = props.onReportingLinesClick;
|
|
31
|
-
var _reportingLines$manag = reportingLines.managers,
|
|
32
|
-
managers = _reportingLines$manag === void 0 ? [] : _reportingLines$manag,
|
|
33
|
-
_reportingLines$repor = reportingLines.reports,
|
|
34
|
-
reports = _reportingLines$repor === void 0 ? [] : _reportingLines$repor;
|
|
35
|
-
var manager = managers.length >= 1 ? managers[0] : undefined;
|
|
36
|
-
var hasReports = reports.length > 0;
|
|
37
|
-
var getReportingLinesOnClick = function getReportingLinesOnClick(user, userType) {
|
|
38
|
-
return onReportingLinesClick ? function () {
|
|
39
|
-
fireAnalyticsWithDuration(function (duration) {
|
|
40
|
-
return reportingLinesClicked({
|
|
41
|
-
duration: duration,
|
|
42
|
-
userType: userType
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
onReportingLinesClick(user);
|
|
46
|
-
} : undefined;
|
|
47
|
-
};
|
|
48
|
-
var onReportingLinksClick = function onReportingLinksClick(user, userType, href) {
|
|
49
|
-
var shouldPreventDefault = false;
|
|
50
|
-
if (onReportingLinesClick) {
|
|
51
|
-
shouldPreventDefault = onReportingLinesClick(user) === false;
|
|
52
|
-
}
|
|
53
|
-
fireAnalyticsWithDuration(function (duration) {
|
|
54
|
-
return reportingLinesClicked({
|
|
55
|
-
duration: duration,
|
|
56
|
-
userType: userType
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
if (shouldPreventDefault) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (href) {
|
|
63
|
-
window.location.href = href;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var showMoreButtonProps = {
|
|
67
|
-
'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
|
|
68
|
-
count: reports.length - avatarGroupMaxCount + 1
|
|
69
|
-
})
|
|
70
|
-
};
|
|
71
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
72
|
-
xcss: cx(styles.reportingLinesHeadingDefaultStyles, styles.reportingLinesHeadingStyles)
|
|
73
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)), /*#__PURE__*/React.createElement(OffsetWrapper, null, /*#__PURE__*/React.createElement(Pressable, {
|
|
74
|
-
onClick: function onClick() {
|
|
75
|
-
return onReportingLinksClick(manager, 'manager', getProfileHref(manager.accountIdentifier, reportingLinesProfileUrl));
|
|
76
|
-
},
|
|
77
|
-
isDisabled: !onReportingLinesClick,
|
|
78
|
-
xcss: styles.reportingLinesButton
|
|
79
|
-
}, /*#__PURE__*/React.createElement(ManagerSection, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
80
|
-
size: "xsmall",
|
|
81
|
-
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
82
|
-
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
83
|
-
xcss: styles.reportingLinesHeadingDefaultStyles
|
|
84
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)), /*#__PURE__*/React.createElement(AvatarGroup, {
|
|
85
|
-
appearance: "stack",
|
|
86
|
-
size: "small",
|
|
87
|
-
data: reports.map(function (member) {
|
|
88
|
-
var _member$pii, _member$pii2;
|
|
89
|
-
return {
|
|
90
|
-
key: member.accountIdentifier,
|
|
91
|
-
name: ((_member$pii = member.pii) === null || _member$pii === void 0 ? void 0 : _member$pii.name) || '',
|
|
92
|
-
src: (_member$pii2 = member.pii) === null || _member$pii2 === void 0 ? void 0 : _member$pii2.picture,
|
|
93
|
-
href: getProfileHref(member.accountIdentifier, reportingLinesProfileUrl),
|
|
94
|
-
onClick: getReportingLinesOnClick(member, 'direct-report')
|
|
95
|
-
};
|
|
96
|
-
}),
|
|
97
|
-
maxCount: avatarGroupMaxCount,
|
|
98
|
-
testId: "profilecard-reports-avatar-group",
|
|
99
|
-
showMoreButtonProps: showMoreButtonProps
|
|
100
|
-
})));
|
|
101
|
-
};
|
|
102
|
-
export default ReportingLinesDetails;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ProfileClient, type RovoAgentProfileCardInfo } from '../../types';
|
|
3
|
-
type AgentActionsProps = {
|
|
4
|
-
agent: RovoAgentProfileCardInfo;
|
|
5
|
-
onEditAgent: () => void;
|
|
6
|
-
onCopyAgent: () => void;
|
|
7
|
-
onDuplicateAgent: () => void;
|
|
8
|
-
onDeleteAgent: () => void;
|
|
9
|
-
onChatClick: (event: React.MouseEvent) => void;
|
|
10
|
-
onViewFullProfileClick: () => void;
|
|
11
|
-
resourceClient: ProfileClient;
|
|
12
|
-
hideMoreActions?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, hideMoreActions, }: AgentActionsProps) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AgentProfileCardProps } from '../../types';
|
|
3
|
-
declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: AgentProfileCardProps) => React.JSX.Element;
|
|
4
|
-
export default AgentProfileCard;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AnalyticsWithDurationProps, type ProfilecardProps } from '../../types';
|
|
3
|
-
export type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
|
|
4
|
-
declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => React.JSX.Element;
|
|
5
|
-
export default ReportingLinesDetails;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ProfileClient, type RovoAgentProfileCardInfo } from '../../types';
|
|
3
|
-
type AgentActionsProps = {
|
|
4
|
-
agent: RovoAgentProfileCardInfo;
|
|
5
|
-
onEditAgent: () => void;
|
|
6
|
-
onCopyAgent: () => void;
|
|
7
|
-
onDuplicateAgent: () => void;
|
|
8
|
-
onDeleteAgent: () => void;
|
|
9
|
-
onChatClick: (event: React.MouseEvent) => void;
|
|
10
|
-
onViewFullProfileClick: () => void;
|
|
11
|
-
resourceClient: ProfileClient;
|
|
12
|
-
hideMoreActions?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, hideMoreActions, }: AgentActionsProps) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AgentProfileCardProps } from '../../types';
|
|
3
|
-
declare const AgentProfileCard: ({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: AgentProfileCardProps) => React.JSX.Element;
|
|
4
|
-
export default AgentProfileCard;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AnalyticsWithDurationProps, type ProfilecardProps } from '../../types';
|
|
3
|
-
export type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
|
|
4
|
-
declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => React.JSX.Element;
|
|
5
|
-
export default ReportingLinesDetails;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|