@atlaskit/profilecard 22.2.3 → 22.2.4
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 +9 -0
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Team/TeamProfileCard.js +13 -5
- package/dist/cjs/components/User/ReportingLinesDetails.js +12 -2
- package/dist/cjs/messages.js +10 -0
- 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/Team/TeamProfileCard.js +15 -5
- package/dist/es2019/components/User/ReportingLinesDetails.js +14 -3
- package/dist/es2019/messages.js +10 -0
- 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/Team/TeamProfileCard.js +14 -6
- package/dist/esm/components/User/ReportingLinesDetails.js +13 -3
- package/dist/esm/messages.js +10 -0
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/messages.d.ts +10 -0
- package/dist/types-ts4.5/messages.d.ts +10 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 22.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115593](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115593)
|
|
8
|
+
[`d549b45702f75`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d549b45702f75) -
|
|
9
|
+
Updates the reporting lines avatar group (in the platform profile card component both user and
|
|
10
|
+
team) to have an aria label for the more indicator button
|
|
11
|
+
|
|
3
12
|
## 22.2.3
|
|
4
13
|
|
|
5
14
|
### 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', "22.2.
|
|
14
|
+
headers.append('atl-client-version', "22.2.4");
|
|
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', "22.2.
|
|
69
|
+
headers.append('atl-client-version', "22.2.4");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _avatarGroup = _interopRequireDefault(require("@atlaskit/avatar-group"));
|
|
@@ -39,6 +39,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
39
39
|
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; }
|
|
40
40
|
var LARGE_MEMBER_COUNT = 50;
|
|
41
41
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
42
|
+
var avatarGroupMaxCount = 9;
|
|
42
43
|
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
43
44
|
return function (event) {
|
|
44
45
|
analytics(function (duration) {
|
|
@@ -60,6 +61,8 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
60
61
|
members = _ref.members,
|
|
61
62
|
onUserClick = _ref.onUserClick,
|
|
62
63
|
includingYou = _ref.includingYou;
|
|
64
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
65
|
+
formatMessage = _useIntl.formatMessage;
|
|
63
66
|
var count = members ? members.length : 0;
|
|
64
67
|
var message = includingYou ? count >= LARGE_MEMBER_COUNT ? _messages.default.membersMoreThan50IncludingYou : _messages.default.memberCountIncludingYou : count >= LARGE_MEMBER_COUNT ? _messages.default.membersMoreThan50 : _messages.default.memberCount;
|
|
65
68
|
|
|
@@ -78,6 +81,13 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
78
81
|
}
|
|
79
82
|
isMoreMembersOpen.current = !isOpen;
|
|
80
83
|
}, [analytics, count]);
|
|
84
|
+
var showMoreButtonProps = _objectSpread({
|
|
85
|
+
onClick: onMoreClick
|
|
86
|
+
}, (0, _platformFeatureFlags.fg)('platform_profilecard-enable_reporting_lines_label') ? {
|
|
87
|
+
'aria-label': formatMessage(_messages.default.profileCardMoreMembersLabel, {
|
|
88
|
+
count: count - avatarGroupMaxCount + 1
|
|
89
|
+
})
|
|
90
|
+
} : {});
|
|
81
91
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TeamCard.MemberCount, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, message, {
|
|
82
92
|
values: {
|
|
83
93
|
count: count
|
|
@@ -95,10 +105,8 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
95
105
|
onClick: onClick
|
|
96
106
|
};
|
|
97
107
|
}),
|
|
98
|
-
maxCount:
|
|
99
|
-
showMoreButtonProps:
|
|
100
|
-
onClick: onMoreClick
|
|
101
|
-
},
|
|
108
|
+
maxCount: avatarGroupMaxCount,
|
|
109
|
+
showMoreButtonProps: showMoreButtonProps,
|
|
102
110
|
testId: "profilecard-avatar-group"
|
|
103
111
|
})));
|
|
104
112
|
};
|
|
@@ -10,6 +10,7 @@ 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");
|
|
13
14
|
var _primitives = require("@atlaskit/primitives");
|
|
14
15
|
var _messages = _interopRequireDefault(require("../../messages"));
|
|
15
16
|
var _ReportingLines = require("../../styled/ReportingLines");
|
|
@@ -26,8 +27,11 @@ var reportingLinesHeadingDefaultStyles = (0, _primitives.xcss)({
|
|
|
26
27
|
var reportingLinesHeadingStyles = (0, _primitives.xcss)({
|
|
27
28
|
marginBottom: '0'
|
|
28
29
|
});
|
|
30
|
+
var avatarGroupMaxCount = 5;
|
|
29
31
|
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
30
32
|
var _manager$pii, _manager$pii2;
|
|
33
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
34
|
+
formatMessage = _useIntl.formatMessage;
|
|
31
35
|
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
32
36
|
_props$reportingLines = props.reportingLines,
|
|
33
37
|
reportingLines = _props$reportingLines === void 0 ? {} : _props$reportingLines,
|
|
@@ -50,6 +54,11 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
50
54
|
onReportingLinesClick(user);
|
|
51
55
|
} : undefined;
|
|
52
56
|
};
|
|
57
|
+
var showMoreButtonProps = (0, _platformFeatureFlags.fg)('platform_profilecard-enable_reporting_lines_label') ? {
|
|
58
|
+
'aria-label': formatMessage(_messages.default.profileCardMoreReportingLinesLabel, {
|
|
59
|
+
count: reports.length - avatarGroupMaxCount + 1
|
|
60
|
+
})
|
|
61
|
+
} : undefined;
|
|
53
62
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, manager && /*#__PURE__*/_react.default.createElement(_ReportingLines.ReportingLinesSection, null, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
54
63
|
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
55
64
|
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.managerSectionHeading)), /*#__PURE__*/_react.default.createElement(_ReportingLines.OffsetWrapper, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
@@ -76,8 +85,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
76
85
|
onClick: getReportingLinesOnClick(member, 'direct-report')
|
|
77
86
|
};
|
|
78
87
|
}),
|
|
79
|
-
maxCount:
|
|
80
|
-
testId: "profilecard-reports-avatar-group"
|
|
88
|
+
maxCount: avatarGroupMaxCount,
|
|
89
|
+
testId: "profilecard-reports-avatar-group",
|
|
90
|
+
showMoreButtonProps: showMoreButtonProps
|
|
81
91
|
})));
|
|
82
92
|
};
|
|
83
93
|
var _default = exports.default = ReportingLinesDetails;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -165,6 +165,16 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
165
165
|
id: 'pt.profile-card.more-icon-label',
|
|
166
166
|
defaultMessage: 'More',
|
|
167
167
|
description: 'Label for the meatballs icon on the profile card, which when clicked will provide more options'
|
|
168
|
+
},
|
|
169
|
+
profileCardMoreReportingLinesLabel: {
|
|
170
|
+
id: 'pt.user-profile-card.reporting-lines.more-icon-label',
|
|
171
|
+
defaultMessage: '+{count} more {count, plural, one {profile} other {profiles}}',
|
|
172
|
+
description: 'Label for the "more profiles" indicator in the reporting lines section of the user profile card'
|
|
173
|
+
},
|
|
174
|
+
profileCardMoreMembersLabel: {
|
|
175
|
+
id: 'pt.team.profile-card.members.more-icon-label',
|
|
176
|
+
defaultMessage: '+{count} more {count, plural, one {members} other {members}}',
|
|
177
|
+
description: 'Label for the "more members" indicator in the members section of the team profile card'
|
|
168
178
|
}
|
|
169
179
|
});
|
|
170
180
|
var _default = exports.default = messages;
|
|
@@ -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: "22.2.
|
|
48
|
+
packageVersion: "22.2.4"
|
|
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', "22.2.
|
|
9
|
+
headers.append('atl-client-version', "22.2.4");
|
|
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', "22.2.
|
|
78
|
+
headers.append('atl-client-version', "22.2.4");
|
|
79
79
|
return headers;
|
|
80
80
|
};
|
|
81
81
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
4
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
5
5
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
6
6
|
import Button from '@atlaskit/button/standard-button';
|
|
@@ -24,6 +24,7 @@ import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
|
24
24
|
import TeamLoadingState from './TeamLoadingState';
|
|
25
25
|
const LARGE_MEMBER_COUNT = 50;
|
|
26
26
|
const GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
27
|
+
const avatarGroupMaxCount = 9;
|
|
27
28
|
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
28
29
|
return event => {
|
|
29
30
|
analytics(duration => teamAvatarClicked({
|
|
@@ -44,6 +45,9 @@ const TeamMembers = ({
|
|
|
44
45
|
onUserClick,
|
|
45
46
|
includingYou
|
|
46
47
|
}) => {
|
|
48
|
+
const {
|
|
49
|
+
formatMessage
|
|
50
|
+
} = useIntl();
|
|
47
51
|
const count = members ? members.length : 0;
|
|
48
52
|
const message = includingYou ? count >= LARGE_MEMBER_COUNT ? messages.membersMoreThan50IncludingYou : messages.memberCountIncludingYou : count >= LARGE_MEMBER_COUNT ? messages.membersMoreThan50 : messages.memberCount;
|
|
49
53
|
|
|
@@ -62,6 +66,14 @@ const TeamMembers = ({
|
|
|
62
66
|
}
|
|
63
67
|
isMoreMembersOpen.current = !isOpen;
|
|
64
68
|
}, [analytics, count]);
|
|
69
|
+
const showMoreButtonProps = {
|
|
70
|
+
onClick: onMoreClick,
|
|
71
|
+
...(fg('platform_profilecard-enable_reporting_lines_label') ? {
|
|
72
|
+
'aria-label': formatMessage(messages.profileCardMoreMembersLabel, {
|
|
73
|
+
count: count - avatarGroupMaxCount + 1
|
|
74
|
+
})
|
|
75
|
+
} : {})
|
|
76
|
+
};
|
|
65
77
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MemberCount, null, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
66
78
|
values: {
|
|
67
79
|
count
|
|
@@ -79,10 +91,8 @@ const TeamMembers = ({
|
|
|
79
91
|
onClick
|
|
80
92
|
};
|
|
81
93
|
}),
|
|
82
|
-
maxCount:
|
|
83
|
-
showMoreButtonProps:
|
|
84
|
-
onClick: onMoreClick
|
|
85
|
-
},
|
|
94
|
+
maxCount: avatarGroupMaxCount,
|
|
95
|
+
showMoreButtonProps: showMoreButtonProps,
|
|
86
96
|
testId: "profilecard-avatar-group"
|
|
87
97
|
})));
|
|
88
98
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
2
|
+
import { FormattedMessage, useIntl } 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';
|
|
6
7
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
8
|
import messages from '../../messages';
|
|
8
9
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
@@ -19,8 +20,12 @@ const reportingLinesHeadingDefaultStyles = xcss({
|
|
|
19
20
|
const reportingLinesHeadingStyles = xcss({
|
|
20
21
|
marginBottom: '0'
|
|
21
22
|
});
|
|
23
|
+
const avatarGroupMaxCount = 5;
|
|
22
24
|
const ReportingLinesDetails = props => {
|
|
23
25
|
var _manager$pii, _manager$pii2;
|
|
26
|
+
const {
|
|
27
|
+
formatMessage
|
|
28
|
+
} = useIntl();
|
|
24
29
|
const {
|
|
25
30
|
fireAnalyticsWithDuration,
|
|
26
31
|
reportingLines = {},
|
|
@@ -40,6 +45,11 @@ const ReportingLinesDetails = props => {
|
|
|
40
45
|
}));
|
|
41
46
|
onReportingLinesClick(user);
|
|
42
47
|
} : undefined;
|
|
48
|
+
const showMoreButtonProps = fg('platform_profilecard-enable_reporting_lines_label') ? {
|
|
49
|
+
'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
|
|
50
|
+
count: reports.length - avatarGroupMaxCount + 1
|
|
51
|
+
})
|
|
52
|
+
} : undefined;
|
|
43
53
|
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
44
54
|
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
45
55
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)), /*#__PURE__*/React.createElement(OffsetWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -66,8 +76,9 @@ const ReportingLinesDetails = props => {
|
|
|
66
76
|
onClick: getReportingLinesOnClick(member, 'direct-report')
|
|
67
77
|
};
|
|
68
78
|
}),
|
|
69
|
-
maxCount:
|
|
70
|
-
testId: "profilecard-reports-avatar-group"
|
|
79
|
+
maxCount: avatarGroupMaxCount,
|
|
80
|
+
testId: "profilecard-reports-avatar-group",
|
|
81
|
+
showMoreButtonProps: showMoreButtonProps
|
|
71
82
|
})));
|
|
72
83
|
};
|
|
73
84
|
export default ReportingLinesDetails;
|
package/dist/es2019/messages.js
CHANGED
|
@@ -159,6 +159,16 @@ const messages = defineMessages({
|
|
|
159
159
|
id: 'pt.profile-card.more-icon-label',
|
|
160
160
|
defaultMessage: 'More',
|
|
161
161
|
description: 'Label for the meatballs icon on the profile card, which when clicked will provide more options'
|
|
162
|
+
},
|
|
163
|
+
profileCardMoreReportingLinesLabel: {
|
|
164
|
+
id: 'pt.user-profile-card.reporting-lines.more-icon-label',
|
|
165
|
+
defaultMessage: '+{count} more {count, plural, one {profile} other {profiles}}',
|
|
166
|
+
description: 'Label for the "more profiles" indicator in the reporting lines section of the user profile card'
|
|
167
|
+
},
|
|
168
|
+
profileCardMoreMembersLabel: {
|
|
169
|
+
id: 'pt.team.profile-card.members.more-icon-label',
|
|
170
|
+
defaultMessage: '+{count} more {count, plural, one {members} other {members}}',
|
|
171
|
+
description: 'Label for the "more members" indicator in the members section of the team profile card'
|
|
162
172
|
}
|
|
163
173
|
});
|
|
164
174
|
export default messages;
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "22.2.
|
|
35
|
+
packageVersion: "22.2.4",
|
|
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', "22.2.
|
|
7
|
+
headers.append('atl-client-version', "22.2.4");
|
|
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', "22.2.
|
|
60
|
+
headers.append('atl-client-version', "22.2.4");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
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; }
|
|
7
7
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
9
9
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
10
10
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
11
11
|
import Button from '@atlaskit/button/standard-button';
|
|
@@ -29,6 +29,7 @@ import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
|
29
29
|
import TeamLoadingState from './TeamLoadingState';
|
|
30
30
|
var LARGE_MEMBER_COUNT = 50;
|
|
31
31
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
32
|
+
var avatarGroupMaxCount = 9;
|
|
32
33
|
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
33
34
|
return function (event) {
|
|
34
35
|
analytics(function (duration) {
|
|
@@ -50,6 +51,8 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
50
51
|
members = _ref.members,
|
|
51
52
|
onUserClick = _ref.onUserClick,
|
|
52
53
|
includingYou = _ref.includingYou;
|
|
54
|
+
var _useIntl = useIntl(),
|
|
55
|
+
formatMessage = _useIntl.formatMessage;
|
|
53
56
|
var count = members ? members.length : 0;
|
|
54
57
|
var message = includingYou ? count >= LARGE_MEMBER_COUNT ? messages.membersMoreThan50IncludingYou : messages.memberCountIncludingYou : count >= LARGE_MEMBER_COUNT ? messages.membersMoreThan50 : messages.memberCount;
|
|
55
58
|
|
|
@@ -68,6 +71,13 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
68
71
|
}
|
|
69
72
|
isMoreMembersOpen.current = !isOpen;
|
|
70
73
|
}, [analytics, count]);
|
|
74
|
+
var showMoreButtonProps = _objectSpread({
|
|
75
|
+
onClick: onMoreClick
|
|
76
|
+
}, fg('platform_profilecard-enable_reporting_lines_label') ? {
|
|
77
|
+
'aria-label': formatMessage(messages.profileCardMoreMembersLabel, {
|
|
78
|
+
count: count - avatarGroupMaxCount + 1
|
|
79
|
+
})
|
|
80
|
+
} : {});
|
|
71
81
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MemberCount, null, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
72
82
|
values: {
|
|
73
83
|
count: count
|
|
@@ -85,10 +95,8 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
85
95
|
onClick: onClick
|
|
86
96
|
};
|
|
87
97
|
}),
|
|
88
|
-
maxCount:
|
|
89
|
-
showMoreButtonProps:
|
|
90
|
-
onClick: onMoreClick
|
|
91
|
-
},
|
|
98
|
+
maxCount: avatarGroupMaxCount,
|
|
99
|
+
showMoreButtonProps: showMoreButtonProps,
|
|
92
100
|
testId: "profilecard-avatar-group"
|
|
93
101
|
})));
|
|
94
102
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
2
|
+
import { FormattedMessage, useIntl } 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';
|
|
6
7
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
8
|
import messages from '../../messages';
|
|
8
9
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
@@ -19,8 +20,11 @@ var reportingLinesHeadingDefaultStyles = xcss({
|
|
|
19
20
|
var reportingLinesHeadingStyles = xcss({
|
|
20
21
|
marginBottom: '0'
|
|
21
22
|
});
|
|
23
|
+
var avatarGroupMaxCount = 5;
|
|
22
24
|
var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
23
25
|
var _manager$pii, _manager$pii2;
|
|
26
|
+
var _useIntl = useIntl(),
|
|
27
|
+
formatMessage = _useIntl.formatMessage;
|
|
24
28
|
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
25
29
|
_props$reportingLines = props.reportingLines,
|
|
26
30
|
reportingLines = _props$reportingLines === void 0 ? {} : _props$reportingLines,
|
|
@@ -43,6 +47,11 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
43
47
|
onReportingLinesClick(user);
|
|
44
48
|
} : undefined;
|
|
45
49
|
};
|
|
50
|
+
var showMoreButtonProps = fg('platform_profilecard-enable_reporting_lines_label') ? {
|
|
51
|
+
'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
|
|
52
|
+
count: reports.length - avatarGroupMaxCount + 1
|
|
53
|
+
})
|
|
54
|
+
} : undefined;
|
|
46
55
|
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
47
56
|
xcss: [reportingLinesHeadingDefaultStyles, reportingLinesHeadingStyles]
|
|
48
57
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)), /*#__PURE__*/React.createElement(OffsetWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -69,8 +78,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
69
78
|
onClick: getReportingLinesOnClick(member, 'direct-report')
|
|
70
79
|
};
|
|
71
80
|
}),
|
|
72
|
-
maxCount:
|
|
73
|
-
testId: "profilecard-reports-avatar-group"
|
|
81
|
+
maxCount: avatarGroupMaxCount,
|
|
82
|
+
testId: "profilecard-reports-avatar-group",
|
|
83
|
+
showMoreButtonProps: showMoreButtonProps
|
|
74
84
|
})));
|
|
75
85
|
};
|
|
76
86
|
export default ReportingLinesDetails;
|
package/dist/esm/messages.js
CHANGED
|
@@ -159,6 +159,16 @@ var messages = defineMessages({
|
|
|
159
159
|
id: 'pt.profile-card.more-icon-label',
|
|
160
160
|
defaultMessage: 'More',
|
|
161
161
|
description: 'Label for the meatballs icon on the profile card, which when clicked will provide more options'
|
|
162
|
+
},
|
|
163
|
+
profileCardMoreReportingLinesLabel: {
|
|
164
|
+
id: 'pt.user-profile-card.reporting-lines.more-icon-label',
|
|
165
|
+
defaultMessage: '+{count} more {count, plural, one {profile} other {profiles}}',
|
|
166
|
+
description: 'Label for the "more profiles" indicator in the reporting lines section of the user profile card'
|
|
167
|
+
},
|
|
168
|
+
profileCardMoreMembersLabel: {
|
|
169
|
+
id: 'pt.team.profile-card.members.more-icon-label',
|
|
170
|
+
defaultMessage: '+{count} more {count, plural, one {members} other {members}}',
|
|
171
|
+
description: 'Label for the "more members" indicator in the members section of the team profile card'
|
|
162
172
|
}
|
|
163
173
|
});
|
|
164
174
|
export default messages;
|
|
@@ -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: "22.2.
|
|
42
|
+
packageVersion: "22.2.4"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -159,5 +159,15 @@ declare const messages: {
|
|
|
159
159
|
defaultMessage: string;
|
|
160
160
|
description: string;
|
|
161
161
|
};
|
|
162
|
+
profileCardMoreReportingLinesLabel: {
|
|
163
|
+
id: string;
|
|
164
|
+
defaultMessage: string;
|
|
165
|
+
description: string;
|
|
166
|
+
};
|
|
167
|
+
profileCardMoreMembersLabel: {
|
|
168
|
+
id: string;
|
|
169
|
+
defaultMessage: string;
|
|
170
|
+
description: string;
|
|
171
|
+
};
|
|
162
172
|
};
|
|
163
173
|
export default messages;
|
|
@@ -159,5 +159,15 @@ declare const messages: {
|
|
|
159
159
|
defaultMessage: string;
|
|
160
160
|
description: string;
|
|
161
161
|
};
|
|
162
|
+
profileCardMoreReportingLinesLabel: {
|
|
163
|
+
id: string;
|
|
164
|
+
defaultMessage: string;
|
|
165
|
+
description: string;
|
|
166
|
+
};
|
|
167
|
+
profileCardMoreMembersLabel: {
|
|
168
|
+
id: string;
|
|
169
|
+
defaultMessage: string;
|
|
170
|
+
description: string;
|
|
171
|
+
};
|
|
162
172
|
};
|
|
163
173
|
export default messages;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.4",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/empty-state": "^8.3.0",
|
|
61
61
|
"@atlaskit/focus-ring": "^2.1.0",
|
|
62
62
|
"@atlaskit/give-kudos": "^3.2.0",
|
|
63
|
-
"@atlaskit/icon": "^23.
|
|
63
|
+
"@atlaskit/icon": "^23.11.0",
|
|
64
64
|
"@atlaskit/lozenge": "^11.14.0",
|
|
65
65
|
"@atlaskit/menu": "^2.14.0",
|
|
66
66
|
"@atlaskit/modal-dialog": "^12.20.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
69
69
|
"@atlaskit/popup": "^1.32.0",
|
|
70
70
|
"@atlaskit/primitives": "^13.6.0",
|
|
71
|
-
"@atlaskit/rovo-agent-components": "^1.
|
|
72
|
-
"@atlaskit/rovo-triggers": "^1.
|
|
71
|
+
"@atlaskit/rovo-agent-components": "^1.19.0",
|
|
72
|
+
"@atlaskit/rovo-triggers": "^1.6.0",
|
|
73
73
|
"@atlaskit/spinner": "^17.2.0",
|
|
74
74
|
"@atlaskit/theme": "^16.0.0",
|
|
75
75
|
"@atlaskit/tokens": "^3.3.0",
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
},
|
|
153
153
|
"fix_profilecard_trigger_isvisible": {
|
|
154
154
|
"type": "boolean"
|
|
155
|
+
},
|
|
156
|
+
"platform_profilecard-enable_reporting_lines_label": {
|
|
157
|
+
"type": "boolean"
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
}
|