@atlaskit/profilecard 16.12.1 → 17.0.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 +6 -0
- package/dist/cjs/client/ProfileCardClient.js +2 -2
- package/dist/cjs/client/TeamProfileCardClient.js +13 -12
- package/dist/cjs/client/UserProfileCardClient.js +25 -2
- package/dist/cjs/client/errorUtils.js +25 -0
- package/dist/cjs/components/Error/ErrorMessage.js +40 -77
- package/dist/cjs/components/Team/TeamLoadingState.js +1 -1
- package/dist/cjs/components/Team/TeamProfileCard.js +4 -4
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +3 -3
- package/dist/cjs/components/User/OverflowProfileCardButtons.js +44 -10
- package/dist/cjs/components/User/ProfileCard.js +195 -362
- package/dist/cjs/components/User/ProfileCardDetails.js +142 -0
- package/dist/cjs/components/User/ProfileCardResourced.js +25 -20
- package/dist/cjs/components/User/ProfileCardTrigger.js +35 -7
- package/dist/cjs/components/User/ReportingLinesDetails.js +13 -13
- package/dist/cjs/components/User/UserLoadingState.js +14 -2
- package/dist/cjs/util/analytics.js +31 -16
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/ProfileCardClient.js +2 -2
- package/dist/es2019/client/TeamProfileCardClient.js +3 -9
- package/dist/es2019/client/UserProfileCardClient.js +23 -2
- package/dist/es2019/client/errorUtils.js +17 -0
- package/dist/es2019/components/Error/ErrorMessage.js +38 -42
- package/dist/es2019/components/Team/TeamLoadingState.js +2 -2
- package/dist/es2019/components/Team/TeamProfileCard.js +5 -5
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +4 -4
- package/dist/es2019/components/User/OverflowProfileCardButtons.js +30 -4
- package/dist/es2019/components/User/ProfileCard.js +161 -292
- package/dist/es2019/components/User/ProfileCardDetails.js +118 -0
- package/dist/es2019/components/User/ProfileCardResourced.js +21 -21
- package/dist/es2019/components/User/ProfileCardTrigger.js +32 -6
- package/dist/es2019/components/User/ReportingLinesDetails.js +10 -11
- package/dist/es2019/components/User/UserLoadingState.js +10 -2
- package/dist/es2019/util/analytics.js +13 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/ProfileCardClient.js +2 -2
- package/dist/esm/client/TeamProfileCardClient.js +11 -12
- package/dist/esm/client/UserProfileCardClient.js +22 -2
- package/dist/esm/client/errorUtils.js +17 -0
- package/dist/esm/components/Error/ErrorMessage.js +35 -80
- package/dist/esm/components/Team/TeamLoadingState.js +2 -2
- package/dist/esm/components/Team/TeamProfileCard.js +5 -5
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +4 -4
- package/dist/esm/components/User/OverflowProfileCardButtons.js +39 -9
- package/dist/esm/components/User/ProfileCard.js +180 -362
- package/dist/esm/components/User/ProfileCardDetails.js +120 -0
- package/dist/esm/components/User/ProfileCardResourced.js +17 -17
- package/dist/esm/components/User/ProfileCardTrigger.js +33 -7
- package/dist/esm/components/User/ReportingLinesDetails.js +12 -12
- package/dist/esm/components/User/UserLoadingState.js +7 -2
- package/dist/esm/util/analytics.js +21 -12
- package/dist/esm/version.json +1 -1
- package/dist/types/client/ProfileCardClient.d.ts +3 -2
- package/dist/types/client/TeamProfileCardClient.d.ts +2 -1
- package/dist/types/client/UserProfileCardClient.d.ts +2 -1
- package/dist/types/client/errorUtils.d.ts +6 -0
- package/dist/types/components/Error/ErrorMessage.d.ts +6 -15
- package/dist/types/components/Team/TeamProfileCardTrigger.d.ts +5 -11
- package/dist/types/components/User/OverflowProfileCardButtons.d.ts +4 -3
- package/dist/types/components/User/ProfileCard.d.ts +5 -29
- package/dist/types/components/User/ProfileCardDetails.d.ts +3 -0
- package/dist/types/components/User/ProfileCardResourced.d.ts +7 -3
- package/dist/types/components/User/ProfileCardTrigger.d.ts +3 -40
- package/dist/types/components/User/ReportingLinesDetails.d.ts +2 -4
- package/dist/types/components/User/UserLoadingState.d.ts +5 -1
- package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types/types.d.ts +11 -10
- package/dist/types/util/analytics.d.ts +22 -13
- package/package.json +8 -8
- package/report.api.md +71 -124
- package/dist/cjs/internal/analytics.js +0 -15
- package/dist/es2019/internal/analytics.js +0 -8
- package/dist/esm/internal/analytics.js +0 -8
- package/dist/types/internal/analytics.d.ts +0 -8
|
@@ -21,7 +21,7 @@ import messages from '../../messages';
|
|
|
21
21
|
import { AnimatedKudosButton, KudosBlobAnimation } from '../../styled/Card';
|
|
22
22
|
import { ErrorWrapper, TeamErrorText, TeamErrorTitle } from '../../styled/Error';
|
|
23
23
|
import { ActionButtons, AvatarSection, CardContent, CardHeader, CardWrapper, Description, DescriptionWrapper, MemberCount, MoreButton, TeamName, WrappedButton } from '../../styled/TeamCard';
|
|
24
|
-
import { errorRetryClicked, moreActionsClicked, moreMembersClicked,
|
|
24
|
+
import { actionClicked, errorRetryClicked, moreActionsClicked, moreMembersClicked, profileCardRendered, teamAvatarClicked } from '../../util/analytics';
|
|
25
25
|
import { isBasicClick } from '../../util/click';
|
|
26
26
|
import { ErrorIllustration } from '../Error';
|
|
27
27
|
import TeamLoadingState from './TeamLoadingState';
|
|
@@ -98,7 +98,7 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
98
98
|
function onActionClick(action, analytics, index) {
|
|
99
99
|
return function (event) {
|
|
100
100
|
analytics(function (duration) {
|
|
101
|
-
return
|
|
101
|
+
return actionClicked('team', {
|
|
102
102
|
duration: duration,
|
|
103
103
|
hasHref: !!action.link,
|
|
104
104
|
hasOnClick: !!action.callback,
|
|
@@ -152,7 +152,7 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
152
152
|
if (shouldBeOpen) {
|
|
153
153
|
// Only fire this event when OPENING the dropdown
|
|
154
154
|
analytics(function (duration) {
|
|
155
|
-
return moreActionsClicked({
|
|
155
|
+
return moreActionsClicked('team', {
|
|
156
156
|
duration: duration,
|
|
157
157
|
numActions: count + 2
|
|
158
158
|
});
|
|
@@ -243,7 +243,7 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
243
243
|
analytics(function (duration) {
|
|
244
244
|
var _team$members;
|
|
245
245
|
|
|
246
|
-
return
|
|
246
|
+
return profileCardRendered('team', 'content', {
|
|
247
247
|
duration: duration,
|
|
248
248
|
numActions: allActions.length,
|
|
249
249
|
memberCount: (_team$members = team.members) === null || _team$members === void 0 ? void 0 : _team$members.length,
|
|
@@ -276,7 +276,7 @@ var ErrorMessage = function ErrorMessage(_ref6) {
|
|
|
276
276
|
var hasRetry = !!clientFetchProfile;
|
|
277
277
|
useEffect(function () {
|
|
278
278
|
analytics(function (duration) {
|
|
279
|
-
return
|
|
279
|
+
return profileCardRendered('team', 'error', {
|
|
280
280
|
duration: duration,
|
|
281
281
|
hasRetry: hasRetry
|
|
282
282
|
});
|
|
@@ -20,7 +20,7 @@ import Popup from '@atlaskit/popup';
|
|
|
20
20
|
import { layers } from '@atlaskit/theme/constants';
|
|
21
21
|
import _filterActions from '../../internal/filterActions';
|
|
22
22
|
import messages from '../../messages';
|
|
23
|
-
import {
|
|
23
|
+
import { cardTriggered, fireEvent, profileCardRendered } from '../../util/analytics';
|
|
24
24
|
import { isBasicClick } from '../../util/click';
|
|
25
25
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
26
26
|
import { getPageTime } from '../../util/performance';
|
|
@@ -119,7 +119,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
119
119
|
_this.showProfilecard(0);
|
|
120
120
|
|
|
121
121
|
if (!_this.state.visible) {
|
|
122
|
-
_this.fireAnalytics(
|
|
122
|
+
_this.fireAnalytics(cardTriggered('team', 'click'));
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
});
|
|
@@ -132,7 +132,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
132
132
|
if (!_this.state.visible) {
|
|
133
133
|
_this.openedByHover = true;
|
|
134
134
|
|
|
135
|
-
_this.fireAnalytics(
|
|
135
|
+
_this.fireAnalytics(cardTriggered('team', 'hover'));
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
_this.showProfilecard(DELAY_MS_SHOW);
|
|
@@ -234,7 +234,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
234
234
|
});
|
|
235
235
|
|
|
236
236
|
_defineProperty(_assertThisInitialized(_this), "onErrorBoundary", function () {
|
|
237
|
-
_this.fireAnalytics(
|
|
237
|
+
_this.fireAnalytics(profileCardRendered('team', 'errorBoundary', {
|
|
238
238
|
duration: 0
|
|
239
239
|
}));
|
|
240
240
|
|
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
var _excluded = ["triggerRef", "isSelected", "testId"];
|
|
4
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback, useState } from 'react';
|
|
5
6
|
import { useIntl } from 'react-intl-next';
|
|
6
7
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
7
8
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
8
9
|
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
9
10
|
import messages from '../../messages';
|
|
10
11
|
import { OverflowActionButtonsWrapper } from '../../styled/Card';
|
|
12
|
+
import { moreActionsClicked } from '../../util/analytics';
|
|
13
|
+
export var ACTION_OVERFLOW_THRESHOLD = 2;
|
|
11
14
|
export var OverflowProfileCardButtons = function OverflowProfileCardButtons(props) {
|
|
12
15
|
var intl = useIntl();
|
|
13
|
-
|
|
16
|
+
|
|
17
|
+
var _useState = useState(false),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
setOpen = _useState2[1];
|
|
20
|
+
|
|
21
|
+
var actions = props.actions,
|
|
22
|
+
onItemClick = props.onItemClick,
|
|
23
|
+
fireAnalyticsWithDuration = props.fireAnalyticsWithDuration;
|
|
24
|
+
var numActions = actions.length + ACTION_OVERFLOW_THRESHOLD;
|
|
25
|
+
var onOpenChange = useCallback(function (_ref) {
|
|
26
|
+
var nextOpen = _ref.isOpen;
|
|
27
|
+
setOpen(function (prevOpen) {
|
|
28
|
+
if (nextOpen && !prevOpen) {
|
|
29
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
30
|
+
return moreActionsClicked('user', {
|
|
31
|
+
duration: duration,
|
|
32
|
+
numActions: numActions
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return nextOpen;
|
|
38
|
+
});
|
|
39
|
+
}, [numActions, fireAnalyticsWithDuration]);
|
|
40
|
+
return /*#__PURE__*/React.createElement(OverflowActionButtonsWrapper, {
|
|
41
|
+
"data-testid": "profilecard-actions-overflow"
|
|
42
|
+
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
43
|
+
onOpenChange: onOpenChange,
|
|
14
44
|
placement: 'bottom-end',
|
|
15
|
-
trigger: function trigger(
|
|
16
|
-
var triggerRef =
|
|
17
|
-
isSelected =
|
|
18
|
-
testId =
|
|
19
|
-
providedProps = _objectWithoutProperties(
|
|
45
|
+
trigger: function trigger(_ref2) {
|
|
46
|
+
var triggerRef = _ref2.triggerRef,
|
|
47
|
+
isSelected = _ref2.isSelected,
|
|
48
|
+
testId = _ref2.testId,
|
|
49
|
+
providedProps = _objectWithoutProperties(_ref2, _excluded);
|
|
20
50
|
|
|
21
51
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
22
52
|
type: "button"
|
|
@@ -27,7 +57,7 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
|
|
|
27
57
|
})
|
|
28
58
|
}));
|
|
29
59
|
}
|
|
30
|
-
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null,
|
|
60
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(function (action, index) {
|
|
31
61
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
32
62
|
key: action.id,
|
|
33
63
|
onClick: function onClick(event) {
|
|
@@ -35,7 +65,7 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
|
|
|
35
65
|
args[_key - 1] = arguments[_key];
|
|
36
66
|
}
|
|
37
67
|
|
|
38
|
-
|
|
68
|
+
onItemClick(action, args, event, index);
|
|
39
69
|
},
|
|
40
70
|
href: action.link
|
|
41
71
|
}, action.label);
|