@atlaskit/profilecard 18.3.0 → 19.0.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,17 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 19.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`6e57454a13a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6e57454a13a) - makeRequestViaGateway removed from TeamProfileClient, instead use makeRequest. teamsUseV2 removed from ProfileCardClient, it will now always use V3.
8
+
9
+ ## 18.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`312e4be46d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/312e4be46d2) - Always call AGG for team data'
14
+
3
15
  ## 18.3.0
4
16
 
5
17
  ### Minor Changes
@@ -16,21 +16,10 @@ var _performance = require("../util/performance");
16
16
  var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
17
17
  var _errorUtils = require("./errorUtils");
18
18
  var _getTeamFromAGG = require("./getTeamFromAGG");
19
- var _graphqlUtils = require("./graphqlUtils");
20
19
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
21
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
22
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
- var QUERY = "query Team($teamId: String!, $organizationId: String) {\n Team: Team(teamId: $teamId, organizationId: $organizationId) {\n id,\n description,\n displayName,\n largeHeaderImageUrl,\n smallHeaderImageUrl,\n largeAvatarImageUrl,\n smallAvatarImageUrl,\n members {\n id,\n fullName,\n avatarUrl,\n },\n }\n}";
25
- var buildTeamQuery = function buildTeamQuery(teamId, orgId) {
26
- return {
27
- query: QUERY,
28
- variables: {
29
- teamId: teamId,
30
- organizationId: orgId || ''
31
- }
32
- };
33
- };
34
23
  var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
35
24
  (0, _inherits2.default)(TeamProfileCardClient, _CachingClient);
36
25
  var _super = _createSuper(TeamProfileCardClient);
@@ -42,24 +31,13 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
42
31
  return _this;
43
32
  }
44
33
  (0, _createClass2.default)(TeamProfileCardClient, [{
45
- key: "makeRequestViaGateway",
46
- value: function makeRequestViaGateway(teamId, _orgId) {
34
+ key: "makeRequest",
35
+ value: function makeRequest(teamId, _orgId) {
47
36
  if (!this.options.gatewayGraphqlUrl) {
48
37
  throw new Error('Trying to fetch via gateway with no specified config.gatewayGraphqlUrl');
49
38
  }
50
39
  return (0, _getTeamFromAGG.getTeamFromAGG)(this.options.gatewayGraphqlUrl, teamId);
51
40
  }
52
- }, {
53
- key: "makeRequest",
54
- value: function makeRequest(teamId, orgId) {
55
- if (!this.options.url) {
56
- throw new Error('config.url is a required parameter for fetching teams');
57
- }
58
- var query = buildTeamQuery(teamId, orgId);
59
- return (0, _graphqlUtils.graphqlQuery)(this.options.url, query).then(function (data) {
60
- return data.Team;
61
- });
62
- }
63
41
  }, {
64
42
  key: "getProfile",
65
43
  value: function getProfile(teamId, orgId, analytics) {
@@ -76,16 +54,14 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
76
54
  if (analytics) {
77
55
  analytics((0, _analytics.teamRequestAnalytics)('triggered'));
78
56
  }
79
- var shouldUseGateway = !!_this2.options.gatewayGraphqlUrl && !_this2.options.teamsUseV2;
80
- var promise = shouldUseGateway ? _this2.makeRequestViaGateway(teamId, orgId) : _this2.makeRequest(teamId, orgId);
81
- promise.then(function (data) {
57
+ _this2.makeRequest(teamId, orgId).then(function (data) {
82
58
  if (_this2.cache) {
83
59
  _this2.setCachedProfile(teamId, data);
84
60
  }
85
61
  if (analytics) {
86
62
  analytics((0, _analytics.teamRequestAnalytics)('succeeded', {
87
63
  duration: (0, _performance.getPageTime)() - startTime,
88
- gateway: shouldUseGateway
64
+ gateway: true
89
65
  }));
90
66
  }
91
67
  resolve(data);
@@ -94,7 +70,7 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
94
70
  analytics((0, _analytics.teamRequestAnalytics)('failed', _objectSpread(_objectSpread({
95
71
  duration: (0, _performance.getPageTime)() - startTime
96
72
  }, (0, _errorUtils.getErrorAttributes)(error)), {}, {
97
- gateway: shouldUseGateway
73
+ gateway: true
98
74
  })));
99
75
  }
100
76
  reject(error);
@@ -43,11 +43,6 @@ function getMockTeamClient(data) {
43
43
  }, data.timeout);
44
44
  });
45
45
  }
46
- }, {
47
- key: "makeRequestViaGateway",
48
- value: function makeRequestViaGateway(teamId) {
49
- return this.makeRequest(teamId);
50
- }
51
46
  }]);
52
47
  return MockTeamClient;
53
48
  }(_TeamProfileCardClient.default);
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
44
44
  actionSubjectId: actionSubjectId,
45
45
  attributes: _objectSpread(_objectSpread({
46
46
  packageName: "@atlaskit/profilecard",
47
- packageVersion: "18.3.0"
47
+ packageVersion: "19.0.0"
48
48
  }, attributes), {}, {
49
49
  firedAt: Math.round((0, _performance.getPageTime)())
50
50
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.3.0"
3
+ "version": "19.0.0"
4
4
  }
@@ -3,48 +3,17 @@ import { getPageTime } from '../util/performance';
3
3
  import CachingClient from './CachingClient';
4
4
  import { getErrorAttributes } from './errorUtils';
5
5
  import { getTeamFromAGG } from './getTeamFromAGG';
6
- import { graphqlQuery } from './graphqlUtils';
7
- const QUERY = `query Team($teamId: String!, $organizationId: String) {
8
- Team: Team(teamId: $teamId, organizationId: $organizationId) {
9
- id,
10
- description,
11
- displayName,
12
- largeHeaderImageUrl,
13
- smallHeaderImageUrl,
14
- largeAvatarImageUrl,
15
- smallAvatarImageUrl,
16
- members {
17
- id,
18
- fullName,
19
- avatarUrl,
20
- },
21
- }
22
- }`;
23
- const buildTeamQuery = (teamId, orgId) => ({
24
- query: QUERY,
25
- variables: {
26
- teamId,
27
- organizationId: orgId || ''
28
- }
29
- });
30
6
  export default class TeamProfileCardClient extends CachingClient {
31
7
  constructor(options) {
32
8
  super(options);
33
9
  this.options = options;
34
10
  }
35
- makeRequestViaGateway(teamId, _orgId) {
11
+ makeRequest(teamId, _orgId) {
36
12
  if (!this.options.gatewayGraphqlUrl) {
37
13
  throw new Error('Trying to fetch via gateway with no specified config.gatewayGraphqlUrl');
38
14
  }
39
15
  return getTeamFromAGG(this.options.gatewayGraphqlUrl, teamId);
40
16
  }
41
- makeRequest(teamId, orgId) {
42
- if (!this.options.url) {
43
- throw new Error('config.url is a required parameter for fetching teams');
44
- }
45
- const query = buildTeamQuery(teamId, orgId);
46
- return graphqlQuery(this.options.url, query).then(data => data.Team);
47
- }
48
17
  getProfile(teamId, orgId, analytics) {
49
18
  if (!teamId) {
50
19
  return Promise.reject(new Error('teamId is missing'));
@@ -58,16 +27,14 @@ export default class TeamProfileCardClient extends CachingClient {
58
27
  if (analytics) {
59
28
  analytics(teamRequestAnalytics('triggered'));
60
29
  }
61
- const shouldUseGateway = !!this.options.gatewayGraphqlUrl && !this.options.teamsUseV2;
62
- const promise = shouldUseGateway ? this.makeRequestViaGateway(teamId, orgId) : this.makeRequest(teamId, orgId);
63
- promise.then(data => {
30
+ this.makeRequest(teamId, orgId).then(data => {
64
31
  if (this.cache) {
65
32
  this.setCachedProfile(teamId, data);
66
33
  }
67
34
  if (analytics) {
68
35
  analytics(teamRequestAnalytics('succeeded', {
69
36
  duration: getPageTime() - startTime,
70
- gateway: shouldUseGateway
37
+ gateway: true
71
38
  }));
72
39
  }
73
40
  resolve(data);
@@ -76,7 +43,7 @@ export default class TeamProfileCardClient extends CachingClient {
76
43
  analytics(teamRequestAnalytics('failed', {
77
44
  duration: getPageTime() - startTime,
78
45
  ...getErrorAttributes(error),
79
- gateway: shouldUseGateway
46
+ gateway: true
80
47
  }));
81
48
  }
82
49
  reject(error);
@@ -21,8 +21,5 @@ export default function getMockTeamClient(data) {
21
21
  }, data.timeout);
22
22
  });
23
23
  }
24
- makeRequestViaGateway(teamId) {
25
- return this.makeRequest(teamId);
26
- }
27
24
  };
28
25
  }
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
31
31
  actionSubjectId,
32
32
  attributes: {
33
33
  packageName: "@atlaskit/profilecard",
34
- packageVersion: "18.3.0",
34
+ packageVersion: "19.0.0",
35
35
  ...attributes,
36
36
  firedAt: Math.round(getPageTime())
37
37
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.3.0"
3
+ "version": "19.0.0"
4
4
  }
@@ -13,17 +13,6 @@ import { getPageTime } from '../util/performance';
13
13
  import CachingClient from './CachingClient';
14
14
  import { getErrorAttributes } from './errorUtils';
15
15
  import { getTeamFromAGG } from './getTeamFromAGG';
16
- import { graphqlQuery } from './graphqlUtils';
17
- var QUERY = "query Team($teamId: String!, $organizationId: String) {\n Team: Team(teamId: $teamId, organizationId: $organizationId) {\n id,\n description,\n displayName,\n largeHeaderImageUrl,\n smallHeaderImageUrl,\n largeAvatarImageUrl,\n smallAvatarImageUrl,\n members {\n id,\n fullName,\n avatarUrl,\n },\n }\n}";
18
- var buildTeamQuery = function buildTeamQuery(teamId, orgId) {
19
- return {
20
- query: QUERY,
21
- variables: {
22
- teamId: teamId,
23
- organizationId: orgId || ''
24
- }
25
- };
26
- };
27
16
  var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
28
17
  _inherits(TeamProfileCardClient, _CachingClient);
29
18
  var _super = _createSuper(TeamProfileCardClient);
@@ -35,24 +24,13 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
35
24
  return _this;
36
25
  }
37
26
  _createClass(TeamProfileCardClient, [{
38
- key: "makeRequestViaGateway",
39
- value: function makeRequestViaGateway(teamId, _orgId) {
27
+ key: "makeRequest",
28
+ value: function makeRequest(teamId, _orgId) {
40
29
  if (!this.options.gatewayGraphqlUrl) {
41
30
  throw new Error('Trying to fetch via gateway with no specified config.gatewayGraphqlUrl');
42
31
  }
43
32
  return getTeamFromAGG(this.options.gatewayGraphqlUrl, teamId);
44
33
  }
45
- }, {
46
- key: "makeRequest",
47
- value: function makeRequest(teamId, orgId) {
48
- if (!this.options.url) {
49
- throw new Error('config.url is a required parameter for fetching teams');
50
- }
51
- var query = buildTeamQuery(teamId, orgId);
52
- return graphqlQuery(this.options.url, query).then(function (data) {
53
- return data.Team;
54
- });
55
- }
56
34
  }, {
57
35
  key: "getProfile",
58
36
  value: function getProfile(teamId, orgId, analytics) {
@@ -69,16 +47,14 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
69
47
  if (analytics) {
70
48
  analytics(teamRequestAnalytics('triggered'));
71
49
  }
72
- var shouldUseGateway = !!_this2.options.gatewayGraphqlUrl && !_this2.options.teamsUseV2;
73
- var promise = shouldUseGateway ? _this2.makeRequestViaGateway(teamId, orgId) : _this2.makeRequest(teamId, orgId);
74
- promise.then(function (data) {
50
+ _this2.makeRequest(teamId, orgId).then(function (data) {
75
51
  if (_this2.cache) {
76
52
  _this2.setCachedProfile(teamId, data);
77
53
  }
78
54
  if (analytics) {
79
55
  analytics(teamRequestAnalytics('succeeded', {
80
56
  duration: getPageTime() - startTime,
81
- gateway: shouldUseGateway
57
+ gateway: true
82
58
  }));
83
59
  }
84
60
  resolve(data);
@@ -87,7 +63,7 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
87
63
  analytics(teamRequestAnalytics('failed', _objectSpread(_objectSpread({
88
64
  duration: getPageTime() - startTime
89
65
  }, getErrorAttributes(error)), {}, {
90
- gateway: shouldUseGateway
66
+ gateway: true
91
67
  })));
92
68
  }
93
69
  reject(error);
@@ -36,11 +36,6 @@ export default function getMockTeamClient(data) {
36
36
  }, data.timeout);
37
37
  });
38
38
  }
39
- }, {
40
- key: "makeRequestViaGateway",
41
- value: function makeRequestViaGateway(teamId) {
42
- return this.makeRequest(teamId);
43
- }
44
39
  }]);
45
40
  return MockTeamClient;
46
41
  }(TeamProfileCardClient);
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
38
38
  actionSubjectId: actionSubjectId,
39
39
  attributes: _objectSpread(_objectSpread({
40
40
  packageName: "@atlaskit/profilecard",
41
- packageVersion: "18.3.0"
41
+ packageVersion: "19.0.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.3.0"
3
+ "version": "19.0.0"
4
4
  }
@@ -4,7 +4,6 @@ import CachingClient from './CachingClient';
4
4
  export default class TeamProfileCardClient extends CachingClient<Team> {
5
5
  options: ProfileClientOptions;
6
6
  constructor(options: ProfileClientOptions);
7
- makeRequestViaGateway(teamId: string, _orgId: string | undefined): Promise<Team>;
8
- makeRequest(teamId: string, orgId: string | undefined): Promise<Team>;
7
+ makeRequest(teamId: string, _orgId: string | undefined): Promise<Team>;
9
8
  getProfile(teamId: string, orgId: string | undefined, analytics?: (event: AnalyticsEventPayload) => void): Promise<Team>;
10
9
  }
@@ -340,7 +340,6 @@ export declare type TeamProfileCardErrorType = {
340
340
  } | null;
341
341
  export interface ProfileClientOptions {
342
342
  url: string;
343
- teamsUseV2?: boolean;
344
343
  gatewayGraphqlUrl?: string;
345
344
  cacheSize?: number;
346
345
  cacheMaxAge?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.3.0",
3
+ "version": "19.0.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,17 +41,17 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@atlaskit/analytics-next": "^9.0.0",
44
- "@atlaskit/avatar": "^21.1.0",
44
+ "@atlaskit/avatar": "^21.2.0",
45
45
  "@atlaskit/avatar-group": "^9.2.0",
46
46
  "@atlaskit/button": "^16.5.0",
47
- "@atlaskit/dropdown-menu": "^11.6.0",
47
+ "@atlaskit/dropdown-menu": "^11.7.0",
48
48
  "@atlaskit/empty-state": "^7.4.8",
49
49
  "@atlaskit/give-kudos": "^1.0.0",
50
50
  "@atlaskit/icon": "^21.11.0",
51
51
  "@atlaskit/lozenge": "^11.3.0",
52
52
  "@atlaskit/menu": "^1.5.0",
53
53
  "@atlaskit/popup": "^1.5.0",
54
- "@atlaskit/spinner": "^15.3.0",
54
+ "@atlaskit/spinner": "^15.4.0",
55
55
  "@atlaskit/theme": "^12.2.0",
56
56
  "@atlaskit/tokens": "^1.2.0",
57
57
  "@babel/runtime": "^7.0.0",
package/report.api.md CHANGED
@@ -480,8 +480,6 @@ export interface ProfileClientOptions {
480
480
  teamCentralBaseUrl?: string;
481
481
  teamCentralUrl?: string;
482
482
  // (undocumented)
483
- teamsUseV2?: boolean;
484
- // (undocumented)
485
483
  url: string;
486
484
  }
487
485
 
@@ -670,12 +668,7 @@ export class TeamProfileClient extends CachingClient<Team> {
670
668
  analytics?: (event: AnalyticsEventPayload) => void,
671
669
  ): Promise<Team>;
672
670
  // (undocumented)
673
- makeRequest(teamId: string, orgId: string | undefined): Promise<Team>;
674
- // (undocumented)
675
- makeRequestViaGateway(
676
- teamId: string,
677
- _orgId: string | undefined,
678
- ): Promise<Team>;
671
+ makeRequest(teamId: string, _orgId: string | undefined): Promise<Team>;
679
672
  // (undocumented)
680
673
  options: ProfileClientOptions;
681
674
  }
@@ -392,8 +392,6 @@ export interface ProfileClientOptions {
392
392
  teamCentralBaseUrl?: string;
393
393
  teamCentralUrl?: string;
394
394
  // (undocumented)
395
- teamsUseV2?: boolean;
396
- // (undocumented)
397
395
  url: string;
398
396
  }
399
397
 
@@ -537,9 +535,7 @@ export class TeamProfileClient extends CachingClient<Team> {
537
535
  // (undocumented)
538
536
  getProfile(teamId: string, orgId: string | undefined, analytics?: (event: AnalyticsEventPayload) => void): Promise<Team>;
539
537
  // (undocumented)
540
- makeRequest(teamId: string, orgId: string | undefined): Promise<Team>;
541
- // (undocumented)
542
- makeRequestViaGateway(teamId: string, _orgId: string | undefined): Promise<Team>;
538
+ makeRequest(teamId: string, _orgId: string | undefined): Promise<Team>;
543
539
  // (undocumented)
544
540
  options: ProfileClientOptions;
545
541
  }