@atlaskit/profilecard 20.8.2 → 20.8.3
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 +8 -0
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/User/ProfileCardDetails.js +40 -1
- package/dist/cjs/components/User/ProfileCardTrigger.js +3 -0
- package/dist/cjs/components/User/ReportingLinesDetails.js +20 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/User/ProfileCardDetails.js +40 -1
- package/dist/es2019/components/User/ProfileCardTrigger.js +3 -0
- package/dist/es2019/components/User/ReportingLinesDetails.js +20 -2
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/User/ProfileCardDetails.js +40 -1
- package/dist/esm/components/User/ProfileCardTrigger.js +3 -0
- package/dist/esm/components/User/ReportingLinesDetails.js +20 -2
- package/dist/esm/util/analytics.js +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 20.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159176)
|
|
8
|
+
[`b8e7f2a47aae5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8e7f2a47aae5) -
|
|
9
|
+
A11Y-7954 Fix expandable button reading order
|
|
10
|
+
|
|
3
11
|
## 20.8.2
|
|
4
12
|
|
|
5
13
|
### Patch 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', "20.8.
|
|
14
|
+
headers.append('atl-client-version', "20.8.3");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.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', "20.8.
|
|
60
|
+
headers.append('atl-client-version', "20.8.3");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -10,6 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _primitives = require("@atlaskit/primitives");
|
|
14
15
|
var _relativeDate = _interopRequireDefault(require("../../internal/relative-date"));
|
|
15
16
|
var _messages = _interopRequireDefault(require("../../messages"));
|
|
@@ -21,6 +22,33 @@ var detailedListWrapperStyles = (0, _primitives.xcss)({
|
|
|
21
22
|
margin: 'space.0',
|
|
22
23
|
padding: 'space.0'
|
|
23
24
|
});
|
|
25
|
+
var fullNameLabelStyles = (0, _primitives.xcss)({
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
textOverflow: 'ellipsis',
|
|
28
|
+
whiteSpace: 'nowrap',
|
|
29
|
+
fontSize: '18px',
|
|
30
|
+
fontWeight: '400',
|
|
31
|
+
letterSpacing: 'normal',
|
|
32
|
+
lineHeight: "".concat(24 / 18, "em")
|
|
33
|
+
});
|
|
34
|
+
var noMetaLabelStyles = (0, _primitives.xcss)({
|
|
35
|
+
marginTop: 'space.400',
|
|
36
|
+
marginRight: '0',
|
|
37
|
+
marginBottom: 'space.150',
|
|
38
|
+
marginLeft: '0'
|
|
39
|
+
});
|
|
40
|
+
var metaLabelStyles = (0, _primitives.xcss)({
|
|
41
|
+
marginTop: 'space.150',
|
|
42
|
+
marginRight: '0',
|
|
43
|
+
marginBottom: '0',
|
|
44
|
+
marginLeft: '0'
|
|
45
|
+
});
|
|
46
|
+
var disabledAccountStyles = (0, _primitives.xcss)({
|
|
47
|
+
color: 'color.text'
|
|
48
|
+
});
|
|
49
|
+
var activeAccountStyles = (0, _primitives.xcss)({
|
|
50
|
+
color: 'color.text.inverse'
|
|
51
|
+
});
|
|
24
52
|
var renderName = function renderName(nickname, fullName, meta) {
|
|
25
53
|
if (!fullName && !nickname) {
|
|
26
54
|
return null;
|
|
@@ -28,6 +56,13 @@ var renderName = function renderName(nickname, fullName, meta) {
|
|
|
28
56
|
var isNicknameRedundant = !nickname || nickname === fullName;
|
|
29
57
|
var shownNickname = " (".concat(nickname, ") ");
|
|
30
58
|
var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
|
|
59
|
+
if ((0, _platformFeatureFlags.fg)('platform_profile_card_css_refactor')) {
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
61
|
+
xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
|
|
62
|
+
testId: "profilecard-name",
|
|
63
|
+
id: "profilecard-name-label"
|
|
64
|
+
}, displayName);
|
|
65
|
+
}
|
|
31
66
|
return /*#__PURE__*/_react.default.createElement(_Card.FullNameLabel, {
|
|
32
67
|
noMeta: !meta,
|
|
33
68
|
"data-testid": "profilecard-name",
|
|
@@ -78,7 +113,11 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
|
|
|
78
113
|
status = props.status,
|
|
79
114
|
statusModifiedDate = props.statusModifiedDate;
|
|
80
115
|
var name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.disabledAccountDefaultName);
|
|
81
|
-
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, /*#__PURE__*/_react.default.createElement(
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, (0, _platformFeatureFlags.fg)('platform_profile_card_css_refactor') ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
117
|
+
xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
|
|
118
|
+
testId: "profilecard-name",
|
|
119
|
+
id: "profilecard-name-label"
|
|
120
|
+
}, name) : /*#__PURE__*/_react.default.createElement(_Card.FullNameLabel, {
|
|
82
121
|
noMeta: true,
|
|
83
122
|
isDisabledAccount: true,
|
|
84
123
|
"data-testid": "profilecard-name",
|
|
@@ -385,6 +385,9 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
385
385
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
386
386
|
,
|
|
387
387
|
autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
|
|
388
|
+
// This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
|
|
389
|
+
,
|
|
390
|
+
shouldRenderToParent: (0, _platformFeatureFlags.fg)('enable_appropriate_reading_order_in_profile_card')
|
|
388
391
|
}), shouldShowGiveKudos && teamCentralBaseUrl && /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
389
392
|
fallback: null
|
|
390
393
|
}, /*#__PURE__*/_react.default.createElement(_giveKudos.GiveKudosLauncherLazy, {
|
|
@@ -10,12 +10,23 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
10
10
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
11
11
|
var _avatarGroup = _interopRequireDefault(require("@atlaskit/avatar-group"));
|
|
12
12
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _primitives = require("@atlaskit/primitives");
|
|
13
15
|
var _messages = _interopRequireDefault(require("../../messages"));
|
|
14
16
|
var _ReportingLines = require("../../styled/ReportingLines");
|
|
15
17
|
var _analytics = require("../../util/analytics");
|
|
16
18
|
function getProfileHref(userId, profileUrl) {
|
|
17
19
|
return profileUrl ? profileUrl + userId : undefined;
|
|
18
20
|
}
|
|
21
|
+
var reportingLinesHeadingDefaultStyles = (0, _primitives.xcss)({
|
|
22
|
+
color: 'color.text',
|
|
23
|
+
font: 'font.heading.xxsmall',
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
marginBottom: 'space.100'
|
|
26
|
+
});
|
|
27
|
+
var reportingLinesHeadingStyles = (0, _primitives.xcss)({
|
|
28
|
+
marginBottom: '0'
|
|
29
|
+
});
|
|
19
30
|
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
20
31
|
var _manager$pii, _manager$pii2;
|
|
21
32
|
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
@@ -40,7 +51,12 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
40
51
|
onReportingLinesClick(user);
|
|
41
52
|
} : undefined;
|
|
42
53
|
};
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, manager && /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesSection, null, /*#__PURE__*/_react.default.createElement(
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, manager && /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesSection, null, (0, _platformFeatureFlags.fg)('platform_profile_card_css_refactor') ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
55
|
+
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.managerSectionHeading)) :
|
|
57
|
+
/*#__PURE__*/
|
|
58
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */
|
|
59
|
+
_react.default.createElement(_ReportingLines.ReportingLinesHeading, {
|
|
44
60
|
style: {
|
|
45
61
|
marginBottom: 0
|
|
46
62
|
}
|
|
@@ -53,7 +69,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
53
69
|
}, /*#__PURE__*/_react.default.createElement(_ReportingLines.ManagerSection, null, /*#__PURE__*/_react.default.createElement(_avatar.default, {
|
|
54
70
|
size: "xsmall",
|
|
55
71
|
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
56
|
-
}), /*#__PURE__*/_react.default.createElement(_ReportingLines.ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesSection, null,
|
|
72
|
+
}), /*#__PURE__*/_react.default.createElement(_ReportingLines.ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesSection, null, (0, _platformFeatureFlags.fg)('platform_profile_card_css_refactor') ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
73
|
+
xcss: reportingLinesHeadingDefaultStyles
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.directReportsSectionHeading)) : /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesHeading, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.directReportsSectionHeading)), /*#__PURE__*/_react.default.createElement(_avatarGroup.default, {
|
|
57
75
|
appearance: "stack",
|
|
58
76
|
size: "small",
|
|
59
77
|
data: reports.map(function (member) {
|
|
@@ -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: "20.8.
|
|
48
|
+
packageVersion: "20.8.3"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -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', "20.8.
|
|
9
|
+
headers.append('atl-client-version', "20.8.3");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
|
|
|
67
67
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
68
68
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
69
69
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
70
|
-
headers.append('atl-client-version', "20.8.
|
|
70
|
+
headers.append('atl-client-version', "20.8.3");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
6
7
|
import relativeDate from '../../internal/relative-date';
|
|
7
8
|
import messages from '../../messages';
|
|
@@ -12,6 +13,33 @@ const detailedListWrapperStyles = xcss({
|
|
|
12
13
|
margin: 'space.0',
|
|
13
14
|
padding: 'space.0'
|
|
14
15
|
});
|
|
16
|
+
const fullNameLabelStyles = xcss({
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
textOverflow: 'ellipsis',
|
|
19
|
+
whiteSpace: 'nowrap',
|
|
20
|
+
fontSize: '18px',
|
|
21
|
+
fontWeight: '400',
|
|
22
|
+
letterSpacing: 'normal',
|
|
23
|
+
lineHeight: `${24 / 18}em`
|
|
24
|
+
});
|
|
25
|
+
const noMetaLabelStyles = xcss({
|
|
26
|
+
marginTop: 'space.400',
|
|
27
|
+
marginRight: '0',
|
|
28
|
+
marginBottom: 'space.150',
|
|
29
|
+
marginLeft: '0'
|
|
30
|
+
});
|
|
31
|
+
const metaLabelStyles = xcss({
|
|
32
|
+
marginTop: 'space.150',
|
|
33
|
+
marginRight: '0',
|
|
34
|
+
marginBottom: '0',
|
|
35
|
+
marginLeft: '0'
|
|
36
|
+
});
|
|
37
|
+
const disabledAccountStyles = xcss({
|
|
38
|
+
color: 'color.text'
|
|
39
|
+
});
|
|
40
|
+
const activeAccountStyles = xcss({
|
|
41
|
+
color: 'color.text.inverse'
|
|
42
|
+
});
|
|
15
43
|
const renderName = (nickname, fullName, meta) => {
|
|
16
44
|
if (!fullName && !nickname) {
|
|
17
45
|
return null;
|
|
@@ -19,6 +47,13 @@ const renderName = (nickname, fullName, meta) => {
|
|
|
19
47
|
const isNicknameRedundant = !nickname || nickname === fullName;
|
|
20
48
|
const shownNickname = ` (${nickname}) `;
|
|
21
49
|
const displayName = isNicknameRedundant ? fullName : `${fullName}${shownNickname}`;
|
|
50
|
+
if (fg('platform_profile_card_css_refactor')) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
52
|
+
xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
|
|
53
|
+
testId: "profilecard-name",
|
|
54
|
+
id: "profilecard-name-label"
|
|
55
|
+
}, displayName);
|
|
56
|
+
}
|
|
22
57
|
return /*#__PURE__*/React.createElement(FullNameLabel, {
|
|
23
58
|
noMeta: !meta,
|
|
24
59
|
"data-testid": "profilecard-name",
|
|
@@ -70,7 +105,11 @@ const DisabledProfileCardDetails = props => {
|
|
|
70
105
|
statusModifiedDate
|
|
71
106
|
} = props;
|
|
72
107
|
const name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/React.createElement(FormattedMessage, messages.disabledAccountDefaultName);
|
|
73
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, /*#__PURE__*/React.createElement(
|
|
108
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
109
|
+
xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
|
|
110
|
+
testId: "profilecard-name",
|
|
111
|
+
id: "profilecard-name-label"
|
|
112
|
+
}, name) : /*#__PURE__*/React.createElement(FullNameLabel, {
|
|
74
113
|
noMeta: true,
|
|
75
114
|
isDisabledAccount: true,
|
|
76
115
|
"data-testid": "profilecard-name",
|
|
@@ -317,6 +317,9 @@ export default function ProfilecardTriggerNext({
|
|
|
317
317
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
318
318
|
,
|
|
319
319
|
autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
|
|
320
|
+
// This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
|
|
321
|
+
,
|
|
322
|
+
shouldRenderToParent: fg('enable_appropriate_reading_order_in_profile_card')
|
|
320
323
|
}), shouldShowGiveKudos && teamCentralBaseUrl && /*#__PURE__*/React.createElement(Suspense, {
|
|
321
324
|
fallback: null
|
|
322
325
|
}, /*#__PURE__*/React.createElement(GiveKudosLauncherLazy, {
|
|
@@ -3,12 +3,23 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
3
3
|
import Avatar from '@atlaskit/avatar';
|
|
4
4
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
8
|
import messages from '../../messages';
|
|
7
9
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesHeading, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
8
10
|
import { reportingLinesClicked } from '../../util/analytics';
|
|
9
11
|
function getProfileHref(userId, profileUrl) {
|
|
10
12
|
return profileUrl ? profileUrl + userId : undefined;
|
|
11
13
|
}
|
|
14
|
+
const reportingLinesHeadingDefaultStyles = xcss({
|
|
15
|
+
color: 'color.text',
|
|
16
|
+
font: 'font.heading.xxsmall',
|
|
17
|
+
fontWeight: 600,
|
|
18
|
+
marginBottom: 'space.100'
|
|
19
|
+
});
|
|
20
|
+
const reportingLinesHeadingStyles = xcss({
|
|
21
|
+
marginBottom: '0'
|
|
22
|
+
});
|
|
12
23
|
const ReportingLinesDetails = props => {
|
|
13
24
|
var _manager$pii, _manager$pii2;
|
|
14
25
|
const {
|
|
@@ -30,7 +41,12 @@ const ReportingLinesDetails = props => {
|
|
|
30
41
|
}));
|
|
31
42
|
onReportingLinesClick(user);
|
|
32
43
|
} : undefined;
|
|
33
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(
|
|
44
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
45
|
+
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
46
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)) :
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */
|
|
49
|
+
React.createElement(ReportingLinesHeading, {
|
|
34
50
|
style: {
|
|
35
51
|
marginBottom: 0
|
|
36
52
|
}
|
|
@@ -43,7 +59,9 @@ const ReportingLinesDetails = props => {
|
|
|
43
59
|
}, /*#__PURE__*/React.createElement(ManagerSection, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
44
60
|
size: "xsmall",
|
|
45
61
|
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
46
|
-
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null,
|
|
62
|
+
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
63
|
+
xcss: reportingLinesHeadingDefaultStyles
|
|
64
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)) : /*#__PURE__*/React.createElement(ReportingLinesHeading, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)), /*#__PURE__*/React.createElement(AvatarGroup, {
|
|
47
65
|
appearance: "stack",
|
|
48
66
|
size: "small",
|
|
49
67
|
data: reports.map(member => {
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "20.8.
|
|
35
|
+
packageVersion: "20.8.3",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -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', "20.8.
|
|
7
|
+
headers.append('atl-client-version', "20.8.3");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
48
48
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
49
49
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
50
50
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
51
|
-
headers.append('atl-client-version', "20.8.
|
|
51
|
+
headers.append('atl-client-version', "20.8.3");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -4,6 +4,7 @@ var _excluded = ["text"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import Lozenge from '@atlaskit/lozenge';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
8
9
|
import relativeDate from '../../internal/relative-date';
|
|
9
10
|
import messages from '../../messages';
|
|
@@ -14,6 +15,33 @@ var detailedListWrapperStyles = xcss({
|
|
|
14
15
|
margin: 'space.0',
|
|
15
16
|
padding: 'space.0'
|
|
16
17
|
});
|
|
18
|
+
var fullNameLabelStyles = xcss({
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
textOverflow: 'ellipsis',
|
|
21
|
+
whiteSpace: 'nowrap',
|
|
22
|
+
fontSize: '18px',
|
|
23
|
+
fontWeight: '400',
|
|
24
|
+
letterSpacing: 'normal',
|
|
25
|
+
lineHeight: "".concat(24 / 18, "em")
|
|
26
|
+
});
|
|
27
|
+
var noMetaLabelStyles = xcss({
|
|
28
|
+
marginTop: 'space.400',
|
|
29
|
+
marginRight: '0',
|
|
30
|
+
marginBottom: 'space.150',
|
|
31
|
+
marginLeft: '0'
|
|
32
|
+
});
|
|
33
|
+
var metaLabelStyles = xcss({
|
|
34
|
+
marginTop: 'space.150',
|
|
35
|
+
marginRight: '0',
|
|
36
|
+
marginBottom: '0',
|
|
37
|
+
marginLeft: '0'
|
|
38
|
+
});
|
|
39
|
+
var disabledAccountStyles = xcss({
|
|
40
|
+
color: 'color.text'
|
|
41
|
+
});
|
|
42
|
+
var activeAccountStyles = xcss({
|
|
43
|
+
color: 'color.text.inverse'
|
|
44
|
+
});
|
|
17
45
|
var renderName = function renderName(nickname, fullName, meta) {
|
|
18
46
|
if (!fullName && !nickname) {
|
|
19
47
|
return null;
|
|
@@ -21,6 +49,13 @@ var renderName = function renderName(nickname, fullName, meta) {
|
|
|
21
49
|
var isNicknameRedundant = !nickname || nickname === fullName;
|
|
22
50
|
var shownNickname = " (".concat(nickname, ") ");
|
|
23
51
|
var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
|
|
52
|
+
if (fg('platform_profile_card_css_refactor')) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
xcss: [fullNameLabelStyles, activeAccountStyles, meta ? metaLabelStyles : noMetaLabelStyles],
|
|
55
|
+
testId: "profilecard-name",
|
|
56
|
+
id: "profilecard-name-label"
|
|
57
|
+
}, displayName);
|
|
58
|
+
}
|
|
24
59
|
return /*#__PURE__*/React.createElement(FullNameLabel, {
|
|
25
60
|
noMeta: !meta,
|
|
26
61
|
"data-testid": "profilecard-name",
|
|
@@ -71,7 +106,11 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
|
|
|
71
106
|
status = props.status,
|
|
72
107
|
statusModifiedDate = props.statusModifiedDate;
|
|
73
108
|
var name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/React.createElement(FormattedMessage, messages.disabledAccountDefaultName);
|
|
74
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, /*#__PURE__*/React.createElement(
|
|
109
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
xcss: [fullNameLabelStyles, noMetaLabelStyles, disabledAccountStyles],
|
|
111
|
+
testId: "profilecard-name",
|
|
112
|
+
id: "profilecard-name-label"
|
|
113
|
+
}, name) : /*#__PURE__*/React.createElement(FullNameLabel, {
|
|
75
114
|
noMeta: true,
|
|
76
115
|
isDisabledAccount: true,
|
|
77
116
|
"data-testid": "profilecard-name",
|
|
@@ -375,6 +375,9 @@ export default function ProfilecardTriggerNext(_ref2) {
|
|
|
375
375
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
376
376
|
,
|
|
377
377
|
autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
|
|
378
|
+
// This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
|
|
379
|
+
,
|
|
380
|
+
shouldRenderToParent: fg('enable_appropriate_reading_order_in_profile_card')
|
|
378
381
|
}), shouldShowGiveKudos && teamCentralBaseUrl && /*#__PURE__*/React.createElement(Suspense, {
|
|
379
382
|
fallback: null
|
|
380
383
|
}, /*#__PURE__*/React.createElement(GiveKudosLauncherLazy, {
|
|
@@ -3,12 +3,23 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
3
3
|
import Avatar from '@atlaskit/avatar';
|
|
4
4
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
8
|
import messages from '../../messages';
|
|
7
9
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesHeading, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
8
10
|
import { reportingLinesClicked } from '../../util/analytics';
|
|
9
11
|
function getProfileHref(userId, profileUrl) {
|
|
10
12
|
return profileUrl ? profileUrl + userId : undefined;
|
|
11
13
|
}
|
|
14
|
+
var reportingLinesHeadingDefaultStyles = xcss({
|
|
15
|
+
color: 'color.text',
|
|
16
|
+
font: 'font.heading.xxsmall',
|
|
17
|
+
fontWeight: 600,
|
|
18
|
+
marginBottom: 'space.100'
|
|
19
|
+
});
|
|
20
|
+
var reportingLinesHeadingStyles = xcss({
|
|
21
|
+
marginBottom: '0'
|
|
22
|
+
});
|
|
12
23
|
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
13
24
|
var _manager$pii, _manager$pii2;
|
|
14
25
|
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
@@ -33,7 +44,12 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
33
44
|
onReportingLinesClick(user);
|
|
34
45
|
} : undefined;
|
|
35
46
|
};
|
|
36
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(
|
|
47
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
48
|
+
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
49
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)) :
|
|
50
|
+
/*#__PURE__*/
|
|
51
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */
|
|
52
|
+
React.createElement(ReportingLinesHeading, {
|
|
37
53
|
style: {
|
|
38
54
|
marginBottom: 0
|
|
39
55
|
}
|
|
@@ -46,7 +62,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
46
62
|
}, /*#__PURE__*/React.createElement(ManagerSection, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
47
63
|
size: "xsmall",
|
|
48
64
|
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
49
|
-
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null,
|
|
65
|
+
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null, fg('platform_profile_card_css_refactor') ? /*#__PURE__*/React.createElement(Box, {
|
|
66
|
+
xcss: reportingLinesHeadingDefaultStyles
|
|
67
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)) : /*#__PURE__*/React.createElement(ReportingLinesHeading, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)), /*#__PURE__*/React.createElement(AvatarGroup, {
|
|
50
68
|
appearance: "stack",
|
|
51
69
|
size: "small",
|
|
52
70
|
data: reports.map(function (member) {
|
|
@@ -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: "20.8.
|
|
42
|
+
packageVersion: "20.8.3"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "20.8.
|
|
3
|
+
"version": "20.8.3",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
54
54
|
"@atlaskit/atlassian-context": "^0.0.2",
|
|
55
|
-
"@atlaskit/avatar": "^21.
|
|
55
|
+
"@atlaskit/avatar": "^21.17.0",
|
|
56
56
|
"@atlaskit/avatar-group": "^10.0.0",
|
|
57
57
|
"@atlaskit/button": "^20.3.0",
|
|
58
58
|
"@atlaskit/dropdown-menu": "^12.22.0",
|
|
@@ -127,6 +127,9 @@
|
|
|
127
127
|
},
|
|
128
128
|
"enable_agent_profile_card": {
|
|
129
129
|
"type": "boolean"
|
|
130
|
+
},
|
|
131
|
+
"platform_profile_card_css_refactor": {
|
|
132
|
+
"type": "boolean"
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
}
|