@atlaskit/profilecard 27.4.4 → 27.4.6

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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 27.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 27.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`92641f712dc34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92641f712dc34) -
14
+ Defer the `TeamCentralCardClient` `containsAnyWorkspace` probe from construction to first use,
15
+ behind the `ptc_profilecard_lazy_team_central_preload` gate. Consumers that construct a
16
+ `ProfileCardClient` but render the Relay-backed profile card no longer issue a Townsquare request
17
+ on page load. The workspace-type and org ID preloads are unchanged.
18
+ - Updated dependencies
19
+
3
20
  ## 27.4.4
4
21
 
5
22
  ### Patch Changes
@@ -39,13 +39,32 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
39
39
  _this = _callSuper(this, TeamCentralCardClient, [options]);
40
40
  _this.options = options;
41
41
  _this.bypassOnFailure = false;
42
- _this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
42
+ if (!(0, _fg.fg)('ptc_profilecard_lazy_team_central_preload')) {
43
+ _this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
44
+ }
43
45
  _this.workspaceExistsWithTypePromise = _this.preloadWorkspaceExistsWithType(options.cloudId);
44
46
  _this.orgIdPromise = _this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
45
47
  return _this;
46
48
  }
49
+
50
+ /**
51
+ * Workspace probe shared by reporting lines and kudos visibility, and the only Team Central
52
+ * request still made against the sharded Townsquare API.
53
+ *
54
+ * Under `ptc_profilecard_lazy_team_central_preload` the constructor leaves the promise unset
55
+ * and it is created here instead, on the first call that actually needs it. Callers that only
56
+ * construct a client never reach this method, and so never call Townsquare.
57
+ */
47
58
  (0, _inherits2.default)(TeamCentralCardClient, _CachingClient);
48
59
  return (0, _createClass2.default)(TeamCentralCardClient, [{
60
+ key: "resolveOrgContainsAnyWorkspace",
61
+ value: function resolveOrgContainsAnyWorkspace() {
62
+ if (!this.orgContainsAnyWorkspacePromise) {
63
+ this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(this.options);
64
+ }
65
+ return this.orgContainsAnyWorkspacePromise;
66
+ }
67
+ }, {
49
68
  key: "createOrgContainsAnyWorkspacePromise",
50
69
  value: function createOrgContainsAnyWorkspacePromise(config) {
51
70
  if (config.cloudId) {
@@ -62,7 +81,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
62
81
  key: "getReportingLines",
63
82
  value: function getReportingLines(userId) {
64
83
  var _this2 = this;
65
- return this.orgContainsAnyWorkspacePromise.then(function (orgContainsAnyWorkspace) {
84
+ return this.resolveOrgContainsAnyWorkspace().then(function (orgContainsAnyWorkspace) {
66
85
  if (orgContainsAnyWorkspace) {
67
86
  if (!userId) {
68
87
  return Promise.reject(new Error('userId missing'));
@@ -154,7 +173,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
154
173
  case 0:
155
174
  workspaceExistsPromise = (0, _fg.fg)('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(function (workspaceExistsWithType) {
156
175
  return workspaceExistsWithType !== undefined;
157
- }) : this.orgContainsAnyWorkspacePromise;
176
+ }) : this.resolveOrgContainsAnyWorkspace();
158
177
  return _context2.abrupt("return", workspaceExistsPromise.then(function (workspaceExistsWithType) {
159
178
  if (workspaceExistsWithType) {
160
179
  return Promise.resolve(true);
@@ -11,6 +11,6 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
11
11
  headers.append('X-ExperimentalApi', 'teams-beta');
12
12
  headers.append('X-ExperimentalApi', 'team-members-beta');
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "27.4.3");
14
+ headers.append('atl-client-version', "27.4.5");
15
15
  return headers;
16
16
  };
@@ -11,7 +11,7 @@ var _AGGQuery = require("./AGGQuery");
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', "27.4.3");
14
+ headers.append('atl-client-version', "27.4.5");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -7,7 +7,7 @@ exports.USER_SUBJECT = exports.TEAM_SUBJECT = exports.PACKAGE_META_DATA = export
7
7
  var _process$env$_PACKAGE, _process$env$_PACKAGE2;
8
8
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
9
9
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
10
- packageVersion: (_process$env$_PACKAGE2 = "27.4.3") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
10
+ packageVersion: (_process$env$_PACKAGE2 = "27.4.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
11
11
  };
12
12
  var TEAM_SUBJECT = exports.TEAM_SUBJECT = 'teamProfileCard';
13
13
  var USER_SUBJECT = exports.USER_SUBJECT = 'profilecard';
@@ -22,7 +22,7 @@ var createEvent = exports.createEvent = function createEvent(eventType, action,
22
22
  actionSubjectId: actionSubjectId,
23
23
  attributes: _objectSpread(_objectSpread({
24
24
  packageName: "@atlaskit/profilecard",
25
- packageVersion: "27.4.3"
25
+ packageVersion: "27.4.5"
26
26
  }, attributes), {}, {
27
27
  firedAt: Math.round((0, _performance.getPageTime)())
28
28
  })
@@ -21,10 +21,27 @@ class TeamCentralCardClient extends CachingClient {
21
21
  super(options);
22
22
  this.options = options;
23
23
  this.bypassOnFailure = false;
24
- this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(options);
24
+ if (!fg('ptc_profilecard_lazy_team_central_preload')) {
25
+ this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(options);
26
+ }
25
27
  this.workspaceExistsWithTypePromise = this.preloadWorkspaceExistsWithType(options.cloudId);
26
28
  this.orgIdPromise = this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
27
29
  }
30
+
31
+ /**
32
+ * Workspace probe shared by reporting lines and kudos visibility, and the only Team Central
33
+ * request still made against the sharded Townsquare API.
34
+ *
35
+ * Under `ptc_profilecard_lazy_team_central_preload` the constructor leaves the promise unset
36
+ * and it is created here instead, on the first call that actually needs it. Callers that only
37
+ * construct a client never reach this method, and so never call Townsquare.
38
+ */
39
+ resolveOrgContainsAnyWorkspace() {
40
+ if (!this.orgContainsAnyWorkspacePromise) {
41
+ this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(this.options);
42
+ }
43
+ return this.orgContainsAnyWorkspacePromise;
44
+ }
28
45
  createOrgContainsAnyWorkspacePromise(config) {
29
46
  if (config.cloudId) {
30
47
  let promise = orgContainsAnyWorkspacePromiseCache.get(config.cloudId);
@@ -37,7 +54,7 @@ class TeamCentralCardClient extends CachingClient {
37
54
  return Promise.resolve(true);
38
55
  }
39
56
  getReportingLines(userId) {
40
- return this.orgContainsAnyWorkspacePromise.then(orgContainsAnyWorkspace => {
57
+ return this.resolveOrgContainsAnyWorkspace().then(orgContainsAnyWorkspace => {
41
58
  if (orgContainsAnyWorkspace) {
42
59
  if (!userId) {
43
60
  return Promise.reject(new Error('userId missing'));
@@ -95,7 +112,7 @@ class TeamCentralCardClient extends CachingClient {
95
112
  return response.reportingLines;
96
113
  }
97
114
  async checkWorkspaceExists() {
98
- const workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(workspaceExistsWithType => workspaceExistsWithType !== undefined) : this.orgContainsAnyWorkspacePromise;
115
+ const workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(workspaceExistsWithType => workspaceExistsWithType !== undefined) : this.resolveOrgContainsAnyWorkspace();
99
116
  return workspaceExistsPromise.then(workspaceExistsWithType => {
100
117
  if (workspaceExistsWithType) {
101
118
  return Promise.resolve(true);
@@ -5,6 +5,6 @@ export const addHeaders = headers => {
5
5
  headers.append('X-ExperimentalApi', 'teams-beta');
6
6
  headers.append('X-ExperimentalApi', 'team-members-beta');
7
7
  headers.append('atl-client-name', "@atlaskit/profilecard");
8
- headers.append('atl-client-version', "27.4.3");
8
+ headers.append('atl-client-version', "27.4.5");
9
9
  return headers;
10
10
  };
@@ -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', "27.4.3");
9
+ headers.append('atl-client-version', "27.4.5");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -1,7 +1,7 @@
1
1
  var _process$env$_PACKAGE, _process$env$_PACKAGE2;
2
2
  export const PACKAGE_META_DATA = {
3
3
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
4
- packageVersion: (_process$env$_PACKAGE2 = "27.4.3") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
4
+ packageVersion: (_process$env$_PACKAGE2 = "27.4.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
5
5
  };
6
6
  export const TEAM_SUBJECT = 'teamProfileCard';
7
7
  export const USER_SUBJECT = 'profilecard';
@@ -11,7 +11,7 @@ export const createEvent = (eventType, action, actionSubject, actionSubjectId, a
11
11
  actionSubjectId,
12
12
  attributes: {
13
13
  packageName: "@atlaskit/profilecard",
14
- packageVersion: "27.4.3",
14
+ packageVersion: "27.4.5",
15
15
  ...attributes,
16
16
  firedAt: Math.round(getPageTime())
17
17
  }
@@ -32,13 +32,32 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
32
32
  _this = _callSuper(this, TeamCentralCardClient, [options]);
33
33
  _this.options = options;
34
34
  _this.bypassOnFailure = false;
35
- _this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
35
+ if (!fg('ptc_profilecard_lazy_team_central_preload')) {
36
+ _this.orgContainsAnyWorkspacePromise = _this.createOrgContainsAnyWorkspacePromise(options);
37
+ }
36
38
  _this.workspaceExistsWithTypePromise = _this.preloadWorkspaceExistsWithType(options.cloudId);
37
39
  _this.orgIdPromise = _this.preloadOrgId(options.gatewayGraphqlUrl, options.cloudId, options.orgId);
38
40
  return _this;
39
41
  }
42
+
43
+ /**
44
+ * Workspace probe shared by reporting lines and kudos visibility, and the only Team Central
45
+ * request still made against the sharded Townsquare API.
46
+ *
47
+ * Under `ptc_profilecard_lazy_team_central_preload` the constructor leaves the promise unset
48
+ * and it is created here instead, on the first call that actually needs it. Callers that only
49
+ * construct a client never reach this method, and so never call Townsquare.
50
+ */
40
51
  _inherits(TeamCentralCardClient, _CachingClient);
41
52
  return _createClass(TeamCentralCardClient, [{
53
+ key: "resolveOrgContainsAnyWorkspace",
54
+ value: function resolveOrgContainsAnyWorkspace() {
55
+ if (!this.orgContainsAnyWorkspacePromise) {
56
+ this.orgContainsAnyWorkspacePromise = this.createOrgContainsAnyWorkspacePromise(this.options);
57
+ }
58
+ return this.orgContainsAnyWorkspacePromise;
59
+ }
60
+ }, {
42
61
  key: "createOrgContainsAnyWorkspacePromise",
43
62
  value: function createOrgContainsAnyWorkspacePromise(config) {
44
63
  if (config.cloudId) {
@@ -55,7 +74,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
55
74
  key: "getReportingLines",
56
75
  value: function getReportingLines(userId) {
57
76
  var _this2 = this;
58
- return this.orgContainsAnyWorkspacePromise.then(function (orgContainsAnyWorkspace) {
77
+ return this.resolveOrgContainsAnyWorkspace().then(function (orgContainsAnyWorkspace) {
59
78
  if (orgContainsAnyWorkspace) {
60
79
  if (!userId) {
61
80
  return Promise.reject(new Error('userId missing'));
@@ -147,7 +166,7 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
147
166
  case 0:
148
167
  workspaceExistsPromise = fg('enable_ptc_townsquare_reporting_lines_unsharded') ? this.workspaceExistsWithTypePromise.then(function (workspaceExistsWithType) {
149
168
  return workspaceExistsWithType !== undefined;
150
- }) : this.orgContainsAnyWorkspacePromise;
169
+ }) : this.resolveOrgContainsAnyWorkspace();
151
170
  return _context2.abrupt("return", workspaceExistsPromise.then(function (workspaceExistsWithType) {
152
171
  if (workspaceExistsWithType) {
153
172
  return Promise.resolve(true);
@@ -5,6 +5,6 @@ export var addHeaders = function addHeaders(headers) {
5
5
  headers.append('X-ExperimentalApi', 'teams-beta');
6
6
  headers.append('X-ExperimentalApi', 'team-members-beta');
7
7
  headers.append('atl-client-name', "@atlaskit/profilecard");
8
- headers.append('atl-client-version', "27.4.3");
8
+ headers.append('atl-client-version', "27.4.5");
9
9
  return headers;
10
10
  };
@@ -4,7 +4,7 @@ import { AGGQuery } from './AGGQuery';
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', "27.4.3");
7
+ headers.append('atl-client-version', "27.4.5");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -1,7 +1,7 @@
1
1
  var _process$env$_PACKAGE, _process$env$_PACKAGE2;
2
2
  export var PACKAGE_META_DATA = {
3
3
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
4
- packageVersion: (_process$env$_PACKAGE2 = "27.4.3") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
4
+ packageVersion: (_process$env$_PACKAGE2 = "27.4.5") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
5
5
  };
6
6
  export var TEAM_SUBJECT = 'teamProfileCard';
7
7
  export var USER_SUBJECT = 'profilecard';
@@ -16,7 +16,7 @@ export var createEvent = function createEvent(eventType, action, actionSubject,
16
16
  actionSubjectId: actionSubjectId,
17
17
  attributes: _objectSpread(_objectSpread({
18
18
  packageName: "@atlaskit/profilecard",
19
- packageVersion: "27.4.3"
19
+ packageVersion: "27.4.5"
20
20
  }, attributes), {}, {
21
21
  firedAt: Math.round(getPageTime())
22
22
  })
@@ -25,6 +25,15 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
25
25
  private orgIdPromise;
26
26
  private workspaceExistsWithTypePromise;
27
27
  constructor(options: TeamCentralCardClientOptions);
28
+ /**
29
+ * Workspace probe shared by reporting lines and kudos visibility, and the only Team Central
30
+ * request still made against the sharded Townsquare API.
31
+ *
32
+ * Under `ptc_profilecard_lazy_team_central_preload` the constructor leaves the promise unset
33
+ * and it is created here instead, on the first call that actually needs it. Callers that only
34
+ * construct a client never reach this method, and so never call Townsquare.
35
+ */
36
+ private resolveOrgContainsAnyWorkspace;
28
37
  createOrgContainsAnyWorkspacePromise(config: TeamCentralCardClientOptions): Promise<boolean>;
29
38
  getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
30
39
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "27.4.4",
3
+ "version": "27.4.6",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/popup": "^10.2.0",
63
63
  "@atlaskit/primitives": "^22.6.0",
64
64
  "@atlaskit/react-compiler-gating": "^0.2.0",
65
- "@atlaskit/rovo-agent-components": "^10.3.0",
65
+ "@atlaskit/rovo-agent-components": "^10.4.0",
66
66
  "@atlaskit/rovo-triggers": "^12.12.0",
67
67
  "@atlaskit/spinner": "^20.4.0",
68
68
  "@atlaskit/teams-app-config": "^3.1.0",
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/teams-avatar": "^4.2.0",
72
72
  "@atlaskit/teams-public": "^3.7.0",
73
73
  "@atlaskit/theme": "^28.2.0",
74
- "@atlaskit/tmp-editor-statsig": "^251.0.0",
74
+ "@atlaskit/tmp-editor-statsig": "^253.0.0",
75
75
  "@atlaskit/tokens": "^20.9.0",
76
76
  "@atlaskit/tooltip": "^24.4.0",
77
77
  "@babel/runtime": "^7.0.0",
@@ -91,7 +91,7 @@
91
91
  "devDependencies": {
92
92
  "@af/visual-regression": "workspace:^",
93
93
  "@atlaskit/flag": "^19.0.0",
94
- "@atlaskit/inline-edit": "^16.4.0",
94
+ "@atlaskit/inline-edit": "^16.5.0",
95
95
  "@atlaskit/section-message": "^10.2.0",
96
96
  "@atlaskit/select": "^23.1.0",
97
97
  "@atlassian/a11y-jest-testing": "^0.17.0",
@@ -161,6 +161,9 @@
161
161
  },
162
162
  "ptc_a11y_profile_card_text_spacing": {
163
163
  "type": "boolean"
164
+ },
165
+ "ptc_profilecard_lazy_team_central_preload": {
166
+ "type": "boolean"
164
167
  }
165
168
  },
166
169
  "sideEffects": [