@atlaskit/profilecard 18.1.3 → 18.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 18.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`da891855ee9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/da891855ee9) - Remove Atlas give kudos M2 feature flag check
8
+
3
9
  ## 18.1.3
4
10
 
5
11
  ### Patch Changes
@@ -70,11 +70,11 @@ var ProfileCardClient = /*#__PURE__*/function () {
70
70
  }, {
71
71
  key: "shouldShowGiveKudos",
72
72
  value: function shouldShowGiveKudos() {
73
- var _this$tcClient4, _this$tcClient5;
73
+ if (!this.tcClient || !this.getTeamCentralBaseUrl()) {
74
+ return Promise.resolve(false);
75
+ }
74
76
 
75
- // Check if the kudos feature enabled and if the user has TC
76
- // if the user does not have TC the tc client will be undefined.
77
- return this.getTeamCentralBaseUrl() && ((_this$tcClient4 = this.tcClient) === null || _this$tcClient4 === void 0 ? void 0 : _this$tcClient4.getFlagEnabled('team-central-kudos-enabled-m2', (_this$tcClient5 = this.tcClient) === null || _this$tcClient5 === void 0 ? void 0 : _this$tcClient5.options.productIdentifier)) || Promise.resolve(false);
77
+ return this.tcClient.checkWorkspaceExists();
78
78
  }
79
79
  }]);
80
80
  return ProfileCardClient;
@@ -280,6 +280,19 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
280
280
  });
281
281
  }
282
282
  }, {
283
+ key: "checkWorkspaceExists",
284
+ value: function checkWorkspaceExists() {
285
+ return this.isTCReadyPromise.then(function (workSpaceExists) {
286
+ if (workSpaceExists) {
287
+ return Promise.resolve(true);
288
+ }
289
+
290
+ return Promise.resolve(false);
291
+ }, function () {
292
+ return Promise.resolve(false);
293
+ });
294
+ }
295
+ }, {
283
296
  key: "filterReportingLinesUser",
284
297
  value: function filterReportingLinesUser() {
285
298
  var users = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -59,7 +59,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
59
59
  actionSubjectId: actionSubjectId,
60
60
  attributes: _objectSpread(_objectSpread({
61
61
  packageName: "@atlaskit/profilecard",
62
- packageVersion: "18.1.3"
62
+ packageVersion: "18.2.0"
63
63
  }, attributes), {}, {
64
64
  firedAt: Math.round((0, _performance.getPageTime)())
65
65
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.1.3"
3
+ "version": "18.2.0"
4
4
  }
@@ -41,11 +41,11 @@ class ProfileCardClient {
41
41
  }
42
42
 
43
43
  shouldShowGiveKudos() {
44
- var _this$tcClient4, _this$tcClient5;
44
+ if (!this.tcClient || !this.getTeamCentralBaseUrl()) {
45
+ return Promise.resolve(false);
46
+ }
45
47
 
46
- // Check if the kudos feature enabled and if the user has TC
47
- // if the user does not have TC the tc client will be undefined.
48
- return this.getTeamCentralBaseUrl() && ((_this$tcClient4 = this.tcClient) === null || _this$tcClient4 === void 0 ? void 0 : _this$tcClient4.getFlagEnabled('team-central-kudos-enabled-m2', (_this$tcClient5 = this.tcClient) === null || _this$tcClient5 === void 0 ? void 0 : _this$tcClient5.options.productIdentifier)) || Promise.resolve(false);
48
+ return this.tcClient.checkWorkspaceExists();
49
49
  }
50
50
 
51
51
  }
@@ -199,6 +199,16 @@ class TeamCentralCardClient extends CachingClient {
199
199
  }, () => Promise.resolve(false));
200
200
  }
201
201
 
202
+ checkWorkspaceExists() {
203
+ return this.isTCReadyPromise.then(workSpaceExists => {
204
+ if (workSpaceExists) {
205
+ return Promise.resolve(true);
206
+ }
207
+
208
+ return Promise.resolve(false);
209
+ }, () => Promise.resolve(false));
210
+ }
211
+
202
212
  filterReportingLinesUser(users = []) {
203
213
  return users.filter(user => user.identifierType === 'ATLASSIAN_ID');
204
214
  }
@@ -38,7 +38,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
38
38
  actionSubjectId,
39
39
  attributes: {
40
40
  packageName: "@atlaskit/profilecard",
41
- packageVersion: "18.1.3",
41
+ packageVersion: "18.2.0",
42
42
  ...attributes,
43
43
  firedAt: Math.round(getPageTime())
44
44
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.1.3"
3
+ "version": "18.2.0"
4
4
  }
@@ -58,11 +58,11 @@ var ProfileCardClient = /*#__PURE__*/function () {
58
58
  }, {
59
59
  key: "shouldShowGiveKudos",
60
60
  value: function shouldShowGiveKudos() {
61
- var _this$tcClient4, _this$tcClient5;
61
+ if (!this.tcClient || !this.getTeamCentralBaseUrl()) {
62
+ return Promise.resolve(false);
63
+ }
62
64
 
63
- // Check if the kudos feature enabled and if the user has TC
64
- // if the user does not have TC the tc client will be undefined.
65
- return this.getTeamCentralBaseUrl() && ((_this$tcClient4 = this.tcClient) === null || _this$tcClient4 === void 0 ? void 0 : _this$tcClient4.getFlagEnabled('team-central-kudos-enabled-m2', (_this$tcClient5 = this.tcClient) === null || _this$tcClient5 === void 0 ? void 0 : _this$tcClient5.options.productIdentifier)) || Promise.resolve(false);
65
+ return this.tcClient.checkWorkspaceExists();
66
66
  }
67
67
  }]);
68
68
 
@@ -265,6 +265,19 @@ var TeamCentralCardClient = /*#__PURE__*/function (_CachingClient) {
265
265
  });
266
266
  }
267
267
  }, {
268
+ key: "checkWorkspaceExists",
269
+ value: function checkWorkspaceExists() {
270
+ return this.isTCReadyPromise.then(function (workSpaceExists) {
271
+ if (workSpaceExists) {
272
+ return Promise.resolve(true);
273
+ }
274
+
275
+ return Promise.resolve(false);
276
+ }, function () {
277
+ return Promise.resolve(false);
278
+ });
279
+ }
280
+ }, {
268
281
  key: "filterReportingLinesUser",
269
282
  value: function filterReportingLinesUser() {
270
283
  var users = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -48,7 +48,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
48
48
  actionSubjectId: actionSubjectId,
49
49
  attributes: _objectSpread(_objectSpread({
50
50
  packageName: "@atlaskit/profilecard",
51
- packageVersion: "18.1.3"
51
+ packageVersion: "18.2.0"
52
52
  }, attributes), {}, {
53
53
  firedAt: Math.round(getPageTime())
54
54
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.1.3"
3
+ "version": "18.2.0"
4
4
  }
@@ -26,6 +26,7 @@ declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLi
26
26
  makeRequest(userId: string): Promise<TeamCentralReportingLinesData>;
27
27
  getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
28
28
  getFlagEnabled(featureKey: string, productIdentifier?: string): Promise<boolean>;
29
+ checkWorkspaceExists(): Promise<boolean>;
29
30
  private filterReportingLinesUser;
30
31
  }
31
32
  export default TeamCentralCardClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.1.3",
3
+ "version": "18.2.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -557,6 +557,8 @@ class TeamCentralCardClient extends CachingClient<TeamCentralReportingLinesData>
557
557
  constructor(options: TeamCentralCardClientOptions);
558
558
  bypassOnFailure: boolean;
559
559
  // (undocumented)
560
+ checkWorkspaceExists(): Promise<boolean>;
561
+ // (undocumented)
560
562
  createTcReadyPromise(config: ProfileClientOptions): Promise<boolean>;
561
563
  // (undocumented)
562
564
  featureFlagKeys: Map<string, boolean>;
@@ -455,6 +455,8 @@ class TeamCentralCardClient extends CachingClient<TeamCentralReportingLinesData>
455
455
  constructor(options: TeamCentralCardClientOptions);
456
456
  bypassOnFailure: boolean;
457
457
  // (undocumented)
458
+ checkWorkspaceExists(): Promise<boolean>;
459
+ // (undocumented)
458
460
  createTcReadyPromise(config: ProfileClientOptions): Promise<boolean>;
459
461
  // (undocumented)
460
462
  featureFlagKeys: Map<string, boolean>;