@atlaskit/profilecard 19.23.0 → 19.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 +8 -0
- package/dist/cjs/client/ProfileCardClient.js +12 -0
- package/dist/cjs/client/RovoAgentCardClient.js +131 -9
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +4 -3
- package/dist/cjs/components/Agent/AgentDeleteConfirmationModal.js +9 -9
- package/dist/cjs/components/Agent/AgentProfileCard.js +78 -38
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +3 -1
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +4 -2
- package/dist/cjs/components/Agent/messages.js +29 -0
- package/dist/cjs/components/User/ProfileCardTrigger.js +6 -3
- package/dist/cjs/components/common/ProfileCardTrigger.js +13 -25
- package/dist/cjs/util/analytics.js +3 -3
- package/dist/cjs/util/rovoAgentUtils.js +1 -15
- package/dist/es2019/client/ProfileCardClient.js +8 -0
- package/dist/es2019/client/RovoAgentCardClient.js +103 -6
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +4 -3
- package/dist/es2019/components/Agent/AgentDeleteConfirmationModal.js +9 -9
- package/dist/es2019/components/Agent/AgentProfileCard.js +42 -22
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +3 -1
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +4 -2
- package/dist/es2019/components/Agent/messages.js +23 -0
- package/dist/es2019/components/User/ProfileCardTrigger.js +6 -3
- package/dist/es2019/components/common/ProfileCardTrigger.js +2 -2
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/es2019/util/rovoAgentUtils.js +0 -12
- package/dist/esm/client/ProfileCardClient.js +12 -0
- package/dist/esm/client/RovoAgentCardClient.js +131 -9
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +4 -3
- package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +9 -9
- package/dist/esm/components/Agent/AgentProfileCard.js +79 -39
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +3 -1
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +4 -2
- package/dist/esm/components/Agent/messages.js +23 -0
- package/dist/esm/components/User/ProfileCardTrigger.js +6 -3
- package/dist/esm/components/common/ProfileCardTrigger.js +13 -25
- package/dist/esm/util/analytics.js +3 -3
- package/dist/esm/util/rovoAgentUtils.js +0 -13
- package/dist/types/client/ProfileCardClient.d.ts +2 -0
- package/dist/types/client/RovoAgentCardClient.d.ts +2 -0
- package/dist/types/components/Agent/Actions.d.ts +3 -1
- package/dist/types/components/Agent/AgentProfileCard.d.ts +2 -11
- package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +2 -1
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -9
- package/dist/types/components/Agent/messages.d.ts +22 -0
- package/dist/types/components/common/LoadingState.d.ts +2 -1
- package/dist/types/components/common/types.d.ts +2 -2
- package/dist/types/types.d.ts +31 -1
- package/dist/types/util/analytics.d.ts +6 -5
- package/dist/types/util/rovoAgentUtils.d.ts +0 -1
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +2 -0
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +2 -0
- package/dist/types-ts4.5/components/Agent/Actions.d.ts +3 -1
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +2 -11
- package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +2 -1
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -9
- package/dist/types-ts4.5/components/Agent/messages.d.ts +22 -0
- package/dist/types-ts4.5/components/common/LoadingState.d.ts +2 -1
- package/dist/types-ts4.5/components/common/types.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +31 -1
- package/dist/types-ts4.5/util/analytics.d.ts +6 -5
- package/dist/types-ts4.5/util/rovoAgentUtils.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/client/getAgentInfo.js +0 -66
- package/dist/cjs/components/Agent/hooks/useDeleteAgent.js +0 -70
- package/dist/cjs/components/Agent/hooks/useSetFavouriteAgent.js +0 -91
- package/dist/es2019/client/getAgentInfo.js +0 -21
- package/dist/es2019/components/Agent/hooks/useDeleteAgent.js +0 -33
- package/dist/es2019/components/Agent/hooks/useSetFavouriteAgent.js +0 -48
- package/dist/esm/client/getAgentInfo.js +0 -58
- package/dist/esm/components/Agent/hooks/useDeleteAgent.js +0 -63
- package/dist/esm/components/Agent/hooks/useSetFavouriteAgent.js +0 -84
- package/dist/types/client/getAgentInfo.d.ts +0 -3
- package/dist/types/components/Agent/hooks/useDeleteAgent.d.ts +0 -8
- package/dist/types/components/Agent/hooks/useSetFavouriteAgent.d.ts +0 -10
- package/dist/types-ts4.5/client/getAgentInfo.d.ts +0 -3
- package/dist/types-ts4.5/components/Agent/hooks/useDeleteAgent.d.ts +0 -8
- package/dist/types-ts4.5/components/Agent/hooks/useSetFavouriteAgent.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#135350](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135350)
|
|
8
|
+
[`e22e1c78bb96d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e22e1c78bb96d) -
|
|
9
|
+
[ux] Move api call to agent clients
|
|
10
|
+
|
|
3
11
|
## 19.23.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -79,6 +79,18 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
79
79
|
var _this$rovoAgentClient2;
|
|
80
80
|
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics);
|
|
81
81
|
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "deleteAgent",
|
|
84
|
+
value: function deleteAgent(id, analytics) {
|
|
85
|
+
var _this$rovoAgentClient3;
|
|
86
|
+
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.deleteAgent(id, analytics);
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "setFavouriteAgent",
|
|
90
|
+
value: function setFavouriteAgent(id, isFavourite, analytics) {
|
|
91
|
+
var _this$rovoAgentClient4;
|
|
92
|
+
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.setFavouriteAgent(id, isFavourite, analytics);
|
|
93
|
+
}
|
|
82
94
|
}]);
|
|
83
95
|
return ProfileCardClient;
|
|
84
96
|
}();
|
|
@@ -5,21 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
16
|
var _analytics = require("../util/analytics");
|
|
15
17
|
var _performance = require("../util/performance");
|
|
16
18
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
17
19
|
var _errorUtils = require("./errorUtils");
|
|
18
|
-
var _getAgentInfo = require("./getAgentInfo");
|
|
19
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
var createHeaders = function createHeaders(product, cloudId) {
|
|
25
|
+
var config = {
|
|
26
|
+
headers: {
|
|
27
|
+
'X-Product': product,
|
|
28
|
+
'X-Experience-Id': 'profile-card',
|
|
29
|
+
'X-Cloudid': cloudId || ''
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return new Headers(_objectSpread({}, config.headers || {}));
|
|
33
|
+
};
|
|
23
34
|
var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClient) {
|
|
24
35
|
(0, _inherits2.default)(RovoAgentCardClient, _CachingClient);
|
|
25
36
|
var _super = _createSuper(RovoAgentCardClient);
|
|
@@ -33,17 +44,33 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
33
44
|
(0, _createClass2.default)(RovoAgentCardClient, [{
|
|
34
45
|
key: "makeRequest",
|
|
35
46
|
value: function makeRequest(id, cloudId) {
|
|
47
|
+
var product = this.options.productIdentifier || 'rovo';
|
|
48
|
+
var headers = createHeaders(product, this.options.cloudId);
|
|
36
49
|
if (id.type === 'identity') {
|
|
37
|
-
return (
|
|
50
|
+
return fetch(new Request("/gateway/api/assist/agents/v1/accountid/".concat(id.value), {
|
|
51
|
+
method: 'GET',
|
|
52
|
+
credentials: 'include',
|
|
53
|
+
mode: 'cors',
|
|
54
|
+
headers: headers
|
|
55
|
+
})).then(function (response) {
|
|
56
|
+
return response.json();
|
|
57
|
+
});
|
|
38
58
|
}
|
|
39
|
-
return (
|
|
59
|
+
return fetch(new Request("/gateway/api/assist/agents/v1/".concat(id.value), {
|
|
60
|
+
method: 'GET',
|
|
61
|
+
credentials: 'include',
|
|
62
|
+
mode: 'cors',
|
|
63
|
+
headers: headers
|
|
64
|
+
})).then(function (response) {
|
|
65
|
+
return response.json();
|
|
66
|
+
});
|
|
40
67
|
}
|
|
41
68
|
}, {
|
|
42
69
|
key: "getProfile",
|
|
43
70
|
value: function getProfile(id, analytics) {
|
|
44
71
|
var _this2 = this;
|
|
45
72
|
if (!id.value) {
|
|
46
|
-
return Promise.reject(new Error('
|
|
73
|
+
return Promise.reject(new Error('Id is missing'));
|
|
47
74
|
}
|
|
48
75
|
if (!this.options.cloudId) {
|
|
49
76
|
return Promise.reject(new Error('cloudId is missing'));
|
|
@@ -62,7 +89,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
62
89
|
_this2.setCachedProfile(id.value, data);
|
|
63
90
|
}
|
|
64
91
|
if (analytics) {
|
|
65
|
-
analytics((0, _analytics.agentRequestAnalytics)('succeeded', {
|
|
92
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', 'request', {
|
|
66
93
|
duration: (0, _performance.getPageTime)() - startTime,
|
|
67
94
|
gateway: true
|
|
68
95
|
}));
|
|
@@ -70,7 +97,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
70
97
|
resolve(data);
|
|
71
98
|
}).catch(function (error) {
|
|
72
99
|
if (analytics) {
|
|
73
|
-
analytics((0, _analytics.agentRequestAnalytics)('failed', _objectSpread(_objectSpread({
|
|
100
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', 'request', _objectSpread(_objectSpread({
|
|
74
101
|
duration: (0, _performance.getPageTime)() - startTime
|
|
75
102
|
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
76
103
|
gateway: true
|
|
@@ -80,6 +107,101 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
80
107
|
});
|
|
81
108
|
});
|
|
82
109
|
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "deleteAgent",
|
|
112
|
+
value: function deleteAgent(agentId, analytics) {
|
|
113
|
+
var _this3 = this;
|
|
114
|
+
if (!this.options.cloudId) {
|
|
115
|
+
return Promise.reject(new Error('cloudId is missing'));
|
|
116
|
+
}
|
|
117
|
+
return new Promise(function (resolve, reject) {
|
|
118
|
+
var startTime = (0, _performance.getPageTime)();
|
|
119
|
+
var product = _this3.options.productIdentifier || 'rovo';
|
|
120
|
+
if (analytics) {
|
|
121
|
+
analytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
122
|
+
}
|
|
123
|
+
var headers = createHeaders(product, _this3.options.cloudId);
|
|
124
|
+
fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId), {
|
|
125
|
+
method: 'DELETE',
|
|
126
|
+
credentials: 'include',
|
|
127
|
+
mode: 'cors',
|
|
128
|
+
headers: headers
|
|
129
|
+
})).then(function () {
|
|
130
|
+
if (analytics) {
|
|
131
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', 'deleteAgent', {
|
|
132
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
133
|
+
gateway: true
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
resolve();
|
|
137
|
+
}).catch(function (error) {
|
|
138
|
+
if (analytics) {
|
|
139
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', 'deleteAgent', _objectSpread(_objectSpread({
|
|
140
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
141
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
142
|
+
gateway: true
|
|
143
|
+
})));
|
|
144
|
+
}
|
|
145
|
+
reject(error);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
key: "setFavouriteAgent",
|
|
151
|
+
value: function setFavouriteAgent(agentId, isFavourite, analytics) {
|
|
152
|
+
var _this4 = this;
|
|
153
|
+
if (!this.options.cloudId) {
|
|
154
|
+
return Promise.reject(new Error('cloudId is missing'));
|
|
155
|
+
}
|
|
156
|
+
return new Promise( /*#__PURE__*/function () {
|
|
157
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(resolve, reject) {
|
|
158
|
+
var startTime, product, actionSubjectId, requestMethod, headers;
|
|
159
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
160
|
+
while (1) switch (_context.prev = _context.next) {
|
|
161
|
+
case 0:
|
|
162
|
+
startTime = (0, _performance.getPageTime)();
|
|
163
|
+
product = _this4.options.productIdentifier || 'rovo';
|
|
164
|
+
actionSubjectId = isFavourite ? 'favourite' : 'unfavourite';
|
|
165
|
+
requestMethod = isFavourite ? 'POST' : 'DELETE';
|
|
166
|
+
if (analytics) {
|
|
167
|
+
analytics((0, _analytics.agentRequestAnalytics)('triggered', 'actionSubjectId'));
|
|
168
|
+
}
|
|
169
|
+
headers = createHeaders(product, _this4.options.cloudId);
|
|
170
|
+
_context.next = 8;
|
|
171
|
+
return fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId, "/favourite"), {
|
|
172
|
+
method: requestMethod,
|
|
173
|
+
credentials: 'include',
|
|
174
|
+
mode: 'cors',
|
|
175
|
+
headers: headers
|
|
176
|
+
})).then(function () {
|
|
177
|
+
if (analytics) {
|
|
178
|
+
analytics((0, _analytics.agentRequestAnalytics)('succeeded', actionSubjectId, {
|
|
179
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
180
|
+
gateway: true
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
resolve();
|
|
184
|
+
}).catch(function (error) {
|
|
185
|
+
if (analytics) {
|
|
186
|
+
analytics((0, _analytics.agentRequestAnalytics)('failed', actionSubjectId, _objectSpread(_objectSpread({
|
|
187
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
188
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
189
|
+
gateway: true
|
|
190
|
+
})));
|
|
191
|
+
}
|
|
192
|
+
reject(error);
|
|
193
|
+
});
|
|
194
|
+
case 8:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context.stop();
|
|
197
|
+
}
|
|
198
|
+
}, _callee);
|
|
199
|
+
}));
|
|
200
|
+
return function (_x, _x2) {
|
|
201
|
+
return _ref.apply(this, arguments);
|
|
202
|
+
};
|
|
203
|
+
}());
|
|
204
|
+
}
|
|
83
205
|
}]);
|
|
84
206
|
return RovoAgentCardClient;
|
|
85
207
|
}(_CachingClient2.default);
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "19.
|
|
60
|
+
headers.append('atl-client-version', "19.24.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -78,7 +78,8 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
|
|
|
78
78
|
onDeleteAgent = _ref3.onDeleteAgent,
|
|
79
79
|
onDuplicateAgent = _ref3.onDuplicateAgent,
|
|
80
80
|
onCopyAgent = _ref3.onCopyAgent,
|
|
81
|
-
onChatClick = _ref3.onChatClick
|
|
81
|
+
onChatClick = _ref3.onChatClick,
|
|
82
|
+
agent = _ref3.agent;
|
|
82
83
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
83
84
|
formatMessage = _useIntl.formatMessage;
|
|
84
85
|
var _useState = (0, _react.useState)(false),
|
|
@@ -159,8 +160,8 @@ var AgentActions = exports.AgentActions = function AgentActions(_ref3) {
|
|
|
159
160
|
setIsDeleteModalOpen(false);
|
|
160
161
|
},
|
|
161
162
|
onSubmit: onDeleteAgent,
|
|
162
|
-
agentId:
|
|
163
|
-
agentName:
|
|
163
|
+
agentId: agent.id,
|
|
164
|
+
agentName: agent.name
|
|
164
165
|
}));
|
|
165
166
|
};
|
|
166
167
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
@@ -59,45 +59,45 @@ var AgentDeleteConfirmationModal = exports.AgentDeleteConfirmationModal = functi
|
|
|
59
59
|
};
|
|
60
60
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
61
61
|
cancelText: {
|
|
62
|
-
id: '
|
|
62
|
+
id: 'profilecard.agent-profile.agent-delete-confirm.cancel-text',
|
|
63
63
|
defaultMessage: 'Cancel'
|
|
64
64
|
},
|
|
65
65
|
confirmText: {
|
|
66
|
-
id: '
|
|
66
|
+
id: 'profilecard.agent-profile.agent-delete-confirm.confirm-text',
|
|
67
67
|
defaultMessage: 'Delete'
|
|
68
68
|
},
|
|
69
69
|
title: {
|
|
70
|
-
id: '
|
|
70
|
+
id: 'profilecard.agent-profile.delete-agent-confirm-title',
|
|
71
71
|
defaultMessage: 'Delete "{agentName}"?',
|
|
72
72
|
description: 'Title text for the delete agent confirmation modal'
|
|
73
73
|
},
|
|
74
74
|
body: {
|
|
75
|
-
id: '
|
|
75
|
+
id: 'profilecard.agent-profile.delete-agent-confirm-body',
|
|
76
76
|
defaultMessage: "Are you sure you want to delete this agent? This action cannot be undone.",
|
|
77
77
|
description: 'Body text for the delete agent confirmation modal'
|
|
78
78
|
},
|
|
79
79
|
error: {
|
|
80
|
-
id: '
|
|
80
|
+
id: 'profilecard.agent-profile.delete-agent-error',
|
|
81
81
|
defaultMessage: 'Could not delete agent',
|
|
82
82
|
description: 'Error message displayed when an agent cannot be deleted'
|
|
83
83
|
},
|
|
84
84
|
errorAgentNotFound: {
|
|
85
|
-
id: '
|
|
85
|
+
id: 'profilecard.agent-profile.delete-agent-error.agent-not-found',
|
|
86
86
|
defaultMessage: 'That agent could not be found.',
|
|
87
87
|
description: 'Error message displayed when an agent cannot be found'
|
|
88
88
|
},
|
|
89
89
|
errorAgentInUse: {
|
|
90
|
-
id: '
|
|
90
|
+
id: 'profilecard.agent-profile.delete-agent-error.agent-in-use',
|
|
91
91
|
defaultMessage: 'Agent is currently in use. Try again later.',
|
|
92
92
|
description: 'Error message displayed when an agent is in use'
|
|
93
93
|
},
|
|
94
94
|
errorIncorrectOwner: {
|
|
95
|
-
id: '
|
|
95
|
+
id: 'profilecard.agent-profile.delete-agent-error.incorrect-owner',
|
|
96
96
|
defaultMessage: 'You cannot delete agents you have not created yourself. Please contact the agent owner.',
|
|
97
97
|
description: 'Error message displayed when the agent owner is incorrect'
|
|
98
98
|
},
|
|
99
99
|
agentDeletedSuccess: {
|
|
100
|
-
id: '
|
|
100
|
+
id: 'profilecard.agent-profile.delete-agent-success',
|
|
101
101
|
defaultMessage: 'Agent has been deleted!',
|
|
102
102
|
description: 'Success message displayed when an agent is deleted'
|
|
103
103
|
}
|
|
@@ -8,7 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _reactIntlNext = require("react-intl-next");
|
|
12
14
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
15
|
var _primitives = require("@atlaskit/primitives");
|
|
14
16
|
var _rovoAgentComponents = require("@atlaskit/rovo-agent-components");
|
|
@@ -19,8 +21,7 @@ var _Actions = require("./Actions");
|
|
|
19
21
|
var _AgentProfileCardWrapper = require("./AgentProfileCardWrapper");
|
|
20
22
|
var _ConversationStarters = require("./ConversationStarters");
|
|
21
23
|
var _useAgentActions = require("./hooks/useAgentActions");
|
|
22
|
-
var
|
|
23
|
-
var _useSetFavouriteAgent2 = require("./hooks/useSetFavouriteAgent");
|
|
24
|
+
var _messages = require("./messages");
|
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
27
|
var styles = (0, _primitives.xcss)({
|
|
@@ -48,7 +49,9 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
48
49
|
product = _ref$product === void 0 ? 'rovo' : _ref$product,
|
|
49
50
|
hasError = _ref.hasError,
|
|
50
51
|
errorType = _ref.errorType,
|
|
51
|
-
onConversationStartersClick = _ref.onConversationStartersClick
|
|
52
|
+
onConversationStartersClick = _ref.onConversationStartersClick,
|
|
53
|
+
resourceClient = _ref.resourceClient,
|
|
54
|
+
addFlag = _ref.addFlag;
|
|
52
55
|
var _useAgentUrlActions = (0, _useAgentActions.useAgentUrlActions)({
|
|
53
56
|
cloudId: cloudId || ''
|
|
54
57
|
}),
|
|
@@ -57,19 +60,15 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
57
60
|
_onDuplicateAgent = _useAgentUrlActions.onDuplicateAgent,
|
|
58
61
|
onOpenChatFullScreecn = _useAgentUrlActions.onOpenChat,
|
|
59
62
|
onConversationStarter = _useAgentUrlActions.onConversationStarter;
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
cloudId: cloudId,
|
|
70
|
-
product: product
|
|
71
|
-
}),
|
|
72
|
-
deleteAgent = _useDeleteAgent.deleteAgent;
|
|
63
|
+
var _useState = (0, _react.useState)(false),
|
|
64
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
65
|
+
isStarred = _useState2[0],
|
|
66
|
+
setIsStarred = _useState2[1];
|
|
67
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
68
|
+
formatMessage = _useIntl.formatMessage;
|
|
69
|
+
(0, _react.useEffect)(function () {
|
|
70
|
+
setIsStarred(!!(agent !== null && agent !== void 0 && agent.favourite));
|
|
71
|
+
}, [agent === null || agent === void 0 ? void 0 : agent.favourite]);
|
|
73
72
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
74
73
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
75
74
|
var fireAnalytics = (0, _react.useCallback)(function (payload) {
|
|
@@ -77,27 +76,67 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
77
76
|
(0, _analytics.fireEvent)(createAnalyticsEvent, payload);
|
|
78
77
|
}
|
|
79
78
|
}, [createAnalyticsEvent]);
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
var handleSetFavourite = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
80
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
81
|
+
while (1) switch (_context.prev = _context.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
if (!(agent !== null && agent !== void 0 && agent.id)) {
|
|
84
|
+
_context.next = 9;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
_context.prev = 1;
|
|
88
|
+
_context.next = 4;
|
|
89
|
+
return resourceClient.setFavouriteAgent(agent.id, !isStarred, fireAnalytics);
|
|
90
|
+
case 4:
|
|
91
|
+
setIsStarred(!isStarred);
|
|
92
|
+
_context.next = 9;
|
|
93
|
+
break;
|
|
94
|
+
case 7:
|
|
95
|
+
_context.prev = 7;
|
|
96
|
+
_context.t0 = _context["catch"](1);
|
|
97
|
+
case 9:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
100
|
+
}
|
|
101
|
+
}, _callee, null, [[1, 7]]);
|
|
102
|
+
})), [agent === null || agent === void 0 ? void 0 : agent.id, fireAnalytics, isStarred, resourceClient]);
|
|
103
|
+
var handleOnDelete = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
104
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
105
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
if (!agent) {
|
|
108
|
+
_context2.next = 10;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
_context2.prev = 1;
|
|
112
|
+
_context2.next = 4;
|
|
113
|
+
return resourceClient.deleteAgent(agent.id, fireAnalytics);
|
|
114
|
+
case 4:
|
|
115
|
+
addFlag === null || addFlag === void 0 || addFlag({
|
|
116
|
+
title: formatMessage(_messages.messages.agentDeletedSuccessFlagTitle),
|
|
117
|
+
description: formatMessage(_messages.messages.agentDeletedSuccessFlagDescription, {
|
|
118
|
+
agentName: agent.name
|
|
119
|
+
}),
|
|
120
|
+
type: 'success',
|
|
121
|
+
id: 'ptc-directory.agent-profile.delete-agent-success'
|
|
122
|
+
});
|
|
123
|
+
_context2.next = 10;
|
|
124
|
+
break;
|
|
125
|
+
case 7:
|
|
126
|
+
_context2.prev = 7;
|
|
127
|
+
_context2.t0 = _context2["catch"](1);
|
|
128
|
+
addFlag === null || addFlag === void 0 || addFlag({
|
|
129
|
+
title: formatMessage(_messages.messages.agentDeletedErrorFlagTitle),
|
|
130
|
+
description: formatMessage(_messages.messages.agentDeletedErrorFlagDescription),
|
|
131
|
+
type: 'error',
|
|
132
|
+
id: 'ptc-directory.agent-profile.delete-agent-error'
|
|
133
|
+
});
|
|
134
|
+
case 10:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context2.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee2, null, [[1, 7]]);
|
|
139
|
+
})), [addFlag, agent, fireAnalytics, formatMessage, resourceClient]);
|
|
101
140
|
(0, _react.useEffect)(function () {
|
|
102
141
|
if (!isLoading && agent) {
|
|
103
142
|
fireAnalytics((0, _analytics.profileCardRendered)('agent', 'content'));
|
|
@@ -133,7 +172,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
133
172
|
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentProfileInfo, {
|
|
134
173
|
agentName: agent.name,
|
|
135
174
|
isStarred: isStarred,
|
|
136
|
-
onStarToggle:
|
|
175
|
+
onStarToggle: handleSetFavourite,
|
|
137
176
|
isHidden: agent.visibility === 'PRIVATE',
|
|
138
177
|
creatorRender: ((_agent$creatorInfo = agent.creatorInfo) === null || _agent$creatorInfo === void 0 ? void 0 : _agent$creatorInfo.type) && /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentProfileCreator, {
|
|
139
178
|
creator: {
|
|
@@ -159,6 +198,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
159
198
|
});
|
|
160
199
|
}
|
|
161
200
|
})), /*#__PURE__*/_react.default.createElement(_Actions.AgentActions, {
|
|
201
|
+
agent: agent,
|
|
162
202
|
isAgentCreatedByCurrentUser: isCreatedByViewingUser,
|
|
163
203
|
onEditAgent: function onEditAgent() {
|
|
164
204
|
return _onEditAgent(agent.id);
|
|
@@ -178,7 +178,9 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
178
178
|
isCreatedByViewingUser: creatorUserId === props.viewingUserId,
|
|
179
179
|
product: props.product,
|
|
180
180
|
onConversationStartersClick: props.onConversationStartersClick,
|
|
181
|
-
onChatClick: props.onChatClick
|
|
181
|
+
onChatClick: props.onChatClick,
|
|
182
|
+
addFlag: props.addFlag,
|
|
183
|
+
resourceClient: props.resourceClient
|
|
182
184
|
});
|
|
183
185
|
}
|
|
184
186
|
return null;
|
|
@@ -136,12 +136,14 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = function AgentPr
|
|
|
136
136
|
}, /*#__PURE__*/_react.default.createElement(_lazyAgentProfileCard.AgentProfileCardLazy, {
|
|
137
137
|
agent: profileData,
|
|
138
138
|
hasError: !!error,
|
|
139
|
-
isCreatedByViewingUser: (profileData === null || profileData === void 0 || (_profileData$creatorI = profileData.creatorInfo) === null || _profileData$creatorI === void 0 ? void 0 : _profileData$creatorI.id) === viewingUserId,
|
|
139
|
+
isCreatedByViewingUser: (profileData === null || profileData === void 0 ? void 0 : profileData.creatorInfo) && (profileData === null || profileData === void 0 || (_profileData$creatorI = profileData.creatorInfo) === null || _profileData$creatorI === void 0 ? void 0 : _profileData$creatorI.id) === viewingUserId,
|
|
140
140
|
cloudId: props.cloudId,
|
|
141
141
|
product: product,
|
|
142
142
|
errorType: error,
|
|
143
143
|
onChatClick: props.onChatClick,
|
|
144
|
-
onConversationStartersClick: props.onConversationStartersClick
|
|
144
|
+
onConversationStartersClick: props.onConversationStartersClick,
|
|
145
|
+
resourceClient: props.resourceClient,
|
|
146
|
+
addFlag: props.addFlag
|
|
145
147
|
}));
|
|
146
148
|
};
|
|
147
149
|
return /*#__PURE__*/_react.default.createElement(_ProfileCardTrigger.default, (0, _extends2.default)({}, props, {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.messages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
agentDeletedSuccessFlagTitle: {
|
|
10
|
+
id: 'profilecard.agent-profile-card.delete-agent-success-flag-title',
|
|
11
|
+
defaultMessage: 'Agent deleted',
|
|
12
|
+
description: 'Flag message title displayed when an agent is deleted'
|
|
13
|
+
},
|
|
14
|
+
agentDeletedSuccessFlagDescription: {
|
|
15
|
+
id: 'profilecard.agent-profile-card.delete-agent-success-flag-description',
|
|
16
|
+
defaultMessage: 'You deleted {agentName}',
|
|
17
|
+
description: 'Flag message description displayed when an agent is deleted'
|
|
18
|
+
},
|
|
19
|
+
agentDeletedErrorFlagTitle: {
|
|
20
|
+
id: 'profilecard.agent-profile-card.delete-agent-error-flag-title',
|
|
21
|
+
defaultMessage: 'Failed to delete Agent',
|
|
22
|
+
description: 'Flag message title displayed when there is an error deleting agent'
|
|
23
|
+
},
|
|
24
|
+
agentDeletedErrorFlagDescription: {
|
|
25
|
+
id: 'profilecard.agent-profile-card.delete-agent-error-flag-description',
|
|
26
|
+
defaultMessage: 'Something went wrong while deleting the agent. Try again in a few moments.',
|
|
27
|
+
description: 'Flag message description displayed when there is an error deleting agent'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
@@ -46,7 +46,8 @@ function ProfileCardContent(_ref) {
|
|
|
46
46
|
profileCardAction = _ref.profileCardAction,
|
|
47
47
|
hasError = _ref.hasError,
|
|
48
48
|
errorType = _ref.errorType,
|
|
49
|
-
agentActions = _ref.agentActions
|
|
49
|
+
agentActions = _ref.agentActions,
|
|
50
|
+
addFlag = _ref.addFlag;
|
|
50
51
|
if (isAgent && (0, _platformFeatureFlags.fg)('enable_agent_profile_card')) {
|
|
51
52
|
return /*#__PURE__*/_react.default.createElement(_AgentProfileCardResourced.AgentProfileCardResourced, {
|
|
52
53
|
accountId: userId,
|
|
@@ -56,7 +57,8 @@ function ProfileCardContent(_ref) {
|
|
|
56
57
|
trigger: trigger,
|
|
57
58
|
product: product,
|
|
58
59
|
onChatClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onChatClick,
|
|
59
|
-
onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick
|
|
60
|
+
onConversationStartersClick: agentActions === null || agentActions === void 0 ? void 0 : agentActions.onConversationStartersClick,
|
|
61
|
+
addFlag: addFlag
|
|
60
62
|
});
|
|
61
63
|
} else {
|
|
62
64
|
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
@@ -349,7 +351,8 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
349
351
|
profileCardAction: filterActions(),
|
|
350
352
|
errorType: error,
|
|
351
353
|
hasError: hasError,
|
|
352
|
-
agentActions: agentActions
|
|
354
|
+
agentActions: agentActions,
|
|
355
|
+
addFlag: addFlag
|
|
353
356
|
}));
|
|
354
357
|
},
|
|
355
358
|
trigger: function trigger(triggerProps) {
|
|
@@ -64,38 +64,26 @@ function ProfileCardTrigger(_ref) {
|
|
|
64
64
|
setVisible(false);
|
|
65
65
|
}, hideDelay);
|
|
66
66
|
}, [hideDelay]);
|
|
67
|
-
var showProfilecard = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
68
|
-
return _regenerator.default.wrap(function
|
|
69
|
-
while (1) switch (
|
|
67
|
+
var showProfilecard = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
68
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
|
70
70
|
case 0:
|
|
71
71
|
clearTimeout(hideTimer.current);
|
|
72
72
|
clearTimeout(showTimer.current);
|
|
73
|
-
showTimer.current = window.setTimeout(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
_context.next = 3;
|
|
82
|
-
return getProfileData === null || getProfileData === void 0 ? void 0 : getProfileData();
|
|
83
|
-
case 3:
|
|
84
|
-
setVisible(true);
|
|
85
|
-
if (fireAnalytics) {
|
|
86
|
-
fireAnalytics((0, _analytics.cardTriggered)(profileCardType, _trigger));
|
|
87
|
-
}
|
|
88
|
-
case 5:
|
|
89
|
-
case "end":
|
|
90
|
-
return _context.stop();
|
|
73
|
+
showTimer.current = window.setTimeout(function () {
|
|
74
|
+
if (!visible) {
|
|
75
|
+
getProfileData === null || getProfileData === void 0 || getProfileData();
|
|
76
|
+
setVisible(true);
|
|
77
|
+
if (fireAnalytics) {
|
|
78
|
+
fireAnalytics((0, _analytics.cardTriggered)(profileCardType, _trigger));
|
|
91
79
|
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
80
|
+
}
|
|
81
|
+
}, showDelay);
|
|
94
82
|
case 3:
|
|
95
83
|
case "end":
|
|
96
|
-
return
|
|
84
|
+
return _context.stop();
|
|
97
85
|
}
|
|
98
|
-
},
|
|
86
|
+
}, _callee);
|
|
99
87
|
})), [showDelay, visible, getProfileData, fireAnalytics, profileCardType, _trigger]);
|
|
100
88
|
var onMouseEnter = (0, _react.useCallback)(function () {
|
|
101
89
|
showProfilecard();
|
|
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
45
45
|
actionSubjectId: actionSubjectId,
|
|
46
46
|
attributes: _objectSpread(_objectSpread({
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "19.
|
|
48
|
+
packageVersion: "19.24.0"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -95,6 +95,6 @@ var moreMembersClicked = exports.moreMembersClicked = function moreMembersClicke
|
|
|
95
95
|
var errorRetryClicked = exports.errorRetryClicked = function errorRetryClicked(attributes) {
|
|
96
96
|
return createEvent('ui', 'clicked', TEAM_SUBJECT, 'errorRetry', attributes);
|
|
97
97
|
};
|
|
98
|
-
var agentRequestAnalytics = exports.agentRequestAnalytics = function agentRequestAnalytics(action, attributes) {
|
|
99
|
-
return createEvent('operational', action, AGENT_SUBJECT, 'request', attributes);
|
|
98
|
+
var agentRequestAnalytics = exports.agentRequestAnalytics = function agentRequestAnalytics(action, actionSubjectId, attributes) {
|
|
99
|
+
return createEvent('operational', action, AGENT_SUBJECT, actionSubjectId || 'request', attributes);
|
|
100
100
|
};
|