@atlaskit/profilecard 19.9.0 → 19.11.0
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 +16 -0
- package/dist/cjs/client/UserProfileCardClient.js +2 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/User/ProfileCard.js +1 -7
- package/dist/cjs/components/User/ProfileCardTriggerNext.js +9 -4
- package/dist/cjs/internal/getLabelMessage.js +28 -0
- package/dist/cjs/mocks/profile-data.js +22 -11
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/UserProfileCardClient.js +2 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/User/ProfileCard.js +2 -8
- package/dist/es2019/components/User/ProfileCardTriggerNext.js +10 -4
- package/dist/es2019/internal/getLabelMessage.js +22 -0
- package/dist/es2019/mocks/profile-data.js +22 -11
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/UserProfileCardClient.js +2 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/User/ProfileCard.js +2 -8
- package/dist/esm/components/User/ProfileCardTriggerNext.js +9 -4
- package/dist/esm/internal/getLabelMessage.js +22 -0
- package/dist/esm/mocks/profile-data.js +22 -11
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/User/ProfileCardTriggerNext.d.ts +1 -1
- package/dist/types/internal/getLabelMessage.d.ts +3 -0
- package/dist/types/mocks/profile-data.d.ts +3 -0
- package/dist/types/types.d.ts +8 -0
- package/dist/types-ts4.5/components/User/ProfileCardTriggerNext.d.ts +1 -1
- package/dist/types-ts4.5/internal/getLabelMessage.d.ts +3 -0
- package/dist/types-ts4.5/mocks/profile-data.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +8 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#72021](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72021) [`bfb147303ac8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfb147303ac8) - Pass fullName props to ProfileCardTrigger, and update aria-label message
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 19.10.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#71508](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71508) [`e6125d2215ef`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e6125d2215ef) - Added accountType prop
|
|
18
|
+
|
|
3
19
|
## 19.9.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -48,7 +48,8 @@ var modifyResponse = exports.modifyResponse = function modifyResponse(response)
|
|
|
48
48
|
meta: data.meta || undefined,
|
|
49
49
|
nickname: data.nickname || undefined,
|
|
50
50
|
companyName: data.companyName || undefined,
|
|
51
|
-
timestring: data.remoteTimeString || undefined
|
|
51
|
+
timestring: data.remoteTimeString || undefined,
|
|
52
|
+
accountType: data.accountType || undefined
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
55
|
|
|
@@ -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', "19.
|
|
60
|
+
headers.append('atl-client-version', "19.11.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -154,12 +154,6 @@ var Actions = function Actions(_ref) {
|
|
|
154
154
|
action.callback.apply(action, [event].concat((0, _toConsumableArray2.default)(args)));
|
|
155
155
|
}
|
|
156
156
|
}, [fireAnalyticsWithDuration]);
|
|
157
|
-
var buttonRef = (0, _react.useRef)(null);
|
|
158
|
-
(0, _react.useEffect)(function () {
|
|
159
|
-
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
160
|
-
buttonRef.current.focus();
|
|
161
|
-
}
|
|
162
|
-
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
163
157
|
if (!actions || actions.length === 0) {
|
|
164
158
|
return null;
|
|
165
159
|
}
|
|
@@ -182,7 +176,7 @@ var Actions = function Actions(_ref) {
|
|
|
182
176
|
return onActionClick(action, args, event, index);
|
|
183
177
|
},
|
|
184
178
|
href: action.link,
|
|
185
|
-
|
|
179
|
+
autoFocus: index === 0 && isTriggeredUsingKeyboard
|
|
186
180
|
}, action.label, isKudos && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null))));
|
|
187
181
|
if (isKudos) {
|
|
188
182
|
return /*#__PURE__*/_react.default.createElement(_Card.AnimatedKudosButton, {
|
|
@@ -14,11 +14,13 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _reactIntlNext = require("react-intl-next");
|
|
17
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
18
19
|
var _giveKudos = require("@atlaskit/give-kudos");
|
|
19
20
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
20
21
|
var _constants = require("@atlaskit/theme/constants");
|
|
21
22
|
var _filterActions = _interopRequireDefault(require("../../internal/filterActions"));
|
|
23
|
+
var _getLabelMessage = _interopRequireDefault(require("../../internal/getLabelMessage"));
|
|
22
24
|
var _Card = require("../../styled/Card");
|
|
23
25
|
var _analytics = require("../../util/analytics");
|
|
24
26
|
var _config = require("../../util/config");
|
|
@@ -44,9 +46,12 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
44
46
|
addFlag = _ref.addFlag,
|
|
45
47
|
onReportingLinesClick = _ref.onReportingLinesClick,
|
|
46
48
|
ariaLabel = _ref.ariaLabel,
|
|
47
|
-
ariaLabelledBy = _ref.ariaLabelledBy
|
|
49
|
+
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
50
|
+
prepopulatedData = _ref.prepopulatedData;
|
|
48
51
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
49
52
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
53
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
54
|
+
formatMessage = _useIntl.formatMessage;
|
|
50
55
|
var _useState = (0, _react.useState)(false),
|
|
51
56
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
52
57
|
isMounted = _useState2[0],
|
|
@@ -136,10 +141,9 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
136
141
|
setVisible(false);
|
|
137
142
|
}, hideDelay));
|
|
138
143
|
}
|
|
139
|
-
setTriggeredUsingKeyboard(false);
|
|
140
144
|
}, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
|
|
141
145
|
var handleKeyboardClose = (0, _react.useCallback)(function (event) {
|
|
142
|
-
if (event.key !== 'Escape') {
|
|
146
|
+
if (event.key && event.key !== 'Escape') {
|
|
143
147
|
return;
|
|
144
148
|
}
|
|
145
149
|
if (triggerRef.current) {
|
|
@@ -271,6 +275,7 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
271
275
|
}, [hideProfilecard, onFocus, onMouseEnter, trigger]);
|
|
272
276
|
var profilecardProps = _objectSpread(_objectSpread({
|
|
273
277
|
userId: userId,
|
|
278
|
+
fullName: prepopulatedData === null || prepopulatedData === void 0 ? void 0 : prepopulatedData.fullName,
|
|
274
279
|
isCurrentUser: data === null || data === void 0 ? void 0 : data.isCurrentUser,
|
|
275
280
|
clientFetchProfile: clientFetchProfile
|
|
276
281
|
}, data), {}, {
|
|
@@ -315,7 +320,7 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
315
320
|
"data-testid": testId,
|
|
316
321
|
role: "button",
|
|
317
322
|
tabIndex: 0,
|
|
318
|
-
"aria-label": ariaLabel,
|
|
323
|
+
"aria-label": (0, _getLabelMessage.default)(ariaLabel, profilecardProps.fullName, formatMessage),
|
|
319
324
|
"aria-labelledby": ariaLabelledBy
|
|
320
325
|
}), children);
|
|
321
326
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var getLabelMessage = function getLabelMessage(ariaLabelProp, fullName, formatMessage) {
|
|
9
|
+
if (ariaLabelProp) {
|
|
10
|
+
return ariaLabelProp;
|
|
11
|
+
}
|
|
12
|
+
return fullName ? formatMessage(messages.label, {
|
|
13
|
+
fullName: fullName
|
|
14
|
+
}) : formatMessage(messages.fallbackLabel);
|
|
15
|
+
};
|
|
16
|
+
var messages = (0, _reactIntlNext.defineMessages)({
|
|
17
|
+
fallbackLabel: {
|
|
18
|
+
id: 'profilecard.user.trigger.fallback-aria-label',
|
|
19
|
+
defaultMessage: 'More information about this user',
|
|
20
|
+
description: 'Label for profile card trigger when we do not have user name'
|
|
21
|
+
},
|
|
22
|
+
label: {
|
|
23
|
+
id: 'profilecard.user.trigger.aria-label',
|
|
24
|
+
defaultMessage: 'More information about {fullName}',
|
|
25
|
+
description: 'Label for profile card trigger'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var _default = exports.default = getLabelMessage;
|
|
@@ -23,7 +23,8 @@ var profiles = [{
|
|
|
23
23
|
meta: 'Manager',
|
|
24
24
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
25
25
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
26
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
26
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
27
|
+
accountType: 'atlassian'
|
|
27
28
|
}
|
|
28
29
|
}, {
|
|
29
30
|
User: {
|
|
@@ -35,7 +36,8 @@ var profiles = [{
|
|
|
35
36
|
meta: 'Senior Developer',
|
|
36
37
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
37
38
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
38
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
39
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
40
|
+
accountType: 'atlassian'
|
|
39
41
|
}
|
|
40
42
|
}, {
|
|
41
43
|
User: {
|
|
@@ -48,7 +50,8 @@ var profiles = [{
|
|
|
48
50
|
status: 'inactive',
|
|
49
51
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
50
52
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
51
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
53
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
54
|
+
accountType: 'atlassian'
|
|
52
55
|
}
|
|
53
56
|
}, {
|
|
54
57
|
User: {
|
|
@@ -56,7 +59,8 @@ var profiles = [{
|
|
|
56
59
|
fullName: 'Cleveland Rodriquez',
|
|
57
60
|
nickname: 'crodriquez',
|
|
58
61
|
email: 'crodriquez@slofast.com',
|
|
59
|
-
meta: 'Manager'
|
|
62
|
+
meta: 'Manager',
|
|
63
|
+
accountType: 'customer'
|
|
60
64
|
}
|
|
61
65
|
}, {
|
|
62
66
|
User: {
|
|
@@ -68,7 +72,8 @@ var profiles = [{
|
|
|
68
72
|
meta: 'Manager',
|
|
69
73
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
70
74
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
71
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
75
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
76
|
+
accountType: 'atlassian'
|
|
72
77
|
}
|
|
73
78
|
}, {
|
|
74
79
|
User: {
|
|
@@ -80,7 +85,8 @@ var profiles = [{
|
|
|
80
85
|
meta: 'Designer',
|
|
81
86
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
82
87
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
83
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
88
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
89
|
+
accountType: 'atlassian'
|
|
84
90
|
}
|
|
85
91
|
}, {
|
|
86
92
|
User: {
|
|
@@ -92,7 +98,8 @@ var profiles = [{
|
|
|
92
98
|
meta: 'Senior Developer',
|
|
93
99
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
94
100
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
95
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
101
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
102
|
+
accountType: 'atlassian'
|
|
96
103
|
}
|
|
97
104
|
}, {
|
|
98
105
|
User: {
|
|
@@ -104,7 +111,8 @@ var profiles = [{
|
|
|
104
111
|
meta: 'Senior Developer',
|
|
105
112
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
106
113
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
107
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
114
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
115
|
+
accountType: 'atlassian'
|
|
108
116
|
}
|
|
109
117
|
}, {
|
|
110
118
|
User: {
|
|
@@ -116,7 +124,8 @@ var profiles = [{
|
|
|
116
124
|
meta: 'Head of Something',
|
|
117
125
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
118
126
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
119
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
127
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
128
|
+
accountType: 'atlassian'
|
|
120
129
|
}
|
|
121
130
|
}, {
|
|
122
131
|
User: {
|
|
@@ -128,7 +137,8 @@ var profiles = [{
|
|
|
128
137
|
meta: 'Senior Designer',
|
|
129
138
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
130
139
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
131
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
140
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
141
|
+
accountType: 'atlassian'
|
|
132
142
|
}
|
|
133
143
|
}, {
|
|
134
144
|
User: {
|
|
@@ -140,7 +150,8 @@ var profiles = [{
|
|
|
140
150
|
meta: 'Senior Designer',
|
|
141
151
|
remoteTimeString: (0, _util.getTimeString)(),
|
|
142
152
|
remoteWeekdayIndex: (0, _util.getWeekday)().index,
|
|
143
|
-
remoteWeekdayString: (0, _util.getWeekday)().string
|
|
153
|
+
remoteWeekdayString: (0, _util.getWeekday)().string,
|
|
154
|
+
accountType: 'atlassian'
|
|
144
155
|
}
|
|
145
156
|
}];
|
|
146
157
|
var _default = exports.default = profiles;
|
|
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
44
44
|
actionSubjectId: actionSubjectId,
|
|
45
45
|
attributes: _objectSpread(_objectSpread({
|
|
46
46
|
packageName: "@atlaskit/profilecard",
|
|
47
|
-
packageVersion: "19.
|
|
47
|
+
packageVersion: "19.11.0"
|
|
48
48
|
}, attributes), {}, {
|
|
49
49
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
50
50
|
})
|
|
@@ -32,7 +32,8 @@ export const modifyResponse = response => {
|
|
|
32
32
|
meta: data.meta || undefined,
|
|
33
33
|
nickname: data.nickname || undefined,
|
|
34
34
|
companyName: data.companyName || undefined,
|
|
35
|
-
timestring: data.remoteTimeString || undefined
|
|
35
|
+
timestring: data.remoteTimeString || undefined,
|
|
36
|
+
accountType: data.accountType || undefined
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -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', "19.
|
|
70
|
+
headers.append('atl-client-version', "19.11.0");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useEffect, useMemo,
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
5
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -140,12 +140,6 @@ const Actions = ({
|
|
|
140
140
|
action.callback(event, ...args);
|
|
141
141
|
}
|
|
142
142
|
}, [fireAnalyticsWithDuration]);
|
|
143
|
-
const buttonRef = useRef(null);
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
146
|
-
buttonRef.current.focus();
|
|
147
|
-
}
|
|
148
|
-
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
149
143
|
if (!actions || actions.length === 0) {
|
|
150
144
|
return null;
|
|
151
145
|
}
|
|
@@ -163,7 +157,7 @@ const Actions = ({
|
|
|
163
157
|
key: action.id || index,
|
|
164
158
|
onClick: (event, ...args) => onActionClick(action, args, event, index),
|
|
165
159
|
href: action.link,
|
|
166
|
-
|
|
160
|
+
autoFocus: index === 0 && isTriggeredUsingKeyboard
|
|
167
161
|
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null))));
|
|
168
162
|
if (isKudos) {
|
|
169
163
|
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
3
4
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
5
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
5
6
|
import Popup from '@atlaskit/popup';
|
|
6
7
|
import { layers } from '@atlaskit/theme/constants';
|
|
7
8
|
import filterActionsInner from '../../internal/filterActions';
|
|
9
|
+
import getLabelMessage from '../../internal/getLabelMessage';
|
|
8
10
|
import { CardWrapper } from '../../styled/Card';
|
|
9
11
|
import { cardTriggered, fireEvent } from '../../util/analytics';
|
|
10
12
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
@@ -22,11 +24,15 @@ export default function ProfilecardTriggerNext({
|
|
|
22
24
|
addFlag,
|
|
23
25
|
onReportingLinesClick,
|
|
24
26
|
ariaLabel,
|
|
25
|
-
ariaLabelledBy
|
|
27
|
+
ariaLabelledBy,
|
|
28
|
+
prepopulatedData
|
|
26
29
|
}) {
|
|
27
30
|
const {
|
|
28
31
|
createAnalyticsEvent
|
|
29
32
|
} = useAnalyticsEvents();
|
|
33
|
+
const {
|
|
34
|
+
formatMessage
|
|
35
|
+
} = useIntl();
|
|
30
36
|
const [isMounted, setIsMounted] = useState(false);
|
|
31
37
|
const showDelay = trigger === 'click' ? 0 : DELAY_MS_SHOW;
|
|
32
38
|
const hideDelay = trigger === 'click' ? 0 : DELAY_MS_HIDE;
|
|
@@ -77,10 +83,9 @@ export default function ProfilecardTriggerNext({
|
|
|
77
83
|
setVisible(false);
|
|
78
84
|
}, hideDelay));
|
|
79
85
|
}
|
|
80
|
-
setTriggeredUsingKeyboard(false);
|
|
81
86
|
}, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
|
|
82
87
|
const handleKeyboardClose = useCallback(event => {
|
|
83
|
-
if (event.key !== 'Escape') {
|
|
88
|
+
if (event.key && event.key !== 'Escape') {
|
|
84
89
|
return;
|
|
85
90
|
}
|
|
86
91
|
if (triggerRef.current) {
|
|
@@ -191,6 +196,7 @@ export default function ProfilecardTriggerNext({
|
|
|
191
196
|
} : {}, [hideProfilecard, onFocus, onMouseEnter, trigger]);
|
|
192
197
|
const profilecardProps = {
|
|
193
198
|
userId: userId,
|
|
199
|
+
fullName: prepopulatedData === null || prepopulatedData === void 0 ? void 0 : prepopulatedData.fullName,
|
|
194
200
|
isCurrentUser: data === null || data === void 0 ? void 0 : data.isCurrentUser,
|
|
195
201
|
clientFetchProfile: clientFetchProfile,
|
|
196
202
|
...data,
|
|
@@ -235,7 +241,7 @@ export default function ProfilecardTriggerNext({
|
|
|
235
241
|
"data-testid": testId,
|
|
236
242
|
role: "button",
|
|
237
243
|
tabIndex: 0,
|
|
238
|
-
"aria-label": ariaLabel,
|
|
244
|
+
"aria-label": getLabelMessage(ariaLabel, profilecardProps.fullName, formatMessage),
|
|
239
245
|
"aria-labelledby": ariaLabelledBy
|
|
240
246
|
}), children);
|
|
241
247
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
const getLabelMessage = (ariaLabelProp, fullName, formatMessage) => {
|
|
3
|
+
if (ariaLabelProp) {
|
|
4
|
+
return ariaLabelProp;
|
|
5
|
+
}
|
|
6
|
+
return fullName ? formatMessage(messages.label, {
|
|
7
|
+
fullName
|
|
8
|
+
}) : formatMessage(messages.fallbackLabel);
|
|
9
|
+
};
|
|
10
|
+
const messages = defineMessages({
|
|
11
|
+
fallbackLabel: {
|
|
12
|
+
id: 'profilecard.user.trigger.fallback-aria-label',
|
|
13
|
+
defaultMessage: 'More information about this user',
|
|
14
|
+
description: 'Label for profile card trigger when we do not have user name'
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
id: 'profilecard.user.trigger.aria-label',
|
|
18
|
+
defaultMessage: 'More information about {fullName}',
|
|
19
|
+
description: 'Label for profile card trigger'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default getLabelMessage;
|
|
@@ -14,7 +14,8 @@ const profiles = [{
|
|
|
14
14
|
meta: 'Manager',
|
|
15
15
|
remoteTimeString: getTimeString(),
|
|
16
16
|
remoteWeekdayIndex: getWeekday().index,
|
|
17
|
-
remoteWeekdayString: getWeekday().string
|
|
17
|
+
remoteWeekdayString: getWeekday().string,
|
|
18
|
+
accountType: 'atlassian'
|
|
18
19
|
}
|
|
19
20
|
}, {
|
|
20
21
|
User: {
|
|
@@ -26,7 +27,8 @@ const profiles = [{
|
|
|
26
27
|
meta: 'Senior Developer',
|
|
27
28
|
remoteTimeString: getTimeString(),
|
|
28
29
|
remoteWeekdayIndex: getWeekday().index,
|
|
29
|
-
remoteWeekdayString: getWeekday().string
|
|
30
|
+
remoteWeekdayString: getWeekday().string,
|
|
31
|
+
accountType: 'atlassian'
|
|
30
32
|
}
|
|
31
33
|
}, {
|
|
32
34
|
User: {
|
|
@@ -39,7 +41,8 @@ const profiles = [{
|
|
|
39
41
|
status: 'inactive',
|
|
40
42
|
remoteTimeString: getTimeString(),
|
|
41
43
|
remoteWeekdayIndex: getWeekday().index,
|
|
42
|
-
remoteWeekdayString: getWeekday().string
|
|
44
|
+
remoteWeekdayString: getWeekday().string,
|
|
45
|
+
accountType: 'atlassian'
|
|
43
46
|
}
|
|
44
47
|
}, {
|
|
45
48
|
User: {
|
|
@@ -47,7 +50,8 @@ const profiles = [{
|
|
|
47
50
|
fullName: 'Cleveland Rodriquez',
|
|
48
51
|
nickname: 'crodriquez',
|
|
49
52
|
email: 'crodriquez@slofast.com',
|
|
50
|
-
meta: 'Manager'
|
|
53
|
+
meta: 'Manager',
|
|
54
|
+
accountType: 'customer'
|
|
51
55
|
}
|
|
52
56
|
}, {
|
|
53
57
|
User: {
|
|
@@ -59,7 +63,8 @@ const profiles = [{
|
|
|
59
63
|
meta: 'Manager',
|
|
60
64
|
remoteTimeString: getTimeString(),
|
|
61
65
|
remoteWeekdayIndex: getWeekday().index,
|
|
62
|
-
remoteWeekdayString: getWeekday().string
|
|
66
|
+
remoteWeekdayString: getWeekday().string,
|
|
67
|
+
accountType: 'atlassian'
|
|
63
68
|
}
|
|
64
69
|
}, {
|
|
65
70
|
User: {
|
|
@@ -71,7 +76,8 @@ const profiles = [{
|
|
|
71
76
|
meta: 'Designer',
|
|
72
77
|
remoteTimeString: getTimeString(),
|
|
73
78
|
remoteWeekdayIndex: getWeekday().index,
|
|
74
|
-
remoteWeekdayString: getWeekday().string
|
|
79
|
+
remoteWeekdayString: getWeekday().string,
|
|
80
|
+
accountType: 'atlassian'
|
|
75
81
|
}
|
|
76
82
|
}, {
|
|
77
83
|
User: {
|
|
@@ -83,7 +89,8 @@ const profiles = [{
|
|
|
83
89
|
meta: 'Senior Developer',
|
|
84
90
|
remoteTimeString: getTimeString(),
|
|
85
91
|
remoteWeekdayIndex: getWeekday().index,
|
|
86
|
-
remoteWeekdayString: getWeekday().string
|
|
92
|
+
remoteWeekdayString: getWeekday().string,
|
|
93
|
+
accountType: 'atlassian'
|
|
87
94
|
}
|
|
88
95
|
}, {
|
|
89
96
|
User: {
|
|
@@ -95,7 +102,8 @@ const profiles = [{
|
|
|
95
102
|
meta: 'Senior Developer',
|
|
96
103
|
remoteTimeString: getTimeString(),
|
|
97
104
|
remoteWeekdayIndex: getWeekday().index,
|
|
98
|
-
remoteWeekdayString: getWeekday().string
|
|
105
|
+
remoteWeekdayString: getWeekday().string,
|
|
106
|
+
accountType: 'atlassian'
|
|
99
107
|
}
|
|
100
108
|
}, {
|
|
101
109
|
User: {
|
|
@@ -107,7 +115,8 @@ const profiles = [{
|
|
|
107
115
|
meta: 'Head of Something',
|
|
108
116
|
remoteTimeString: getTimeString(),
|
|
109
117
|
remoteWeekdayIndex: getWeekday().index,
|
|
110
|
-
remoteWeekdayString: getWeekday().string
|
|
118
|
+
remoteWeekdayString: getWeekday().string,
|
|
119
|
+
accountType: 'atlassian'
|
|
111
120
|
}
|
|
112
121
|
}, {
|
|
113
122
|
User: {
|
|
@@ -119,7 +128,8 @@ const profiles = [{
|
|
|
119
128
|
meta: 'Senior Designer',
|
|
120
129
|
remoteTimeString: getTimeString(),
|
|
121
130
|
remoteWeekdayIndex: getWeekday().index,
|
|
122
|
-
remoteWeekdayString: getWeekday().string
|
|
131
|
+
remoteWeekdayString: getWeekday().string,
|
|
132
|
+
accountType: 'atlassian'
|
|
123
133
|
}
|
|
124
134
|
}, {
|
|
125
135
|
User: {
|
|
@@ -131,7 +141,8 @@ const profiles = [{
|
|
|
131
141
|
meta: 'Senior Designer',
|
|
132
142
|
remoteTimeString: getTimeString(),
|
|
133
143
|
remoteWeekdayIndex: getWeekday().index,
|
|
134
|
-
remoteWeekdayString: getWeekday().string
|
|
144
|
+
remoteWeekdayString: getWeekday().string,
|
|
145
|
+
accountType: 'atlassian'
|
|
135
146
|
}
|
|
136
147
|
}];
|
|
137
148
|
export default profiles;
|
|
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
31
31
|
actionSubjectId,
|
|
32
32
|
attributes: {
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "19.
|
|
34
|
+
packageVersion: "19.11.0",
|
|
35
35
|
...attributes,
|
|
36
36
|
firedAt: Math.round(getPageTime())
|
|
37
37
|
}
|
|
@@ -42,7 +42,8 @@ export var modifyResponse = function modifyResponse(response) {
|
|
|
42
42
|
meta: data.meta || undefined,
|
|
43
43
|
nickname: data.nickname || undefined,
|
|
44
44
|
companyName: data.companyName || undefined,
|
|
45
|
-
timestring: data.remoteTimeString || undefined
|
|
45
|
+
timestring: data.remoteTimeString || undefined,
|
|
46
|
+
accountType: data.accountType || undefined
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
49
|
|
|
@@ -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', "19.
|
|
51
|
+
headers.append('atl-client-version', "19.11.0");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import React, { useCallback, useEffect, useMemo,
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -144,12 +144,6 @@ var Actions = function Actions(_ref) {
|
|
|
144
144
|
action.callback.apply(action, [event].concat(_toConsumableArray(args)));
|
|
145
145
|
}
|
|
146
146
|
}, [fireAnalyticsWithDuration]);
|
|
147
|
-
var buttonRef = useRef(null);
|
|
148
|
-
useEffect(function () {
|
|
149
|
-
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
150
|
-
buttonRef.current.focus();
|
|
151
|
-
}
|
|
152
|
-
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
153
147
|
if (!actions || actions.length === 0) {
|
|
154
148
|
return null;
|
|
155
149
|
}
|
|
@@ -172,7 +166,7 @@ var Actions = function Actions(_ref) {
|
|
|
172
166
|
return onActionClick(action, args, event, index);
|
|
173
167
|
},
|
|
174
168
|
href: action.link,
|
|
175
|
-
|
|
169
|
+
autoFocus: index === 0 && isTriggeredUsingKeyboard
|
|
176
170
|
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null))));
|
|
177
171
|
if (isKudos) {
|
|
178
172
|
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
@@ -9,11 +9,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
9
9
|
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; }
|
|
10
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
11
|
import React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
|
+
import { useIntl } from 'react-intl-next';
|
|
12
13
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
14
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
14
15
|
import Popup from '@atlaskit/popup';
|
|
15
16
|
import { layers } from '@atlaskit/theme/constants';
|
|
16
17
|
import filterActionsInner from '../../internal/filterActions';
|
|
18
|
+
import getLabelMessage from '../../internal/getLabelMessage';
|
|
17
19
|
import { CardWrapper } from '../../styled/Card';
|
|
18
20
|
import { cardTriggered, fireEvent } from '../../util/analytics';
|
|
19
21
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
@@ -34,9 +36,12 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
34
36
|
addFlag = _ref.addFlag,
|
|
35
37
|
onReportingLinesClick = _ref.onReportingLinesClick,
|
|
36
38
|
ariaLabel = _ref.ariaLabel,
|
|
37
|
-
ariaLabelledBy = _ref.ariaLabelledBy
|
|
39
|
+
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
40
|
+
prepopulatedData = _ref.prepopulatedData;
|
|
38
41
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
39
42
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
43
|
+
var _useIntl = useIntl(),
|
|
44
|
+
formatMessage = _useIntl.formatMessage;
|
|
40
45
|
var _useState = useState(false),
|
|
41
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
47
|
isMounted = _useState2[0],
|
|
@@ -126,10 +131,9 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
126
131
|
setVisible(false);
|
|
127
132
|
}, hideDelay));
|
|
128
133
|
}
|
|
129
|
-
setTriggeredUsingKeyboard(false);
|
|
130
134
|
}, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
|
|
131
135
|
var handleKeyboardClose = useCallback(function (event) {
|
|
132
|
-
if (event.key !== 'Escape') {
|
|
136
|
+
if (event.key && event.key !== 'Escape') {
|
|
133
137
|
return;
|
|
134
138
|
}
|
|
135
139
|
if (triggerRef.current) {
|
|
@@ -261,6 +265,7 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
261
265
|
}, [hideProfilecard, onFocus, onMouseEnter, trigger]);
|
|
262
266
|
var profilecardProps = _objectSpread(_objectSpread({
|
|
263
267
|
userId: userId,
|
|
268
|
+
fullName: prepopulatedData === null || prepopulatedData === void 0 ? void 0 : prepopulatedData.fullName,
|
|
264
269
|
isCurrentUser: data === null || data === void 0 ? void 0 : data.isCurrentUser,
|
|
265
270
|
clientFetchProfile: clientFetchProfile
|
|
266
271
|
}, data), {}, {
|
|
@@ -305,7 +310,7 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
305
310
|
"data-testid": testId,
|
|
306
311
|
role: "button",
|
|
307
312
|
tabIndex: 0,
|
|
308
|
-
"aria-label": ariaLabel,
|
|
313
|
+
"aria-label": getLabelMessage(ariaLabel, profilecardProps.fullName, formatMessage),
|
|
309
314
|
"aria-labelledby": ariaLabelledBy
|
|
310
315
|
}), children);
|
|
311
316
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
var getLabelMessage = function getLabelMessage(ariaLabelProp, fullName, formatMessage) {
|
|
3
|
+
if (ariaLabelProp) {
|
|
4
|
+
return ariaLabelProp;
|
|
5
|
+
}
|
|
6
|
+
return fullName ? formatMessage(messages.label, {
|
|
7
|
+
fullName: fullName
|
|
8
|
+
}) : formatMessage(messages.fallbackLabel);
|
|
9
|
+
};
|
|
10
|
+
var messages = defineMessages({
|
|
11
|
+
fallbackLabel: {
|
|
12
|
+
id: 'profilecard.user.trigger.fallback-aria-label',
|
|
13
|
+
defaultMessage: 'More information about this user',
|
|
14
|
+
description: 'Label for profile card trigger when we do not have user name'
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
id: 'profilecard.user.trigger.aria-label',
|
|
18
|
+
defaultMessage: 'More information about {fullName}',
|
|
19
|
+
description: 'Label for profile card trigger'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default getLabelMessage;
|
|
@@ -16,7 +16,8 @@ var profiles = [{
|
|
|
16
16
|
meta: 'Manager',
|
|
17
17
|
remoteTimeString: getTimeString(),
|
|
18
18
|
remoteWeekdayIndex: getWeekday().index,
|
|
19
|
-
remoteWeekdayString: getWeekday().string
|
|
19
|
+
remoteWeekdayString: getWeekday().string,
|
|
20
|
+
accountType: 'atlassian'
|
|
20
21
|
}
|
|
21
22
|
}, {
|
|
22
23
|
User: {
|
|
@@ -28,7 +29,8 @@ var profiles = [{
|
|
|
28
29
|
meta: 'Senior Developer',
|
|
29
30
|
remoteTimeString: getTimeString(),
|
|
30
31
|
remoteWeekdayIndex: getWeekday().index,
|
|
31
|
-
remoteWeekdayString: getWeekday().string
|
|
32
|
+
remoteWeekdayString: getWeekday().string,
|
|
33
|
+
accountType: 'atlassian'
|
|
32
34
|
}
|
|
33
35
|
}, {
|
|
34
36
|
User: {
|
|
@@ -41,7 +43,8 @@ var profiles = [{
|
|
|
41
43
|
status: 'inactive',
|
|
42
44
|
remoteTimeString: getTimeString(),
|
|
43
45
|
remoteWeekdayIndex: getWeekday().index,
|
|
44
|
-
remoteWeekdayString: getWeekday().string
|
|
46
|
+
remoteWeekdayString: getWeekday().string,
|
|
47
|
+
accountType: 'atlassian'
|
|
45
48
|
}
|
|
46
49
|
}, {
|
|
47
50
|
User: {
|
|
@@ -49,7 +52,8 @@ var profiles = [{
|
|
|
49
52
|
fullName: 'Cleveland Rodriquez',
|
|
50
53
|
nickname: 'crodriquez',
|
|
51
54
|
email: 'crodriquez@slofast.com',
|
|
52
|
-
meta: 'Manager'
|
|
55
|
+
meta: 'Manager',
|
|
56
|
+
accountType: 'customer'
|
|
53
57
|
}
|
|
54
58
|
}, {
|
|
55
59
|
User: {
|
|
@@ -61,7 +65,8 @@ var profiles = [{
|
|
|
61
65
|
meta: 'Manager',
|
|
62
66
|
remoteTimeString: getTimeString(),
|
|
63
67
|
remoteWeekdayIndex: getWeekday().index,
|
|
64
|
-
remoteWeekdayString: getWeekday().string
|
|
68
|
+
remoteWeekdayString: getWeekday().string,
|
|
69
|
+
accountType: 'atlassian'
|
|
65
70
|
}
|
|
66
71
|
}, {
|
|
67
72
|
User: {
|
|
@@ -73,7 +78,8 @@ var profiles = [{
|
|
|
73
78
|
meta: 'Designer',
|
|
74
79
|
remoteTimeString: getTimeString(),
|
|
75
80
|
remoteWeekdayIndex: getWeekday().index,
|
|
76
|
-
remoteWeekdayString: getWeekday().string
|
|
81
|
+
remoteWeekdayString: getWeekday().string,
|
|
82
|
+
accountType: 'atlassian'
|
|
77
83
|
}
|
|
78
84
|
}, {
|
|
79
85
|
User: {
|
|
@@ -85,7 +91,8 @@ var profiles = [{
|
|
|
85
91
|
meta: 'Senior Developer',
|
|
86
92
|
remoteTimeString: getTimeString(),
|
|
87
93
|
remoteWeekdayIndex: getWeekday().index,
|
|
88
|
-
remoteWeekdayString: getWeekday().string
|
|
94
|
+
remoteWeekdayString: getWeekday().string,
|
|
95
|
+
accountType: 'atlassian'
|
|
89
96
|
}
|
|
90
97
|
}, {
|
|
91
98
|
User: {
|
|
@@ -97,7 +104,8 @@ var profiles = [{
|
|
|
97
104
|
meta: 'Senior Developer',
|
|
98
105
|
remoteTimeString: getTimeString(),
|
|
99
106
|
remoteWeekdayIndex: getWeekday().index,
|
|
100
|
-
remoteWeekdayString: getWeekday().string
|
|
107
|
+
remoteWeekdayString: getWeekday().string,
|
|
108
|
+
accountType: 'atlassian'
|
|
101
109
|
}
|
|
102
110
|
}, {
|
|
103
111
|
User: {
|
|
@@ -109,7 +117,8 @@ var profiles = [{
|
|
|
109
117
|
meta: 'Head of Something',
|
|
110
118
|
remoteTimeString: getTimeString(),
|
|
111
119
|
remoteWeekdayIndex: getWeekday().index,
|
|
112
|
-
remoteWeekdayString: getWeekday().string
|
|
120
|
+
remoteWeekdayString: getWeekday().string,
|
|
121
|
+
accountType: 'atlassian'
|
|
113
122
|
}
|
|
114
123
|
}, {
|
|
115
124
|
User: {
|
|
@@ -121,7 +130,8 @@ var profiles = [{
|
|
|
121
130
|
meta: 'Senior Designer',
|
|
122
131
|
remoteTimeString: getTimeString(),
|
|
123
132
|
remoteWeekdayIndex: getWeekday().index,
|
|
124
|
-
remoteWeekdayString: getWeekday().string
|
|
133
|
+
remoteWeekdayString: getWeekday().string,
|
|
134
|
+
accountType: 'atlassian'
|
|
125
135
|
}
|
|
126
136
|
}, {
|
|
127
137
|
User: {
|
|
@@ -133,7 +143,8 @@ var profiles = [{
|
|
|
133
143
|
meta: 'Senior Designer',
|
|
134
144
|
remoteTimeString: getTimeString(),
|
|
135
145
|
remoteWeekdayIndex: getWeekday().index,
|
|
136
|
-
remoteWeekdayString: getWeekday().string
|
|
146
|
+
remoteWeekdayString: getWeekday().string,
|
|
147
|
+
accountType: 'atlassian'
|
|
137
148
|
}
|
|
138
149
|
}];
|
|
139
150
|
export default profiles;
|
|
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
38
38
|
actionSubjectId: actionSubjectId,
|
|
39
39
|
attributes: _objectSpread(_objectSpread({
|
|
40
40
|
packageName: "@atlaskit/profilecard",
|
|
41
|
-
packageVersion: "19.
|
|
41
|
+
packageVersion: "19.11.0"
|
|
42
42
|
}, attributes), {}, {
|
|
43
43
|
firedAt: Math.round(getPageTime())
|
|
44
44
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProfileCardTriggerProps } from '../../types';
|
|
3
|
-
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, }: ProfileCardTriggerProps): JSX.Element;
|
|
3
|
+
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, }: ProfileCardTriggerProps): JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
+
declare const getLabelMessage: (ariaLabelProp: string | undefined, fullName: string | undefined, formatMessage: (message: MessageDescriptor, values?: Record<string, string>) => string) => string;
|
|
3
|
+
export default getLabelMessage;
|
|
@@ -9,6 +9,7 @@ declare const profiles: ({
|
|
|
9
9
|
remoteTimeString: string;
|
|
10
10
|
remoteWeekdayIndex: number;
|
|
11
11
|
remoteWeekdayString: string;
|
|
12
|
+
accountType: string;
|
|
12
13
|
status?: undefined;
|
|
13
14
|
};
|
|
14
15
|
} | {
|
|
@@ -23,6 +24,7 @@ declare const profiles: ({
|
|
|
23
24
|
remoteTimeString: string;
|
|
24
25
|
remoteWeekdayIndex: number;
|
|
25
26
|
remoteWeekdayString: string;
|
|
27
|
+
accountType: string;
|
|
26
28
|
};
|
|
27
29
|
} | {
|
|
28
30
|
User: {
|
|
@@ -31,6 +33,7 @@ declare const profiles: ({
|
|
|
31
33
|
nickname: string;
|
|
32
34
|
email: string;
|
|
33
35
|
meta: string;
|
|
36
|
+
accountType: string;
|
|
34
37
|
location?: undefined;
|
|
35
38
|
remoteTimeString?: undefined;
|
|
36
39
|
remoteWeekdayIndex?: undefined;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import UserProfileCardClient from './client/UserProfileCardClient';
|
|
|
7
7
|
export interface ApiClientResponse {
|
|
8
8
|
User: {
|
|
9
9
|
id: string;
|
|
10
|
+
accountType: string;
|
|
10
11
|
isBot: boolean;
|
|
11
12
|
isCurrentUser: boolean;
|
|
12
13
|
avatarUrl: string | null;
|
|
@@ -52,6 +53,7 @@ export interface ProfileCardClientData {
|
|
|
52
53
|
status: StatusType;
|
|
53
54
|
statusModifiedDate?: number | null;
|
|
54
55
|
customLozenges?: LozengeProps[];
|
|
56
|
+
accountType?: string;
|
|
55
57
|
}
|
|
56
58
|
export interface ReportingLinesUserPII {
|
|
57
59
|
name: string;
|
|
@@ -113,6 +115,7 @@ export interface ProfileCardTriggerProps {
|
|
|
113
115
|
addFlag?: (flag: any) => void;
|
|
114
116
|
ariaLabel?: string;
|
|
115
117
|
ariaLabelledBy?: string;
|
|
118
|
+
prepopulatedData?: PrepopulatedData;
|
|
116
119
|
}
|
|
117
120
|
export interface ProfileCardTriggerState {
|
|
118
121
|
visible?: boolean;
|
|
@@ -267,6 +270,7 @@ export interface ProfilecardProps {
|
|
|
267
270
|
isLoading?: boolean;
|
|
268
271
|
hasError?: boolean;
|
|
269
272
|
errorType?: ProfileCardErrorType;
|
|
273
|
+
accountType?: string;
|
|
270
274
|
status?: StatusType;
|
|
271
275
|
isBot?: boolean;
|
|
272
276
|
avatarUrl?: string;
|
|
@@ -359,3 +363,7 @@ export interface ClientOverrides {
|
|
|
359
363
|
teamClient?: TeamProfileCardClient;
|
|
360
364
|
teamCentralClient?: TeamCentralCardClient;
|
|
361
365
|
}
|
|
366
|
+
/** This interface represents the data that is prepopulated in the profile card. **/
|
|
367
|
+
export interface PrepopulatedData {
|
|
368
|
+
fullName?: string;
|
|
369
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProfileCardTriggerProps } from '../../types';
|
|
3
|
-
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, }: ProfileCardTriggerProps): JSX.Element;
|
|
3
|
+
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, }: ProfileCardTriggerProps): JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
+
declare const getLabelMessage: (ariaLabelProp: string | undefined, fullName: string | undefined, formatMessage: (message: MessageDescriptor, values?: Record<string, string>) => string) => string;
|
|
3
|
+
export default getLabelMessage;
|
|
@@ -9,6 +9,7 @@ declare const profiles: ({
|
|
|
9
9
|
remoteTimeString: string;
|
|
10
10
|
remoteWeekdayIndex: number;
|
|
11
11
|
remoteWeekdayString: string;
|
|
12
|
+
accountType: string;
|
|
12
13
|
status?: undefined;
|
|
13
14
|
};
|
|
14
15
|
} | {
|
|
@@ -23,6 +24,7 @@ declare const profiles: ({
|
|
|
23
24
|
remoteTimeString: string;
|
|
24
25
|
remoteWeekdayIndex: number;
|
|
25
26
|
remoteWeekdayString: string;
|
|
27
|
+
accountType: string;
|
|
26
28
|
};
|
|
27
29
|
} | {
|
|
28
30
|
User: {
|
|
@@ -31,6 +33,7 @@ declare const profiles: ({
|
|
|
31
33
|
nickname: string;
|
|
32
34
|
email: string;
|
|
33
35
|
meta: string;
|
|
36
|
+
accountType: string;
|
|
34
37
|
location?: undefined;
|
|
35
38
|
remoteTimeString?: undefined;
|
|
36
39
|
remoteWeekdayIndex?: undefined;
|
|
@@ -7,6 +7,7 @@ import UserProfileCardClient from './client/UserProfileCardClient';
|
|
|
7
7
|
export interface ApiClientResponse {
|
|
8
8
|
User: {
|
|
9
9
|
id: string;
|
|
10
|
+
accountType: string;
|
|
10
11
|
isBot: boolean;
|
|
11
12
|
isCurrentUser: boolean;
|
|
12
13
|
avatarUrl: string | null;
|
|
@@ -52,6 +53,7 @@ export interface ProfileCardClientData {
|
|
|
52
53
|
status: StatusType;
|
|
53
54
|
statusModifiedDate?: number | null;
|
|
54
55
|
customLozenges?: LozengeProps[];
|
|
56
|
+
accountType?: string;
|
|
55
57
|
}
|
|
56
58
|
export interface ReportingLinesUserPII {
|
|
57
59
|
name: string;
|
|
@@ -113,6 +115,7 @@ export interface ProfileCardTriggerProps {
|
|
|
113
115
|
addFlag?: (flag: any) => void;
|
|
114
116
|
ariaLabel?: string;
|
|
115
117
|
ariaLabelledBy?: string;
|
|
118
|
+
prepopulatedData?: PrepopulatedData;
|
|
116
119
|
}
|
|
117
120
|
export interface ProfileCardTriggerState {
|
|
118
121
|
visible?: boolean;
|
|
@@ -267,6 +270,7 @@ export interface ProfilecardProps {
|
|
|
267
270
|
isLoading?: boolean;
|
|
268
271
|
hasError?: boolean;
|
|
269
272
|
errorType?: ProfileCardErrorType;
|
|
273
|
+
accountType?: string;
|
|
270
274
|
status?: StatusType;
|
|
271
275
|
isBot?: boolean;
|
|
272
276
|
avatarUrl?: string;
|
|
@@ -359,3 +363,7 @@ export interface ClientOverrides {
|
|
|
359
363
|
teamClient?: TeamProfileCardClient;
|
|
360
364
|
teamCentralClient?: TeamCentralCardClient;
|
|
361
365
|
}
|
|
366
|
+
/** This interface represents the data that is prepopulated in the profile card. **/
|
|
367
|
+
export interface PrepopulatedData {
|
|
368
|
+
fullName?: string;
|
|
369
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.11.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
56
56
|
"@atlaskit/avatar": "^21.4.0",
|
|
57
57
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
58
|
-
"@atlaskit/button": "^17.
|
|
58
|
+
"@atlaskit/button": "^17.4.0",
|
|
59
59
|
"@atlaskit/dropdown-menu": "^12.5.0",
|
|
60
|
-
"@atlaskit/empty-state": "^7.
|
|
60
|
+
"@atlaskit/empty-state": "^7.7.0",
|
|
61
61
|
"@atlaskit/focus-ring": "^1.3.4",
|
|
62
62
|
"@atlaskit/give-kudos": "^2.1.0",
|
|
63
63
|
"@atlaskit/icon": "^22.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@atlaskit/popup": "^1.12.0",
|
|
68
68
|
"@atlaskit/spinner": "^16.0.0",
|
|
69
69
|
"@atlaskit/theme": "^12.6.0",
|
|
70
|
-
"@atlaskit/tokens": "^1.
|
|
70
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
71
71
|
"@atlaskit/tooltip": "^18.1.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
73
73
|
"@emotion/react": "^11.7.1",
|