@atlaskit/profilecard 20.10.0 → 20.11.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/afm-post-office/tsconfig.json +1 -1
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +47 -67
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +29 -37
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +48 -68
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +1 -1
- package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 20.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#163611](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163611)
|
|
8
|
+
[`559a5e24a2892`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/559a5e24a2892) -
|
|
9
|
+
Fix asynchronous loading of agent profile card
|
|
10
|
+
|
|
3
11
|
## 20.10.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
|
|
|
11
11
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
12
12
|
var addHeaders = function addHeaders(headers) {
|
|
13
13
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
14
|
-
headers.append('atl-client-version', "20.
|
|
14
|
+
headers.append('atl-client-version', "20.11.0");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -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', "20.
|
|
60
|
+
headers.append('atl-client-version', "20.11.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -102,65 +102,46 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
102
102
|
return _ref.apply(this, arguments);
|
|
103
103
|
};
|
|
104
104
|
}(), [creatorUserId, fireAnalytics, props.cloudId, props.resourceClient]);
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, fireAnalytics);
|
|
110
|
-
}, [fireAnalytics, props.accountId, props.resourceClient]);
|
|
111
|
-
var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
112
|
-
var getAgentData, agentData;
|
|
113
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
114
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
105
|
+
var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
106
|
+
var profileData, agentCreatorInfo;
|
|
107
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
108
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
115
109
|
case 0:
|
|
116
110
|
setIsLoading(true);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_context2.next = 2;
|
|
124
|
-
return getAgentInfo();
|
|
125
|
-
case 2:
|
|
126
|
-
profileData = _context2.sent;
|
|
127
|
-
_context2.next = 5;
|
|
128
|
-
return getCreator(profileData === null || profileData === void 0 ? void 0 : profileData.creator_type, (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined);
|
|
129
|
-
case 5:
|
|
130
|
-
agentCreatorInfo = _context2.sent;
|
|
131
|
-
return _context2.abrupt("return", _objectSpread(_objectSpread({}, profileData), {}, {
|
|
132
|
-
creatorInfo: agentCreatorInfo
|
|
133
|
-
}));
|
|
134
|
-
case 7:
|
|
135
|
-
case "end":
|
|
136
|
-
return _context2.stop();
|
|
137
|
-
}
|
|
138
|
-
}, _callee2);
|
|
139
|
-
}));
|
|
140
|
-
return function getAgentData() {
|
|
141
|
-
return _ref3.apply(this, arguments);
|
|
142
|
-
};
|
|
143
|
-
}();
|
|
144
|
-
_context3.next = 4;
|
|
145
|
-
return getAgentData();
|
|
111
|
+
_context2.prev = 1;
|
|
112
|
+
_context2.next = 4;
|
|
113
|
+
return props.resourceClient.getRovoAgentProfile({
|
|
114
|
+
type: 'identity',
|
|
115
|
+
value: props.accountId
|
|
116
|
+
}, fireAnalytics);
|
|
146
117
|
case 4:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
118
|
+
profileData = _context2.sent;
|
|
119
|
+
_context2.next = 7;
|
|
120
|
+
return getCreator(profileData === null || profileData === void 0 ? void 0 : profileData.creator_type, (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined);
|
|
150
121
|
case 7:
|
|
122
|
+
agentCreatorInfo = _context2.sent;
|
|
123
|
+
setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
|
|
124
|
+
creatorInfo: agentCreatorInfo
|
|
125
|
+
}));
|
|
126
|
+
_context2.next = 14;
|
|
127
|
+
break;
|
|
128
|
+
case 11:
|
|
129
|
+
_context2.prev = 11;
|
|
130
|
+
_context2.t0 = _context2["catch"](1);
|
|
131
|
+
setError(_context2.t0);
|
|
132
|
+
case 14:
|
|
133
|
+
_context2.prev = 14;
|
|
134
|
+
setIsLoading(false);
|
|
135
|
+
return _context2.finish(14);
|
|
136
|
+
case 17:
|
|
151
137
|
case "end":
|
|
152
|
-
return
|
|
138
|
+
return _context2.stop();
|
|
153
139
|
}
|
|
154
|
-
},
|
|
155
|
-
})), [
|
|
140
|
+
}, _callee2, null, [[1, 11, 14, 17]]);
|
|
141
|
+
})), [fireAnalytics, getCreator, props.accountId, props.resourceClient]);
|
|
156
142
|
(0, _react.useEffect)(function () {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} catch (error) {
|
|
160
|
-
setIsLoading(false);
|
|
161
|
-
setError(error);
|
|
162
|
-
}
|
|
163
|
-
}, [fetchData, getAgentInfo, getCreator, props.accountId, props.cloudId, props.resourceClient]);
|
|
143
|
+
fetchData();
|
|
144
|
+
}, [fetchData]);
|
|
164
145
|
if (error || !isLoading && !agentData) {
|
|
165
146
|
return /*#__PURE__*/_react.default.createElement(_AgentProfileCardWrapper.AgentProfileCardWrapper, null, /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
|
|
166
147
|
reload: function reload() {
|
|
@@ -170,19 +151,18 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
170
151
|
fireAnalytics: function fireAnalytics() {}
|
|
171
152
|
}));
|
|
172
153
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
return null;
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
155
|
+
fallback: null
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_lazyAgentProfileCard.AgentProfileCardLazy, {
|
|
157
|
+
agent: agentData,
|
|
158
|
+
isLoading: isLoading,
|
|
159
|
+
hasError: !!error,
|
|
160
|
+
isCreatedByViewingUser: creatorUserId === props.viewingUserId,
|
|
161
|
+
product: props.product,
|
|
162
|
+
onConversationStartersClick: props.onConversationStartersClick,
|
|
163
|
+
onChatClick: props.onChatClick,
|
|
164
|
+
addFlag: props.addFlag,
|
|
165
|
+
resourceClient: props.resourceClient,
|
|
166
|
+
cloudId: props.cloudId
|
|
167
|
+
}));
|
|
188
168
|
};
|
|
@@ -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: "20.
|
|
48
|
+
packageVersion: "20.11.0"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
|
|
|
6
6
|
}`;
|
|
7
7
|
const addHeaders = headers => {
|
|
8
8
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
9
|
-
headers.append('atl-client-version', "20.
|
|
9
|
+
headers.append('atl-client-version', "20.11.0");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
|
|
|
67
67
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
68
68
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
69
69
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
70
|
-
headers.append('atl-client-version', "20.
|
|
70
|
+
headers.append('atl-client-version', "20.11.0");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
1
|
+
import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { fireEvent } from '../../util/analytics';
|
|
4
4
|
import { getAAIDFromARI } from '../../util/rovoAgentUtils';
|
|
@@ -51,34 +51,27 @@ export const AgentProfileCardResourced = props => {
|
|
|
51
51
|
return undefined;
|
|
52
52
|
}
|
|
53
53
|
}, [creatorUserId, fireAnalytics, props.cloudId, props.resourceClient]);
|
|
54
|
-
const getAgentInfo = useCallback(() => {
|
|
55
|
-
return props.resourceClient.getRovoAgentProfile({
|
|
56
|
-
type: 'identity',
|
|
57
|
-
value: props.accountId
|
|
58
|
-
}, fireAnalytics);
|
|
59
|
-
}, [fireAnalytics, props.accountId, props.resourceClient]);
|
|
60
54
|
const fetchData = useCallback(async () => {
|
|
61
55
|
setIsLoading(true);
|
|
62
|
-
|
|
63
|
-
const profileData = await
|
|
56
|
+
try {
|
|
57
|
+
const profileData = await props.resourceClient.getRovoAgentProfile({
|
|
58
|
+
type: 'identity',
|
|
59
|
+
value: props.accountId
|
|
60
|
+
}, fireAnalytics);
|
|
64
61
|
const agentCreatorInfo = await getCreator(profileData === null || profileData === void 0 ? void 0 : profileData.creator_type, (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined);
|
|
65
|
-
|
|
62
|
+
setAgentData({
|
|
66
63
|
...profileData,
|
|
67
64
|
creatorInfo: agentCreatorInfo
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
setIsLoading(false);
|
|
73
|
-
}, [getAgentInfo, getCreator]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
try {
|
|
76
|
-
fetchData();
|
|
77
|
-
} catch (error) {
|
|
65
|
+
});
|
|
66
|
+
} catch (err) {
|
|
67
|
+
setError(err);
|
|
68
|
+
} finally {
|
|
78
69
|
setIsLoading(false);
|
|
79
|
-
setError(error);
|
|
80
70
|
}
|
|
81
|
-
}, [
|
|
71
|
+
}, [fireAnalytics, getCreator, props.accountId, props.resourceClient]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
fetchData();
|
|
74
|
+
}, [fetchData]);
|
|
82
75
|
if (error || !isLoading && !agentData) {
|
|
83
76
|
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
84
77
|
reload: () => {
|
|
@@ -88,19 +81,18 @@ export const AgentProfileCardResourced = props => {
|
|
|
88
81
|
fireAnalytics: () => {}
|
|
89
82
|
}));
|
|
90
83
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
84
|
+
return /*#__PURE__*/React.createElement(Suspense, {
|
|
85
|
+
fallback: null
|
|
86
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardLazy, {
|
|
87
|
+
agent: agentData,
|
|
88
|
+
isLoading: isLoading,
|
|
89
|
+
hasError: !!error,
|
|
90
|
+
isCreatedByViewingUser: creatorUserId === props.viewingUserId,
|
|
91
|
+
product: props.product,
|
|
92
|
+
onConversationStartersClick: props.onConversationStartersClick,
|
|
93
|
+
onChatClick: props.onChatClick,
|
|
94
|
+
addFlag: props.addFlag,
|
|
95
|
+
resourceClient: props.resourceClient,
|
|
96
|
+
cloudId: props.cloudId
|
|
97
|
+
}));
|
|
106
98
|
};
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "20.
|
|
35
|
+
packageVersion: "20.11.0",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
|
|
|
4
4
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
5
5
|
var addHeaders = function addHeaders(headers) {
|
|
6
6
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
7
|
-
headers.append('atl-client-version', "20.
|
|
7
|
+
headers.append('atl-client-version', "20.11.0");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
48
48
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
49
49
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
50
50
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
51
|
-
headers.append('atl-client-version', "20.
|
|
51
|
+
headers.append('atl-client-version', "20.11.0");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
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; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
9
9
|
import { fireEvent } from '../../util/analytics';
|
|
10
10
|
import { getAAIDFromARI } from '../../util/rovoAgentUtils';
|
|
@@ -92,65 +92,46 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
92
92
|
return _ref.apply(this, arguments);
|
|
93
93
|
};
|
|
94
94
|
}(), [creatorUserId, fireAnalytics, props.cloudId, props.resourceClient]);
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, fireAnalytics);
|
|
100
|
-
}, [fireAnalytics, props.accountId, props.resourceClient]);
|
|
101
|
-
var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
102
|
-
var getAgentData, agentData;
|
|
103
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
104
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
95
|
+
var fetchData = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
96
|
+
var profileData, agentCreatorInfo;
|
|
97
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
98
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
105
99
|
case 0:
|
|
106
100
|
setIsLoading(true);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_context2.next = 2;
|
|
114
|
-
return getAgentInfo();
|
|
115
|
-
case 2:
|
|
116
|
-
profileData = _context2.sent;
|
|
117
|
-
_context2.next = 5;
|
|
118
|
-
return getCreator(profileData === null || profileData === void 0 ? void 0 : profileData.creator_type, (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined);
|
|
119
|
-
case 5:
|
|
120
|
-
agentCreatorInfo = _context2.sent;
|
|
121
|
-
return _context2.abrupt("return", _objectSpread(_objectSpread({}, profileData), {}, {
|
|
122
|
-
creatorInfo: agentCreatorInfo
|
|
123
|
-
}));
|
|
124
|
-
case 7:
|
|
125
|
-
case "end":
|
|
126
|
-
return _context2.stop();
|
|
127
|
-
}
|
|
128
|
-
}, _callee2);
|
|
129
|
-
}));
|
|
130
|
-
return function getAgentData() {
|
|
131
|
-
return _ref3.apply(this, arguments);
|
|
132
|
-
};
|
|
133
|
-
}();
|
|
134
|
-
_context3.next = 4;
|
|
135
|
-
return getAgentData();
|
|
101
|
+
_context2.prev = 1;
|
|
102
|
+
_context2.next = 4;
|
|
103
|
+
return props.resourceClient.getRovoAgentProfile({
|
|
104
|
+
type: 'identity',
|
|
105
|
+
value: props.accountId
|
|
106
|
+
}, fireAnalytics);
|
|
136
107
|
case 4:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
108
|
+
profileData = _context2.sent;
|
|
109
|
+
_context2.next = 7;
|
|
110
|
+
return getCreator(profileData === null || profileData === void 0 ? void 0 : profileData.creator_type, (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined);
|
|
140
111
|
case 7:
|
|
112
|
+
agentCreatorInfo = _context2.sent;
|
|
113
|
+
setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
|
|
114
|
+
creatorInfo: agentCreatorInfo
|
|
115
|
+
}));
|
|
116
|
+
_context2.next = 14;
|
|
117
|
+
break;
|
|
118
|
+
case 11:
|
|
119
|
+
_context2.prev = 11;
|
|
120
|
+
_context2.t0 = _context2["catch"](1);
|
|
121
|
+
setError(_context2.t0);
|
|
122
|
+
case 14:
|
|
123
|
+
_context2.prev = 14;
|
|
124
|
+
setIsLoading(false);
|
|
125
|
+
return _context2.finish(14);
|
|
126
|
+
case 17:
|
|
141
127
|
case "end":
|
|
142
|
-
return
|
|
128
|
+
return _context2.stop();
|
|
143
129
|
}
|
|
144
|
-
},
|
|
145
|
-
})), [
|
|
130
|
+
}, _callee2, null, [[1, 11, 14, 17]]);
|
|
131
|
+
})), [fireAnalytics, getCreator, props.accountId, props.resourceClient]);
|
|
146
132
|
useEffect(function () {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
} catch (error) {
|
|
150
|
-
setIsLoading(false);
|
|
151
|
-
setError(error);
|
|
152
|
-
}
|
|
153
|
-
}, [fetchData, getAgentInfo, getCreator, props.accountId, props.cloudId, props.resourceClient]);
|
|
133
|
+
fetchData();
|
|
134
|
+
}, [fetchData]);
|
|
154
135
|
if (error || !isLoading && !agentData) {
|
|
155
136
|
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
156
137
|
reload: function reload() {
|
|
@@ -160,19 +141,18 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
160
141
|
fireAnalytics: function fireAnalytics() {}
|
|
161
142
|
}));
|
|
162
143
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
return null;
|
|
144
|
+
return /*#__PURE__*/React.createElement(Suspense, {
|
|
145
|
+
fallback: null
|
|
146
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardLazy, {
|
|
147
|
+
agent: agentData,
|
|
148
|
+
isLoading: isLoading,
|
|
149
|
+
hasError: !!error,
|
|
150
|
+
isCreatedByViewingUser: creatorUserId === props.viewingUserId,
|
|
151
|
+
product: props.product,
|
|
152
|
+
onConversationStartersClick: props.onConversationStartersClick,
|
|
153
|
+
onChatClick: props.onChatClick,
|
|
154
|
+
addFlag: props.addFlag,
|
|
155
|
+
resourceClient: props.resourceClient,
|
|
156
|
+
cloudId: props.cloudId
|
|
157
|
+
}));
|
|
178
158
|
};
|
|
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
39
39
|
actionSubjectId: actionSubjectId,
|
|
40
40
|
attributes: _objectSpread(_objectSpread({
|
|
41
41
|
packageName: "@atlaskit/profilecard",
|
|
42
|
-
packageVersion: "20.
|
|
42
|
+
packageVersion: "20.11.0"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -10,4 +10,4 @@ export type AgentProfileCardResourcedProps = {
|
|
|
10
10
|
product?: string;
|
|
11
11
|
addFlag?: (flag: Flag) => void;
|
|
12
12
|
} & AgentActionsType;
|
|
13
|
-
export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => JSX.Element
|
|
13
|
+
export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => JSX.Element;
|
|
@@ -10,4 +10,4 @@ export type AgentProfileCardResourcedProps = {
|
|
|
10
10
|
product?: string;
|
|
11
11
|
addFlag?: (flag: Flag) => void;
|
|
12
12
|
} & AgentActionsType;
|
|
13
|
-
export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => JSX.Element
|
|
13
|
+
export declare const AgentProfileCardResourced: (props: AgentProfileCardResourcedProps) => JSX.Element;
|