@atlaskit/profilecard 23.11.0 → 23.11.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,21 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 23.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#154380](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154380)
8
+ [`d9b89b5a507e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9b89b5a507e5) -
9
+ Migrate rovo endpoints away from assistant-service
10
+
11
+ ## 23.11.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#150331](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150331)
16
+ [`7730aa59c3905`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7730aa59c3905) -
17
+ Heading element for Full Name in profile card
18
+
3
19
  ## 23.11.0
4
20
 
5
21
  ### Minor Changes
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _analytics = require("../util/analytics");
17
18
  var _performance = require("../util/performance");
18
19
  var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
@@ -42,12 +43,17 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
42
43
  }
43
44
  (0, _inherits2.default)(RovoAgentCardClient, _CachingClient);
44
45
  return (0, _createClass2.default)(RovoAgentCardClient, [{
46
+ key: "basePath",
47
+ value: function basePath() {
48
+ return (0, _platformFeatureFlags.fg)('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
49
+ }
50
+ }, {
45
51
  key: "makeRequest",
46
52
  value: function makeRequest(id, cloudId) {
47
53
  var product = this.options.productIdentifier || 'rovo';
48
54
  var headers = createHeaders(product, this.options.cloudId);
49
55
  if (id.type === 'identity') {
50
- return fetch(new Request("/gateway/api/assist/agents/v1/accountid/".concat(id.value), {
56
+ return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
51
57
  method: 'GET',
52
58
  credentials: 'include',
53
59
  mode: 'cors',
@@ -56,7 +62,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
56
62
  return response.json();
57
63
  });
58
64
  }
59
- return fetch(new Request("/gateway/api/assist/agents/v1/".concat(id.value), {
65
+ return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
60
66
  method: 'GET',
61
67
  credentials: 'include',
62
68
  mode: 'cors',
@@ -121,7 +127,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
121
127
  analytics((0, _analytics.agentRequestAnalytics)('triggered'));
122
128
  }
123
129
  var headers = createHeaders(product, _this3.options.cloudId);
124
- fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId), {
130
+ fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
125
131
  method: 'DELETE',
126
132
  credentials: 'include',
127
133
  mode: 'cors',
@@ -168,7 +174,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
168
174
  }
169
175
  headers = createHeaders(product, _this4.options.cloudId);
170
176
  _context.next = 8;
171
- return fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId, "/favourite"), {
177
+ return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
172
178
  method: requestMethod,
173
179
  credentials: 'include',
174
180
  mode: 'cors',
@@ -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', "23.11.0");
14
+ headers.append('atl-client-version', "23.11.2");
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', "23.11.0");
69
+ headers.append('atl-client-version', "23.11.2");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -0,0 +1,21 @@
1
+ ._11c81ixg{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._18m915vq{overflow-y:hidden}
3
+ ._18u0idpf{margin-left:0}
4
+ ._18u0ze3t{margin-left:var(--ds-space-0,0)}
5
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
6
+ ._19pkze3t{margin-top:var(--ds-space-0,0)}
7
+ ._1bto1l2s{text-overflow:ellipsis}
8
+ ._1l6uutpp._1l6uutpp{margin-bottom:var(--ds-space-150,9pt)}
9
+ ._1reo15vq{overflow-x:hidden}
10
+ ._2hwxidpf{margin-right:0}
11
+ ._2hwxze3t{margin-right:var(--ds-space-0,0)}
12
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
14
+ ._o5721q9c{white-space:nowrap}
15
+ ._otyridpf{margin-bottom:0}
16
+ ._otyrze3t{margin-bottom:var(--ds-space-0,0)}
17
+ ._rcujutpp._rcujutpp{margin-top:var(--ds-space-150,9pt)}
18
+ ._rcujxy5q._rcujxy5q{margin-top:var(--ds-space-400,2pc)}
19
+ ._syaz15cr{color:var(--ds-text-inverse,#fff)}
20
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
21
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
@@ -1,3 +1,4 @@
1
+ /* ProfileCardDetails.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,12 +6,17 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.ProfileCardDetails = void 0;
9
+ require("./ProfileCardDetails.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
8
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
13
  var _react = _interopRequireDefault(require("react"));
14
+ var _react2 = require("@compiled/react");
11
15
  var _reactIntlNext = require("react-intl-next");
12
16
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
18
  var _primitives = require("@atlaskit/primitives");
19
+ var _compiled = require("@atlaskit/primitives/compiled");
14
20
  var _relativeDate = _interopRequireDefault(require("../../internal/relative-date"));
15
21
  var _messages = _interopRequireDefault(require("../../messages"));
16
22
  var _Card = require("../../styled/Card");
@@ -45,6 +51,14 @@ var disabledAccountStyles = (0, _primitives.xcss)({
45
51
  var activeAccountStyles = (0, _primitives.xcss)({
46
52
  color: 'color.text.inverse'
47
53
  });
54
+ var styles = {
55
+ detailedListWrapper: "_19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
56
+ fullNameLabel: "_1reo15vq _18m915vq _11c81ixg _1bto1l2s _o5721q9c",
57
+ noMetaLabel: "_2hwxidpf _18u0idpf _rcujxy5q _1l6uutpp",
58
+ metaLabel: "_2hwxidpf _otyridpf _18u0idpf _rcujutpp",
59
+ disabledAccount: "_syaz1fxt",
60
+ activeAccount: "_syaz15cr"
61
+ };
48
62
  var renderName = function renderName(nickname, fullName, meta) {
49
63
  if (!fullName && !nickname) {
50
64
  return null;
@@ -52,6 +66,14 @@ var renderName = function renderName(nickname, fullName, meta) {
52
66
  var isNicknameRedundant = !nickname || nickname === fullName;
53
67
  var shownNickname = " (".concat(nickname, ") ");
54
68
  var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
69
+ if ((0, _platformFeatureFlags.fg)('jfp-a11y-autodev-profile-card-name-heading')) {
70
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
71
+ as: "h2",
72
+ xcss: (0, _react2.cx)(styles.fullNameLabel, styles.activeAccount, meta ? styles.metaLabel : styles.noMetaLabel),
73
+ testId: "profilecard-name",
74
+ id: "profilecard-name-label"
75
+ }, displayName);
76
+ }
55
77
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
56
78
  xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
57
79
  testId: "profilecard-name",
@@ -102,7 +124,12 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
102
124
  status = props.status,
103
125
  statusModifiedDate = props.statusModifiedDate;
104
126
  var name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.disabledAccountDefaultName);
105
- return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
127
+ return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, (0, _platformFeatureFlags.fg)('jfp-a11y-autodev-profile-card-name-heading') ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
128
+ as: "h2",
129
+ xcss: (0, _react2.cx)(styles.fullNameLabel, styles.noMetaLabel, styles.disabledAccount),
130
+ testId: "profilecard-name",
131
+ id: "profilecard-name-label"
132
+ }, name) : /*#__PURE__*/_react.default.createElement(_primitives.Box, {
106
133
  xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
107
134
  testId: "profilecard-name",
108
135
  id: "profilecard-name-label"
@@ -128,7 +155,7 @@ var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetail
128
155
  lozenges: props.customLozenges
129
156
  }), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
130
157
  as: "dl",
131
- xcss: detailedListWrapperStyles
158
+ xcss: (0, _platformFeatureFlags.fg)('jfp-a11y-autodev-profile-card-name-heading') ? styles.detailedListWrapper : detailedListWrapperStyles
132
159
  }, /*#__PURE__*/_react.default.createElement(_Icon.IconLabel, {
133
160
  icon: "email",
134
161
  extraTopSpace: true
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "23.11.0"
48
+ packageVersion: "23.11.2"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { agentRequestAnalytics } from '../util/analytics';
2
3
  import { getPageTime } from '../util/performance';
3
4
  import CachingClient from './CachingClient';
@@ -18,18 +19,21 @@ export default class RovoAgentCardClient extends CachingClient {
18
19
  super(options);
19
20
  this.options = options;
20
21
  }
22
+ basePath() {
23
+ return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
24
+ }
21
25
  makeRequest(id, cloudId) {
22
26
  const product = this.options.productIdentifier || 'rovo';
23
27
  const headers = createHeaders(product, this.options.cloudId);
24
28
  if (id.type === 'identity') {
25
- return fetch(new Request(`/gateway/api/assist/agents/v1/accountid/${id.value}`, {
29
+ return fetch(new Request(`${this.basePath()}/accountid/${id.value}`, {
26
30
  method: 'GET',
27
31
  credentials: 'include',
28
32
  mode: 'cors',
29
33
  headers
30
34
  })).then(response => response.json());
31
35
  }
32
- return fetch(new Request(`/gateway/api/assist/agents/v1/${id.value}`, {
36
+ return fetch(new Request(`${this.basePath()}/${id.value}`, {
33
37
  method: 'GET',
34
38
  credentials: 'include',
35
39
  mode: 'cors',
@@ -86,7 +90,7 @@ export default class RovoAgentCardClient extends CachingClient {
86
90
  analytics(agentRequestAnalytics('triggered'));
87
91
  }
88
92
  const headers = createHeaders(product, this.options.cloudId);
89
- fetch(new Request(`/gateway/api/assist/agents/v1/${agentId}`, {
93
+ fetch(new Request(`${this.basePath()}/${agentId}`, {
90
94
  method: 'DELETE',
91
95
  credentials: 'include',
92
96
  mode: 'cors',
@@ -124,7 +128,7 @@ export default class RovoAgentCardClient extends CachingClient {
124
128
  analytics(agentRequestAnalytics('triggered', 'actionSubjectId'));
125
129
  }
126
130
  const headers = createHeaders(product, this.options.cloudId);
127
- await fetch(new Request(`/gateway/api/assist/agents/v1/${agentId}/favourite`, {
131
+ await fetch(new Request(`${this.basePath()}/${agentId}/favourite`, {
128
132
  method: requestMethod,
129
133
  credentials: 'include',
130
134
  mode: 'cors',
@@ -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', "23.11.0");
9
+ headers.append('atl-client-version', "23.11.2");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
75
75
  headers.append('X-ExperimentalApi', 'teams-beta');
76
76
  headers.append('X-ExperimentalApi', 'team-members-beta');
77
77
  headers.append('atl-client-name', "@atlaskit/profilecard");
78
- headers.append('atl-client-version', "23.11.0");
78
+ headers.append('atl-client-version', "23.11.2");
79
79
  return headers;
80
80
  };
81
81
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -0,0 +1,21 @@
1
+ ._11c81ixg{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._18m915vq{overflow-y:hidden}
3
+ ._18u0idpf{margin-left:0}
4
+ ._18u0ze3t{margin-left:var(--ds-space-0,0)}
5
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
6
+ ._19pkze3t{margin-top:var(--ds-space-0,0)}
7
+ ._1bto1l2s{text-overflow:ellipsis}
8
+ ._1l6uutpp._1l6uutpp{margin-bottom:var(--ds-space-150,9pt)}
9
+ ._1reo15vq{overflow-x:hidden}
10
+ ._2hwxidpf{margin-right:0}
11
+ ._2hwxze3t{margin-right:var(--ds-space-0,0)}
12
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
14
+ ._o5721q9c{white-space:nowrap}
15
+ ._otyridpf{margin-bottom:0}
16
+ ._otyrze3t{margin-bottom:var(--ds-space-0,0)}
17
+ ._rcujutpp._rcujutpp{margin-top:var(--ds-space-150,9pt)}
18
+ ._rcujxy5q._rcujxy5q{margin-top:var(--ds-space-400,2pc)}
19
+ ._syaz15cr{color:var(--ds-text-inverse,#fff)}
20
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
21
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
@@ -1,8 +1,14 @@
1
+ /* ProfileCardDetails.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import "./ProfileCardDetails.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
2
5
  import React from 'react';
6
+ import { cx } from '@compiled/react';
3
7
  import { FormattedMessage } from 'react-intl-next';
4
8
  import Lozenge from '@atlaskit/lozenge';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
5
10
  import { Box, Text, xcss } from '@atlaskit/primitives';
11
+ import { Box as CompiledBox } from '@atlaskit/primitives/compiled';
6
12
  import relativeDate from '../../internal/relative-date';
7
13
  import messages from '../../messages';
8
14
  import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
@@ -36,6 +42,14 @@ const disabledAccountStyles = xcss({
36
42
  const activeAccountStyles = xcss({
37
43
  color: 'color.text.inverse'
38
44
  });
45
+ const styles = {
46
+ detailedListWrapper: "_19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
47
+ fullNameLabel: "_1reo15vq _18m915vq _11c81ixg _1bto1l2s _o5721q9c",
48
+ noMetaLabel: "_2hwxidpf _18u0idpf _rcujxy5q _1l6uutpp",
49
+ metaLabel: "_2hwxidpf _otyridpf _18u0idpf _rcujutpp",
50
+ disabledAccount: "_syaz1fxt",
51
+ activeAccount: "_syaz15cr"
52
+ };
39
53
  const renderName = (nickname, fullName, meta) => {
40
54
  if (!fullName && !nickname) {
41
55
  return null;
@@ -43,6 +57,14 @@ const renderName = (nickname, fullName, meta) => {
43
57
  const isNicknameRedundant = !nickname || nickname === fullName;
44
58
  const shownNickname = ` (${nickname}) `;
45
59
  const displayName = isNicknameRedundant ? fullName : `${fullName}${shownNickname}`;
60
+ if (fg('jfp-a11y-autodev-profile-card-name-heading')) {
61
+ return /*#__PURE__*/React.createElement(CompiledBox, {
62
+ as: "h2",
63
+ xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? styles.metaLabel : styles.noMetaLabel),
64
+ testId: "profilecard-name",
65
+ id: "profilecard-name-label"
66
+ }, displayName);
67
+ }
46
68
  return /*#__PURE__*/React.createElement(Box, {
47
69
  xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
48
70
  testId: "profilecard-name",
@@ -94,7 +116,12 @@ const DisabledProfileCardDetails = props => {
94
116
  statusModifiedDate
95
117
  } = props;
96
118
  const name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/React.createElement(FormattedMessage, messages.disabledAccountDefaultName);
97
- return /*#__PURE__*/React.createElement(DetailsGroup, null, /*#__PURE__*/React.createElement(Box, {
119
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, fg('jfp-a11y-autodev-profile-card-name-heading') ? /*#__PURE__*/React.createElement(CompiledBox, {
120
+ as: "h2",
121
+ xcss: cx(styles.fullNameLabel, styles.noMetaLabel, styles.disabledAccount),
122
+ testId: "profilecard-name",
123
+ id: "profilecard-name-label"
124
+ }, name) : /*#__PURE__*/React.createElement(Box, {
98
125
  xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
99
126
  testId: "profilecard-name",
100
127
  id: "profilecard-name-label"
@@ -122,7 +149,7 @@ export const ProfileCardDetails = props => {
122
149
  lozenges: props.customLozenges
123
150
  }), /*#__PURE__*/React.createElement(Box, {
124
151
  as: "dl",
125
- xcss: detailedListWrapperStyles
152
+ xcss: fg('jfp-a11y-autodev-profile-card-name-heading') ? styles.detailedListWrapper : detailedListWrapperStyles
126
153
  }, /*#__PURE__*/React.createElement(IconLabel, {
127
154
  icon: "email",
128
155
  extraTopSpace: true
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "23.11.0",
35
+ packageVersion: "23.11.2",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -10,6 +10,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
10
10
  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) { _defineProperty(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; }
11
11
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
12
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  import { agentRequestAnalytics } from '../util/analytics';
14
15
  import { getPageTime } from '../util/performance';
15
16
  import CachingClient from './CachingClient';
@@ -35,12 +36,17 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
35
36
  }
36
37
  _inherits(RovoAgentCardClient, _CachingClient);
37
38
  return _createClass(RovoAgentCardClient, [{
39
+ key: "basePath",
40
+ value: function basePath() {
41
+ return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
42
+ }
43
+ }, {
38
44
  key: "makeRequest",
39
45
  value: function makeRequest(id, cloudId) {
40
46
  var product = this.options.productIdentifier || 'rovo';
41
47
  var headers = createHeaders(product, this.options.cloudId);
42
48
  if (id.type === 'identity') {
43
- return fetch(new Request("/gateway/api/assist/agents/v1/accountid/".concat(id.value), {
49
+ return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
44
50
  method: 'GET',
45
51
  credentials: 'include',
46
52
  mode: 'cors',
@@ -49,7 +55,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
49
55
  return response.json();
50
56
  });
51
57
  }
52
- return fetch(new Request("/gateway/api/assist/agents/v1/".concat(id.value), {
58
+ return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
53
59
  method: 'GET',
54
60
  credentials: 'include',
55
61
  mode: 'cors',
@@ -114,7 +120,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
114
120
  analytics(agentRequestAnalytics('triggered'));
115
121
  }
116
122
  var headers = createHeaders(product, _this3.options.cloudId);
117
- fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId), {
123
+ fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
118
124
  method: 'DELETE',
119
125
  credentials: 'include',
120
126
  mode: 'cors',
@@ -161,7 +167,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
161
167
  }
162
168
  headers = createHeaders(product, _this4.options.cloudId);
163
169
  _context.next = 8;
164
- return fetch(new Request("/gateway/api/assist/agents/v1/".concat(agentId, "/favourite"), {
170
+ return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
165
171
  method: requestMethod,
166
172
  credentials: 'include',
167
173
  mode: 'cors',
@@ -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', "23.11.0");
7
+ headers.append('atl-client-version', "23.11.2");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -57,7 +57,7 @@ export var addHeaders = function addHeaders(headers) {
57
57
  headers.append('X-ExperimentalApi', 'teams-beta');
58
58
  headers.append('X-ExperimentalApi', 'team-members-beta');
59
59
  headers.append('atl-client-name', "@atlaskit/profilecard");
60
- headers.append('atl-client-version', "23.11.0");
60
+ headers.append('atl-client-version', "23.11.2");
61
61
  return headers;
62
62
  };
63
63
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -0,0 +1,21 @@
1
+ ._11c81ixg{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._18m915vq{overflow-y:hidden}
3
+ ._18u0idpf{margin-left:0}
4
+ ._18u0ze3t{margin-left:var(--ds-space-0,0)}
5
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
6
+ ._19pkze3t{margin-top:var(--ds-space-0,0)}
7
+ ._1bto1l2s{text-overflow:ellipsis}
8
+ ._1l6uutpp._1l6uutpp{margin-bottom:var(--ds-space-150,9pt)}
9
+ ._1reo15vq{overflow-x:hidden}
10
+ ._2hwxidpf{margin-right:0}
11
+ ._2hwxze3t{margin-right:var(--ds-space-0,0)}
12
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
14
+ ._o5721q9c{white-space:nowrap}
15
+ ._otyridpf{margin-bottom:0}
16
+ ._otyrze3t{margin-bottom:var(--ds-space-0,0)}
17
+ ._rcujutpp._rcujutpp{margin-top:var(--ds-space-150,9pt)}
18
+ ._rcujxy5q._rcujxy5q{margin-top:var(--ds-space-400,2pc)}
19
+ ._syaz15cr{color:var(--ds-text-inverse,#fff)}
20
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
21
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
@@ -1,10 +1,16 @@
1
+ /* ProfileCardDetails.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
4
  var _excluded = ["text"];
5
+ import "./ProfileCardDetails.compiled.css";
6
+ import { ax, ix } from "@compiled/react/runtime";
4
7
  import React from 'react';
8
+ import { cx } from '@compiled/react';
5
9
  import { FormattedMessage } from 'react-intl-next';
6
10
  import Lozenge from '@atlaskit/lozenge';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
7
12
  import { Box, Text, xcss } from '@atlaskit/primitives';
13
+ import { Box as CompiledBox } from '@atlaskit/primitives/compiled';
8
14
  import relativeDate from '../../internal/relative-date';
9
15
  import messages from '../../messages';
10
16
  import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
@@ -38,6 +44,14 @@ var disabledAccountStyles = xcss({
38
44
  var activeAccountStyles = xcss({
39
45
  color: 'color.text.inverse'
40
46
  });
47
+ var styles = {
48
+ detailedListWrapper: "_19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
49
+ fullNameLabel: "_1reo15vq _18m915vq _11c81ixg _1bto1l2s _o5721q9c",
50
+ noMetaLabel: "_2hwxidpf _18u0idpf _rcujxy5q _1l6uutpp",
51
+ metaLabel: "_2hwxidpf _otyridpf _18u0idpf _rcujutpp",
52
+ disabledAccount: "_syaz1fxt",
53
+ activeAccount: "_syaz15cr"
54
+ };
41
55
  var renderName = function renderName(nickname, fullName, meta) {
42
56
  if (!fullName && !nickname) {
43
57
  return null;
@@ -45,6 +59,14 @@ var renderName = function renderName(nickname, fullName, meta) {
45
59
  var isNicknameRedundant = !nickname || nickname === fullName;
46
60
  var shownNickname = " (".concat(nickname, ") ");
47
61
  var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
62
+ if (fg('jfp-a11y-autodev-profile-card-name-heading')) {
63
+ return /*#__PURE__*/React.createElement(CompiledBox, {
64
+ as: "h2",
65
+ xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? styles.metaLabel : styles.noMetaLabel),
66
+ testId: "profilecard-name",
67
+ id: "profilecard-name-label"
68
+ }, displayName);
69
+ }
48
70
  return /*#__PURE__*/React.createElement(Box, {
49
71
  xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
50
72
  testId: "profilecard-name",
@@ -95,7 +117,12 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
95
117
  status = props.status,
96
118
  statusModifiedDate = props.statusModifiedDate;
97
119
  var name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/React.createElement(FormattedMessage, messages.disabledAccountDefaultName);
98
- return /*#__PURE__*/React.createElement(DetailsGroup, null, /*#__PURE__*/React.createElement(Box, {
120
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, fg('jfp-a11y-autodev-profile-card-name-heading') ? /*#__PURE__*/React.createElement(CompiledBox, {
121
+ as: "h2",
122
+ xcss: cx(styles.fullNameLabel, styles.noMetaLabel, styles.disabledAccount),
123
+ testId: "profilecard-name",
124
+ id: "profilecard-name-label"
125
+ }, name) : /*#__PURE__*/React.createElement(Box, {
99
126
  xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
100
127
  testId: "profilecard-name",
101
128
  id: "profilecard-name-label"
@@ -121,7 +148,7 @@ export var ProfileCardDetails = function ProfileCardDetails(props) {
121
148
  lozenges: props.customLozenges
122
149
  }), /*#__PURE__*/React.createElement(Box, {
123
150
  as: "dl",
124
- xcss: detailedListWrapperStyles
151
+ xcss: fg('jfp-a11y-autodev-profile-card-name-heading') ? styles.detailedListWrapper : detailedListWrapperStyles
125
152
  }, /*#__PURE__*/React.createElement(IconLabel, {
126
153
  icon: "email",
127
154
  extraTopSpace: true
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "23.11.0"
42
+ packageVersion: "23.11.2"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
4
4
  export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
5
5
  options: ProfileClientOptions;
6
6
  constructor(options: ProfileClientOptions);
7
+ private basePath;
7
8
  makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
8
9
  getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
9
10
  deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
4
4
  export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
5
5
  options: ProfileClientOptions;
6
6
  constructor(options: ProfileClientOptions);
7
+ private basePath;
7
8
  makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
8
9
  getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
9
10
  deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "23.11.0",
3
+ "version": "23.11.2",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,11 +52,11 @@
52
52
  "dependencies": {
53
53
  "@atlaskit/analytics-next": "^11.0.0",
54
54
  "@atlaskit/atlassian-context": "^0.2.0",
55
- "@atlaskit/avatar": "^25.0.0",
55
+ "@atlaskit/avatar": "^25.1.0",
56
56
  "@atlaskit/avatar-group": "^12.0.0",
57
57
  "@atlaskit/button": "^23.0.0",
58
58
  "@atlaskit/css": "^0.10.0",
59
- "@atlaskit/dropdown-menu": "^14.1.0",
59
+ "@atlaskit/dropdown-menu": "^14.2.0",
60
60
  "@atlaskit/empty-state": "^10.0.0",
61
61
  "@atlaskit/focus-ring": "^3.0.0",
62
62
  "@atlaskit/give-kudos": "^4.1.0",
@@ -65,10 +65,10 @@
65
65
  "@atlaskit/logo": "^18.0.0",
66
66
  "@atlaskit/lozenge": "^12.2.0",
67
67
  "@atlaskit/menu": "^5.0.0",
68
- "@atlaskit/modal-dialog": "^14.1.0",
68
+ "@atlaskit/modal-dialog": "^14.2.0",
69
69
  "@atlaskit/people-teams-ui-public": "^3.1.0",
70
70
  "@atlaskit/platform-feature-flags": "^1.1.0",
71
- "@atlaskit/popup": "^4.1.0",
71
+ "@atlaskit/popup": "^4.2.0",
72
72
  "@atlaskit/primitives": "^14.7.0",
73
73
  "@atlaskit/rovo-agent-components": "^2.8.0",
74
74
  "@atlaskit/rovo-triggers": "^2.11.0",
@@ -162,6 +162,12 @@
162
162
  },
163
163
  "enable_userprofilecard_arialabelfix": {
164
164
  "type": "boolean"
165
+ },
166
+ "jfp-a11y-autodev-profile-card-name-heading": {
167
+ "type": "boolean"
168
+ },
169
+ "pt-deprecate-assistance-service": {
170
+ "type": "boolean"
165
171
  }
166
172
  },
167
173
  "sideEffects": [