@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 24.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`86f959878c6d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/86f959878c6d4) -
|
|
8
|
+
Migrated team and agent profile card analytics to teams-app-internal-analytics
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 24.14.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`ffd8cae818b90`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ffd8cae818b90) -
|
|
19
|
+
Always fill header images in team card
|
|
20
|
+
- [`0168357a3987b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0168357a3987b) -
|
|
21
|
+
Migrate primitives to compiled
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 24.14.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
Binary file
|
|
@@ -2,4 +2,10 @@ import { snapshot } from '@af/visual-regression';
|
|
|
2
2
|
|
|
3
3
|
import { AgentProfileCardExample } from '../../examples/13-agent-profilecard';
|
|
4
4
|
|
|
5
|
-
snapshot(AgentProfileCardExample
|
|
5
|
+
snapshot(AgentProfileCardExample, {
|
|
6
|
+
hooks: {
|
|
7
|
+
flags: {
|
|
8
|
+
profilecard_primitives_compiled: true,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -9,9 +9,45 @@ import {
|
|
|
9
9
|
WorstCaseProfile,
|
|
10
10
|
} from '../../examples/03-profilecard-overview';
|
|
11
11
|
|
|
12
|
-
snapshot(ErrorState
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
snapshot(ErrorState, {
|
|
13
|
+
hooks: {
|
|
14
|
+
flags: {
|
|
15
|
+
profilecard_primitives_compiled: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
snapshot(ErrorStateNotFound, {
|
|
20
|
+
hooks: {
|
|
21
|
+
flags: {
|
|
22
|
+
profilecard_primitives_compiled: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
snapshot(BestCaseProfile, {
|
|
27
|
+
hooks: {
|
|
28
|
+
flags: {
|
|
29
|
+
profilecard_primitives_compiled: true,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
snapshot(WorstCaseProfile, {
|
|
34
|
+
hooks: {
|
|
35
|
+
flags: {
|
|
36
|
+
profilecard_primitives_compiled: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
snapshot(BotCaseProfile, {
|
|
41
|
+
hooks: {
|
|
42
|
+
flags: {
|
|
43
|
+
profilecard_primitives_compiled: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
snapshot(AlternateActions, {
|
|
48
|
+
hooks: {
|
|
49
|
+
flags: {
|
|
50
|
+
profilecard_primitives_compiled: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -49,8 +49,8 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
49
49
|
}
|
|
50
50
|
}, {
|
|
51
51
|
key: "getTeamProfile",
|
|
52
|
-
value: function getTeamProfile(teamId, orgId, analytics) {
|
|
53
|
-
return this.teamClient.getProfile(teamId, orgId, analytics);
|
|
52
|
+
value: function getTeamProfile(teamId, orgId, analytics, analyticsNext) {
|
|
53
|
+
return this.teamClient.getProfile(teamId, orgId, analytics, analyticsNext);
|
|
54
54
|
}
|
|
55
55
|
}, {
|
|
56
56
|
key: "getReportingLines",
|
|
@@ -154,27 +154,27 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
154
154
|
}()
|
|
155
155
|
}, {
|
|
156
156
|
key: "getRovoAgentProfile",
|
|
157
|
-
value: function getRovoAgentProfile(id, analytics) {
|
|
157
|
+
value: function getRovoAgentProfile(id, analytics, analyticsNext) {
|
|
158
158
|
var _this$rovoAgentClient2;
|
|
159
|
-
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics);
|
|
159
|
+
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics, analyticsNext);
|
|
160
160
|
}
|
|
161
161
|
}, {
|
|
162
162
|
key: "getRovoAgentPermissions",
|
|
163
|
-
value: function getRovoAgentPermissions(id, fireAnalytics) {
|
|
163
|
+
value: function getRovoAgentPermissions(id, fireAnalytics, analyticsNext) {
|
|
164
164
|
var _this$rovoAgentClient3;
|
|
165
|
-
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics);
|
|
165
|
+
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics, analyticsNext);
|
|
166
166
|
}
|
|
167
167
|
}, {
|
|
168
168
|
key: "deleteAgent",
|
|
169
|
-
value: function deleteAgent(id, analytics) {
|
|
169
|
+
value: function deleteAgent(id, analytics, analyticsNext) {
|
|
170
170
|
var _this$rovoAgentClient4;
|
|
171
|
-
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics);
|
|
171
|
+
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics, analyticsNext);
|
|
172
172
|
}
|
|
173
173
|
}, {
|
|
174
174
|
key: "setFavouriteAgent",
|
|
175
|
-
value: function setFavouriteAgent(id, isFavourite, analytics) {
|
|
175
|
+
value: function setFavouriteAgent(id, isFavourite, analytics, analyticsNext) {
|
|
176
176
|
var _this$rovoAgentClient5;
|
|
177
|
-
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics);
|
|
177
|
+
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics, analyticsNext);
|
|
178
178
|
}
|
|
179
179
|
}]);
|
|
180
180
|
}();
|
|
@@ -73,7 +73,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
73
73
|
}
|
|
74
74
|
}, {
|
|
75
75
|
key: "getProfile",
|
|
76
|
-
value: function getProfile(id, analytics) {
|
|
76
|
+
value: function getProfile(id, analytics, analyticsNext) {
|
|
77
77
|
var _this2 = this;
|
|
78
78
|
if (!id.value) {
|
|
79
79
|
return Promise.reject(new Error('Id is missing'));
|
|
@@ -87,27 +87,56 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
87
87
|
}
|
|
88
88
|
return new Promise(function (resolve, reject) {
|
|
89
89
|
var startTime = (0, _performance.getPageTime)();
|
|
90
|
-
if (analytics) {
|
|
91
|
-
|
|
90
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
91
|
+
if (analyticsNext) {
|
|
92
|
+
analyticsNext('operational.rovoAgentProfilecard.triggered.request', _objectSpread({
|
|
93
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
94
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (analytics) {
|
|
98
|
+
analytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
101
|
_this2.makeRequest(id, _this2.options.cloudId || '').then(function (data) {
|
|
94
102
|
if (_this2.cache) {
|
|
95
103
|
_this2.setCachedProfile(id.value, data);
|
|
96
104
|
}
|
|
97
|
-
if (analytics) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
106
|
+
if (analyticsNext) {
|
|
107
|
+
analyticsNext('operational.rovoAgentProfilecard.succeeded.request', _objectSpread({
|
|
108
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
109
|
+
gateway: true,
|
|
110
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
111
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
if (analytics) {
|
|
115
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', 'request', {
|
|
116
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
117
|
+
gateway: true
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
102
120
|
}
|
|
103
121
|
resolve(data);
|
|
104
122
|
}).catch(function (error) {
|
|
105
|
-
if (analytics) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
124
|
+
if (analyticsNext) {
|
|
125
|
+
analyticsNext('operational.rovoAgentProfilecard.failed.request', _objectSpread(_objectSpread({
|
|
126
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
127
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
128
|
+
gateway: true,
|
|
129
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
130
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
if (analytics) {
|
|
134
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', 'request', _objectSpread(_objectSpread({
|
|
135
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
136
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error)), {}, {
|
|
137
|
+
gateway: true
|
|
138
|
+
})));
|
|
139
|
+
}
|
|
111
140
|
}
|
|
112
141
|
reject(error);
|
|
113
142
|
});
|
|
@@ -115,7 +144,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
115
144
|
}
|
|
116
145
|
}, {
|
|
117
146
|
key: "deleteAgent",
|
|
118
|
-
value: function deleteAgent(agentId, analytics) {
|
|
147
|
+
value: function deleteAgent(agentId, analytics, analyticsNext) {
|
|
119
148
|
var _this3 = this;
|
|
120
149
|
if (!this.options.cloudId) {
|
|
121
150
|
return Promise.reject(new Error('cloudId is missing'));
|
|
@@ -123,8 +152,16 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
123
152
|
return new Promise(function (resolve, reject) {
|
|
124
153
|
var startTime = (0, _performance.getPageTime)();
|
|
125
154
|
var product = _this3.options.productIdentifier || 'rovo';
|
|
126
|
-
if (analytics) {
|
|
127
|
-
|
|
155
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
156
|
+
if (analyticsNext) {
|
|
157
|
+
analyticsNext('operational.rovoAgentProfilecard.triggered.request', _objectSpread({
|
|
158
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
159
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
if (analytics) {
|
|
163
|
+
analytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
164
|
+
}
|
|
128
165
|
}
|
|
129
166
|
var headers = createHeaders(product, _this3.options.cloudId);
|
|
130
167
|
fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
|
|
@@ -133,20 +170,41 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
133
170
|
mode: 'cors',
|
|
134
171
|
headers: headers
|
|
135
172
|
})).then(function () {
|
|
136
|
-
if (analytics) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
173
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
174
|
+
if (analyticsNext) {
|
|
175
|
+
analyticsNext('operational.rovoAgentProfilecard.succeeded.deleteAgent', _objectSpread({
|
|
176
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
177
|
+
gateway: true,
|
|
178
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
179
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
if (analytics) {
|
|
183
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', 'deleteAgent', {
|
|
184
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
185
|
+
gateway: true
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
141
188
|
}
|
|
142
189
|
resolve();
|
|
143
190
|
}).catch(function (error) {
|
|
144
|
-
if (analytics) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
191
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
192
|
+
if (analyticsNext) {
|
|
193
|
+
analyticsNext('operational.rovoAgentProfilecard.failed.deleteAgent', _objectSpread(_objectSpread({
|
|
194
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
195
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
196
|
+
gateway: true,
|
|
197
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
198
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
if (analytics) {
|
|
202
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', 'deleteAgent', _objectSpread(_objectSpread({
|
|
203
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
204
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error)), {}, {
|
|
205
|
+
gateway: true
|
|
206
|
+
})));
|
|
207
|
+
}
|
|
150
208
|
}
|
|
151
209
|
reject(error);
|
|
152
210
|
});
|
|
@@ -154,7 +212,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
154
212
|
}
|
|
155
213
|
}, {
|
|
156
214
|
key: "setFavouriteAgent",
|
|
157
|
-
value: function setFavouriteAgent(agentId, isFavourite, analytics) {
|
|
215
|
+
value: function setFavouriteAgent(agentId, isFavourite, analytics, analyticsNext) {
|
|
158
216
|
var _this4 = this;
|
|
159
217
|
if (!this.options.cloudId) {
|
|
160
218
|
return Promise.reject(new Error('cloudId is missing'));
|
|
@@ -169,8 +227,16 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
169
227
|
product = _this4.options.productIdentifier || 'rovo';
|
|
170
228
|
actionSubjectId = isFavourite ? 'favourite' : 'unfavourite';
|
|
171
229
|
requestMethod = isFavourite ? 'POST' : 'DELETE';
|
|
172
|
-
if (analytics) {
|
|
173
|
-
|
|
230
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
231
|
+
if (analyticsNext) {
|
|
232
|
+
analyticsNext("operational.rovoAgentProfilecard.triggered.".concat(actionSubjectId), _objectSpread({
|
|
233
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
234
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
if (analytics) {
|
|
238
|
+
analytics((0, _analytics.agentRequestAnalytics)('triggered', 'actionSubjectId'));
|
|
239
|
+
}
|
|
174
240
|
}
|
|
175
241
|
headers = createHeaders(product, _this4.options.cloudId);
|
|
176
242
|
_context.next = 8;
|
|
@@ -180,20 +246,41 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
180
246
|
mode: 'cors',
|
|
181
247
|
headers: headers
|
|
182
248
|
})).then(function () {
|
|
183
|
-
if (analytics) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
249
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
250
|
+
if (analyticsNext) {
|
|
251
|
+
analyticsNext("operational.rovoAgentProfilecard.succeeded.".concat(actionSubjectId), _objectSpread({
|
|
252
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
253
|
+
gateway: true,
|
|
254
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
255
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
if (analytics) {
|
|
259
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', actionSubjectId, {
|
|
260
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
261
|
+
gateway: true
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
188
264
|
}
|
|
189
265
|
resolve();
|
|
190
266
|
}).catch(function (error) {
|
|
191
|
-
if (analytics) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
267
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
268
|
+
if (analyticsNext) {
|
|
269
|
+
analyticsNext("operational.rovoAgentProfilecard.failed.".concat(actionSubjectId), _objectSpread(_objectSpread({
|
|
270
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
271
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
272
|
+
gateway: true,
|
|
273
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
274
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
if (analytics) {
|
|
278
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', actionSubjectId, _objectSpread(_objectSpread({
|
|
279
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
280
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error)), {}, {
|
|
281
|
+
gateway: true
|
|
282
|
+
})));
|
|
283
|
+
}
|
|
197
284
|
}
|
|
198
285
|
reject(error);
|
|
199
286
|
});
|
|
@@ -210,7 +297,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
210
297
|
}
|
|
211
298
|
}, {
|
|
212
299
|
key: "getPermissions",
|
|
213
|
-
value: function getPermissions(id, fireAnalytics) {
|
|
300
|
+
value: function getPermissions(id, fireAnalytics, fireAnalyticsNext) {
|
|
214
301
|
var _this5 = this;
|
|
215
302
|
if (!this.options.cloudId) {
|
|
216
303
|
return Promise.reject(new Error('cloudId is missing'));
|
|
@@ -218,8 +305,16 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
218
305
|
return new Promise(function (resolve, reject) {
|
|
219
306
|
var startTime = (0, _performance.getPageTime)();
|
|
220
307
|
var product = _this5.options.productIdentifier || 'rovo';
|
|
221
|
-
if (
|
|
222
|
-
|
|
308
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
309
|
+
if (fireAnalyticsNext) {
|
|
310
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.triggered.request', _objectSpread({
|
|
311
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
312
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
if (fireAnalytics) {
|
|
316
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
317
|
+
}
|
|
223
318
|
}
|
|
224
319
|
var headers = createHeaders(product, _this5.options.cloudId, true);
|
|
225
320
|
fetch(new Request("/gateway/api/assist/api/rovo/v2/permissions/agents/".concat(id), {
|
|
@@ -233,20 +328,41 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
233
328
|
})).then(function (response) {
|
|
234
329
|
return response.json();
|
|
235
330
|
}).then(function (data) {
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
331
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
332
|
+
if (fireAnalyticsNext) {
|
|
333
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.succeeded.getAgentPermissions', _objectSpread({
|
|
334
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
335
|
+
gateway: true,
|
|
336
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
337
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
338
|
+
}
|
|
339
|
+
} else {
|
|
340
|
+
if (fireAnalytics) {
|
|
341
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('succeeded', 'getAgentPermissions', {
|
|
342
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
343
|
+
gateway: true
|
|
344
|
+
}));
|
|
345
|
+
}
|
|
241
346
|
}
|
|
242
347
|
resolve(data);
|
|
243
348
|
}).catch(function (error) {
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
349
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
350
|
+
if (fireAnalyticsNext) {
|
|
351
|
+
fireAnalyticsNext('operational.rovoAgentProfilecard.failed.getAgentPermissions', _objectSpread(_objectSpread({
|
|
352
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
353
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
354
|
+
gateway: true,
|
|
355
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
356
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
if (fireAnalytics) {
|
|
360
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('failed', 'getAgentPermissions', _objectSpread(_objectSpread({
|
|
361
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
362
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error)), {}, {
|
|
363
|
+
gateway: true
|
|
364
|
+
})));
|
|
365
|
+
}
|
|
250
366
|
}
|
|
251
367
|
reject(error);
|
|
252
368
|
});
|
|
@@ -11,6 +11,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _analytics = require("../util/analytics");
|
|
15
16
|
var _performance = require("../util/performance");
|
|
16
17
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
@@ -39,7 +40,7 @@ var TeamProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
39
40
|
}
|
|
40
41
|
}, {
|
|
41
42
|
key: "getProfile",
|
|
42
|
-
value: function getProfile(teamId, orgId, analytics) {
|
|
43
|
+
value: function getProfile(teamId, orgId, analytics, analyticsNext) {
|
|
43
44
|
var _this2 = this;
|
|
44
45
|
if (!teamId) {
|
|
45
46
|
return Promise.reject(new Error('teamId is missing'));
|
|
@@ -50,27 +51,56 @@ var TeamProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
50
51
|
}
|
|
51
52
|
return new Promise(function (resolve, reject) {
|
|
52
53
|
var startTime = (0, _performance.getPageTime)();
|
|
53
|
-
if (analytics) {
|
|
54
|
-
|
|
54
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
55
|
+
if (analyticsNext) {
|
|
56
|
+
analyticsNext('operational.teamProfileCard.triggered.request', _objectSpread({
|
|
57
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
58
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
if (analytics) {
|
|
62
|
+
analytics((0, _analytics.teamRequestAnalytics)('triggered'));
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
_this2.makeRequest(teamId, orgId).then(function (data) {
|
|
57
66
|
if (_this2.cache) {
|
|
58
67
|
_this2.setCachedProfile(teamId, data);
|
|
59
68
|
}
|
|
60
|
-
if (analytics) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
70
|
+
if (analyticsNext) {
|
|
71
|
+
analyticsNext('operational.teamProfileCard.succeeded.request', _objectSpread({
|
|
72
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
73
|
+
gateway: true,
|
|
74
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
75
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
if (analytics) {
|
|
79
|
+
analytics((0, _analytics.teamRequestAnalytics)('succeeded', {
|
|
80
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
81
|
+
gateway: true
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
resolve(data);
|
|
67
86
|
}).catch(function (error) {
|
|
68
|
-
if (analytics) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
88
|
+
if (analyticsNext) {
|
|
89
|
+
analyticsNext('operational.teamProfileCard.failed.request', _objectSpread(_objectSpread({
|
|
90
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
91
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
92
|
+
gateway: true,
|
|
93
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
94
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (analytics) {
|
|
98
|
+
analytics((0, _analytics.teamRequestAnalytics)('failed', _objectSpread(_objectSpread({
|
|
99
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
100
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error)), {}, {
|
|
101
|
+
gateway: true
|
|
102
|
+
})));
|
|
103
|
+
}
|
|
74
104
|
}
|
|
75
105
|
reject(error);
|
|
76
106
|
});
|
|
@@ -198,16 +198,9 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
198
198
|
}).catch(function (error) {
|
|
199
199
|
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
200
200
|
if (analyticsNext) {
|
|
201
|
-
var errorAttributes = (0, _errorUtils.getErrorAttributes)(error);
|
|
202
201
|
analyticsNext('operational.profilecard.failed.request', _objectSpread(_objectSpread({
|
|
203
202
|
duration: (0, _performance.getPageTime)() - startTime
|
|
204
|
-
},
|
|
205
|
-
traceId: errorAttributes.traceId || null,
|
|
206
|
-
errorCategory: errorAttributes.errorCategory || null,
|
|
207
|
-
errorType: errorAttributes.errorType || null,
|
|
208
|
-
errorPath: errorAttributes.errorPath || null,
|
|
209
|
-
errorNumber: errorAttributes.errorNumber || null,
|
|
210
|
-
errorStatusCode: errorAttributes.errorStatusCode || null,
|
|
203
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
211
204
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
212
205
|
}, _analytics.PACKAGE_META_DATA));
|
|
213
206
|
}
|
|
@@ -215,7 +208,7 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
215
208
|
if (analytics) {
|
|
216
209
|
analytics((0, _analytics.userRequestAnalytics)('failed', _objectSpread({
|
|
217
210
|
duration: (0, _performance.getPageTime)() - startTime
|
|
218
|
-
}, (0, _errorUtils.
|
|
211
|
+
}, (0, _errorUtils.DEPRECATED_getErrorAttributes)(error))));
|
|
219
212
|
}
|
|
220
213
|
}
|
|
221
214
|
reject(error);
|