@atlaskit/profilecard 24.14.0 → 24.15.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 +21 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/error-state--default.png +0 -0
- package/__tests__/vr-tests/agent-profilecard.vr.tsx +7 -1
- package/__tests__/vr-tests/user-profilecard.vr.tsx +42 -6
- package/dist/cjs/client/ProfileCardClient.js +10 -10
- package/dist/cjs/client/RovoAgentCardClient.js +172 -56
- package/dist/cjs/client/TeamProfileCardClient.js +44 -14
- package/dist/cjs/client/UserProfileCardClient.js +2 -9
- package/dist/cjs/client/errorUtils.js +83 -5
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +25 -11
- package/dist/cjs/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/cjs/components/Agent/ActionsCompiled.js +150 -0
- package/dist/cjs/components/Agent/AgentDeleteConfirmationModal.js +2 -4
- package/dist/cjs/components/Agent/AgentProfileCard.js +28 -14
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.js +257 -0
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.js +9 -8
- package/dist/cjs/components/Agent/ConversationStarters.js +2 -4
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/cjs/components/Error/ErrorMessage.js +3 -3
- package/dist/cjs/components/Team/TeamForbiddenErrorState.js +21 -6
- package/dist/cjs/components/Team/TeamLoadingState.js +21 -6
- package/dist/cjs/components/Team/TeamProfileCard.js +155 -60
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +107 -36
- package/dist/cjs/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/cjs/components/User/ProfileCardDetails.js +2 -4
- package/dist/cjs/components/User/ReportingLinesDetails.js +4 -1
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.js +109 -0
- package/dist/cjs/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/cjs/components/common/ProfileCardWrapper.js +9 -8
- package/dist/cjs/components/team-profile-card/main.js +18 -9
- package/dist/cjs/components/team-profile-card/team-actions/more-actions/index.js +2 -4
- package/dist/cjs/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/cjs/styled/CoverImage.compiled.css +2 -0
- package/dist/cjs/styled/CoverImage.js +4 -2
- package/dist/cjs/styled/Error.compiled.css +0 -2
- package/dist/cjs/styled/Error.js +5 -3
- package/dist/cjs/util/analytics.js +57 -2
- package/dist/es2019/client/ProfileCardClient.js +10 -10
- package/dist/es2019/client/RovoAgentCardClient.js +186 -58
- package/dist/es2019/client/TeamProfileCardClient.js +49 -16
- package/dist/es2019/client/UserProfileCardClient.js +3 -10
- package/dist/es2019/client/errorUtils.js +84 -3
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +26 -11
- package/dist/es2019/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/es2019/components/Agent/ActionsCompiled.js +127 -0
- package/dist/es2019/components/Agent/AgentDeleteConfirmationModal.js +1 -2
- package/dist/es2019/components/Agent/AgentProfileCard.js +28 -13
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.js +200 -0
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +9 -5
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +7 -2
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.js +8 -7
- package/dist/es2019/components/Agent/ConversationStarters.js +1 -3
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +62 -30
- package/dist/es2019/components/Error/ErrorMessage.js +1 -2
- package/dist/es2019/components/Team/TeamForbiddenErrorState.js +17 -6
- package/dist/es2019/components/Team/TeamLoadingState.js +17 -6
- package/dist/es2019/components/Team/TeamProfileCard.js +144 -54
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +75 -12
- package/dist/es2019/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/es2019/components/User/ProfileCardDetails.js +1 -4
- package/dist/es2019/components/User/ReportingLinesDetails.js +4 -1
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.js +96 -0
- package/dist/es2019/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/es2019/components/common/ProfileCardWrapper.js +8 -7
- package/dist/es2019/components/team-profile-card/main.js +19 -9
- package/dist/es2019/components/team-profile-card/team-actions/more-actions/index.js +1 -2
- package/dist/es2019/components/team-profile-card/team-connections/main.js +38 -17
- package/dist/es2019/styled/CoverImage.compiled.css +2 -0
- package/dist/es2019/styled/CoverImage.js +4 -2
- package/dist/es2019/styled/Error.compiled.css +0 -2
- package/dist/es2019/styled/Error.js +6 -4
- package/dist/es2019/util/analytics.js +57 -2
- package/dist/esm/client/ProfileCardClient.js +10 -10
- package/dist/esm/client/RovoAgentCardClient.js +174 -58
- package/dist/esm/client/TeamProfileCardClient.js +46 -16
- package/dist/esm/client/UserProfileCardClient.js +3 -10
- package/dist/esm/client/errorUtils.js +82 -4
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +25 -11
- package/dist/esm/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/esm/components/Agent/ActionsCompiled.js +141 -0
- package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +1 -2
- package/dist/esm/components/Agent/AgentProfileCard.js +29 -13
- package/dist/esm/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/esm/components/Agent/AgentProfileCardCompiled.js +248 -0
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/esm/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/esm/components/Agent/AgentProfileCardWrapper.js +8 -7
- package/dist/esm/components/Agent/ConversationStarters.js +1 -3
- package/dist/esm/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/esm/components/Error/ErrorMessage.js +1 -2
- package/dist/esm/components/Team/TeamForbiddenErrorState.js +22 -7
- package/dist/esm/components/Team/TeamLoadingState.js +22 -7
- package/dist/esm/components/Team/TeamProfileCard.js +156 -61
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +106 -36
- package/dist/esm/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/esm/components/User/ProfileCardDetails.js +1 -4
- package/dist/esm/components/User/ReportingLinesDetails.js +4 -1
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.js +102 -0
- package/dist/esm/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/esm/components/common/ProfileCardWrapper.js +8 -7
- package/dist/esm/components/team-profile-card/main.js +18 -9
- package/dist/esm/components/team-profile-card/team-actions/more-actions/index.js +1 -2
- package/dist/esm/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/esm/styled/CoverImage.compiled.css +2 -0
- package/dist/esm/styled/CoverImage.js +4 -2
- package/dist/esm/styled/Error.compiled.css +0 -2
- package/dist/esm/styled/Error.js +6 -4
- package/dist/esm/util/analytics.js +57 -2
- package/dist/types/client/ProfileCardClient.d.ts +5 -5
- package/dist/types/client/RovoAgentCardClient.d.ts +5 -4
- package/dist/types/client/TeamProfileCardClient.d.ts +2 -1
- package/dist/types/client/errorUtils.d.ts +2 -1
- package/dist/types/client/types.d.ts +14 -2
- package/dist/types/components/Agent/Actions.d.ts +10 -1
- package/dist/types/components/Agent/ActionsCompiled.d.ts +14 -0
- package/dist/types/components/Agent/AgentProfileCard.d.ts +13 -3
- package/dist/types/components/Agent/AgentProfileCardCompiled.d.ts +4 -0
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +12 -1
- package/dist/types/components/Team/TeamForbiddenErrorState.d.ts +2 -1
- package/dist/types/components/Team/TeamLoadingState.d.ts +2 -1
- package/dist/types/components/Team/TeamProfileCardTrigger.d.ts +7 -2
- package/dist/types/components/User/ReportingLinesDetails.d.ts +2 -2
- package/dist/types/components/User/ReportingLinesDetailsCompiled.d.ts +5 -0
- package/dist/types/types.d.ts +2 -0
- package/dist/types/util/analytics.d.ts +46 -2
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +5 -5
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +5 -4
- package/dist/types-ts4.5/client/TeamProfileCardClient.d.ts +2 -1
- package/dist/types-ts4.5/client/errorUtils.d.ts +2 -1
- package/dist/types-ts4.5/client/types.d.ts +14 -2
- package/dist/types-ts4.5/components/Agent/Actions.d.ts +10 -1
- package/dist/types-ts4.5/components/Agent/ActionsCompiled.d.ts +14 -0
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +13 -3
- package/dist/types-ts4.5/components/Agent/AgentProfileCardCompiled.d.ts +4 -0
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +12 -1
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +2 -1
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +2 -1
- package/dist/types-ts4.5/components/Team/TeamProfileCardTrigger.d.ts +7 -2
- package/dist/types-ts4.5/components/User/ReportingLinesDetails.d.ts +2 -2
- package/dist/types-ts4.5/components/User/ReportingLinesDetailsCompiled.d.ts +5 -0
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/dist/types-ts4.5/util/analytics.d.ts +46 -2
- package/package.json +15 -9
|
@@ -11,7 +11,9 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
13
|
var _menu = require("@atlaskit/menu");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
|
+
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
15
17
|
var _teamsPublic = require("@atlaskit/teams-public");
|
|
16
18
|
var _analytics = require("../../../util/analytics");
|
|
17
19
|
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); }
|
|
@@ -35,16 +37,24 @@ var TeamConnections = exports.TeamConnections = function TeamConnections(_ref) {
|
|
|
35
37
|
containerTypeText = _getContainerProperti.containerTypeText;
|
|
36
38
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
37
39
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
40
|
+
var _useAnalyticsEventsNe = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
41
|
+
fireEventNext = _useAnalyticsEventsNe.fireEvent;
|
|
38
42
|
var onClick = (0, _react.useCallback)(function () {
|
|
39
|
-
(0,
|
|
40
|
-
|
|
41
|
-
actionSubject: 'teamConnectionItem',
|
|
42
|
-
actionSubjectId: 'teamProfileCard',
|
|
43
|
-
attributes: {
|
|
43
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
44
|
+
fireEventNext('ui.teamConnectionItem.clicked.teamProfileCard', {
|
|
44
45
|
container: containerType
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
(0, _analytics.fireEvent)(createAnalyticsEvent, {
|
|
49
|
+
action: 'clicked',
|
|
50
|
+
actionSubject: 'teamConnectionItem',
|
|
51
|
+
actionSubjectId: 'teamProfileCard',
|
|
52
|
+
attributes: {
|
|
53
|
+
container: containerType
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, [containerType, createAnalyticsEvent, fireEventNext]);
|
|
48
58
|
return /*#__PURE__*/_react.default.createElement(_menu.LinkItem, {
|
|
49
59
|
href: link,
|
|
50
60
|
onClick: onClick,
|
|
@@ -89,16 +99,24 @@ var NewTeamConnections = exports.NewTeamConnections = function NewTeamConnection
|
|
|
89
99
|
containerTypeText = _getContainerProperti2.containerTypeText;
|
|
90
100
|
var _useAnalyticsEvents2 = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
91
101
|
createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
|
|
102
|
+
var _useAnalyticsEventsNe2 = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
103
|
+
fireEventNext = _useAnalyticsEventsNe2.fireEvent;
|
|
92
104
|
var onClick = (0, _react.useCallback)(function () {
|
|
93
|
-
(0,
|
|
94
|
-
|
|
95
|
-
actionSubject: 'teamConnectionItem',
|
|
96
|
-
actionSubjectId: 'teamProfileCard',
|
|
97
|
-
attributes: {
|
|
105
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
106
|
+
fireEventNext('ui.teamConnectionItem.clicked.teamProfileCard', {
|
|
98
107
|
container: containerType
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
(0, _analytics.fireEvent)(createAnalyticsEvent, {
|
|
111
|
+
action: 'clicked',
|
|
112
|
+
actionSubject: 'teamConnectionItem',
|
|
113
|
+
actionSubjectId: 'teamProfileCard',
|
|
114
|
+
attributes: {
|
|
115
|
+
container: containerType
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, [containerType, createAnalyticsEvent, fireEventNext]);
|
|
102
120
|
return /*#__PURE__*/_react.default.createElement(_menu.LinkItem, {
|
|
103
121
|
href: link,
|
|
104
122
|
onClick: onClick,
|
|
@@ -122,7 +140,8 @@ var NewTeamConnections = exports.NewTeamConnections = function NewTeamConnection
|
|
|
122
140
|
backgroundColor: 'color.background.neutral.subtle',
|
|
123
141
|
xcss: styles.containerTypeIconButtonStyles,
|
|
124
142
|
testId: "container-type-icon"
|
|
125
|
-
}, icon)
|
|
143
|
+
}, icon),
|
|
144
|
+
testId: "team-connection-item"
|
|
126
145
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
127
146
|
maxLines: 1,
|
|
128
147
|
color: "color.text"
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
._1e0c1txw{display:flex}
|
|
7
7
|
._1reo15vq{overflow-x:hidden}
|
|
8
8
|
._4cvr1h6o{align-items:center}
|
|
9
|
+
._4t3i1osq{height:100%}
|
|
9
10
|
._4t3i1qr7{height:8pc}
|
|
10
11
|
._4t3i1wug{height:auto}
|
|
12
|
+
._5ral1dfr{object-fit:cover}
|
|
11
13
|
._kqswh2mm{position:relative}
|
|
12
14
|
._qrwq12b0{border-top-right-radius:var(--ds-radius-small,4px)}
|
|
@@ -9,11 +9,13 @@ exports.CoverImage = void 0;
|
|
|
9
9
|
require("./CoverImage.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
14
|
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); }
|
|
14
15
|
var styles = {
|
|
15
16
|
container: "_1reo15vq _18m915vq _1bsb1osq _4t3i1qr7 _kqswh2mm _13li12b0 _qrwq12b0 _1e0c1txw _1bah1h6o _4cvr1h6o",
|
|
16
|
-
image: "_1bsbnklw _4t3i1wug"
|
|
17
|
+
image: "_1bsbnklw _4t3i1wug",
|
|
18
|
+
imageNext: "_4t3i1osq _5ral1dfr"
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -34,6 +36,6 @@ var CoverImage = exports.CoverImage = function CoverImage(_ref) {
|
|
|
34
36
|
ref: imgRef,
|
|
35
37
|
src: src,
|
|
36
38
|
alt: alt,
|
|
37
|
-
xcss: styles.image
|
|
39
|
+
xcss: (0, _platformFeatureFlags.fg)('cover-header-image-team-profilecard') ? styles.imageNext : styles.image
|
|
38
40
|
}));
|
|
39
41
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
1
|
._19bv1ejb{padding-left:var(--ds-space-300,24px)}
|
|
3
2
|
._19pku2gc{margin-top:var(--ds-space-100,8px)}
|
|
4
3
|
._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
|
|
5
4
|
._n3td1ejb{padding-bottom:var(--ds-space-300,24px)}
|
|
6
|
-
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
7
5
|
._syaz1wmz{color:var(--ds-text-subtlest,#6b778c)}
|
|
8
6
|
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
9
7
|
._y3gn1h6o{text-align:center}
|
package/dist/cjs/styled/Error.js
CHANGED
|
@@ -15,7 +15,7 @@ var _compiled = require("@atlaskit/primitives/compiled");
|
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var styles = {
|
|
17
17
|
errorWrapper: "_y3gn1h6o _ca0q1ejb _u5f31ejb _n3td1ejb _19bv1ejb",
|
|
18
|
-
errorTitle: "
|
|
18
|
+
errorTitle: "_19pku2gc",
|
|
19
19
|
teamErrorText: "_syaz1wmz _19pku2gc"
|
|
20
20
|
};
|
|
21
21
|
var ErrorWrapper = exports.ErrorWrapper = function ErrorWrapper(props) {
|
|
@@ -25,8 +25,10 @@ var ErrorWrapper = exports.ErrorWrapper = function ErrorWrapper(props) {
|
|
|
25
25
|
};
|
|
26
26
|
var ErrorTitle = exports.ErrorTitle = function ErrorTitle(props) {
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
28
|
-
xcss:
|
|
29
|
-
},
|
|
28
|
+
xcss: styles.errorTitle
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
30
|
+
color: "color.text"
|
|
31
|
+
}, props.children));
|
|
30
32
|
};
|
|
31
33
|
var TeamErrorText = exports.TeamErrorText = function TeamErrorText(props) {
|
|
32
34
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
14
14
|
var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
|
|
15
15
|
packageName: "@atlaskit/profilecard",
|
|
16
|
-
packageVersion: "
|
|
16
|
+
packageVersion: "0.0.0-development"
|
|
17
17
|
};
|
|
18
18
|
var runItLater = function runItLater(cb) {
|
|
19
19
|
var requestIdleCallback = window.requestIdleCallback;
|
|
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
58
58
|
actionSubjectId: actionSubjectId,
|
|
59
59
|
attributes: _objectSpread(_objectSpread({
|
|
60
60
|
packageName: "@atlaskit/profilecard",
|
|
61
|
-
packageVersion: "
|
|
61
|
+
packageVersion: "0.0.0-development"
|
|
62
62
|
}, attributes), {}, {
|
|
63
63
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
64
64
|
})
|
|
@@ -76,6 +76,11 @@ var getActionSubject = exports.getActionSubject = function getActionSubject(type
|
|
|
76
76
|
return 'user';
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @private
|
|
82
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
83
|
+
*/
|
|
79
84
|
var cardTriggered = exports.cardTriggered = function cardTriggered(type, method, teamId) {
|
|
80
85
|
return createEvent('ui', 'triggered', getActionSubject(type), undefined, _objectSpread({
|
|
81
86
|
method: method
|
|
@@ -83,33 +88,83 @@ var cardTriggered = exports.cardTriggered = function cardTriggered(type, method,
|
|
|
83
88
|
teamId: teamId
|
|
84
89
|
} : {}));
|
|
85
90
|
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @private
|
|
94
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
95
|
+
*/
|
|
86
96
|
var teamRequestAnalytics = exports.teamRequestAnalytics = function teamRequestAnalytics(action, attributes) {
|
|
87
97
|
return createEvent('operational', action, TEAM_SUBJECT, 'request', attributes);
|
|
88
98
|
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @private
|
|
102
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
103
|
+
*/
|
|
89
104
|
var userRequestAnalytics = exports.userRequestAnalytics = function userRequestAnalytics(action, attributes) {
|
|
90
105
|
return createEvent('operational', action, USER_SUBJECT, 'request', attributes);
|
|
91
106
|
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @private
|
|
110
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
111
|
+
*/
|
|
92
112
|
var profileCardRendered = exports.profileCardRendered = function profileCardRendered(type, actionSubjectId, attributes) {
|
|
93
113
|
return createEvent('ui', 'rendered', getActionSubject(type), actionSubjectId, attributes);
|
|
94
114
|
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @private
|
|
118
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
119
|
+
*/
|
|
95
120
|
var actionClicked = exports.actionClicked = function actionClicked(type, attributes) {
|
|
96
121
|
return createEvent('ui', 'clicked', getActionSubject(type), 'action', attributes);
|
|
97
122
|
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @private
|
|
126
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
127
|
+
*/
|
|
98
128
|
var reportingLinesClicked = exports.reportingLinesClicked = function reportingLinesClicked(attributes) {
|
|
99
129
|
return createEvent('ui', 'clicked', USER_SUBJECT, 'reportingLines', attributes);
|
|
100
130
|
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @private
|
|
134
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
135
|
+
*/
|
|
101
136
|
var moreActionsClicked = exports.moreActionsClicked = function moreActionsClicked(type, attributes) {
|
|
102
137
|
return createEvent('ui', 'clicked', getActionSubject(type), 'moreActions', attributes);
|
|
103
138
|
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @private
|
|
142
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
143
|
+
*/
|
|
104
144
|
var teamAvatarClicked = exports.teamAvatarClicked = function teamAvatarClicked(attributes) {
|
|
105
145
|
return createEvent('ui', 'clicked', TEAM_SUBJECT, 'avatar', attributes);
|
|
106
146
|
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @private
|
|
150
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
151
|
+
*/
|
|
107
152
|
var moreMembersClicked = exports.moreMembersClicked = function moreMembersClicked(attributes) {
|
|
108
153
|
return createEvent('ui', 'clicked', TEAM_SUBJECT, 'moreMembers', attributes);
|
|
109
154
|
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @private
|
|
158
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
159
|
+
*/
|
|
110
160
|
var errorRetryClicked = exports.errorRetryClicked = function errorRetryClicked(attributes) {
|
|
111
161
|
return createEvent('ui', 'clicked', TEAM_SUBJECT, 'errorRetry', attributes);
|
|
112
162
|
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @private
|
|
166
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
167
|
+
*/
|
|
113
168
|
var agentRequestAnalytics = exports.agentRequestAnalytics = function agentRequestAnalytics(action, actionSubjectId, attributes) {
|
|
114
169
|
return createEvent('operational', action, AGENT_SUBJECT, actionSubjectId || 'request', attributes);
|
|
115
170
|
};
|
|
@@ -32,8 +32,8 @@ class ProfileCardClient {
|
|
|
32
32
|
getProfile(cloudId, userId, analytics, analyticsNext) {
|
|
33
33
|
return this.userClient.getProfile(cloudId, userId, analytics, analyticsNext);
|
|
34
34
|
}
|
|
35
|
-
getTeamProfile(teamId, orgId, analytics) {
|
|
36
|
-
return this.teamClient.getProfile(teamId, orgId, analytics);
|
|
35
|
+
getTeamProfile(teamId, orgId, analytics, analyticsNext) {
|
|
36
|
+
return this.teamClient.getProfile(teamId, orgId, analytics, analyticsNext);
|
|
37
37
|
}
|
|
38
38
|
getReportingLines(userId) {
|
|
39
39
|
var _this$tcClient2;
|
|
@@ -69,21 +69,21 @@ class ProfileCardClient {
|
|
|
69
69
|
}
|
|
70
70
|
return this.tcClient.checkWorkspaceExists();
|
|
71
71
|
}
|
|
72
|
-
getRovoAgentProfile(id, analytics) {
|
|
72
|
+
getRovoAgentProfile(id, analytics, analyticsNext) {
|
|
73
73
|
var _this$rovoAgentClient2;
|
|
74
|
-
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics);
|
|
74
|
+
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics, analyticsNext);
|
|
75
75
|
}
|
|
76
|
-
getRovoAgentPermissions(id, fireAnalytics) {
|
|
76
|
+
getRovoAgentPermissions(id, fireAnalytics, analyticsNext) {
|
|
77
77
|
var _this$rovoAgentClient3;
|
|
78
|
-
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics);
|
|
78
|
+
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics, analyticsNext);
|
|
79
79
|
}
|
|
80
|
-
deleteAgent(id, analytics) {
|
|
80
|
+
deleteAgent(id, analytics, analyticsNext) {
|
|
81
81
|
var _this$rovoAgentClient4;
|
|
82
|
-
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics);
|
|
82
|
+
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics, analyticsNext);
|
|
83
83
|
}
|
|
84
|
-
setFavouriteAgent(id, isFavourite, analytics) {
|
|
84
|
+
setFavouriteAgent(id, isFavourite, analytics, analyticsNext) {
|
|
85
85
|
var _this$rovoAgentClient5;
|
|
86
|
-
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics);
|
|
86
|
+
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics, analyticsNext);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
function maybeCreateTeamCentralClient(config, clients) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { agentRequestAnalytics } from '../util/analytics';
|
|
2
|
+
import { agentRequestAnalytics, PACKAGE_META_DATA } from '../util/analytics';
|
|
3
3
|
import { getPageTime } from '../util/performance';
|
|
4
4
|
import CachingClient from './CachingClient';
|
|
5
|
-
import { getErrorAttributes } from './errorUtils';
|
|
5
|
+
import { DEPRECATED_getErrorAttributes, getErrorAttributes } from './errorUtils';
|
|
6
6
|
const createHeaders = (product, cloudId, isBodyJson) => {
|
|
7
7
|
const headers = new Headers({
|
|
8
8
|
'X-Product': product,
|
|
@@ -40,7 +40,7 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
40
40
|
headers
|
|
41
41
|
})).then(response => response.json());
|
|
42
42
|
}
|
|
43
|
-
getProfile(id, analytics) {
|
|
43
|
+
getProfile(id, analytics, analyticsNext) {
|
|
44
44
|
if (!id.value) {
|
|
45
45
|
return Promise.reject(new Error('Id is missing'));
|
|
46
46
|
}
|
|
@@ -53,41 +53,82 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
53
53
|
}
|
|
54
54
|
return new Promise((resolve, reject) => {
|
|
55
55
|
const startTime = getPageTime();
|
|
56
|
-
if (analytics) {
|
|
57
|
-
|
|
56
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
57
|
+
if (analyticsNext) {
|
|
58
|
+
analyticsNext('operational.rovoAgentProfilecard.triggered.request', {
|
|
59
|
+
firedAt: Math.round(getPageTime()),
|
|
60
|
+
...PACKAGE_META_DATA
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
if (analytics) {
|
|
65
|
+
analytics(agentRequestAnalytics('triggered'));
|
|
66
|
+
}
|
|
58
67
|
}
|
|
59
68
|
this.makeRequest(id, this.options.cloudId || '').then(data => {
|
|
60
69
|
if (this.cache) {
|
|
61
70
|
this.setCachedProfile(id.value, data);
|
|
62
71
|
}
|
|
63
|
-
if (analytics) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
73
|
+
if (analyticsNext) {
|
|
74
|
+
analyticsNext('operational.rovoAgentProfilecard.succeeded.request', {
|
|
75
|
+
duration: getPageTime() - startTime,
|
|
76
|
+
gateway: true,
|
|
77
|
+
firedAt: Math.round(getPageTime()),
|
|
78
|
+
...PACKAGE_META_DATA
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
if (analytics) {
|
|
83
|
+
analytics(agentRequestAnalytics('succeeded', 'request', {
|
|
84
|
+
duration: getPageTime() - startTime,
|
|
85
|
+
gateway: true
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
68
88
|
}
|
|
69
89
|
resolve(data);
|
|
70
90
|
}).catch(error => {
|
|
71
|
-
if (analytics) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
91
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
92
|
+
if (analyticsNext) {
|
|
93
|
+
analyticsNext('operational.rovoAgentProfilecard.failed.request', {
|
|
94
|
+
duration: getPageTime() - startTime,
|
|
95
|
+
...getErrorAttributes(error),
|
|
96
|
+
gateway: true,
|
|
97
|
+
firedAt: Math.round(getPageTime()),
|
|
98
|
+
...PACKAGE_META_DATA
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
if (analytics) {
|
|
103
|
+
analytics(agentRequestAnalytics('failed', 'request', {
|
|
104
|
+
duration: getPageTime() - startTime,
|
|
105
|
+
...DEPRECATED_getErrorAttributes(error),
|
|
106
|
+
gateway: true
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
77
109
|
}
|
|
78
110
|
reject(error);
|
|
79
111
|
});
|
|
80
112
|
});
|
|
81
113
|
}
|
|
82
|
-
deleteAgent(agentId, analytics) {
|
|
114
|
+
deleteAgent(agentId, analytics, analyticsNext) {
|
|
83
115
|
if (!this.options.cloudId) {
|
|
84
116
|
return Promise.reject(new Error('cloudId is missing'));
|
|
85
117
|
}
|
|
86
118
|
return new Promise((resolve, reject) => {
|
|
87
119
|
const startTime = getPageTime();
|
|
88
120
|
const product = this.options.productIdentifier || 'rovo';
|
|
89
|
-
if (analytics) {
|
|
90
|
-
|
|
121
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
122
|
+
if (analyticsNext) {
|
|
123
|
+
analyticsNext('operational.rovoAgentProfilecard.triggered.request', {
|
|
124
|
+
firedAt: Math.round(getPageTime()),
|
|
125
|
+
...PACKAGE_META_DATA
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (analytics) {
|
|
130
|
+
analytics(agentRequestAnalytics('triggered'));
|
|
131
|
+
}
|
|
91
132
|
}
|
|
92
133
|
const headers = createHeaders(product, this.options.cloudId);
|
|
93
134
|
fetch(new Request(`${this.basePath()}/${agentId}`, {
|
|
@@ -96,26 +137,49 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
96
137
|
mode: 'cors',
|
|
97
138
|
headers
|
|
98
139
|
})).then(() => {
|
|
99
|
-
if (analytics) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
140
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
141
|
+
if (analyticsNext) {
|
|
142
|
+
analyticsNext('operational.rovoAgentProfilecard.succeeded.deleteAgent', {
|
|
143
|
+
duration: getPageTime() - startTime,
|
|
144
|
+
gateway: true,
|
|
145
|
+
firedAt: Math.round(getPageTime()),
|
|
146
|
+
...PACKAGE_META_DATA
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
if (analytics) {
|
|
151
|
+
analytics(agentRequestAnalytics('succeeded', 'deleteAgent', {
|
|
152
|
+
duration: getPageTime() - startTime,
|
|
153
|
+
gateway: true
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
104
156
|
}
|
|
105
157
|
resolve();
|
|
106
158
|
}).catch(error => {
|
|
107
|
-
if (analytics) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
159
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
160
|
+
if (analyticsNext) {
|
|
161
|
+
analyticsNext('operational.rovoAgentProfilecard.failed.deleteAgent', {
|
|
162
|
+
duration: getPageTime() - startTime,
|
|
163
|
+
...getErrorAttributes(error),
|
|
164
|
+
gateway: true,
|
|
165
|
+
firedAt: Math.round(getPageTime()),
|
|
166
|
+
...PACKAGE_META_DATA
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
if (analytics) {
|
|
171
|
+
analytics(agentRequestAnalytics('failed', 'deleteAgent', {
|
|
172
|
+
duration: getPageTime() - startTime,
|
|
173
|
+
...DEPRECATED_getErrorAttributes(error),
|
|
174
|
+
gateway: true
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
113
177
|
}
|
|
114
178
|
reject(error);
|
|
115
179
|
});
|
|
116
180
|
});
|
|
117
181
|
}
|
|
118
|
-
setFavouriteAgent(agentId, isFavourite, analytics) {
|
|
182
|
+
setFavouriteAgent(agentId, isFavourite, analytics, analyticsNext) {
|
|
119
183
|
if (!this.options.cloudId) {
|
|
120
184
|
return Promise.reject(new Error('cloudId is missing'));
|
|
121
185
|
}
|
|
@@ -124,8 +188,17 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
124
188
|
const product = this.options.productIdentifier || 'rovo';
|
|
125
189
|
const actionSubjectId = isFavourite ? 'favourite' : 'unfavourite';
|
|
126
190
|
const requestMethod = isFavourite ? 'POST' : 'DELETE';
|
|
127
|
-
if (analytics) {
|
|
128
|
-
|
|
191
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
192
|
+
if (analyticsNext) {
|
|
193
|
+
analyticsNext(`operational.rovoAgentProfilecard.triggered.${actionSubjectId}`, {
|
|
194
|
+
firedAt: Math.round(getPageTime()),
|
|
195
|
+
...PACKAGE_META_DATA
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
if (analytics) {
|
|
200
|
+
analytics(agentRequestAnalytics('triggered', 'actionSubjectId'));
|
|
201
|
+
}
|
|
129
202
|
}
|
|
130
203
|
const headers = createHeaders(product, this.options.cloudId);
|
|
131
204
|
await fetch(new Request(`${this.basePath()}/${agentId}/favourite`, {
|
|
@@ -134,34 +207,66 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
134
207
|
mode: 'cors',
|
|
135
208
|
headers
|
|
136
209
|
})).then(() => {
|
|
137
|
-
if (analytics) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
210
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
211
|
+
if (analyticsNext) {
|
|
212
|
+
analyticsNext(`operational.rovoAgentProfilecard.succeeded.${actionSubjectId}`, {
|
|
213
|
+
duration: getPageTime() - startTime,
|
|
214
|
+
gateway: true,
|
|
215
|
+
firedAt: Math.round(getPageTime()),
|
|
216
|
+
...PACKAGE_META_DATA
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
if (analytics) {
|
|
221
|
+
analytics(agentRequestAnalytics('succeeded', actionSubjectId, {
|
|
222
|
+
duration: getPageTime() - startTime,
|
|
223
|
+
gateway: true
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
142
226
|
}
|
|
143
227
|
resolve();
|
|
144
228
|
}).catch(error => {
|
|
145
|
-
if (analytics) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
229
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
230
|
+
if (analyticsNext) {
|
|
231
|
+
analyticsNext(`operational.rovoAgentProfilecard.failed.${actionSubjectId}`, {
|
|
232
|
+
duration: getPageTime() - startTime,
|
|
233
|
+
...getErrorAttributes(error),
|
|
234
|
+
gateway: true,
|
|
235
|
+
firedAt: Math.round(getPageTime()),
|
|
236
|
+
...PACKAGE_META_DATA
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
if (analytics) {
|
|
241
|
+
analytics(agentRequestAnalytics('failed', actionSubjectId, {
|
|
242
|
+
duration: getPageTime() - startTime,
|
|
243
|
+
...DEPRECATED_getErrorAttributes(error),
|
|
244
|
+
gateway: true
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
151
247
|
}
|
|
152
248
|
reject(error);
|
|
153
249
|
});
|
|
154
250
|
});
|
|
155
251
|
}
|
|
156
|
-
getPermissions(id, fireAnalytics) {
|
|
252
|
+
getPermissions(id, fireAnalytics, fireAnalyticsNext) {
|
|
157
253
|
if (!this.options.cloudId) {
|
|
158
254
|
return Promise.reject(new Error('cloudId is missing'));
|
|
159
255
|
}
|
|
160
256
|
return new Promise((resolve, reject) => {
|
|
161
257
|
const startTime = getPageTime();
|
|
162
258
|
const product = this.options.productIdentifier || 'rovo';
|
|
163
|
-
if (
|
|
164
|
-
|
|
259
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
260
|
+
if (fireAnalyticsNext) {
|
|
261
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.triggered.request', {
|
|
262
|
+
firedAt: Math.round(getPageTime()),
|
|
263
|
+
...PACKAGE_META_DATA
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
if (fireAnalytics) {
|
|
268
|
+
fireAnalytics(agentRequestAnalytics('triggered'));
|
|
269
|
+
}
|
|
165
270
|
}
|
|
166
271
|
const headers = createHeaders(product, this.options.cloudId, true);
|
|
167
272
|
fetch(new Request(`/gateway/api/assist/api/rovo/v2/permissions/agents/${id}`, {
|
|
@@ -173,20 +278,43 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
173
278
|
permission_ids: ['AGENT_CREATE', 'AGENT_UPDATE', 'AGENT_DELETE', 'AGENT_DEACTIVATE', 'AGENT_READ']
|
|
174
279
|
})
|
|
175
280
|
})).then(response => response.json()).then(data => {
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
281
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
282
|
+
if (fireAnalyticsNext) {
|
|
283
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.succeeded.getAgentPermissions', {
|
|
284
|
+
duration: getPageTime() - startTime,
|
|
285
|
+
gateway: true,
|
|
286
|
+
firedAt: Math.round(getPageTime()),
|
|
287
|
+
...PACKAGE_META_DATA
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
if (fireAnalytics) {
|
|
292
|
+
fireAnalytics(agentRequestAnalytics('succeeded', 'getAgentPermissions', {
|
|
293
|
+
duration: getPageTime() - startTime,
|
|
294
|
+
gateway: true
|
|
295
|
+
}));
|
|
296
|
+
}
|
|
181
297
|
}
|
|
182
298
|
resolve(data);
|
|
183
299
|
}).catch(error => {
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
300
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
301
|
+
if (fireAnalyticsNext) {
|
|
302
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.failed.getAgentPermissions', {
|
|
303
|
+
duration: getPageTime() - startTime,
|
|
304
|
+
...getErrorAttributes(error),
|
|
305
|
+
gateway: true,
|
|
306
|
+
firedAt: Math.round(getPageTime()),
|
|
307
|
+
...PACKAGE_META_DATA
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
if (fireAnalytics) {
|
|
312
|
+
fireAnalytics(agentRequestAnalytics('failed', 'getAgentPermissions', {
|
|
313
|
+
duration: getPageTime() - startTime,
|
|
314
|
+
...DEPRECATED_getErrorAttributes(error),
|
|
315
|
+
gateway: true
|
|
316
|
+
}));
|
|
317
|
+
}
|
|
190
318
|
}
|
|
191
319
|
reject(error);
|
|
192
320
|
});
|