@atlaskit/profilecard 21.0.3 → 21.0.4
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 +9 -0
- package/dist/cjs/client/TeamCentralCardClient.js +98 -59
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/mocks/mock-profile-client.js +2 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/TeamCentralCardClient.js +32 -30
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/mocks/mock-profile-client.js +1 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/TeamCentralCardClient.js +98 -59
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/mocks/mock-profile-client.js +2 -2
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/TeamCentralCardClient.d.ts +6 -6
- package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +6 -6
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 21.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#179093](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/179093)
|
|
8
|
+
[`fc80a0b0d4961`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fc80a0b0d4961) -
|
|
9
|
+
Fix reporting lines to be available outside of Atlassian Home
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 21.0.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -12,11 +12,13 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
16
17
|
var _getOrgIdForCloudIdFromAGG = require("./getOrgIdForCloudIdFromAGG");
|
|
17
18
|
var _graphqlUtils = require("./graphqlUtils");
|
|
18
19
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
19
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
+
var UNSHARDED_PREFIX = '/gateway/api/watermelon';
|
|
20
22
|
var buildReportingLinesQuery = exports.buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
21
23
|
return {
|
|
22
24
|
query: "\n fragment ReportingLinesUserPII on UserPII {\n name\n picture\n }\n\n fragment ReportingLinesUserFragment on ReportingLinesUser {\n accountIdentifier\n identifierType\n pii {\n ...ReportingLinesUserPII\n }\n }\n\n query ReportingLines($aaid: String) {\n reportingLines(aaidOrHash: $aaid) {\n managers {\n ...ReportingLinesUserFragment\n }\n reports {\n ...ReportingLinesUserFragment\n }\n }\n }\n ",
|
|
@@ -25,9 +27,9 @@ var buildReportingLinesQuery = exports.buildReportingLinesQuery = function build
|
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
29
|
};
|
|
28
|
-
var
|
|
29
|
-
var globalExperiencePromiseCache = new Map();
|
|
30
|
+
var orgContainsAnyWorkspacePromiseCache = new Map();
|
|
30
31
|
var orgIdPromiseCache = new Map();
|
|
32
|
+
var workspaceExistsWithTypePromiseCache = new Map();
|
|
31
33
|
var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
32
34
|
/**
|
|
33
35
|
* Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures
|
|
@@ -44,20 +46,20 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
44
46
|
_this = _callSuper(this, TeamCentralCardClient, [options]);
|
|
45
47
|
_this.options = options;
|
|
46
48
|
_this.bypassOnFailure = false;
|
|
47
|
-
_this.
|
|
48
|
-
_this.
|
|
49
|
+
_this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
|
|
50
|
+
_this.workspaceExistsWithTypePromise = _this.preloadWorkspaceExistsWithType(options.cloudId);
|
|
49
51
|
_this.orgIdPromise = _this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
|
|
50
52
|
return _this;
|
|
51
53
|
}
|
|
52
54
|
(0, _inherits2.default)(TeamCentralCardClient, _CachingClient);
|
|
53
55
|
return (0, _createClass2.default)(TeamCentralCardClient, [{
|
|
54
|
-
key: "
|
|
55
|
-
value: function
|
|
56
|
+
key: "createOrgContainsAnyWorkspacePromise",
|
|
57
|
+
value: function createOrgContainsAnyWorkspacePromise(config) {
|
|
56
58
|
if (config.cloudId) {
|
|
57
|
-
var promise =
|
|
59
|
+
var promise = orgContainsAnyWorkspacePromiseCache.get(config.cloudId);
|
|
58
60
|
if (!promise) {
|
|
59
|
-
promise = this.
|
|
60
|
-
|
|
61
|
+
promise = this.getOrgContainsAnyWorkspace(config.cloudId);
|
|
62
|
+
orgContainsAnyWorkspacePromiseCache.set(config.cloudId, promise);
|
|
61
63
|
}
|
|
62
64
|
return promise;
|
|
63
65
|
}
|
|
@@ -67,8 +69,8 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
67
69
|
key: "getReportingLines",
|
|
68
70
|
value: function getReportingLines(userId) {
|
|
69
71
|
var _this2 = this;
|
|
70
|
-
return this.
|
|
71
|
-
if (
|
|
72
|
+
return this.orgContainsAnyWorkspacePromise.then(function (orgContainsAnyWorkspace) {
|
|
73
|
+
if (orgContainsAnyWorkspace) {
|
|
72
74
|
if (!userId) {
|
|
73
75
|
return Promise.reject(new Error('userId missing'));
|
|
74
76
|
}
|
|
@@ -151,45 +153,81 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
151
153
|
}())
|
|
152
154
|
}, {
|
|
153
155
|
key: "checkWorkspaceExists",
|
|
154
|
-
value: function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
156
|
+
value: function () {
|
|
157
|
+
var _checkWorkspaceExists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
158
|
+
var workspaceExistsPromise;
|
|
159
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
160
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
161
|
+
case 0:
|
|
162
|
+
workspaceExistsPromise = (0, _platformFeatureFlags.fg)('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(function (workspaceExistsWithType) {
|
|
163
|
+
return workspaceExistsWithType !== undefined;
|
|
164
|
+
}) : this.orgContainsAnyWorkspacePromise;
|
|
165
|
+
return _context2.abrupt("return", workspaceExistsPromise.then(function (workspaceExistsWithType) {
|
|
166
|
+
if (workspaceExistsWithType) {
|
|
167
|
+
return Promise.resolve(true);
|
|
168
|
+
}
|
|
169
|
+
return Promise.resolve(false);
|
|
170
|
+
}, function () {
|
|
171
|
+
return Promise.resolve(false);
|
|
172
|
+
}));
|
|
173
|
+
case 2:
|
|
174
|
+
case "end":
|
|
175
|
+
return _context2.stop();
|
|
176
|
+
}
|
|
177
|
+
}, _callee2, this);
|
|
178
|
+
}));
|
|
179
|
+
function checkWorkspaceExists() {
|
|
180
|
+
return _checkWorkspaceExists.apply(this, arguments);
|
|
181
|
+
}
|
|
182
|
+
return checkWorkspaceExists;
|
|
183
|
+
}()
|
|
164
184
|
}, {
|
|
165
185
|
key: "getIsGlobalExperienceWorkspace",
|
|
166
|
-
value: function
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
value: function () {
|
|
187
|
+
var _getIsGlobalExperienceWorkspace = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
188
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
189
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
_context3.next = 2;
|
|
192
|
+
return this.workspaceExistsWithTypePromise;
|
|
193
|
+
case 2:
|
|
194
|
+
_context3.t0 = _context3.sent;
|
|
195
|
+
return _context3.abrupt("return", _context3.t0 === 'GLOBAL_EXPERIENCE');
|
|
196
|
+
case 4:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context3.stop();
|
|
199
|
+
}
|
|
200
|
+
}, _callee3, this);
|
|
201
|
+
}));
|
|
202
|
+
function getIsGlobalExperienceWorkspace() {
|
|
203
|
+
return _getIsGlobalExperienceWorkspace.apply(this, arguments);
|
|
204
|
+
}
|
|
205
|
+
return getIsGlobalExperienceWorkspace;
|
|
206
|
+
}()
|
|
169
207
|
}, {
|
|
170
208
|
key: "getOrgId",
|
|
171
209
|
value: function getOrgId() {
|
|
172
210
|
return this.orgIdPromise;
|
|
173
211
|
}
|
|
174
212
|
}, {
|
|
175
|
-
key: "
|
|
176
|
-
value: function
|
|
213
|
+
key: "preloadWorkspaceExistsWithType",
|
|
214
|
+
value: function preloadWorkspaceExistsWithType(cloudId) {
|
|
177
215
|
if (cloudId === undefined) {
|
|
178
|
-
return Promise.resolve(
|
|
216
|
+
return Promise.resolve(undefined);
|
|
179
217
|
}
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
182
|
-
return
|
|
218
|
+
var maybeWorkspaceExistsWithTypePromise = workspaceExistsWithTypePromiseCache.get(cloudId);
|
|
219
|
+
if (maybeWorkspaceExistsWithTypePromise !== undefined) {
|
|
220
|
+
return maybeWorkspaceExistsWithTypePromise;
|
|
183
221
|
}
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
return
|
|
222
|
+
var workspaceExistsWithTypePromise = this.getWorkspaceExistsWithType(cloudId);
|
|
223
|
+
workspaceExistsWithTypePromiseCache.set(cloudId, workspaceExistsWithTypePromise);
|
|
224
|
+
return workspaceExistsWithTypePromise;
|
|
187
225
|
}
|
|
188
226
|
}, {
|
|
189
|
-
key: "
|
|
190
|
-
value: function
|
|
191
|
-
if (
|
|
192
|
-
return fetch(
|
|
227
|
+
key: "getOrgContainsAnyWorkspace",
|
|
228
|
+
value: function getOrgContainsAnyWorkspace(cloudId) {
|
|
229
|
+
if (cloudId) {
|
|
230
|
+
return fetch(((0, _platformFeatureFlags.fg)('enable_ptc_townsquare_reporting_lines_unsharded') ? UNSHARDED_PREFIX : this.getShardedApiPath(cloudId)) + "/organization/containsAnyWorkspace?cloudId=".concat(cloudId)).then(function (res) {
|
|
193
231
|
return !res || res && res.ok;
|
|
194
232
|
});
|
|
195
233
|
} else {
|
|
@@ -197,45 +235,46 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
197
235
|
}
|
|
198
236
|
}
|
|
199
237
|
}, {
|
|
200
|
-
key: "
|
|
238
|
+
key: "getWorkspaceExistsWithType",
|
|
201
239
|
value: function () {
|
|
202
|
-
var
|
|
240
|
+
var _getWorkspaceExistsWithType = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(cloudId) {
|
|
203
241
|
var response, workspaceType;
|
|
204
|
-
return _regenerator.default.wrap(function
|
|
205
|
-
while (1) switch (
|
|
242
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
243
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
206
244
|
case 0:
|
|
207
|
-
|
|
208
|
-
|
|
245
|
+
_context4.prev = 0;
|
|
246
|
+
_context4.next = 3;
|
|
209
247
|
return fetch("".concat(this.getShardedApiPath(cloudId), "/workspace/existsWithWorkspaceType?cloudId=").concat(cloudId), {
|
|
210
248
|
credentials: 'include'
|
|
211
249
|
});
|
|
212
250
|
case 3:
|
|
213
|
-
response =
|
|
251
|
+
response = _context4.sent;
|
|
214
252
|
if (!response.ok) {
|
|
215
|
-
|
|
253
|
+
_context4.next = 9;
|
|
216
254
|
break;
|
|
217
255
|
}
|
|
218
|
-
|
|
256
|
+
_context4.next = 7;
|
|
219
257
|
return response.text();
|
|
220
258
|
case 7:
|
|
221
|
-
workspaceType =
|
|
222
|
-
return
|
|
259
|
+
workspaceType = _context4.sent;
|
|
260
|
+
return _context4.abrupt("return", Promise.resolve(workspaceType));
|
|
223
261
|
case 9:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
262
|
+
_context4.next = 14;
|
|
263
|
+
break;
|
|
264
|
+
case 11:
|
|
265
|
+
_context4.prev = 11;
|
|
266
|
+
_context4.t0 = _context4["catch"](0);
|
|
267
|
+
return _context4.abrupt("return", Promise.resolve(undefined));
|
|
268
|
+
case 14:
|
|
230
269
|
case "end":
|
|
231
|
-
return
|
|
270
|
+
return _context4.stop();
|
|
232
271
|
}
|
|
233
|
-
},
|
|
272
|
+
}, _callee4, this, [[0, 11]]);
|
|
234
273
|
}));
|
|
235
|
-
function
|
|
236
|
-
return
|
|
274
|
+
function getWorkspaceExistsWithType(_x2) {
|
|
275
|
+
return _getWorkspaceExistsWithType.apply(this, arguments);
|
|
237
276
|
}
|
|
238
|
-
return
|
|
277
|
+
return getWorkspaceExistsWithType;
|
|
239
278
|
}()
|
|
240
279
|
}, {
|
|
241
280
|
key: "preloadOrgId",
|
|
@@ -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', "21.0.
|
|
14
|
+
headers.append('atl-client-version', "21.0.4");
|
|
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', "21.0.
|
|
60
|
+
headers.append('atl-client-version', "21.0.4");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -65,8 +65,8 @@ function getMockProfileClient(BaseProfileClient, modifyResponse) {
|
|
|
65
65
|
}
|
|
66
66
|
(0, _inherits2.default)(MockTeamCentralClient, _TeamCentralCardClien);
|
|
67
67
|
return (0, _createClass2.default)(MockTeamCentralClient, [{
|
|
68
|
-
key: "
|
|
69
|
-
value: function
|
|
68
|
+
key: "createOrgContainsAnyWorkspacePromise",
|
|
69
|
+
value: function createOrgContainsAnyWorkspacePromise(config) {
|
|
70
70
|
return Promise.resolve(true);
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
@@ -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: "21.0.
|
|
48
|
+
packageVersion: "21.0.4"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import CachingClient from './CachingClient';
|
|
2
3
|
import { getOrgIdForCloudIdFromAGG } from './getOrgIdForCloudIdFromAGG';
|
|
3
4
|
import { directoryGraphqlQuery } from './graphqlUtils';
|
|
5
|
+
const UNSHARDED_PREFIX = '/gateway/api/watermelon';
|
|
4
6
|
export const buildReportingLinesQuery = aaid => ({
|
|
5
7
|
query: `
|
|
6
8
|
fragment ReportingLinesUserPII on UserPII {
|
|
@@ -31,9 +33,9 @@ export const buildReportingLinesQuery = aaid => ({
|
|
|
31
33
|
aaid
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
|
-
|
|
35
|
-
const globalExperiencePromiseCache = new Map();
|
|
36
|
+
const orgContainsAnyWorkspacePromiseCache = new Map();
|
|
36
37
|
const orgIdPromiseCache = new Map();
|
|
38
|
+
const workspaceExistsWithTypePromiseCache = new Map();
|
|
37
39
|
class TeamCentralCardClient extends CachingClient {
|
|
38
40
|
/**
|
|
39
41
|
* Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures
|
|
@@ -48,24 +50,24 @@ class TeamCentralCardClient extends CachingClient {
|
|
|
48
50
|
super(options);
|
|
49
51
|
this.options = options;
|
|
50
52
|
this.bypassOnFailure = false;
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
+
this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(options);
|
|
54
|
+
this.workspaceExistsWithTypePromise = this.preloadWorkspaceExistsWithType(options.cloudId);
|
|
53
55
|
this.orgIdPromise = this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
|
|
54
56
|
}
|
|
55
|
-
|
|
57
|
+
createOrgContainsAnyWorkspacePromise(config) {
|
|
56
58
|
if (config.cloudId) {
|
|
57
|
-
let promise =
|
|
59
|
+
let promise = orgContainsAnyWorkspacePromiseCache.get(config.cloudId);
|
|
58
60
|
if (!promise) {
|
|
59
|
-
promise = this.
|
|
60
|
-
|
|
61
|
+
promise = this.getOrgContainsAnyWorkspace(config.cloudId);
|
|
62
|
+
orgContainsAnyWorkspacePromiseCache.set(config.cloudId, promise);
|
|
61
63
|
}
|
|
62
64
|
return promise;
|
|
63
65
|
}
|
|
64
66
|
return Promise.resolve(true);
|
|
65
67
|
}
|
|
66
68
|
getReportingLines(userId) {
|
|
67
|
-
return this.
|
|
68
|
-
if (
|
|
69
|
+
return this.orgContainsAnyWorkspacePromise.then(orgContainsAnyWorkspace => {
|
|
70
|
+
if (orgContainsAnyWorkspace) {
|
|
69
71
|
if (!userId) {
|
|
70
72
|
return Promise.reject(new Error('userId missing'));
|
|
71
73
|
}
|
|
@@ -121,53 +123,53 @@ class TeamCentralCardClient extends CachingClient {
|
|
|
121
123
|
const response = await directoryGraphqlQuery('/gateway/api/watermelon/graphql?operationName=ReportingLines', query);
|
|
122
124
|
return response.reportingLines;
|
|
123
125
|
}
|
|
124
|
-
checkWorkspaceExists() {
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
async checkWorkspaceExists() {
|
|
127
|
+
const workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(workspaceExistsWithType => workspaceExistsWithType !== undefined) : this.orgContainsAnyWorkspacePromise;
|
|
128
|
+
return workspaceExistsPromise.then(workspaceExistsWithType => {
|
|
129
|
+
if (workspaceExistsWithType) {
|
|
127
130
|
return Promise.resolve(true);
|
|
128
131
|
}
|
|
129
132
|
return Promise.resolve(false);
|
|
130
133
|
}, () => Promise.resolve(false));
|
|
131
134
|
}
|
|
132
|
-
getIsGlobalExperienceWorkspace() {
|
|
133
|
-
return this.
|
|
135
|
+
async getIsGlobalExperienceWorkspace() {
|
|
136
|
+
return (await this.workspaceExistsWithTypePromise) === 'GLOBAL_EXPERIENCE';
|
|
134
137
|
}
|
|
135
138
|
getOrgId() {
|
|
136
139
|
return this.orgIdPromise;
|
|
137
140
|
}
|
|
138
|
-
|
|
141
|
+
preloadWorkspaceExistsWithType(cloudId) {
|
|
139
142
|
if (cloudId === undefined) {
|
|
140
|
-
return Promise.resolve(
|
|
143
|
+
return Promise.resolve(undefined);
|
|
141
144
|
}
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
145
|
+
const maybeWorkspaceExistsWithTypePromise = workspaceExistsWithTypePromiseCache.get(cloudId);
|
|
146
|
+
if (maybeWorkspaceExistsWithTypePromise !== undefined) {
|
|
147
|
+
return maybeWorkspaceExistsWithTypePromise;
|
|
145
148
|
}
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
return
|
|
149
|
+
const workspaceExistsWithTypePromise = this.getWorkspaceExistsWithType(cloudId);
|
|
150
|
+
workspaceExistsWithTypePromiseCache.set(cloudId, workspaceExistsWithTypePromise);
|
|
151
|
+
return workspaceExistsWithTypePromise;
|
|
149
152
|
}
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
-
return fetch(
|
|
153
|
+
getOrgContainsAnyWorkspace(cloudId) {
|
|
154
|
+
if (cloudId) {
|
|
155
|
+
return fetch((fg('enable_ptc_townsquare_reporting_lines_unsharded') ? UNSHARDED_PREFIX : this.getShardedApiPath(cloudId)) + `/organization/containsAnyWorkspace?cloudId=${cloudId}`).then(res => {
|
|
153
156
|
return !res || res && res.ok;
|
|
154
157
|
});
|
|
155
158
|
} else {
|
|
156
159
|
return Promise.resolve(false);
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
async
|
|
162
|
+
async getWorkspaceExistsWithType(cloudId) {
|
|
160
163
|
try {
|
|
161
164
|
const response = await fetch(`${this.getShardedApiPath(cloudId)}/workspace/existsWithWorkspaceType?cloudId=${cloudId}`, {
|
|
162
165
|
credentials: 'include'
|
|
163
166
|
});
|
|
164
167
|
if (response.ok) {
|
|
165
168
|
const workspaceType = await response.text();
|
|
166
|
-
return Promise.resolve(workspaceType
|
|
169
|
+
return Promise.resolve(workspaceType);
|
|
167
170
|
}
|
|
168
|
-
return Promise.resolve(false);
|
|
169
171
|
} catch (err) {
|
|
170
|
-
return Promise.resolve(
|
|
172
|
+
return Promise.resolve(undefined);
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
preloadOrgId(gatewayGraphqlUrl, cloudId, orgId) {
|
|
@@ -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', "21.0.
|
|
9
|
+
headers.append('atl-client-version', "21.0.4");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -68,7 +68,7 @@ export const addHeaders = headers => {
|
|
|
68
68
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
69
69
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
70
70
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
71
|
-
headers.append('atl-client-version', "21.0.
|
|
71
|
+
headers.append('atl-client-version', "21.0.4");
|
|
72
72
|
return headers;
|
|
73
73
|
};
|
|
74
74
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -36,7 +36,7 @@ export default function getMockProfileClient(BaseProfileClient, modifyResponse)
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
class MockTeamCentralClient extends TeamCentralCardClient {
|
|
39
|
-
|
|
39
|
+
createOrgContainsAnyWorkspacePromise(config) {
|
|
40
40
|
return Promise.resolve(true);
|
|
41
41
|
}
|
|
42
42
|
makeRequest(userId) {
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "21.0.
|
|
35
|
+
packageVersion: "21.0.4",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -7,9 +7,11 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import CachingClient from './CachingClient';
|
|
11
12
|
import { getOrgIdForCloudIdFromAGG } from './getOrgIdForCloudIdFromAGG';
|
|
12
13
|
import { directoryGraphqlQuery } from './graphqlUtils';
|
|
14
|
+
var UNSHARDED_PREFIX = '/gateway/api/watermelon';
|
|
13
15
|
export var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
14
16
|
return {
|
|
15
17
|
query: "\n fragment ReportingLinesUserPII on UserPII {\n name\n picture\n }\n\n fragment ReportingLinesUserFragment on ReportingLinesUser {\n accountIdentifier\n identifierType\n pii {\n ...ReportingLinesUserPII\n }\n }\n\n query ReportingLines($aaid: String) {\n reportingLines(aaidOrHash: $aaid) {\n managers {\n ...ReportingLinesUserFragment\n }\n reports {\n ...ReportingLinesUserFragment\n }\n }\n }\n ",
|
|
@@ -18,9 +20,9 @@ export var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
22
|
};
|
|
21
|
-
var
|
|
22
|
-
var globalExperiencePromiseCache = new Map();
|
|
23
|
+
var orgContainsAnyWorkspacePromiseCache = new Map();
|
|
23
24
|
var orgIdPromiseCache = new Map();
|
|
25
|
+
var workspaceExistsWithTypePromiseCache = new Map();
|
|
24
26
|
var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
25
27
|
/**
|
|
26
28
|
* Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures
|
|
@@ -37,20 +39,20 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
37
39
|
_this = _callSuper(this, TeamCentralCardClient, [options]);
|
|
38
40
|
_this.options = options;
|
|
39
41
|
_this.bypassOnFailure = false;
|
|
40
|
-
_this.
|
|
41
|
-
_this.
|
|
42
|
+
_this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
|
|
43
|
+
_this.workspaceExistsWithTypePromise = _this.preloadWorkspaceExistsWithType(options.cloudId);
|
|
42
44
|
_this.orgIdPromise = _this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
|
|
43
45
|
return _this;
|
|
44
46
|
}
|
|
45
47
|
_inherits(TeamCentralCardClient, _CachingClient);
|
|
46
48
|
return _createClass(TeamCentralCardClient, [{
|
|
47
|
-
key: "
|
|
48
|
-
value: function
|
|
49
|
+
key: "createOrgContainsAnyWorkspacePromise",
|
|
50
|
+
value: function createOrgContainsAnyWorkspacePromise(config) {
|
|
49
51
|
if (config.cloudId) {
|
|
50
|
-
var promise =
|
|
52
|
+
var promise = orgContainsAnyWorkspacePromiseCache.get(config.cloudId);
|
|
51
53
|
if (!promise) {
|
|
52
|
-
promise = this.
|
|
53
|
-
|
|
54
|
+
promise = this.getOrgContainsAnyWorkspace(config.cloudId);
|
|
55
|
+
orgContainsAnyWorkspacePromiseCache.set(config.cloudId, promise);
|
|
54
56
|
}
|
|
55
57
|
return promise;
|
|
56
58
|
}
|
|
@@ -60,8 +62,8 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
60
62
|
key: "getReportingLines",
|
|
61
63
|
value: function getReportingLines(userId) {
|
|
62
64
|
var _this2 = this;
|
|
63
|
-
return this.
|
|
64
|
-
if (
|
|
65
|
+
return this.orgContainsAnyWorkspacePromise.then(function (orgContainsAnyWorkspace) {
|
|
66
|
+
if (orgContainsAnyWorkspace) {
|
|
65
67
|
if (!userId) {
|
|
66
68
|
return Promise.reject(new Error('userId missing'));
|
|
67
69
|
}
|
|
@@ -144,45 +146,81 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
144
146
|
}())
|
|
145
147
|
}, {
|
|
146
148
|
key: "checkWorkspaceExists",
|
|
147
|
-
value: function
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
value: function () {
|
|
150
|
+
var _checkWorkspaceExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
151
|
+
var workspaceExistsPromise;
|
|
152
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
153
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
154
|
+
case 0:
|
|
155
|
+
workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(function (workspaceExistsWithType) {
|
|
156
|
+
return workspaceExistsWithType !== undefined;
|
|
157
|
+
}) : this.orgContainsAnyWorkspacePromise;
|
|
158
|
+
return _context2.abrupt("return", workspaceExistsPromise.then(function (workspaceExistsWithType) {
|
|
159
|
+
if (workspaceExistsWithType) {
|
|
160
|
+
return Promise.resolve(true);
|
|
161
|
+
}
|
|
162
|
+
return Promise.resolve(false);
|
|
163
|
+
}, function () {
|
|
164
|
+
return Promise.resolve(false);
|
|
165
|
+
}));
|
|
166
|
+
case 2:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context2.stop();
|
|
169
|
+
}
|
|
170
|
+
}, _callee2, this);
|
|
171
|
+
}));
|
|
172
|
+
function checkWorkspaceExists() {
|
|
173
|
+
return _checkWorkspaceExists.apply(this, arguments);
|
|
174
|
+
}
|
|
175
|
+
return checkWorkspaceExists;
|
|
176
|
+
}()
|
|
157
177
|
}, {
|
|
158
178
|
key: "getIsGlobalExperienceWorkspace",
|
|
159
|
-
value: function
|
|
160
|
-
|
|
161
|
-
|
|
179
|
+
value: function () {
|
|
180
|
+
var _getIsGlobalExperienceWorkspace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
181
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
_context3.next = 2;
|
|
185
|
+
return this.workspaceExistsWithTypePromise;
|
|
186
|
+
case 2:
|
|
187
|
+
_context3.t0 = _context3.sent;
|
|
188
|
+
return _context3.abrupt("return", _context3.t0 === 'GLOBAL_EXPERIENCE');
|
|
189
|
+
case 4:
|
|
190
|
+
case "end":
|
|
191
|
+
return _context3.stop();
|
|
192
|
+
}
|
|
193
|
+
}, _callee3, this);
|
|
194
|
+
}));
|
|
195
|
+
function getIsGlobalExperienceWorkspace() {
|
|
196
|
+
return _getIsGlobalExperienceWorkspace.apply(this, arguments);
|
|
197
|
+
}
|
|
198
|
+
return getIsGlobalExperienceWorkspace;
|
|
199
|
+
}()
|
|
162
200
|
}, {
|
|
163
201
|
key: "getOrgId",
|
|
164
202
|
value: function getOrgId() {
|
|
165
203
|
return this.orgIdPromise;
|
|
166
204
|
}
|
|
167
205
|
}, {
|
|
168
|
-
key: "
|
|
169
|
-
value: function
|
|
206
|
+
key: "preloadWorkspaceExistsWithType",
|
|
207
|
+
value: function preloadWorkspaceExistsWithType(cloudId) {
|
|
170
208
|
if (cloudId === undefined) {
|
|
171
|
-
return Promise.resolve(
|
|
209
|
+
return Promise.resolve(undefined);
|
|
172
210
|
}
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
return
|
|
211
|
+
var maybeWorkspaceExistsWithTypePromise = workspaceExistsWithTypePromiseCache.get(cloudId);
|
|
212
|
+
if (maybeWorkspaceExistsWithTypePromise !== undefined) {
|
|
213
|
+
return maybeWorkspaceExistsWithTypePromise;
|
|
176
214
|
}
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
return
|
|
215
|
+
var workspaceExistsWithTypePromise = this.getWorkspaceExistsWithType(cloudId);
|
|
216
|
+
workspaceExistsWithTypePromiseCache.set(cloudId, workspaceExistsWithTypePromise);
|
|
217
|
+
return workspaceExistsWithTypePromise;
|
|
180
218
|
}
|
|
181
219
|
}, {
|
|
182
|
-
key: "
|
|
183
|
-
value: function
|
|
184
|
-
if (
|
|
185
|
-
return fetch(
|
|
220
|
+
key: "getOrgContainsAnyWorkspace",
|
|
221
|
+
value: function getOrgContainsAnyWorkspace(cloudId) {
|
|
222
|
+
if (cloudId) {
|
|
223
|
+
return fetch((fg('enable_ptc_townsquare_reporting_lines_unsharded') ? UNSHARDED_PREFIX : this.getShardedApiPath(cloudId)) + "/organization/containsAnyWorkspace?cloudId=".concat(cloudId)).then(function (res) {
|
|
186
224
|
return !res || res && res.ok;
|
|
187
225
|
});
|
|
188
226
|
} else {
|
|
@@ -190,45 +228,46 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
190
228
|
}
|
|
191
229
|
}
|
|
192
230
|
}, {
|
|
193
|
-
key: "
|
|
231
|
+
key: "getWorkspaceExistsWithType",
|
|
194
232
|
value: function () {
|
|
195
|
-
var
|
|
233
|
+
var _getWorkspaceExistsWithType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(cloudId) {
|
|
196
234
|
var response, workspaceType;
|
|
197
|
-
return _regeneratorRuntime.wrap(function
|
|
198
|
-
while (1) switch (
|
|
235
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
236
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
199
237
|
case 0:
|
|
200
|
-
|
|
201
|
-
|
|
238
|
+
_context4.prev = 0;
|
|
239
|
+
_context4.next = 3;
|
|
202
240
|
return fetch("".concat(this.getShardedApiPath(cloudId), "/workspace/existsWithWorkspaceType?cloudId=").concat(cloudId), {
|
|
203
241
|
credentials: 'include'
|
|
204
242
|
});
|
|
205
243
|
case 3:
|
|
206
|
-
response =
|
|
244
|
+
response = _context4.sent;
|
|
207
245
|
if (!response.ok) {
|
|
208
|
-
|
|
246
|
+
_context4.next = 9;
|
|
209
247
|
break;
|
|
210
248
|
}
|
|
211
|
-
|
|
249
|
+
_context4.next = 7;
|
|
212
250
|
return response.text();
|
|
213
251
|
case 7:
|
|
214
|
-
workspaceType =
|
|
215
|
-
return
|
|
252
|
+
workspaceType = _context4.sent;
|
|
253
|
+
return _context4.abrupt("return", Promise.resolve(workspaceType));
|
|
216
254
|
case 9:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
255
|
+
_context4.next = 14;
|
|
256
|
+
break;
|
|
257
|
+
case 11:
|
|
258
|
+
_context4.prev = 11;
|
|
259
|
+
_context4.t0 = _context4["catch"](0);
|
|
260
|
+
return _context4.abrupt("return", Promise.resolve(undefined));
|
|
261
|
+
case 14:
|
|
223
262
|
case "end":
|
|
224
|
-
return
|
|
263
|
+
return _context4.stop();
|
|
225
264
|
}
|
|
226
|
-
},
|
|
265
|
+
}, _callee4, this, [[0, 11]]);
|
|
227
266
|
}));
|
|
228
|
-
function
|
|
229
|
-
return
|
|
267
|
+
function getWorkspaceExistsWithType(_x2) {
|
|
268
|
+
return _getWorkspaceExistsWithType.apply(this, arguments);
|
|
230
269
|
}
|
|
231
|
-
return
|
|
270
|
+
return getWorkspaceExistsWithType;
|
|
232
271
|
}()
|
|
233
272
|
}, {
|
|
234
273
|
key: "preloadOrgId",
|
|
@@ -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', "21.0.
|
|
7
|
+
headers.append('atl-client-version', "21.0.4");
|
|
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', "21.0.
|
|
51
|
+
headers.append('atl-client-version', "21.0.4");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -58,8 +58,8 @@ export default function getMockProfileClient(BaseProfileClient, modifyResponse)
|
|
|
58
58
|
}
|
|
59
59
|
_inherits(MockTeamCentralClient, _TeamCentralCardClien);
|
|
60
60
|
return _createClass(MockTeamCentralClient, [{
|
|
61
|
-
key: "
|
|
62
|
-
value: function
|
|
61
|
+
key: "createOrgContainsAnyWorkspacePromise",
|
|
62
|
+
value: function createOrgContainsAnyWorkspacePromise(config) {
|
|
63
63
|
return Promise.resolve(true);
|
|
64
64
|
}
|
|
65
65
|
}, {
|
|
@@ -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: "21.0.
|
|
42
|
+
packageVersion: "21.0.4"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -27,11 +27,11 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
27
27
|
* catch a pretty specific edge case.
|
|
28
28
|
*/
|
|
29
29
|
bypassOnFailure: boolean;
|
|
30
|
-
|
|
31
|
-
private isGlobalExperienceWorkspacePromise;
|
|
30
|
+
orgContainsAnyWorkspacePromise: Promise<boolean>;
|
|
32
31
|
private orgIdPromise;
|
|
32
|
+
private workspaceExistsWithTypePromise;
|
|
33
33
|
constructor(options: TeamCentralCardClientOptions);
|
|
34
|
-
|
|
34
|
+
createOrgContainsAnyWorkspacePromise(config: TeamCentralCardClientOptions): Promise<boolean>;
|
|
35
35
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
36
36
|
/**
|
|
37
37
|
* `public` so that mock client can override it; do not use it otherwise!
|
|
@@ -40,9 +40,9 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
40
40
|
checkWorkspaceExists(): Promise<boolean>;
|
|
41
41
|
getIsGlobalExperienceWorkspace(): Promise<boolean>;
|
|
42
42
|
getOrgId(): Promise<string | null>;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
43
|
+
private preloadWorkspaceExistsWithType;
|
|
44
|
+
private getOrgContainsAnyWorkspace;
|
|
45
|
+
private getWorkspaceExistsWithType;
|
|
46
46
|
private preloadOrgId;
|
|
47
47
|
private getShardedApiPath;
|
|
48
48
|
private filterReportingLinesUser;
|
|
@@ -27,11 +27,11 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
27
27
|
* catch a pretty specific edge case.
|
|
28
28
|
*/
|
|
29
29
|
bypassOnFailure: boolean;
|
|
30
|
-
|
|
31
|
-
private isGlobalExperienceWorkspacePromise;
|
|
30
|
+
orgContainsAnyWorkspacePromise: Promise<boolean>;
|
|
32
31
|
private orgIdPromise;
|
|
32
|
+
private workspaceExistsWithTypePromise;
|
|
33
33
|
constructor(options: TeamCentralCardClientOptions);
|
|
34
|
-
|
|
34
|
+
createOrgContainsAnyWorkspacePromise(config: TeamCentralCardClientOptions): Promise<boolean>;
|
|
35
35
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
36
36
|
/**
|
|
37
37
|
* `public` so that mock client can override it; do not use it otherwise!
|
|
@@ -40,9 +40,9 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
|
|
|
40
40
|
checkWorkspaceExists(): Promise<boolean>;
|
|
41
41
|
getIsGlobalExperienceWorkspace(): Promise<boolean>;
|
|
42
42
|
getOrgId(): Promise<string | null>;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
43
|
+
private preloadWorkspaceExistsWithType;
|
|
44
|
+
private getOrgContainsAnyWorkspace;
|
|
45
|
+
private getWorkspaceExistsWithType;
|
|
46
46
|
private preloadOrgId;
|
|
47
47
|
private getShardedApiPath;
|
|
48
48
|
private filterReportingLinesUser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.4",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
68
68
|
"@atlaskit/popup": "^1.30.0",
|
|
69
69
|
"@atlaskit/primitives": "^13.3.0",
|
|
70
|
-
"@atlaskit/rovo-agent-components": "^1.
|
|
70
|
+
"@atlaskit/rovo-agent-components": "^1.15.0",
|
|
71
71
|
"@atlaskit/rovo-triggers": "^1.4.0",
|
|
72
72
|
"@atlaskit/spinner": "^16.3.0",
|
|
73
73
|
"@atlaskit/theme": "^14.0.0",
|
|
74
|
-
"@atlaskit/tokens": "^2.
|
|
74
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
75
75
|
"@atlaskit/tooltip": "^19.0.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
77
77
|
"@emotion/react": "^11.7.1",
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"@testing-library/react": "^12.1.5",
|
|
94
94
|
"@testing-library/react-hooks": "^8.0.1",
|
|
95
95
|
"@testing-library/user-event": "^14.4.3",
|
|
96
|
+
"@types/react-router-dom": "^4.3.1",
|
|
96
97
|
"enzyme": "^3.10.0",
|
|
97
98
|
"es6-promise": "^4.0.5",
|
|
98
99
|
"fetch-mock": "^8.0.0",
|
|
@@ -124,6 +125,9 @@
|
|
|
124
125
|
"enable_agent_profile_card": {
|
|
125
126
|
"type": "boolean"
|
|
126
127
|
},
|
|
128
|
+
"enable_ptc_townsquare_reporting_lines_unsharded": {
|
|
129
|
+
"type": "boolean"
|
|
130
|
+
},
|
|
127
131
|
"rovo_use_agent_permissions": {
|
|
128
132
|
"type": "boolean"
|
|
129
133
|
},
|