@atlaskit/profilecard 26.0.0 → 26.0.2

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
+ ## 26.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 26.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 26.0.0
4
16
 
5
17
  ### Major Changes
@@ -68,15 +68,27 @@ var buildAggUserQuery = exports.buildAggUserQuery = function buildAggUserQuery(u
68
68
  }
69
69
  };
70
70
  };
71
+ var buildScopedProfileAtlAttributionHeader = function buildScopedProfileAtlAttributionHeader(cloudId) {
72
+ return JSON.stringify({
73
+ tenantId: "ari:cloud:townsquare::site/".concat(cloudId),
74
+ product: 'Atlassian Home',
75
+ service: 'townsquare-frontend'
76
+ });
77
+ };
71
78
  var queryAGGUser = /*#__PURE__*/function () {
72
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, userId) {
73
- var query, _yield$AGGQuery, user;
79
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, userId, cloudId) {
80
+ var query, shouldAddScopedProfileAtlAttribution, _yield$AGGQuery, user;
74
81
  return _regenerator.default.wrap(function (_context) {
75
82
  while (1) switch (_context.prev = _context.next) {
76
83
  case 0:
77
84
  query = buildAggUserQuery(userId);
85
+ shouldAddScopedProfileAtlAttribution = (0, _platformFeatureFlags.fg)('profilecard_scoped_profile_atl_attribution');
78
86
  _context.next = 1;
79
- return (0, _graphqlUtils.AGGQuery)(url, query);
87
+ return (0, _graphqlUtils.AGGQuery)(url, query, cloudId && shouldAddScopedProfileAtlAttribution ? function (headers) {
88
+ // Temporary atl-attribution for scoped profiles until AGG attribution is handled upstream.
89
+ headers.append('atl-attribution', buildScopedProfileAtlAttributionHeader(cloudId));
90
+ return headers;
91
+ } : undefined);
80
92
  case 1:
81
93
  _yield$AGGQuery = _context.sent;
82
94
  user = _yield$AGGQuery.user;
@@ -87,7 +99,7 @@ var queryAGGUser = /*#__PURE__*/function () {
87
99
  }
88
100
  }, _callee);
89
101
  }));
90
- return function queryAGGUser(_x, _x2) {
102
+ return function queryAGGUser(_x, _x2, _x3) {
91
103
  return _ref.apply(this, arguments);
92
104
  };
93
105
  }();
@@ -103,7 +115,7 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
103
115
  return (0, _createClass2.default)(UserProfileCardClient, [{
104
116
  key: "makeRequest",
105
117
  value: function () {
106
- var _makeRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_cloudId, userId) {
118
+ var _makeRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId, userId) {
107
119
  var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5;
108
120
  var gatewayGraphqlUrl, urlWithOperationName, userQueryPromise, user, timestring, localWeekdayIndex, timeFormat;
109
121
  return _regenerator.default.wrap(function (_context2) {
@@ -111,7 +123,7 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
111
123
  case 0:
112
124
  gatewayGraphqlUrl = this.options.gatewayGraphqlUrl || '/gateway/api/graphql';
113
125
  urlWithOperationName = "".concat(gatewayGraphqlUrl, "?operationName=aggUserQuery");
114
- userQueryPromise = queryAGGUser(urlWithOperationName, userId);
126
+ userQueryPromise = queryAGGUser(urlWithOperationName, userId, cloudId);
115
127
  _context2.next = 1;
116
128
  return userQueryPromise;
117
129
  case 1:
@@ -146,7 +158,7 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
146
158
  }
147
159
  }, _callee2, this);
148
160
  }));
149
- function makeRequest(_x3, _x4) {
161
+ function makeRequest(_x4, _x5) {
150
162
  return _makeRequest.apply(this, arguments);
151
163
  }
152
164
  return makeRequest;
@@ -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', "25.9.11");
14
+ headers.append('atl-client-version', "26.0.1");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
66
66
  headers.append('X-ExperimentalApi', 'teams-beta');
67
67
  headers.append('X-ExperimentalApi', 'team-members-beta');
68
68
  headers.append('atl-client-name', "@atlaskit/profilecard");
69
- headers.append('atl-client-version', "25.9.11");
69
+ headers.append('atl-client-version', "26.0.1");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -12,7 +12,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
12
12
  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) { (0, _defineProperty2.default)(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; }
13
13
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
14
14
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
15
- packageVersion: (_process$env$_PACKAGE2 = "25.9.11") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
15
+ packageVersion: (_process$env$_PACKAGE2 = "26.0.1") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
16
16
  };
17
17
  var TEAM_SUBJECT = 'teamProfileCard';
18
18
  var USER_SUBJECT = 'profilecard';
@@ -31,7 +31,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
31
31
  actionSubjectId: actionSubjectId,
32
32
  attributes: _objectSpread(_objectSpread({
33
33
  packageName: "@atlaskit/profilecard",
34
- packageVersion: "25.9.11"
34
+ packageVersion: "26.0.1"
35
35
  }, attributes), {}, {
36
36
  firedAt: Math.round((0, _performance.getPageTime)())
37
37
  })
@@ -104,11 +104,21 @@ export const buildAggUserQuery = userId => ({
104
104
  userId
105
105
  }
106
106
  });
107
- const queryAGGUser = async (url, userId) => {
107
+ const buildScopedProfileAtlAttributionHeader = cloudId => JSON.stringify({
108
+ tenantId: `ari:cloud:townsquare::site/${cloudId}`,
109
+ product: 'Atlassian Home',
110
+ service: 'townsquare-frontend'
111
+ });
112
+ const queryAGGUser = async (url, userId, cloudId) => {
108
113
  const query = buildAggUserQuery(userId);
114
+ const shouldAddScopedProfileAtlAttribution = fg('profilecard_scoped_profile_atl_attribution');
109
115
  const {
110
116
  user
111
- } = await AGGQuery(url, query);
117
+ } = await AGGQuery(url, query, cloudId && shouldAddScopedProfileAtlAttribution ? headers => {
118
+ // Temporary atl-attribution for scoped profiles until AGG attribution is handled upstream.
119
+ headers.append('atl-attribution', buildScopedProfileAtlAttributionHeader(cloudId));
120
+ return headers;
121
+ } : undefined);
112
122
  return user;
113
123
  };
114
124
  export default class UserProfileCardClient extends CachingClient {
@@ -116,11 +126,11 @@ export default class UserProfileCardClient extends CachingClient {
116
126
  super(options);
117
127
  this.options = options;
118
128
  }
119
- async makeRequest(_cloudId, userId) {
129
+ async makeRequest(cloudId, userId) {
120
130
  var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5;
121
131
  const gatewayGraphqlUrl = this.options.gatewayGraphqlUrl || '/gateway/api/graphql';
122
132
  const urlWithOperationName = `${gatewayGraphqlUrl}?operationName=aggUserQuery`;
123
- const userQueryPromise = queryAGGUser(urlWithOperationName, userId);
133
+ const userQueryPromise = queryAGGUser(urlWithOperationName, userId, cloudId);
124
134
  const user = await userQueryPromise;
125
135
  let timestring;
126
136
  const localWeekdayIndex = new Date().getDay().toString();
@@ -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', "25.9.11");
9
+ headers.append('atl-client-version', "26.0.1");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
78
78
  headers.append('X-ExperimentalApi', 'teams-beta');
79
79
  headers.append('X-ExperimentalApi', 'team-members-beta');
80
80
  headers.append('atl-client-name', "@atlaskit/profilecard");
81
- headers.append('atl-client-version', "25.9.11");
81
+ headers.append('atl-client-version', "26.0.1");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -2,7 +2,7 @@ var _process$env$_PACKAGE, _process$env$_PACKAGE2;
2
2
  import { getPageTime } from './performance';
3
3
  export const PACKAGE_META_DATA = {
4
4
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
5
- packageVersion: (_process$env$_PACKAGE2 = "25.9.11") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
5
+ packageVersion: (_process$env$_PACKAGE2 = "26.0.1") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
6
6
  };
7
7
  const TEAM_SUBJECT = 'teamProfileCard';
8
8
  const USER_SUBJECT = 'profilecard';
@@ -19,7 +19,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
19
19
  actionSubjectId,
20
20
  attributes: {
21
21
  packageName: "@atlaskit/profilecard",
22
- packageVersion: "25.9.11",
22
+ packageVersion: "26.0.1",
23
23
  ...attributes,
24
24
  firedAt: Math.round(getPageTime())
25
25
  }
@@ -62,15 +62,27 @@ export var buildAggUserQuery = function buildAggUserQuery(userId) {
62
62
  }
63
63
  };
64
64
  };
65
+ var buildScopedProfileAtlAttributionHeader = function buildScopedProfileAtlAttributionHeader(cloudId) {
66
+ return JSON.stringify({
67
+ tenantId: "ari:cloud:townsquare::site/".concat(cloudId),
68
+ product: 'Atlassian Home',
69
+ service: 'townsquare-frontend'
70
+ });
71
+ };
65
72
  var queryAGGUser = /*#__PURE__*/function () {
66
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, userId) {
67
- var query, _yield$AGGQuery, user;
73
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, userId, cloudId) {
74
+ var query, shouldAddScopedProfileAtlAttribution, _yield$AGGQuery, user;
68
75
  return _regeneratorRuntime.wrap(function (_context) {
69
76
  while (1) switch (_context.prev = _context.next) {
70
77
  case 0:
71
78
  query = buildAggUserQuery(userId);
79
+ shouldAddScopedProfileAtlAttribution = fg('profilecard_scoped_profile_atl_attribution');
72
80
  _context.next = 1;
73
- return AGGQuery(url, query);
81
+ return AGGQuery(url, query, cloudId && shouldAddScopedProfileAtlAttribution ? function (headers) {
82
+ // Temporary atl-attribution for scoped profiles until AGG attribution is handled upstream.
83
+ headers.append('atl-attribution', buildScopedProfileAtlAttributionHeader(cloudId));
84
+ return headers;
85
+ } : undefined);
74
86
  case 1:
75
87
  _yield$AGGQuery = _context.sent;
76
88
  user = _yield$AGGQuery.user;
@@ -81,7 +93,7 @@ var queryAGGUser = /*#__PURE__*/function () {
81
93
  }
82
94
  }, _callee);
83
95
  }));
84
- return function queryAGGUser(_x, _x2) {
96
+ return function queryAGGUser(_x, _x2, _x3) {
85
97
  return _ref.apply(this, arguments);
86
98
  };
87
99
  }();
@@ -97,7 +109,7 @@ var UserProfileCardClient = /*#__PURE__*/function (_CachingClient) {
97
109
  return _createClass(UserProfileCardClient, [{
98
110
  key: "makeRequest",
99
111
  value: function () {
100
- var _makeRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_cloudId, userId) {
112
+ var _makeRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId, userId) {
101
113
  var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5;
102
114
  var gatewayGraphqlUrl, urlWithOperationName, userQueryPromise, user, timestring, localWeekdayIndex, timeFormat;
103
115
  return _regeneratorRuntime.wrap(function (_context2) {
@@ -105,7 +117,7 @@ var UserProfileCardClient = /*#__PURE__*/function (_CachingClient) {
105
117
  case 0:
106
118
  gatewayGraphqlUrl = this.options.gatewayGraphqlUrl || '/gateway/api/graphql';
107
119
  urlWithOperationName = "".concat(gatewayGraphqlUrl, "?operationName=aggUserQuery");
108
- userQueryPromise = queryAGGUser(urlWithOperationName, userId);
120
+ userQueryPromise = queryAGGUser(urlWithOperationName, userId, cloudId);
109
121
  _context2.next = 1;
110
122
  return userQueryPromise;
111
123
  case 1:
@@ -140,7 +152,7 @@ var UserProfileCardClient = /*#__PURE__*/function (_CachingClient) {
140
152
  }
141
153
  }, _callee2, this);
142
154
  }));
143
- function makeRequest(_x3, _x4) {
155
+ function makeRequest(_x4, _x5) {
144
156
  return _makeRequest.apply(this, arguments);
145
157
  }
146
158
  return makeRequest;
@@ -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', "25.9.11");
7
+ headers.append('atl-client-version', "26.0.1");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
59
59
  headers.append('X-ExperimentalApi', 'teams-beta');
60
60
  headers.append('X-ExperimentalApi', 'team-members-beta');
61
61
  headers.append('atl-client-name', "@atlaskit/profilecard");
62
- headers.append('atl-client-version', "25.9.11");
62
+ headers.append('atl-client-version', "26.0.1");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -5,7 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { getPageTime } from './performance';
6
6
  export var PACKAGE_META_DATA = {
7
7
  packageName: (_process$env$_PACKAGE = "@atlaskit/profilecard") !== null && _process$env$_PACKAGE !== void 0 ? _process$env$_PACKAGE : '',
8
- packageVersion: (_process$env$_PACKAGE2 = "25.9.11") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
8
+ packageVersion: (_process$env$_PACKAGE2 = "26.0.1") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
9
9
  };
10
10
  var TEAM_SUBJECT = 'teamProfileCard';
11
11
  var USER_SUBJECT = 'profilecard';
@@ -24,7 +24,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
24
24
  actionSubjectId: actionSubjectId,
25
25
  attributes: _objectSpread(_objectSpread({
26
26
  packageName: "@atlaskit/profilecard",
27
- packageVersion: "25.9.11"
27
+ packageVersion: "26.0.1"
28
28
  }, attributes), {}, {
29
29
  firedAt: Math.round(getPageTime())
30
30
  })
@@ -19,6 +19,6 @@ export declare const buildAggUserQuery: (userId: string) => {
19
19
  export default class UserProfileCardClient extends CachingClient<any> {
20
20
  options: ProfileClientOptions;
21
21
  constructor(options: ProfileClientOptions);
22
- makeRequest(_cloudId: string, userId: string): Promise<ProfileCardClientData>;
22
+ makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
23
23
  getProfile(cloudId: string, userId: string, analytics?: FireEventType): Promise<any>;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "26.0.0",
3
+ "version": "26.0.2",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/popup": "^5.0.0",
60
60
  "@atlaskit/primitives": "^20.0.0",
61
61
  "@atlaskit/rovo-agent-components": "^6.0.0",
62
- "@atlaskit/rovo-triggers": "^8.0.0",
62
+ "@atlaskit/rovo-triggers": "^9.0.0",
63
63
  "@atlaskit/spinner": "^20.0.0",
64
64
  "@atlaskit/teams-app-config": "^2.0.0",
65
65
  "@atlaskit/teams-app-internal-analytics": "^2.0.0",
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/teams-avatar": "^3.0.0",
68
68
  "@atlaskit/teams-public": "^2.0.0",
69
69
  "@atlaskit/theme": "^26.0.0",
70
- "@atlaskit/tmp-editor-statsig": "^104.0.0",
70
+ "@atlaskit/tmp-editor-statsig": "^105.0.0",
71
71
  "@atlaskit/tokens": "^14.0.0",
72
72
  "@atlaskit/tooltip": "^23.0.0",
73
73
  "@atlassian/studio-entry-link": "^1.1.0",
@@ -133,6 +133,9 @@
133
133
  "platform_agg_user_query_doc_change": {
134
134
  "type": "boolean"
135
135
  },
136
+ "profilecard_scoped_profile_atl_attribution": {
137
+ "type": "boolean"
138
+ },
136
139
  "platform-adopt-teams-nav-config": {
137
140
  "type": "boolean"
138
141
  },