@atlaskit/profilecard 20.4.3 → 20.6.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 +16 -0
- package/README.md +3 -14
- package/dist/cjs/client/ProfileCardClient.js +68 -9
- package/dist/cjs/client/TeamCentralCardClient.js +74 -2
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +3 -3
- package/dist/cjs/components/User/ProfileCardResourced.js +9 -6
- package/dist/cjs/components/User/ProfileCardTrigger.js +12 -12
- package/dist/cjs/i18n/languages.js +4 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/ProfileCardClient.js +13 -6
- package/dist/es2019/client/TeamCentralCardClient.js +41 -2
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +3 -3
- package/dist/es2019/components/User/ProfileCardResourced.js +9 -6
- package/dist/es2019/components/User/ProfileCardTrigger.js +3 -3
- package/dist/es2019/i18n/index.js +2 -2
- package/dist/es2019/i18n/languages.js +4 -2
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/ProfileCardClient.js +69 -10
- package/dist/esm/client/TeamCentralCardClient.js +74 -2
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +3 -3
- package/dist/esm/components/User/ProfileCardResourced.js +9 -6
- package/dist/esm/components/User/ProfileCardTrigger.js +12 -12
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/i18n/languages.js +4 -2
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/ProfileCardClient.d.ts +1 -1
- package/dist/types/client/TeamCentralCardClient.d.ts +5 -0
- package/dist/types/components/Team/TeamProfileCardTrigger.d.ts +1 -1
- package/dist/types/components/User/ProfileCardResourced.d.ts +1 -1
- package/dist/types/i18n/index.d.ts +2 -2
- package/dist/types/i18n/languages.d.ts +3 -2
- package/dist/types/types.d.ts +2 -1
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +1 -1
- package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +5 -0
- package/dist/types-ts4.5/components/Team/TeamProfileCardTrigger.d.ts +1 -1
- package/dist/types-ts4.5/components/User/ProfileCardResourced.d.ts +1 -1
- package/dist/types-ts4.5/i18n/index.d.ts +2 -2
- package/dist/types-ts4.5/i18n/languages.d.ts +3 -2
- package/dist/types-ts4.5/types.d.ts +2 -1
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export { default as zh } from './zh';
|
|
8
8
|
export { default as zh_TW } from './zh_TW';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export default {
|
|
8
8
|
zh: 'Chinese',
|
|
@@ -11,6 +11,8 @@ export default {
|
|
|
11
11
|
nl: 'Dutch',
|
|
12
12
|
en: 'English',
|
|
13
13
|
en_GB: 'English (United Kingdom)',
|
|
14
|
+
en_ZZ: 'English (Instrumented)',
|
|
15
|
+
// Used by i18n team in staging
|
|
14
16
|
et: 'Estonian',
|
|
15
17
|
fi: 'Finnish',
|
|
16
18
|
fr: 'French',
|
|
@@ -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.6.0",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
6
|
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
7
|
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
|
-
import { isFedRamp } from '@atlaskit/atlassian-context';
|
|
8
|
+
import { getATLContextUrl, isFedRamp } from '@atlaskit/atlassian-context';
|
|
7
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import RovoAgentCardClient from './RovoAgentCardClient';
|
|
9
11
|
import TeamCentralCardClient from './TeamCentralCardClient';
|
|
@@ -55,18 +57,75 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
55
57
|
}
|
|
56
58
|
}, {
|
|
57
59
|
key: "getTeamCentralBaseUrl",
|
|
58
|
-
value: function
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
value: function () {
|
|
61
|
+
var _getTeamCentralBaseUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
62
|
+
var _this$tcClient3, isGlobalExperienceWorkspace;
|
|
63
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
64
|
+
while (1) switch (_context.prev = _context.next) {
|
|
65
|
+
case 0:
|
|
66
|
+
if (fg('enable_ptc_sharded_townsquare_calls')) {
|
|
67
|
+
_context.next = 2;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return _context.abrupt("return", Promise.resolve((_this$tcClient3 = this.tcClient) === null || _this$tcClient3 === void 0 ? void 0 : _this$tcClient3.options.teamCentralBaseUrl));
|
|
71
|
+
case 2:
|
|
72
|
+
if (!(this.tcClient === undefined)) {
|
|
73
|
+
_context.next = 4;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
return _context.abrupt("return", Promise.resolve(undefined));
|
|
77
|
+
case 4:
|
|
78
|
+
_context.next = 6;
|
|
79
|
+
return this.tcClient.getIsGlobalExperienceWorkspace();
|
|
80
|
+
case 6:
|
|
81
|
+
isGlobalExperienceWorkspace = _context.sent;
|
|
82
|
+
return _context.abrupt("return", Promise.resolve(isGlobalExperienceWorkspace ? getATLContextUrl('home') : getATLContextUrl('team')));
|
|
83
|
+
case 8:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
86
|
+
}
|
|
87
|
+
}, _callee, this);
|
|
88
|
+
}));
|
|
89
|
+
function getTeamCentralBaseUrl() {
|
|
90
|
+
return _getTeamCentralBaseUrl.apply(this, arguments);
|
|
91
|
+
}
|
|
92
|
+
return getTeamCentralBaseUrl;
|
|
93
|
+
}()
|
|
62
94
|
}, {
|
|
63
95
|
key: "shouldShowGiveKudos",
|
|
64
|
-
value: function
|
|
65
|
-
|
|
66
|
-
return
|
|
96
|
+
value: function () {
|
|
97
|
+
var _shouldShowGiveKudos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
98
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
99
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
100
|
+
case 0:
|
|
101
|
+
_context2.t0 = !this.tcClient;
|
|
102
|
+
if (_context2.t0) {
|
|
103
|
+
_context2.next = 5;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
_context2.next = 4;
|
|
107
|
+
return this.getTeamCentralBaseUrl();
|
|
108
|
+
case 4:
|
|
109
|
+
_context2.t0 = !_context2.sent;
|
|
110
|
+
case 5:
|
|
111
|
+
if (!_context2.t0) {
|
|
112
|
+
_context2.next = 7;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return _context2.abrupt("return", Promise.resolve(false));
|
|
116
|
+
case 7:
|
|
117
|
+
return _context2.abrupt("return", this.tcClient.checkWorkspaceExists());
|
|
118
|
+
case 8:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context2.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee2, this);
|
|
123
|
+
}));
|
|
124
|
+
function shouldShowGiveKudos() {
|
|
125
|
+
return _shouldShowGiveKudos.apply(this, arguments);
|
|
67
126
|
}
|
|
68
|
-
return
|
|
69
|
-
}
|
|
127
|
+
return shouldShowGiveKudos;
|
|
128
|
+
}()
|
|
70
129
|
}, {
|
|
71
130
|
key: "getRovoAgentProfile",
|
|
72
131
|
value: function getRovoAgentProfile(id, analytics) {
|
|
@@ -19,6 +19,7 @@ export var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
var isTCReadyPromiseMap = new Map();
|
|
22
|
+
var globalExperiencePromiseCache = new Map();
|
|
22
23
|
var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
23
24
|
_inherits(TeamCentralCardClient, _CachingClient);
|
|
24
25
|
var _super = _createSuper(TeamCentralCardClient);
|
|
@@ -38,6 +39,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
38
39
|
_this.options = options;
|
|
39
40
|
_this.bypassOnFailure = false;
|
|
40
41
|
_this.isTCReadyPromise = _this.createTcReadyPromise(options);
|
|
42
|
+
_this.isGlobalExperienceWorkspacePromise = _this.preloadIsGlobalExperienceWorkspace(options.cloudId);
|
|
41
43
|
return _this;
|
|
42
44
|
}
|
|
43
45
|
_createClass(TeamCentralCardClient, [{
|
|
@@ -168,18 +170,88 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
168
170
|
return Promise.resolve(false);
|
|
169
171
|
});
|
|
170
172
|
}
|
|
173
|
+
}, {
|
|
174
|
+
key: "getIsGlobalExperienceWorkspace",
|
|
175
|
+
value: function getIsGlobalExperienceWorkspace() {
|
|
176
|
+
return this.isGlobalExperienceWorkspacePromise;
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: "preloadIsGlobalExperienceWorkspace",
|
|
180
|
+
value: function preloadIsGlobalExperienceWorkspace(cloudId) {
|
|
181
|
+
if (!fg('enable_ptc_sharded_townsquare_calls')) {
|
|
182
|
+
return Promise.resolve(false);
|
|
183
|
+
}
|
|
184
|
+
if (cloudId === undefined) {
|
|
185
|
+
return Promise.resolve(false);
|
|
186
|
+
}
|
|
187
|
+
var maybeIsGlobalExperienceWorkspaceForCloudIdPromise = globalExperiencePromiseCache.get(cloudId);
|
|
188
|
+
if (maybeIsGlobalExperienceWorkspaceForCloudIdPromise !== undefined) {
|
|
189
|
+
return maybeIsGlobalExperienceWorkspaceForCloudIdPromise;
|
|
190
|
+
}
|
|
191
|
+
var isGlobalExperienceWorkspaceForCloudIdPromise = this.isGlobalExperienceWorkspaceForCloudId(cloudId);
|
|
192
|
+
globalExperiencePromiseCache.set(cloudId, isGlobalExperienceWorkspaceForCloudIdPromise);
|
|
193
|
+
return isGlobalExperienceWorkspaceForCloudIdPromise;
|
|
194
|
+
}
|
|
171
195
|
}, {
|
|
172
196
|
key: "hasTCWorkspace",
|
|
173
197
|
value: function hasTCWorkspace(config) {
|
|
174
198
|
if (config.cloudId) {
|
|
175
|
-
var
|
|
176
|
-
return fetch("
|
|
199
|
+
var maybeShardedApiPath = this.getMaybeShardedApiPath(config.cloudId);
|
|
200
|
+
return fetch("".concat(maybeShardedApiPath, "/organization/containsAnyWorkspace?cloudId=").concat(config.cloudId)).then(function (res) {
|
|
177
201
|
return !res || res && res.ok;
|
|
178
202
|
});
|
|
179
203
|
} else {
|
|
180
204
|
return Promise.resolve(false);
|
|
181
205
|
}
|
|
182
206
|
}
|
|
207
|
+
}, {
|
|
208
|
+
key: "isGlobalExperienceWorkspaceForCloudId",
|
|
209
|
+
value: function () {
|
|
210
|
+
var _isGlobalExperienceWorkspaceForCloudId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId) {
|
|
211
|
+
var maybeShardedApiPath, response, workspaceType;
|
|
212
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
213
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
214
|
+
case 0:
|
|
215
|
+
maybeShardedApiPath = this.getMaybeShardedApiPath(cloudId);
|
|
216
|
+
_context2.prev = 1;
|
|
217
|
+
_context2.next = 4;
|
|
218
|
+
return fetch("".concat(maybeShardedApiPath, "/workspace/existsWithWorkspaceType?cloudId=").concat(cloudId), {
|
|
219
|
+
credentials: 'include'
|
|
220
|
+
});
|
|
221
|
+
case 4:
|
|
222
|
+
response = _context2.sent;
|
|
223
|
+
if (!response.ok) {
|
|
224
|
+
_context2.next = 10;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
_context2.next = 8;
|
|
228
|
+
return response.text();
|
|
229
|
+
case 8:
|
|
230
|
+
workspaceType = _context2.sent;
|
|
231
|
+
return _context2.abrupt("return", Promise.resolve(workspaceType === 'GLOBAL_EXPERIENCE'));
|
|
232
|
+
case 10:
|
|
233
|
+
return _context2.abrupt("return", Promise.resolve(false));
|
|
234
|
+
case 13:
|
|
235
|
+
_context2.prev = 13;
|
|
236
|
+
_context2.t0 = _context2["catch"](1);
|
|
237
|
+
return _context2.abrupt("return", Promise.resolve(false));
|
|
238
|
+
case 16:
|
|
239
|
+
case "end":
|
|
240
|
+
return _context2.stop();
|
|
241
|
+
}
|
|
242
|
+
}, _callee2, this, [[1, 13]]);
|
|
243
|
+
}));
|
|
244
|
+
function isGlobalExperienceWorkspaceForCloudId(_x2) {
|
|
245
|
+
return _isGlobalExperienceWorkspaceForCloudId.apply(this, arguments);
|
|
246
|
+
}
|
|
247
|
+
return isGlobalExperienceWorkspaceForCloudId;
|
|
248
|
+
}()
|
|
249
|
+
}, {
|
|
250
|
+
key: "getMaybeShardedApiPath",
|
|
251
|
+
value: function getMaybeShardedApiPath(cloudId) {
|
|
252
|
+
var maybeShardedPath = fg('enable_ptc_sharded_townsquare_calls') ? "/townsquare/s/".concat(cloudId) : '/watermelon';
|
|
253
|
+
return "/gateway/api".concat(maybeShardedPath);
|
|
254
|
+
}
|
|
183
255
|
}, {
|
|
184
256
|
key: "filterReportingLinesUser",
|
|
185
257
|
value: function filterReportingLinesUser() {
|
|
@@ -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.6.0");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -176,7 +176,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
176
176
|
var fireEvent = function fireEvent(event) {
|
|
177
177
|
_this.fireAnalytics(event);
|
|
178
178
|
};
|
|
179
|
-
var requests = Promise.all([_this.props.resourceClient.getTeamProfile(teamId, orgId, fireEvent), _this.props.resourceClient.shouldShowGiveKudos()]);
|
|
179
|
+
var requests = Promise.all([_this.props.resourceClient.getTeamProfile(teamId, orgId, fireEvent), _this.props.resourceClient.shouldShowGiveKudos(), _this.props.resourceClient.getTeamCentralBaseUrl()]);
|
|
180
180
|
requests.then(function (res) {
|
|
181
181
|
var _this2;
|
|
182
182
|
return (_this2 = _this).handleClientSuccess.apply(_this2, _toConsumableArray(res));
|
|
@@ -299,7 +299,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
299
299
|
}
|
|
300
300
|
}, {
|
|
301
301
|
key: "handleClientSuccess",
|
|
302
|
-
value: function handleClientSuccess(team, shouldShowGiveKudos) {
|
|
302
|
+
value: function handleClientSuccess(team, shouldShowGiveKudos, teamCentralBaseUrl) {
|
|
303
303
|
if (!this._isMounted) {
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
@@ -308,7 +308,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
308
308
|
hasError: false,
|
|
309
309
|
data: team,
|
|
310
310
|
shouldShowGiveKudos: shouldShowGiveKudos,
|
|
311
|
-
teamCentralBaseUrl:
|
|
311
|
+
teamCentralBaseUrl: teamCentralBaseUrl
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
}, {
|
|
@@ -39,7 +39,8 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
39
39
|
data: null,
|
|
40
40
|
reportingLinesData: undefined,
|
|
41
41
|
isKudosEnabled: false,
|
|
42
|
-
kudosDrawerOpen: false
|
|
42
|
+
kudosDrawerOpen: false,
|
|
43
|
+
teamCentralBaseUrl: undefined
|
|
43
44
|
});
|
|
44
45
|
_defineProperty(_assertThisInitialized(_this), "fireAnalytics", function (payload) {
|
|
45
46
|
// Don't fire analytics if the component is unmounted
|
|
@@ -64,7 +65,7 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
65
|
hasError: false,
|
|
65
66
|
data: null
|
|
66
67
|
}, function () {
|
|
67
|
-
var requests = Promise.all([_this.props.resourceClient.getProfile(cloudId, userId, _this.fireAnalytics), _this.props.resourceClient.getReportingLines(userId), _this.props.resourceClient.shouldShowGiveKudos()]);
|
|
68
|
+
var requests = Promise.all([_this.props.resourceClient.getProfile(cloudId, userId, _this.fireAnalytics), _this.props.resourceClient.getReportingLines(userId), _this.props.resourceClient.shouldShowGiveKudos(), _this.props.resourceClient.getTeamCentralBaseUrl()]);
|
|
68
69
|
requests.then(function (res) {
|
|
69
70
|
var _this2;
|
|
70
71
|
return (_this2 = _this).handleClientSuccess.apply(_this2, _toConsumableArray(res));
|
|
@@ -116,7 +117,7 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
116
117
|
}
|
|
117
118
|
}, {
|
|
118
119
|
key: "handleClientSuccess",
|
|
119
|
-
value: function handleClientSuccess(profileData, reportingLinesData, shouldShowGiveKudos) {
|
|
120
|
+
value: function handleClientSuccess(profileData, reportingLinesData, shouldShowGiveKudos, teamCentralBaseUrl) {
|
|
120
121
|
if (!this._isMounted) {
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
@@ -125,7 +126,8 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
125
126
|
hasError: false,
|
|
126
127
|
data: profileData,
|
|
127
128
|
reportingLinesData: reportingLinesData,
|
|
128
|
-
isKudosEnabled: shouldShowGiveKudos
|
|
129
|
+
isKudosEnabled: shouldShowGiveKudos,
|
|
130
|
+
teamCentralBaseUrl: teamCentralBaseUrl
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
133
|
}, {
|
|
@@ -149,7 +151,8 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
151
|
error = _this$state.error,
|
|
150
152
|
data = _this$state.data,
|
|
151
153
|
reportingLinesData = _this$state.reportingLinesData,
|
|
152
|
-
isKudosEnabled = _this$state.isKudosEnabled
|
|
154
|
+
isKudosEnabled = _this$state.isKudosEnabled,
|
|
155
|
+
teamCentralBaseUrl = _this$state.teamCentralBaseUrl;
|
|
153
156
|
var _this$props3 = this.props,
|
|
154
157
|
onReportingLinesClick = _this$props3.onReportingLinesClick,
|
|
155
158
|
cloudId = _this$props3.cloudId,
|
|
@@ -180,7 +183,7 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
180
183
|
addFlag: addFlag
|
|
181
184
|
}, data), {}, {
|
|
182
185
|
isKudosEnabled: isKudosEnabled,
|
|
183
|
-
teamCentralBaseUrl:
|
|
186
|
+
teamCentralBaseUrl: teamCentralBaseUrl,
|
|
184
187
|
openKudosDrawer: this.openKudosDrawer
|
|
185
188
|
});
|
|
186
189
|
return /*#__PURE__*/React.createElement(CardWrapper, null, /*#__PURE__*/React.createElement(React.Fragment, null, isKudosEnabled && /*#__PURE__*/React.createElement(Suspense, {
|
|
@@ -181,7 +181,7 @@ export default function ProfilecardTriggerNext(_ref2) {
|
|
|
181
181
|
setVisible(false);
|
|
182
182
|
onVisibilityChange && onVisibilityChange(false);
|
|
183
183
|
}, [setTriggeredUsingKeyboard, setVisible, onVisibilityChange]);
|
|
184
|
-
var handleClientSuccess = useCallback(function (profileData, reportingLinesData, shouldShowGiveKudos) {
|
|
184
|
+
var handleClientSuccess = useCallback(function (profileData, reportingLinesData, shouldShowGiveKudos, teamCentralBaseUrl) {
|
|
185
185
|
if (!isMounted.current) {
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
@@ -189,6 +189,7 @@ export default function ProfilecardTriggerNext(_ref2) {
|
|
|
189
189
|
setHasError(false);
|
|
190
190
|
setData(profileData);
|
|
191
191
|
setReportingLinesData(reportingLinesData);
|
|
192
|
+
setTeamCentralBaseUrl(teamCentralBaseUrl);
|
|
192
193
|
setShouldShowGiveKudos(shouldShowGiveKudos);
|
|
193
194
|
}, [setHasError, setIsLoading, setData, setReportingLinesData, setShouldShowGiveKudos]);
|
|
194
195
|
var handleClientError = useCallback(function (err) {
|
|
@@ -210,29 +211,28 @@ export default function ProfilecardTriggerNext(_ref2) {
|
|
|
210
211
|
}
|
|
211
212
|
return _context.abrupt("return");
|
|
212
213
|
case 2:
|
|
213
|
-
setTeamCentralBaseUrl(resourceClient.getTeamCentralBaseUrl());
|
|
214
214
|
setIsLoading(true);
|
|
215
215
|
setHasError(false);
|
|
216
216
|
setError(null);
|
|
217
217
|
setData(null);
|
|
218
|
-
_context.prev =
|
|
219
|
-
requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics), resourceClient.getReportingLines(userId), resourceClient.shouldShowGiveKudos()]);
|
|
220
|
-
_context.next =
|
|
218
|
+
_context.prev = 6;
|
|
219
|
+
requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics), resourceClient.getReportingLines(userId), resourceClient.shouldShowGiveKudos(), resourceClient.getTeamCentralBaseUrl()]);
|
|
220
|
+
_context.next = 10;
|
|
221
221
|
return requests;
|
|
222
|
-
case
|
|
222
|
+
case 10:
|
|
223
223
|
responses = _context.sent;
|
|
224
224
|
handleClientSuccess.apply(void 0, _toConsumableArray(responses));
|
|
225
|
-
_context.next =
|
|
225
|
+
_context.next = 17;
|
|
226
226
|
break;
|
|
227
|
-
case
|
|
228
|
-
_context.prev =
|
|
229
|
-
_context.t0 = _context["catch"](
|
|
227
|
+
case 14:
|
|
228
|
+
_context.prev = 14;
|
|
229
|
+
_context.t0 = _context["catch"](6);
|
|
230
230
|
handleClientError(_context.t0);
|
|
231
|
-
case
|
|
231
|
+
case 17:
|
|
232
232
|
case "end":
|
|
233
233
|
return _context.stop();
|
|
234
234
|
}
|
|
235
|
-
}, _callee, null, [[
|
|
235
|
+
}, _callee, null, [[6, 14]]);
|
|
236
236
|
})), [cloudId, fireAnalytics, isLoading, resourceClient, userId, handleClientSuccess, handleClientError]);
|
|
237
237
|
var showProfilecard = useCallback(function () {
|
|
238
238
|
clearTimeout(hideTimer.current);
|
package/dist/esm/i18n/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export { default as zh } from './zh';
|
|
8
8
|
export { default as zh_TW } from './zh_TW';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export default {
|
|
8
8
|
zh: 'Chinese',
|
|
@@ -11,6 +11,8 @@ export default {
|
|
|
11
11
|
nl: 'Dutch',
|
|
12
12
|
en: 'English',
|
|
13
13
|
en_GB: 'English (United Kingdom)',
|
|
14
|
+
en_ZZ: 'English (Instrumented)',
|
|
15
|
+
// Used by i18n team in staging
|
|
14
16
|
et: 'Estonian',
|
|
15
17
|
fi: 'Finnish',
|
|
16
18
|
fr: 'French',
|
|
@@ -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.6.0"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -14,7 +14,7 @@ declare class ProfileCardClient implements ProfileClient {
|
|
|
14
14
|
getProfile(cloudId: string, userId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<any>;
|
|
15
15
|
getTeamProfile(teamId: string, orgId?: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<import("../types").Team>;
|
|
16
16
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
17
|
-
getTeamCentralBaseUrl(): string | undefined
|
|
17
|
+
getTeamCentralBaseUrl(): Promise<string | undefined>;
|
|
18
18
|
shouldShowGiveKudos(): Promise<boolean>;
|
|
19
19
|
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<import("../types").RovoAgent>;
|
|
20
20
|
deleteAgent(id: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
|
@@ -29,6 +29,7 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
29
29
|
*/
|
|
30
30
|
bypassOnFailure: boolean;
|
|
31
31
|
isTCReadyPromise: Promise<boolean>;
|
|
32
|
+
private isGlobalExperienceWorkspacePromise;
|
|
32
33
|
constructor(options: TeamCentralCardClientOptions);
|
|
33
34
|
createTcReadyPromise(config: TeamCentralCardClientOptions): Promise<boolean>;
|
|
34
35
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
@@ -37,7 +38,11 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
37
38
|
*/
|
|
38
39
|
makeRequest(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
39
40
|
checkWorkspaceExists(): Promise<boolean>;
|
|
41
|
+
getIsGlobalExperienceWorkspace(): Promise<boolean>;
|
|
42
|
+
private preloadIsGlobalExperienceWorkspace;
|
|
40
43
|
private hasTCWorkspace;
|
|
44
|
+
private isGlobalExperienceWorkspaceForCloudId;
|
|
45
|
+
private getMaybeShardedApiPath;
|
|
41
46
|
private filterReportingLinesUser;
|
|
42
47
|
}
|
|
43
48
|
export default TeamCentralCardClient;
|
|
@@ -37,7 +37,7 @@ export declare class TeamProfileCardTriggerInternal extends React.PureComponent<
|
|
|
37
37
|
componentWillUnmount(): void;
|
|
38
38
|
clientFetchProfile: () => void;
|
|
39
39
|
onErrorBoundary: () => void;
|
|
40
|
-
handleClientSuccess(team: Team, shouldShowGiveKudos: boolean): void;
|
|
40
|
+
handleClientSuccess(team: Team, shouldShowGiveKudos: boolean, teamCentralBaseUrl: string | undefined): void;
|
|
41
41
|
handleClientError(err: any): void;
|
|
42
42
|
filterActions(): ProfileCardAction[];
|
|
43
43
|
renderProfileCard: () => JSX.Element;
|
|
@@ -10,7 +10,7 @@ declare class ProfileCardResourced extends React.PureComponent<ProfileCardResour
|
|
|
10
10
|
componentDidUpdate(prevProps: ProfileCardResourcedProps): void;
|
|
11
11
|
componentWillUnmount(): void;
|
|
12
12
|
clientFetchProfile: () => void;
|
|
13
|
-
handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean): void;
|
|
13
|
+
handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean, teamCentralBaseUrl?: string): void;
|
|
14
14
|
handleClientError(err: any): void;
|
|
15
15
|
filterActions: () => ProfileCardAction[];
|
|
16
16
|
openKudosDrawer: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export { default as zh } from './zh';
|
|
8
8
|
export { default as zh_TW } from './zh_TW';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
declare const _default: {
|
|
8
8
|
zh: string;
|
|
@@ -11,6 +11,7 @@ declare const _default: {
|
|
|
11
11
|
nl: string;
|
|
12
12
|
en: string;
|
|
13
13
|
en_GB: string;
|
|
14
|
+
en_ZZ: string;
|
|
14
15
|
et: string;
|
|
15
16
|
fi: string;
|
|
16
17
|
fr: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -141,6 +141,7 @@ export interface ProfileCardResourcedState {
|
|
|
141
141
|
reportingLinesData?: TeamCentralReportingLinesData;
|
|
142
142
|
isKudosEnabled?: boolean;
|
|
143
143
|
kudosDrawerOpen: boolean;
|
|
144
|
+
teamCentralBaseUrl?: string;
|
|
144
145
|
}
|
|
145
146
|
export interface ProfileCardTriggerProps {
|
|
146
147
|
userId: string;
|
|
@@ -438,7 +439,7 @@ export interface ProfileClient {
|
|
|
438
439
|
getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<Team>;
|
|
439
440
|
getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
|
|
440
441
|
shouldShowGiveKudos: () => Promise<boolean>;
|
|
441
|
-
getTeamCentralBaseUrl: () => string | undefined
|
|
442
|
+
getTeamCentralBaseUrl: () => Promise<string | undefined>;
|
|
442
443
|
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<RovoAgent>;
|
|
443
444
|
deleteAgent: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<void>;
|
|
444
445
|
setFavouriteAgent: (id: string, isFavourite: boolean, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<void>;
|
|
@@ -14,7 +14,7 @@ declare class ProfileCardClient implements ProfileClient {
|
|
|
14
14
|
getProfile(cloudId: string, userId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<any>;
|
|
15
15
|
getTeamProfile(teamId: string, orgId?: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<import("../types").Team>;
|
|
16
16
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
17
|
-
getTeamCentralBaseUrl(): string | undefined
|
|
17
|
+
getTeamCentralBaseUrl(): Promise<string | undefined>;
|
|
18
18
|
shouldShowGiveKudos(): Promise<boolean>;
|
|
19
19
|
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<import("../types").RovoAgent>;
|
|
20
20
|
deleteAgent(id: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
|
@@ -29,6 +29,7 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
29
29
|
*/
|
|
30
30
|
bypassOnFailure: boolean;
|
|
31
31
|
isTCReadyPromise: Promise<boolean>;
|
|
32
|
+
private isGlobalExperienceWorkspacePromise;
|
|
32
33
|
constructor(options: TeamCentralCardClientOptions);
|
|
33
34
|
createTcReadyPromise(config: TeamCentralCardClientOptions): Promise<boolean>;
|
|
34
35
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
@@ -37,7 +38,11 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
37
38
|
*/
|
|
38
39
|
makeRequest(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
39
40
|
checkWorkspaceExists(): Promise<boolean>;
|
|
41
|
+
getIsGlobalExperienceWorkspace(): Promise<boolean>;
|
|
42
|
+
private preloadIsGlobalExperienceWorkspace;
|
|
40
43
|
private hasTCWorkspace;
|
|
44
|
+
private isGlobalExperienceWorkspaceForCloudId;
|
|
45
|
+
private getMaybeShardedApiPath;
|
|
41
46
|
private filterReportingLinesUser;
|
|
42
47
|
}
|
|
43
48
|
export default TeamCentralCardClient;
|
|
@@ -37,7 +37,7 @@ export declare class TeamProfileCardTriggerInternal extends React.PureComponent<
|
|
|
37
37
|
componentWillUnmount(): void;
|
|
38
38
|
clientFetchProfile: () => void;
|
|
39
39
|
onErrorBoundary: () => void;
|
|
40
|
-
handleClientSuccess(team: Team, shouldShowGiveKudos: boolean): void;
|
|
40
|
+
handleClientSuccess(team: Team, shouldShowGiveKudos: boolean, teamCentralBaseUrl: string | undefined): void;
|
|
41
41
|
handleClientError(err: any): void;
|
|
42
42
|
filterActions(): ProfileCardAction[];
|
|
43
43
|
renderProfileCard: () => JSX.Element;
|
|
@@ -10,7 +10,7 @@ declare class ProfileCardResourced extends React.PureComponent<ProfileCardResour
|
|
|
10
10
|
componentDidUpdate(prevProps: ProfileCardResourcedProps): void;
|
|
11
11
|
componentWillUnmount(): void;
|
|
12
12
|
clientFetchProfile: () => void;
|
|
13
|
-
handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean): void;
|
|
13
|
+
handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean, teamCentralBaseUrl?: string): void;
|
|
14
14
|
handleClientError(err: any): void;
|
|
15
15
|
filterActions: () => ProfileCardAction[];
|
|
16
16
|
openKudosDrawer: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
export { default as zh } from './zh';
|
|
8
8
|
export { default as zh_TW } from './zh_TW';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE:
|
|
3
3
|
*
|
|
4
|
-
* This file
|
|
5
|
-
*
|
|
4
|
+
* This file was generated by i18n-tools which has been deprecated.
|
|
5
|
+
* It now requires manual updates.
|
|
6
6
|
*/
|
|
7
7
|
declare const _default: {
|
|
8
8
|
zh: string;
|
|
@@ -11,6 +11,7 @@ declare const _default: {
|
|
|
11
11
|
nl: string;
|
|
12
12
|
en: string;
|
|
13
13
|
en_GB: string;
|
|
14
|
+
en_ZZ: string;
|
|
14
15
|
et: string;
|
|
15
16
|
fi: string;
|
|
16
17
|
fr: string;
|
|
@@ -141,6 +141,7 @@ export interface ProfileCardResourcedState {
|
|
|
141
141
|
reportingLinesData?: TeamCentralReportingLinesData;
|
|
142
142
|
isKudosEnabled?: boolean;
|
|
143
143
|
kudosDrawerOpen: boolean;
|
|
144
|
+
teamCentralBaseUrl?: string;
|
|
144
145
|
}
|
|
145
146
|
export interface ProfileCardTriggerProps {
|
|
146
147
|
userId: string;
|
|
@@ -444,7 +445,7 @@ export interface ProfileClient {
|
|
|
444
445
|
getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<Team>;
|
|
445
446
|
getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
|
|
446
447
|
shouldShowGiveKudos: () => Promise<boolean>;
|
|
447
|
-
getTeamCentralBaseUrl: () => string | undefined
|
|
448
|
+
getTeamCentralBaseUrl: () => Promise<string | undefined>;
|
|
448
449
|
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<RovoAgent>;
|
|
449
450
|
deleteAgent: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<void>;
|
|
450
451
|
setFavouriteAgent: (id: string, isFavourite: boolean, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<void>;
|