@atlaskit/profilecard 24.27.0 → 24.27.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 +14 -0
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Error/ErrorMessage.js +7 -13
- package/dist/cjs/components/Team/TeamProfileCard.js +1 -1
- package/dist/cjs/components/User/ProfileCardDetails.js +2 -2
- package/dist/cjs/messages.js +30 -0
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Error/ErrorMessage.js +7 -13
- package/dist/es2019/components/Team/TeamProfileCard.js +1 -1
- package/dist/es2019/components/User/ProfileCardDetails.js +2 -2
- package/dist/es2019/messages.js +30 -0
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Error/ErrorMessage.js +7 -13
- package/dist/esm/components/Team/TeamProfileCard.js +1 -1
- package/dist/esm/components/User/ProfileCardDetails.js +2 -2
- package/dist/esm/messages.js +30 -0
- package/dist/esm/util/analytics.js +2 -2
- package/dist/types/messages.d.ts +30 -0
- package/dist/types-ts4.5/messages.d.ts +30 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 24.27.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`613a14991e82d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/613a14991e82d) -
|
|
8
|
+
Add translated message for static values
|
|
9
|
+
|
|
10
|
+
## 24.27.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`fabb0aebeb635`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fabb0aebeb635) -
|
|
15
|
+
Add translations for static values
|
|
16
|
+
|
|
3
17
|
## 24.27.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
|
|
|
11
11
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
12
12
|
var addHeaders = function addHeaders(headers) {
|
|
13
13
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
14
|
-
headers.append('atl-client-version', "
|
|
14
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
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', "
|
|
69
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
12
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
12
13
|
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
|
|
13
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
|
+
var _messages = _interopRequireDefault(require("../../messages"));
|
|
15
17
|
var _Error = require("../../styled/Error");
|
|
16
18
|
var _analytics = require("../../util/analytics");
|
|
17
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -42,19 +44,11 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
42
44
|
}, [errorReason, fireAnalytics, fireAnalyticsNext, hasRetry]);
|
|
43
45
|
var errorContent = function errorContent() {
|
|
44
46
|
if (errorReason === 'NotFound') {
|
|
45
|
-
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_Error.ErrorTitle, null, "The user is no longer available for the site");
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_Error.ErrorTitle, null, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.errorUserNotFound) : 'The user is no longer available for the site');
|
|
47
48
|
}
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_react.default.createElement(_Error.ErrorTitle, null, "Oops, looks like we\u2019re having issues", /*#__PURE__*/_react.default.createElement("br", null), reload &&
|
|
52
|
-
/*#__PURE__*/
|
|
53
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
54
|
-
_react.default.createElement(_compiled.Text, {
|
|
55
|
-
color: "color.text.subtlest"
|
|
56
|
-
}, "Try again and we\u2019ll give it another shot"))
|
|
57
|
-
);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_Error.ErrorTitle, null, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.errorGeneric) : 'Oops, looks like we’re having issues', /*#__PURE__*/_react.default.createElement("br", null), reload && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
50
|
+
color: "color.text.subtlest"
|
|
51
|
+
}, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.errorRetrySuggestion) : 'Try again and we’ll give it another shot'));
|
|
58
52
|
};
|
|
59
53
|
return /*#__PURE__*/_react.default.createElement(_Error.ErrorWrapper, {
|
|
60
54
|
testId: "profilecard-error"
|
|
@@ -62,6 +56,6 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
62
56
|
label: "icon error"
|
|
63
57
|
}), errorContent(), reload && /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
64
58
|
onClick: reload
|
|
65
|
-
},
|
|
59
|
+
}, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.errorTryAgain) : 'Try again'));
|
|
66
60
|
};
|
|
67
61
|
var _default = exports.default = ErrorMessage;
|
|
@@ -309,7 +309,7 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
309
309
|
viewProfileOnClick = _ref5.viewProfileOnClick,
|
|
310
310
|
isTriggeredByKeyboard = _ref5.isTriggeredByKeyboard;
|
|
311
311
|
var newTeamProfileEnabled = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
312
|
-
var isTeamArchived = team.state === 'DISBANDED' &&
|
|
312
|
+
var isTeamArchived = team.state === 'DISBANDED' && newTeamProfileEnabled;
|
|
313
313
|
var allActions = [{
|
|
314
314
|
label: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.teamViewProfile),
|
|
315
315
|
link: viewProfileLink,
|
|
@@ -98,12 +98,12 @@ var CustomLozenges = function CustomLozenges(_ref) {
|
|
|
98
98
|
var ServiceAccountProfileCardDetails = function ServiceAccountProfileCardDetails(props) {
|
|
99
99
|
var fullName = props.fullName,
|
|
100
100
|
nickname = props.nickname;
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/_react.default.createElement(_Card.AppTitleLabel, null,
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/_react.default.createElement(_Card.AppTitleLabel, null, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.serviceAccountLabel) : 'SERVICE ACCOUNT'));
|
|
102
102
|
};
|
|
103
103
|
var BotProfileCardDetails = function BotProfileCardDetails(props) {
|
|
104
104
|
var fullName = props.fullName,
|
|
105
105
|
nickname = props.nickname;
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/_react.default.createElement(_Card.AppTitleLabel, null,
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/_react.default.createElement(_Card.AppTitleLabel, null, (0, _platformFeatureFlags.fg)('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.default.botAccountLabel) : 'APP'));
|
|
107
107
|
};
|
|
108
108
|
var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
|
|
109
109
|
var companyName = props.companyName,
|
package/dist/cjs/messages.js
CHANGED
|
@@ -191,6 +191,36 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
191
191
|
id: 'pt.team-profile-card.archived-lozenge',
|
|
192
192
|
defaultMessage: 'Archived',
|
|
193
193
|
description: 'Lozenge to indicate that a team is archived'
|
|
194
|
+
},
|
|
195
|
+
errorUserNotFound: {
|
|
196
|
+
id: 'pt.profile-card.error.user-not-found',
|
|
197
|
+
defaultMessage: 'The user is no longer available for the site',
|
|
198
|
+
description: 'Error message shown when the user is not found'
|
|
199
|
+
},
|
|
200
|
+
errorGeneric: {
|
|
201
|
+
id: 'pt.profile-card.error.generic',
|
|
202
|
+
defaultMessage: 'Oops, looks like we’re having issues',
|
|
203
|
+
description: 'Generic error message shown when there is an issue loading the profile card'
|
|
204
|
+
},
|
|
205
|
+
errorRetrySuggestion: {
|
|
206
|
+
id: 'pt.profile-card.error.retry-suggestion',
|
|
207
|
+
defaultMessage: 'Try again and we’ll give it another shot',
|
|
208
|
+
description: 'Suggestion message shown to the user to retry loading the profile card'
|
|
209
|
+
},
|
|
210
|
+
errorTryAgain: {
|
|
211
|
+
id: 'pt.profile-card.error.try-again-button',
|
|
212
|
+
defaultMessage: 'Try again',
|
|
213
|
+
description: 'Label for the button to retry loading the profile card after an error'
|
|
214
|
+
},
|
|
215
|
+
serviceAccountLabel: {
|
|
216
|
+
id: 'pt.profile-card.service-account.label',
|
|
217
|
+
defaultMessage: 'SERVICE ACCOUNT',
|
|
218
|
+
description: 'Label to indicate that the user is a service account'
|
|
219
|
+
},
|
|
220
|
+
botAccountLabel: {
|
|
221
|
+
id: 'pt.profile-card.bot-account.label',
|
|
222
|
+
defaultMessage: 'APP',
|
|
223
|
+
description: 'Label to indicate that the user is a bot account'
|
|
194
224
|
}
|
|
195
225
|
});
|
|
196
226
|
var _default = exports.default = messages;
|
|
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
14
14
|
var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
|
|
15
15
|
packageName: "@atlaskit/profilecard",
|
|
16
|
-
packageVersion: "
|
|
16
|
+
packageVersion: "0.0.0-development"
|
|
17
17
|
};
|
|
18
18
|
var runItLater = function runItLater(cb) {
|
|
19
19
|
var requestIdleCallback = window.requestIdleCallback;
|
|
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
58
58
|
actionSubjectId: actionSubjectId,
|
|
59
59
|
attributes: _objectSpread(_objectSpread({
|
|
60
60
|
packageName: "@atlaskit/profilecard",
|
|
61
|
-
packageVersion: "
|
|
61
|
+
packageVersion: "0.0.0-development"
|
|
62
62
|
}, attributes), {}, {
|
|
63
63
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
64
64
|
})
|
|
@@ -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', "
|
|
9
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
|
|
|
78
78
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
79
79
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
80
80
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
81
|
-
headers.append('atl-client-version', "
|
|
81
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
82
82
|
return headers;
|
|
83
83
|
};
|
|
84
84
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
2
3
|
import Button from '@atlaskit/button/new';
|
|
3
4
|
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
4
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import messages from '../../messages';
|
|
6
8
|
import { ErrorTitle, ErrorWrapper } from '../../styled/Error';
|
|
7
9
|
import { PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
8
10
|
const ErrorMessage = props => {
|
|
@@ -33,19 +35,11 @@ const ErrorMessage = props => {
|
|
|
33
35
|
}, [errorReason, fireAnalytics, fireAnalyticsNext, hasRetry]);
|
|
34
36
|
const errorContent = () => {
|
|
35
37
|
if (errorReason === 'NotFound') {
|
|
36
|
-
|
|
37
|
-
return /*#__PURE__*/React.createElement(ErrorTitle, null, "The user is no longer available for the site");
|
|
38
|
+
return /*#__PURE__*/React.createElement(ErrorTitle, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorUserNotFound) : 'The user is no longer available for the site');
|
|
38
39
|
}
|
|
39
|
-
return (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
React.createElement(ErrorTitle, null, "Oops, looks like we\u2019re having issues", /*#__PURE__*/React.createElement("br", null), reload &&
|
|
43
|
-
/*#__PURE__*/
|
|
44
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
45
|
-
React.createElement(Text, {
|
|
46
|
-
color: "color.text.subtlest"
|
|
47
|
-
}, "Try again and we\u2019ll give it another shot"))
|
|
48
|
-
);
|
|
40
|
+
return /*#__PURE__*/React.createElement(ErrorTitle, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorGeneric) : 'Oops, looks like we’re having issues', /*#__PURE__*/React.createElement("br", null), reload && /*#__PURE__*/React.createElement(Text, {
|
|
41
|
+
color: "color.text.subtlest"
|
|
42
|
+
}, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorRetrySuggestion) : 'Try again and we’ll give it another shot'));
|
|
49
43
|
};
|
|
50
44
|
return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
51
45
|
testId: "profilecard-error"
|
|
@@ -53,6 +47,6 @@ const ErrorMessage = props => {
|
|
|
53
47
|
label: "icon error"
|
|
54
48
|
}), errorContent(), reload && /*#__PURE__*/React.createElement(Button, {
|
|
55
49
|
onClick: reload
|
|
56
|
-
},
|
|
50
|
+
}, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorTryAgain) : 'Try again'));
|
|
57
51
|
};
|
|
58
52
|
export default ErrorMessage;
|
|
@@ -273,7 +273,7 @@ const TeamProfilecardContent = ({
|
|
|
273
273
|
isTriggeredByKeyboard
|
|
274
274
|
}) => {
|
|
275
275
|
const newTeamProfileEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
276
|
-
const isTeamArchived = team.state === 'DISBANDED' &&
|
|
276
|
+
const isTeamArchived = team.state === 'DISBANDED' && newTeamProfileEnabled;
|
|
277
277
|
const allActions = [{
|
|
278
278
|
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.teamViewProfile),
|
|
279
279
|
link: viewProfileLink,
|
|
@@ -87,14 +87,14 @@ const ServiceAccountProfileCardDetails = props => {
|
|
|
87
87
|
fullName,
|
|
88
88
|
nickname
|
|
89
89
|
} = props;
|
|
90
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null,
|
|
90
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.serviceAccountLabel) : 'SERVICE ACCOUNT'));
|
|
91
91
|
};
|
|
92
92
|
const BotProfileCardDetails = props => {
|
|
93
93
|
const {
|
|
94
94
|
fullName,
|
|
95
95
|
nickname
|
|
96
96
|
} = props;
|
|
97
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null,
|
|
97
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.botAccountLabel) : 'APP'));
|
|
98
98
|
};
|
|
99
99
|
const DisabledProfileCardDetails = props => {
|
|
100
100
|
const {
|
package/dist/es2019/messages.js
CHANGED
|
@@ -185,6 +185,36 @@ const messages = defineMessages({
|
|
|
185
185
|
id: 'pt.team-profile-card.archived-lozenge',
|
|
186
186
|
defaultMessage: 'Archived',
|
|
187
187
|
description: 'Lozenge to indicate that a team is archived'
|
|
188
|
+
},
|
|
189
|
+
errorUserNotFound: {
|
|
190
|
+
id: 'pt.profile-card.error.user-not-found',
|
|
191
|
+
defaultMessage: 'The user is no longer available for the site',
|
|
192
|
+
description: 'Error message shown when the user is not found'
|
|
193
|
+
},
|
|
194
|
+
errorGeneric: {
|
|
195
|
+
id: 'pt.profile-card.error.generic',
|
|
196
|
+
defaultMessage: 'Oops, looks like we’re having issues',
|
|
197
|
+
description: 'Generic error message shown when there is an issue loading the profile card'
|
|
198
|
+
},
|
|
199
|
+
errorRetrySuggestion: {
|
|
200
|
+
id: 'pt.profile-card.error.retry-suggestion',
|
|
201
|
+
defaultMessage: 'Try again and we’ll give it another shot',
|
|
202
|
+
description: 'Suggestion message shown to the user to retry loading the profile card'
|
|
203
|
+
},
|
|
204
|
+
errorTryAgain: {
|
|
205
|
+
id: 'pt.profile-card.error.try-again-button',
|
|
206
|
+
defaultMessage: 'Try again',
|
|
207
|
+
description: 'Label for the button to retry loading the profile card after an error'
|
|
208
|
+
},
|
|
209
|
+
serviceAccountLabel: {
|
|
210
|
+
id: 'pt.profile-card.service-account.label',
|
|
211
|
+
defaultMessage: 'SERVICE ACCOUNT',
|
|
212
|
+
description: 'Label to indicate that the user is a service account'
|
|
213
|
+
},
|
|
214
|
+
botAccountLabel: {
|
|
215
|
+
id: 'pt.profile-card.bot-account.label',
|
|
216
|
+
defaultMessage: 'APP',
|
|
217
|
+
description: 'Label to indicate that the user is a bot account'
|
|
188
218
|
}
|
|
189
219
|
});
|
|
190
220
|
export default messages;
|
|
@@ -4,7 +4,7 @@ import { getPageTime } from './performance';
|
|
|
4
4
|
const ANALYTICS_CHANNEL = 'peopleTeams';
|
|
5
5
|
export const PACKAGE_META_DATA = {
|
|
6
6
|
packageName: "@atlaskit/profilecard",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
const runItLater = cb => {
|
|
10
10
|
const requestIdleCallback = window.requestIdleCallback;
|
|
@@ -45,7 +45,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
45
45
|
actionSubjectId,
|
|
46
46
|
attributes: {
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "
|
|
48
|
+
packageVersion: "0.0.0-development",
|
|
49
49
|
...attributes,
|
|
50
50
|
firedAt: Math.round(getPageTime())
|
|
51
51
|
}
|
|
@@ -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', "
|
|
7
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
59
59
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
60
60
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
61
61
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
62
|
-
headers.append('atl-client-version', "
|
|
62
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
63
63
|
return headers;
|
|
64
64
|
};
|
|
65
65
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -2,10 +2,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
5
6
|
import Button from '@atlaskit/button/new';
|
|
6
7
|
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
7
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import messages from '../../messages';
|
|
9
11
|
import { ErrorTitle, ErrorWrapper } from '../../styled/Error';
|
|
10
12
|
import { PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
11
13
|
var ErrorMessage = function ErrorMessage(props) {
|
|
@@ -33,19 +35,11 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
33
35
|
}, [errorReason, fireAnalytics, fireAnalyticsNext, hasRetry]);
|
|
34
36
|
var errorContent = function errorContent() {
|
|
35
37
|
if (errorReason === 'NotFound') {
|
|
36
|
-
|
|
37
|
-
return /*#__PURE__*/React.createElement(ErrorTitle, null, "The user is no longer available for the site");
|
|
38
|
+
return /*#__PURE__*/React.createElement(ErrorTitle, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorUserNotFound) : 'The user is no longer available for the site');
|
|
38
39
|
}
|
|
39
|
-
return (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
React.createElement(ErrorTitle, null, "Oops, looks like we\u2019re having issues", /*#__PURE__*/React.createElement("br", null), reload &&
|
|
43
|
-
/*#__PURE__*/
|
|
44
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
45
|
-
React.createElement(Text, {
|
|
46
|
-
color: "color.text.subtlest"
|
|
47
|
-
}, "Try again and we\u2019ll give it another shot"))
|
|
48
|
-
);
|
|
40
|
+
return /*#__PURE__*/React.createElement(ErrorTitle, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorGeneric) : 'Oops, looks like we’re having issues', /*#__PURE__*/React.createElement("br", null), reload && /*#__PURE__*/React.createElement(Text, {
|
|
41
|
+
color: "color.text.subtlest"
|
|
42
|
+
}, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorRetrySuggestion) : 'Try again and we’ll give it another shot'));
|
|
49
43
|
};
|
|
50
44
|
return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
51
45
|
testId: "profilecard-error"
|
|
@@ -53,6 +47,6 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
53
47
|
label: "icon error"
|
|
54
48
|
}), errorContent(), reload && /*#__PURE__*/React.createElement(Button, {
|
|
55
49
|
onClick: reload
|
|
56
|
-
},
|
|
50
|
+
}, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.errorTryAgain) : 'Try again'));
|
|
57
51
|
};
|
|
58
52
|
export default ErrorMessage;
|
|
@@ -300,7 +300,7 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
300
300
|
viewProfileOnClick = _ref5.viewProfileOnClick,
|
|
301
301
|
isTriggeredByKeyboard = _ref5.isTriggeredByKeyboard;
|
|
302
302
|
var newTeamProfileEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
303
|
-
var isTeamArchived = team.state === 'DISBANDED' &&
|
|
303
|
+
var isTeamArchived = team.state === 'DISBANDED' && newTeamProfileEnabled;
|
|
304
304
|
var allActions = [{
|
|
305
305
|
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.teamViewProfile),
|
|
306
306
|
link: viewProfileLink,
|
|
@@ -89,12 +89,12 @@ var CustomLozenges = function CustomLozenges(_ref) {
|
|
|
89
89
|
var ServiceAccountProfileCardDetails = function ServiceAccountProfileCardDetails(props) {
|
|
90
90
|
var fullName = props.fullName,
|
|
91
91
|
nickname = props.nickname;
|
|
92
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null,
|
|
92
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.serviceAccountLabel) : 'SERVICE ACCOUNT'));
|
|
93
93
|
};
|
|
94
94
|
var BotProfileCardDetails = function BotProfileCardDetails(props) {
|
|
95
95
|
var fullName = props.fullName,
|
|
96
96
|
nickname = props.nickname;
|
|
97
|
-
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null,
|
|
97
|
+
return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null, fg('people-teams-fix-no-literal-string-in-jsx') ? /*#__PURE__*/React.createElement(FormattedMessage, messages.botAccountLabel) : 'APP'));
|
|
98
98
|
};
|
|
99
99
|
var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
|
|
100
100
|
var companyName = props.companyName,
|
package/dist/esm/messages.js
CHANGED
|
@@ -185,6 +185,36 @@ var messages = defineMessages({
|
|
|
185
185
|
id: 'pt.team-profile-card.archived-lozenge',
|
|
186
186
|
defaultMessage: 'Archived',
|
|
187
187
|
description: 'Lozenge to indicate that a team is archived'
|
|
188
|
+
},
|
|
189
|
+
errorUserNotFound: {
|
|
190
|
+
id: 'pt.profile-card.error.user-not-found',
|
|
191
|
+
defaultMessage: 'The user is no longer available for the site',
|
|
192
|
+
description: 'Error message shown when the user is not found'
|
|
193
|
+
},
|
|
194
|
+
errorGeneric: {
|
|
195
|
+
id: 'pt.profile-card.error.generic',
|
|
196
|
+
defaultMessage: 'Oops, looks like we’re having issues',
|
|
197
|
+
description: 'Generic error message shown when there is an issue loading the profile card'
|
|
198
|
+
},
|
|
199
|
+
errorRetrySuggestion: {
|
|
200
|
+
id: 'pt.profile-card.error.retry-suggestion',
|
|
201
|
+
defaultMessage: 'Try again and we’ll give it another shot',
|
|
202
|
+
description: 'Suggestion message shown to the user to retry loading the profile card'
|
|
203
|
+
},
|
|
204
|
+
errorTryAgain: {
|
|
205
|
+
id: 'pt.profile-card.error.try-again-button',
|
|
206
|
+
defaultMessage: 'Try again',
|
|
207
|
+
description: 'Label for the button to retry loading the profile card after an error'
|
|
208
|
+
},
|
|
209
|
+
serviceAccountLabel: {
|
|
210
|
+
id: 'pt.profile-card.service-account.label',
|
|
211
|
+
defaultMessage: 'SERVICE ACCOUNT',
|
|
212
|
+
description: 'Label to indicate that the user is a service account'
|
|
213
|
+
},
|
|
214
|
+
botAccountLabel: {
|
|
215
|
+
id: 'pt.profile-card.bot-account.label',
|
|
216
|
+
defaultMessage: 'APP',
|
|
217
|
+
description: 'Label to indicate that the user is a bot account'
|
|
188
218
|
}
|
|
189
219
|
});
|
|
190
220
|
export default messages;
|
|
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
|
|
|
7
7
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
8
8
|
export var PACKAGE_META_DATA = {
|
|
9
9
|
packageName: "@atlaskit/profilecard",
|
|
10
|
-
packageVersion: "
|
|
10
|
+
packageVersion: "0.0.0-development"
|
|
11
11
|
};
|
|
12
12
|
var runItLater = function runItLater(cb) {
|
|
13
13
|
var requestIdleCallback = window.requestIdleCallback;
|
|
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
52
52
|
actionSubjectId: actionSubjectId,
|
|
53
53
|
attributes: _objectSpread(_objectSpread({
|
|
54
54
|
packageName: "@atlaskit/profilecard",
|
|
55
|
-
packageVersion: "
|
|
55
|
+
packageVersion: "0.0.0-development"
|
|
56
56
|
}, attributes), {}, {
|
|
57
57
|
firedAt: Math.round(getPageTime())
|
|
58
58
|
})
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -184,5 +184,35 @@ declare const messages: {
|
|
|
184
184
|
defaultMessage: string;
|
|
185
185
|
description: string;
|
|
186
186
|
};
|
|
187
|
+
errorUserNotFound: {
|
|
188
|
+
id: string;
|
|
189
|
+
defaultMessage: string;
|
|
190
|
+
description: string;
|
|
191
|
+
};
|
|
192
|
+
errorGeneric: {
|
|
193
|
+
id: string;
|
|
194
|
+
defaultMessage: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
errorRetrySuggestion: {
|
|
198
|
+
id: string;
|
|
199
|
+
defaultMessage: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
errorTryAgain: {
|
|
203
|
+
id: string;
|
|
204
|
+
defaultMessage: string;
|
|
205
|
+
description: string;
|
|
206
|
+
};
|
|
207
|
+
serviceAccountLabel: {
|
|
208
|
+
id: string;
|
|
209
|
+
defaultMessage: string;
|
|
210
|
+
description: string;
|
|
211
|
+
};
|
|
212
|
+
botAccountLabel: {
|
|
213
|
+
id: string;
|
|
214
|
+
defaultMessage: string;
|
|
215
|
+
description: string;
|
|
216
|
+
};
|
|
187
217
|
};
|
|
188
218
|
export default messages;
|
|
@@ -184,5 +184,35 @@ declare const messages: {
|
|
|
184
184
|
defaultMessage: string;
|
|
185
185
|
description: string;
|
|
186
186
|
};
|
|
187
|
+
errorUserNotFound: {
|
|
188
|
+
id: string;
|
|
189
|
+
defaultMessage: string;
|
|
190
|
+
description: string;
|
|
191
|
+
};
|
|
192
|
+
errorGeneric: {
|
|
193
|
+
id: string;
|
|
194
|
+
defaultMessage: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
errorRetrySuggestion: {
|
|
198
|
+
id: string;
|
|
199
|
+
defaultMessage: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
errorTryAgain: {
|
|
203
|
+
id: string;
|
|
204
|
+
defaultMessage: string;
|
|
205
|
+
description: string;
|
|
206
|
+
};
|
|
207
|
+
serviceAccountLabel: {
|
|
208
|
+
id: string;
|
|
209
|
+
defaultMessage: string;
|
|
210
|
+
description: string;
|
|
211
|
+
};
|
|
212
|
+
botAccountLabel: {
|
|
213
|
+
id: string;
|
|
214
|
+
defaultMessage: string;
|
|
215
|
+
description: string;
|
|
216
|
+
};
|
|
187
217
|
};
|
|
188
218
|
export default messages;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "24.27.
|
|
3
|
+
"version": "24.27.2",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
50
50
|
"@atlaskit/empty-state": "^10.1.0",
|
|
51
51
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
52
|
-
"@atlaskit/give-kudos": "^4.
|
|
52
|
+
"@atlaskit/give-kudos": "^4.5.0",
|
|
53
53
|
"@atlaskit/heading": "^5.2.0",
|
|
54
54
|
"@atlaskit/icon": "^29.3.0",
|
|
55
|
-
"@atlaskit/lozenge": "^13.
|
|
55
|
+
"@atlaskit/lozenge": "^13.3.0",
|
|
56
56
|
"@atlaskit/menu": "^8.4.0",
|
|
57
57
|
"@atlaskit/modal-dialog": "^14.9.0",
|
|
58
58
|
"@atlaskit/people-teams-ui-public": "^3.7.0",
|
|
59
59
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
60
60
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
61
|
-
"@atlaskit/popup": "^4.
|
|
61
|
+
"@atlaskit/popup": "^4.9.0",
|
|
62
62
|
"@atlaskit/primitives": "^17.0.0",
|
|
63
63
|
"@atlaskit/rovo-agent-components": "^3.16.0",
|
|
64
|
-
"@atlaskit/rovo-triggers": "^5.
|
|
64
|
+
"@atlaskit/rovo-triggers": "^5.3.0",
|
|
65
65
|
"@atlaskit/spinner": "^19.0.0",
|
|
66
66
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
67
67
|
"@atlaskit/teams-app-internal-analytics": "^1.23.0",
|
|
@@ -155,14 +155,14 @@
|
|
|
155
155
|
"jira_ai_profilecard_hide_agent_actions": {
|
|
156
156
|
"type": "boolean"
|
|
157
157
|
},
|
|
158
|
-
"legion-enable-archive-teams": {
|
|
159
|
-
"type": "boolean"
|
|
160
|
-
},
|
|
161
158
|
"rovo_agent_empty_state_refresh": {
|
|
162
159
|
"type": "boolean"
|
|
163
160
|
},
|
|
164
161
|
"enable_profilecard_text_truncation_tooltip": {
|
|
165
162
|
"type": "boolean"
|
|
163
|
+
},
|
|
164
|
+
"people-teams-fix-no-literal-string-in-jsx": {
|
|
165
|
+
"type": "boolean"
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
"sideEffects": [
|