@atlaskit/profilecard 26.2.0 → 26.2.1

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,13 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 26.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88745c9ee6398`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88745c9ee6398) -
8
+ A11Y-35182 Fix Give Kudos button incorrect ARIA role, it should renders as a <button> instead of
9
+ an <a>
10
+
3
11
  ## 26.2.0
4
12
 
5
13
  ### Minor Changes
@@ -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', "26.1.7");
14
+ headers.append('atl-client-version', "26.2.0");
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', "26.1.7");
69
+ headers.append('atl-client-version', "26.2.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -13,6 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _reactIntl = require("react-intl");
15
15
  var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
16
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
16
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
18
19
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
@@ -180,12 +181,30 @@ var Actions = function Actions(_ref) {
180
181
  testId: "profilecard-actions"
181
182
  }, regularActions.map(function (action, index) {
182
183
  var isKudos = action.id === GIVE_KUDOS_ACTION_ID;
184
+ if (isKudos && (0, _platformFeatureFlags.fg)('fix_give_kudos_btn_incorrect_role')) {
185
+ var kudosButton = /*#__PURE__*/_react.default.createElement(_new.default, {
186
+ appearance: "default",
187
+ key: action.id || index,
188
+ onClick: function onClick(event) {
189
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
190
+ args[_key - 1] = arguments[_key];
191
+ }
192
+ return onActionClick(action, args, event, index);
193
+ },
194
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
195
+ id: "action-button-".concat(action.id),
196
+ "aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
197
+ }, action.label, /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null)));
198
+ return /*#__PURE__*/_react.default.createElement(_Card.AnimatedKudosButton, {
199
+ key: "profile-card-action-kudos_".concat(action.id || index)
200
+ }, kudosButton);
201
+ }
183
202
  var button = /*#__PURE__*/_react.default.createElement(_teamsLinkButton.TeamsLinkButton, {
184
203
  appearance: "default",
185
204
  key: action.id || index,
186
205
  onClick: function onClick(event) {
187
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
188
- args[_key - 1] = arguments[_key];
206
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
207
+ args[_key2 - 1] = arguments[_key2];
189
208
  }
190
209
  return onActionClick(action, args, event, index);
191
210
  },
@@ -195,6 +214,8 @@ var Actions = function Actions(_ref) {
195
214
  id: "action-button-".concat(action.id),
196
215
  "aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
197
216
  }, action.label, isKudos && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null)));
217
+
218
+ // TODO: Remove this once fix_give_kudos_btn_incorrect_role is fully rolled out
198
219
  if (isKudos) {
199
220
  return /*#__PURE__*/_react.default.createElement(_Card.AnimatedKudosButton, {
200
221
  key: "profile-card-action-kudos_".concat(action.id || index)
@@ -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 = "26.1.7") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
15
+ packageVersion: (_process$env$_PACKAGE2 = "26.2.0") !== 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: "26.1.7"
34
+ packageVersion: "26.2.0"
35
35
  }, attributes), {}, {
36
36
  firedAt: Math.round((0, _performance.getPageTime)())
37
37
  })
@@ -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', "26.1.7");
9
+ headers.append('atl-client-version', "26.2.0");
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', "26.1.7");
81
+ headers.append('atl-client-version', "26.2.0");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { FormattedMessage, useIntl } from 'react-intl';
4
4
  import Avatar from '@atlaskit/avatar';
5
+ import Button from '@atlaskit/button/new';
5
6
  import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import Spinner from '@atlaskit/spinner';
7
8
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
@@ -165,6 +166,19 @@ const Actions = ({
165
166
  testId: "profilecard-actions"
166
167
  }, regularActions.map((action, index) => {
167
168
  const isKudos = action.id === GIVE_KUDOS_ACTION_ID;
169
+ if (isKudos && fg('fix_give_kudos_btn_incorrect_role')) {
170
+ const kudosButton = /*#__PURE__*/React.createElement(Button, {
171
+ appearance: "default",
172
+ key: action.id || index,
173
+ onClick: (event, ...args) => onActionClick(action, args, event, index),
174
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
175
+ id: `action-button-${action.id}`,
176
+ "aria-labelledby": `action-button-${action.id} profilecard-name-label`
177
+ }, action.label, /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
178
+ return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
179
+ key: `profile-card-action-kudos_${action.id || index}`
180
+ }, kudosButton);
181
+ }
168
182
  const button = /*#__PURE__*/React.createElement(TeamsLinkButton, {
169
183
  appearance: "default",
170
184
  key: action.id || index,
@@ -175,6 +189,8 @@ const Actions = ({
175
189
  id: `action-button-${action.id}`,
176
190
  "aria-labelledby": `action-button-${action.id} profilecard-name-label`
177
191
  }, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
192
+
193
+ // TODO: Remove this once fix_give_kudos_btn_incorrect_role is fully rolled out
178
194
  if (isKudos) {
179
195
  return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
180
196
  key: `profile-card-action-kudos_${action.id || index}`
@@ -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 = "26.1.7") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
5
+ packageVersion: (_process$env$_PACKAGE2 = "26.2.0") !== 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: "26.1.7",
22
+ packageVersion: "26.2.0",
23
23
  ...attributes,
24
24
  firedAt: Math.round(getPageTime())
25
25
  }
@@ -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', "26.1.7");
7
+ headers.append('atl-client-version', "26.2.0");
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', "26.1.7");
62
+ headers.append('atl-client-version', "26.2.0");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
8
8
  import { FormattedMessage, useIntl } from 'react-intl';
9
9
  import Avatar from '@atlaskit/avatar';
10
+ import Button from '@atlaskit/button/new';
10
11
  import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import Spinner from '@atlaskit/spinner';
12
13
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
@@ -171,12 +172,30 @@ var Actions = function Actions(_ref) {
171
172
  testId: "profilecard-actions"
172
173
  }, regularActions.map(function (action, index) {
173
174
  var isKudos = action.id === GIVE_KUDOS_ACTION_ID;
175
+ if (isKudos && fg('fix_give_kudos_btn_incorrect_role')) {
176
+ var kudosButton = /*#__PURE__*/React.createElement(Button, {
177
+ appearance: "default",
178
+ key: action.id || index,
179
+ onClick: function onClick(event) {
180
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
181
+ args[_key - 1] = arguments[_key];
182
+ }
183
+ return onActionClick(action, args, event, index);
184
+ },
185
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
186
+ id: "action-button-".concat(action.id),
187
+ "aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
188
+ }, action.label, /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
189
+ return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
190
+ key: "profile-card-action-kudos_".concat(action.id || index)
191
+ }, kudosButton);
192
+ }
174
193
  var button = /*#__PURE__*/React.createElement(TeamsLinkButton, {
175
194
  appearance: "default",
176
195
  key: action.id || index,
177
196
  onClick: function onClick(event) {
178
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
179
- args[_key - 1] = arguments[_key];
197
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
198
+ args[_key2 - 1] = arguments[_key2];
180
199
  }
181
200
  return onActionClick(action, args, event, index);
182
201
  },
@@ -186,6 +205,8 @@ var Actions = function Actions(_ref) {
186
205
  id: "action-button-".concat(action.id),
187
206
  "aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
188
207
  }, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
208
+
209
+ // TODO: Remove this once fix_give_kudos_btn_incorrect_role is fully rolled out
189
210
  if (isKudos) {
190
211
  return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
191
212
  key: "profile-card-action-kudos_".concat(action.id || index)
@@ -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 = "26.1.7") !== null && _process$env$_PACKAGE2 !== void 0 ? _process$env$_PACKAGE2 : ''
8
+ packageVersion: (_process$env$_PACKAGE2 = "26.2.0") !== 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: "26.1.7"
27
+ packageVersion: "26.2.0"
28
28
  }, attributes), {}, {
29
29
  firedAt: Math.round(getPageTime())
30
30
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "26.2.0",
3
+ "version": "26.2.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -181,6 +181,9 @@
181
181
  "teams_app_react_19_upgrade": {
182
182
  "type": "boolean"
183
183
  },
184
+ "fix_give_kudos_btn_incorrect_role": {
185
+ "type": "boolean"
186
+ },
184
187
  "create_modernization_ga_fixes_drop_2": {
185
188
  "type": "boolean"
186
189
  },