@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
|
@@ -8,30 +8,20 @@ import React from 'react';
|
|
|
8
8
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
9
9
|
import Avatar from '@atlaskit/avatar';
|
|
10
10
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
11
|
+
import { cx } from '@atlaskit/css';
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
import {
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
14
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
15
|
-
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
13
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
16
14
|
import messages from '../../messages';
|
|
17
15
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
18
16
|
import { PACKAGE_META_DATA, reportingLinesClicked } from '../../util/analytics';
|
|
19
17
|
import { getPageTime } from '../../util/performance';
|
|
20
|
-
import { default as ReportingLinesDetailsCompiled } from './ReportingLinesDetailsCompiled';
|
|
21
18
|
function getProfileHref(userId, profileUrl) {
|
|
22
19
|
return profileUrl ? profileUrl + userId : undefined;
|
|
23
20
|
}
|
|
24
|
-
var reportingLinesHeadingDefaultStyles = xcss({
|
|
25
|
-
color: 'color.text',
|
|
26
|
-
font: 'font.heading.xxsmall',
|
|
27
|
-
fontWeight: 'font.weight.semibold',
|
|
28
|
-
marginBottom: 'space.100'
|
|
29
|
-
});
|
|
30
|
-
var reportingLinesHeadingStyles = xcss({
|
|
31
|
-
marginBottom: '0'
|
|
32
|
-
});
|
|
33
21
|
var styles = {
|
|
34
|
-
reportingLinesButton: "_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bfhksm61 _irr31dpa"
|
|
22
|
+
reportingLinesButton: "_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bfhksm61 _irr31dpa",
|
|
23
|
+
reportingLinesHeadingDefaultStyles: "_11c81vhk _syazi7uo _k48p1pd9 _otyru2gc",
|
|
24
|
+
reportingLinesHeadingStyles: "_otyrze3t"
|
|
35
25
|
};
|
|
36
26
|
var avatarGroupMaxCount = 5;
|
|
37
27
|
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
@@ -105,7 +95,7 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
105
95
|
})
|
|
106
96
|
};
|
|
107
97
|
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
108
|
-
xcss:
|
|
98
|
+
xcss: cx(styles.reportingLinesHeadingDefaultStyles, styles.reportingLinesHeadingStyles)
|
|
109
99
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)), /*#__PURE__*/React.createElement(OffsetWrapper, null, /*#__PURE__*/React.createElement(Pressable, {
|
|
110
100
|
onClick: function onClick() {
|
|
111
101
|
return onReportingLinksClick(manager, 'manager', getProfileHref(manager.accountIdentifier, reportingLinesProfileUrl));
|
|
@@ -116,7 +106,7 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
116
106
|
size: "xsmall",
|
|
117
107
|
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
118
108
|
}), /*#__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, {
|
|
119
|
-
xcss: reportingLinesHeadingDefaultStyles
|
|
109
|
+
xcss: styles.reportingLinesHeadingDefaultStyles
|
|
120
110
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)), /*#__PURE__*/React.createElement(AvatarGroup, {
|
|
121
111
|
appearance: "stack",
|
|
122
112
|
size: "small",
|
|
@@ -135,5 +125,4 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
135
125
|
showMoreButtonProps: showMoreButtonProps
|
|
136
126
|
})));
|
|
137
127
|
};
|
|
138
|
-
|
|
139
|
-
export default ReportingLinesDetailsExport;
|
|
128
|
+
export default ReportingLinesDetails;
|
|
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
|
|
|
7
7
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
8
8
|
export var PACKAGE_META_DATA = {
|
|
9
9
|
packageName: "@atlaskit/profilecard",
|
|
10
|
-
packageVersion: "
|
|
10
|
+
packageVersion: "24.24.0"
|
|
11
11
|
};
|
|
12
12
|
var runItLater = function runItLater(cb) {
|
|
13
13
|
var requestIdleCallback = window.requestIdleCallback;
|
|
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
52
52
|
actionSubjectId: actionSubjectId,
|
|
53
53
|
attributes: _objectSpread(_objectSpread({
|
|
54
54
|
packageName: "@atlaskit/profilecard",
|
|
55
|
-
packageVersion: "
|
|
55
|
+
packageVersion: "24.24.0"
|
|
56
56
|
}, attributes), {}, {
|
|
57
57
|
firedAt: Math.round(getPageTime())
|
|
58
58
|
})
|
|
@@ -11,15 +11,5 @@ type AgentActionsProps = {
|
|
|
11
11
|
resourceClient: ProfileClient;
|
|
12
12
|
hideMoreActions?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const AgentActions: React.
|
|
15
|
-
agent: RovoAgentProfileCardInfo;
|
|
16
|
-
onEditAgent: () => void;
|
|
17
|
-
onCopyAgent: () => void;
|
|
18
|
-
onDuplicateAgent: () => void;
|
|
19
|
-
onDeleteAgent: () => void;
|
|
20
|
-
onChatClick: (event: React.MouseEvent) => void;
|
|
21
|
-
onViewFullProfileClick: () => void;
|
|
22
|
-
resourceClient: ProfileClient;
|
|
23
|
-
hideMoreActions?: boolean;
|
|
24
|
-
} & AgentActionsProps>;
|
|
14
|
+
export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, hideMoreActions, }: AgentActionsProps) => React.JSX.Element;
|
|
25
15
|
export {};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isLoading?: boolean;
|
|
6
|
-
hasError?: boolean;
|
|
7
|
-
cloudId?: string;
|
|
8
|
-
errorType?: import("../../types").ProfileCardErrorType;
|
|
9
|
-
addFlag?: (flag: import("../../types").Flag) => void;
|
|
10
|
-
onDeleteAgent?: (agentId: string) => {
|
|
11
|
-
restore: () => void;
|
|
12
|
-
};
|
|
13
|
-
hideMoreActions?: boolean;
|
|
14
|
-
} & import("../../types").AgentActionsType>;
|
|
15
|
-
export default AgentProfileCardExport;
|
|
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,13 +1 @@
|
|
|
1
|
-
export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<import("
|
|
2
|
-
resourceClient: import("../../types").ProfileClient;
|
|
3
|
-
agent?: import("../../types").RovoAgentProfileCardInfo;
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
hasError?: boolean;
|
|
6
|
-
cloudId?: string;
|
|
7
|
-
errorType?: import("../..").ProfileCardErrorType;
|
|
8
|
-
addFlag?: (flag: import("../../types").Flag) => void;
|
|
9
|
-
onDeleteAgent?: (agentId: string) => {
|
|
10
|
-
restore: () => void;
|
|
11
|
-
};
|
|
12
|
-
hideMoreActions?: boolean;
|
|
13
|
-
} & import("../../types").AgentActionsType>>;
|
|
1
|
+
export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AnalyticsWithDurationProps, type ProfilecardProps } from '../../types';
|
|
3
3
|
export type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => React.JSX.Element;
|
|
5
|
+
export default ReportingLinesDetails;
|
|
@@ -11,15 +11,5 @@ type AgentActionsProps = {
|
|
|
11
11
|
resourceClient: ProfileClient;
|
|
12
12
|
hideMoreActions?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const AgentActions: React.
|
|
15
|
-
agent: RovoAgentProfileCardInfo;
|
|
16
|
-
onEditAgent: () => void;
|
|
17
|
-
onCopyAgent: () => void;
|
|
18
|
-
onDuplicateAgent: () => void;
|
|
19
|
-
onDeleteAgent: () => void;
|
|
20
|
-
onChatClick: (event: React.MouseEvent) => void;
|
|
21
|
-
onViewFullProfileClick: () => void;
|
|
22
|
-
resourceClient: ProfileClient;
|
|
23
|
-
hideMoreActions?: boolean;
|
|
24
|
-
} & AgentActionsProps>;
|
|
14
|
+
export declare const AgentActions: ({ onEditAgent, onDeleteAgent, onDuplicateAgent, onCopyAgent, onChatClick, onViewFullProfileClick, agent, resourceClient, hideMoreActions, }: AgentActionsProps) => React.JSX.Element;
|
|
25
15
|
export {};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isLoading?: boolean;
|
|
6
|
-
hasError?: boolean;
|
|
7
|
-
cloudId?: string;
|
|
8
|
-
errorType?: import("../../types").ProfileCardErrorType;
|
|
9
|
-
addFlag?: (flag: import("../../types").Flag) => void;
|
|
10
|
-
onDeleteAgent?: (agentId: string) => {
|
|
11
|
-
restore: () => void;
|
|
12
|
-
};
|
|
13
|
-
hideMoreActions?: boolean;
|
|
14
|
-
} & import("../../types").AgentActionsType>;
|
|
15
|
-
export default AgentProfileCardExport;
|
|
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,13 +1 @@
|
|
|
1
|
-
export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<import("
|
|
2
|
-
resourceClient: import("../../types").ProfileClient;
|
|
3
|
-
agent?: import("../../types").RovoAgentProfileCardInfo;
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
hasError?: boolean;
|
|
6
|
-
cloudId?: string;
|
|
7
|
-
errorType?: import("../..").ProfileCardErrorType;
|
|
8
|
-
addFlag?: (flag: import("../../types").Flag) => void;
|
|
9
|
-
onDeleteAgent?: (agentId: string) => {
|
|
10
|
-
restore: () => void;
|
|
11
|
-
};
|
|
12
|
-
hideMoreActions?: boolean;
|
|
13
|
-
} & import("../../types").AgentActionsType>>;
|
|
1
|
+
export declare const AgentProfileCardLazy: import("react").LazyExoticComponent<({ agent, isLoading, cloudId, onChatClick, hasError, errorType, onConversationStartersClick, resourceClient, addFlag, onDeleteAgent, hideMoreActions, }: import("../../types").AgentProfileCardProps) => React.JSX.Element>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AnalyticsWithDurationProps, type ProfilecardProps } from '../../types';
|
|
3
3
|
export type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => React.JSX.Element;
|
|
5
|
+
export default ReportingLinesDetails;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.24.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"@atlaskit/popup": "^4.6.0",
|
|
62
62
|
"@atlaskit/primitives": "^16.4.0",
|
|
63
63
|
"@atlaskit/rovo-agent-components": "^3.15.0",
|
|
64
|
-
"@atlaskit/rovo-triggers": "^4.
|
|
64
|
+
"@atlaskit/rovo-triggers": "^4.11.0",
|
|
65
65
|
"@atlaskit/spinner": "^19.0.0",
|
|
66
66
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
67
67
|
"@atlaskit/teams-app-internal-analytics": "^1.20.0",
|
|
68
68
|
"@atlaskit/teams-avatar": "^2.4.0",
|
|
69
|
-
"@atlaskit/teams-public": "^0.
|
|
69
|
+
"@atlaskit/teams-public": "^0.64.0",
|
|
70
70
|
"@atlaskit/theme": "^21.0.0",
|
|
71
71
|
"@atlaskit/tokens": "^8.4.0",
|
|
72
|
-
"@atlaskit/tooltip": "^20.
|
|
72
|
+
"@atlaskit/tooltip": "^20.11.0",
|
|
73
73
|
"@babel/runtime": "^7.0.0",
|
|
74
74
|
"@compiled/react": "^0.18.6",
|
|
75
75
|
"date-fns": "^2.17.0",
|
|
@@ -149,9 +149,6 @@
|
|
|
149
149
|
"ptc-enable-profile-card-analytics-refactor": {
|
|
150
150
|
"type": "boolean"
|
|
151
151
|
},
|
|
152
|
-
"profilecard_primitives_compiled": {
|
|
153
|
-
"type": "boolean"
|
|
154
|
-
},
|
|
155
152
|
"cover-header-image-team-profilecard": {
|
|
156
153
|
"type": "boolean"
|
|
157
154
|
},
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/* ActionsCompiled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
exports.AgentActions = void 0;
|
|
10
|
-
require("./ActionsCompiled.compiled.css");
|
|
11
|
-
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
-
var _reactIntlNext = require("react-intl-next");
|
|
17
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
18
|
-
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
-
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
|
-
var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
|
|
22
|
-
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
23
|
-
var _analytics = require("../../util/analytics");
|
|
24
|
-
var _AgentDeleteConfirmationModal = require("./AgentDeleteConfirmationModal");
|
|
25
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
26
|
-
var styles = {
|
|
27
|
-
chatToAgentButtonContainer: "_1bsb1osq",
|
|
28
|
-
chatToAgentButtonWrapper: "_1e0c1txw _1bah1h6o _k48p1wq8 _4t3igktf",
|
|
29
|
-
chatPillButtonInlineStyles: "_18zrv77o",
|
|
30
|
-
chatPillTextStyles: "_1nmz1hna _y3gn1e5h _o5721jtm",
|
|
31
|
-
chatPillIconWrapper: "_1ul9gktf _4t3igktf",
|
|
32
|
-
actionsWrapperStyles: "_189ee4h9 _1h6d1l7x _15a5nqa1 _ca0qpxbi _u5f3pxbi _n3tdpxbi _19bvpxbi _1pfhpxbi _syazi7uo",
|
|
33
|
-
actionsWrapperStylesRefresh: "_ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syazi7uo"
|
|
34
|
-
};
|
|
35
|
-
var AgentActions = exports.AgentActions = function AgentActions(_ref) {
|
|
36
|
-
var onEditAgent = _ref.onEditAgent,
|
|
37
|
-
onDeleteAgent = _ref.onDeleteAgent,
|
|
38
|
-
onDuplicateAgent = _ref.onDuplicateAgent,
|
|
39
|
-
onCopyAgent = _ref.onCopyAgent,
|
|
40
|
-
onChatClick = _ref.onChatClick,
|
|
41
|
-
onViewFullProfileClick = _ref.onViewFullProfileClick,
|
|
42
|
-
agent = _ref.agent,
|
|
43
|
-
resourceClient = _ref.resourceClient,
|
|
44
|
-
hideMoreActions = _ref.hideMoreActions;
|
|
45
|
-
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
46
|
-
formatMessage = _useIntl.formatMessage;
|
|
47
|
-
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
48
|
-
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
49
|
-
var _useAnalyticsEventsNe = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
50
|
-
fireEventNext = _useAnalyticsEventsNe.fireEvent;
|
|
51
|
-
var _useState = (0, _react.useState)(false),
|
|
52
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
|
-
isDeleteModalOpen = _useState2[0],
|
|
54
|
-
setIsDeleteModalOpen = _useState2[1];
|
|
55
|
-
var isForgeAgent = agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY';
|
|
56
|
-
var loadAgentPermissions = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
57
|
-
var _yield$resourceClient, _yield$resourceClient2, AGENT_CREATE, AGENT_UPDATE, AGENT_DEACTIVATE;
|
|
58
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
59
|
-
while (1) switch (_context.prev = _context.next) {
|
|
60
|
-
case 0:
|
|
61
|
-
_context.next = 2;
|
|
62
|
-
return resourceClient.getRovoAgentPermissions(agent.id);
|
|
63
|
-
case 2:
|
|
64
|
-
_yield$resourceClient = _context.sent;
|
|
65
|
-
_yield$resourceClient2 = _yield$resourceClient.permissions;
|
|
66
|
-
AGENT_CREATE = _yield$resourceClient2.AGENT_CREATE;
|
|
67
|
-
AGENT_UPDATE = _yield$resourceClient2.AGENT_UPDATE;
|
|
68
|
-
AGENT_DEACTIVATE = _yield$resourceClient2.AGENT_DEACTIVATE;
|
|
69
|
-
return _context.abrupt("return", {
|
|
70
|
-
isCreateEnabled: AGENT_CREATE.permitted,
|
|
71
|
-
isEditEnabled: AGENT_UPDATE.permitted,
|
|
72
|
-
isDeleteEnabled: AGENT_DEACTIVATE.permitted
|
|
73
|
-
});
|
|
74
|
-
case 8:
|
|
75
|
-
case "end":
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
78
|
-
}, _callee);
|
|
79
|
-
})), [agent.id, resourceClient]);
|
|
80
|
-
var handleDeleteAgent = (0, _react.useCallback)(function () {
|
|
81
|
-
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
82
|
-
fireEventNext('ui.button.clicked.deleteAgentButton', {
|
|
83
|
-
agentId: agent.id,
|
|
84
|
-
source: 'agentProfileCard'
|
|
85
|
-
});
|
|
86
|
-
} else {
|
|
87
|
-
(0, _analytics.fireEvent)(createAnalyticsEvent, {
|
|
88
|
-
action: 'clicked',
|
|
89
|
-
actionSubject: 'button',
|
|
90
|
-
actionSubjectId: 'deleteAgentButton',
|
|
91
|
-
attributes: {
|
|
92
|
-
agentId: agent.id,
|
|
93
|
-
source: 'agentProfileCard'
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
setIsDeleteModalOpen(true);
|
|
98
|
-
}, [agent.id, createAnalyticsEvent, fireEventNext]);
|
|
99
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
100
|
-
space: "space.100",
|
|
101
|
-
xcss: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? styles.actionsWrapperStylesRefresh : styles.actionsWrapperStyles
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
103
|
-
xcss: styles.chatToAgentButtonContainer
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
105
|
-
shouldFitContainer: true,
|
|
106
|
-
onClick: function onClick(e) {
|
|
107
|
-
e.stopPropagation();
|
|
108
|
-
onChatClick(e);
|
|
109
|
-
}
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
111
|
-
xcss: styles.chatToAgentButtonWrapper
|
|
112
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
113
|
-
space: "space.050",
|
|
114
|
-
xcss: (0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') ? null : styles.chatPillButtonInlineStyles,
|
|
115
|
-
alignBlock: "center"
|
|
116
|
-
}, !(0, _platformFeatureFlags.fg)('rovo_agent_empty_state_refresh') && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
117
|
-
xcss: styles.chatPillIconWrapper
|
|
118
|
-
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.ChatPillIcon, null)), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
119
|
-
xcss: styles.chatPillTextStyles
|
|
120
|
-
}, formatMessage(messages.actionChatToAgent)))))), !hideMoreActions && /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentDropdownMenu, {
|
|
121
|
-
agentId: agent.id,
|
|
122
|
-
onDeleteAgent: handleDeleteAgent,
|
|
123
|
-
onEditAgent: onEditAgent,
|
|
124
|
-
onDuplicateAgent: onDuplicateAgent,
|
|
125
|
-
onCopyAgent: onCopyAgent,
|
|
126
|
-
isForgeAgent: isForgeAgent,
|
|
127
|
-
loadAgentPermissions: loadAgentPermissions,
|
|
128
|
-
loadPermissionsOnMount: true,
|
|
129
|
-
onViewAgentFullProfileClick: onViewFullProfileClick,
|
|
130
|
-
doesAgentHaveIdentityAccountId: !!agent.identity_account_id,
|
|
131
|
-
shouldTriggerStopPropagation: true
|
|
132
|
-
})), /*#__PURE__*/_react.default.createElement(_AgentDeleteConfirmationModal.AgentDeleteConfirmationModal, {
|
|
133
|
-
isOpen: isDeleteModalOpen,
|
|
134
|
-
onClose: function onClose() {
|
|
135
|
-
setIsDeleteModalOpen(false);
|
|
136
|
-
},
|
|
137
|
-
onSubmit: onDeleteAgent,
|
|
138
|
-
agentId: agent.id,
|
|
139
|
-
agentName: agent.name
|
|
140
|
-
}));
|
|
141
|
-
};
|
|
142
|
-
var messages = (0, _reactIntlNext.defineMessages)({
|
|
143
|
-
actionChatToAgent: {
|
|
144
|
-
id: 'ptc-directory.agent-profile.action.dropdown.chat-with-agent',
|
|
145
|
-
defaultMessage: 'Chat with Agent',
|
|
146
|
-
description: 'Text for the "chat with agent" action to chat to the agent'
|
|
147
|
-
}
|
|
148
|
-
});
|