@atlaskit/profilecard 24.14.1 → 24.15.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 +11 -0
- package/__tests__/vr-tests/agent-profilecard.vr.tsx +5 -5
- package/__tests__/vr-tests/user-profilecard.vr.tsx +30 -30
- package/dist/cjs/client/ProfileCardClient.js +10 -10
- package/dist/cjs/client/RovoAgentCardClient.js +172 -56
- package/dist/cjs/client/TeamProfileCardClient.js +44 -14
- package/dist/cjs/client/UserProfileCardClient.js +2 -9
- package/dist/cjs/client/errorUtils.js +83 -5
- package/dist/cjs/components/Agent/Actions.js +20 -9
- package/dist/cjs/components/Agent/ActionsCompiled.js +18 -8
- package/dist/cjs/components/Agent/AgentProfileCard.js +24 -14
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.js +23 -8
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/cjs/components/Team/TeamForbiddenErrorState.js +21 -6
- package/dist/cjs/components/Team/TeamLoadingState.js +21 -6
- package/dist/cjs/components/Team/TeamProfileCard.js +155 -60
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +104 -33
- package/dist/cjs/components/team-profile-card/main.js +18 -9
- package/dist/cjs/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/cjs/util/analytics.js +55 -0
- package/dist/es2019/client/ProfileCardClient.js +10 -10
- package/dist/es2019/client/RovoAgentCardClient.js +186 -58
- package/dist/es2019/client/TeamProfileCardClient.js +49 -16
- package/dist/es2019/client/UserProfileCardClient.js +3 -10
- package/dist/es2019/client/errorUtils.js +84 -3
- package/dist/es2019/components/Agent/Actions.js +21 -9
- package/dist/es2019/components/Agent/ActionsCompiled.js +19 -8
- package/dist/es2019/components/Agent/AgentProfileCard.js +24 -13
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.js +23 -9
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +9 -5
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +7 -2
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +62 -30
- package/dist/es2019/components/Team/TeamForbiddenErrorState.js +17 -6
- package/dist/es2019/components/Team/TeamLoadingState.js +17 -6
- package/dist/es2019/components/Team/TeamProfileCard.js +144 -54
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +74 -10
- package/dist/es2019/components/team-profile-card/main.js +19 -9
- package/dist/es2019/components/team-profile-card/team-connections/main.js +38 -17
- package/dist/es2019/util/analytics.js +55 -0
- package/dist/esm/client/ProfileCardClient.js +10 -10
- package/dist/esm/client/RovoAgentCardClient.js +174 -58
- package/dist/esm/client/TeamProfileCardClient.js +46 -16
- package/dist/esm/client/UserProfileCardClient.js +3 -10
- package/dist/esm/client/errorUtils.js +82 -4
- package/dist/esm/components/Agent/Actions.js +20 -9
- package/dist/esm/components/Agent/ActionsCompiled.js +18 -8
- package/dist/esm/components/Agent/AgentProfileCard.js +25 -13
- package/dist/esm/components/Agent/AgentProfileCardCompiled.js +24 -9
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/esm/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/esm/components/Team/TeamForbiddenErrorState.js +22 -7
- package/dist/esm/components/Team/TeamLoadingState.js +22 -7
- package/dist/esm/components/Team/TeamProfileCard.js +156 -61
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +105 -34
- package/dist/esm/components/team-profile-card/main.js +18 -9
- package/dist/esm/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/esm/util/analytics.js +55 -0
- package/dist/types/client/ProfileCardClient.d.ts +5 -5
- package/dist/types/client/RovoAgentCardClient.d.ts +5 -4
- package/dist/types/client/TeamProfileCardClient.d.ts +2 -1
- package/dist/types/client/errorUtils.d.ts +2 -1
- package/dist/types/client/types.d.ts +14 -2
- package/dist/types/components/Team/TeamForbiddenErrorState.d.ts +2 -1
- package/dist/types/components/Team/TeamLoadingState.d.ts +2 -1
- package/dist/types/components/Team/TeamProfileCardTrigger.d.ts +7 -2
- package/dist/types/types.d.ts +2 -0
- package/dist/types/util/analytics.d.ts +46 -2
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +5 -5
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +5 -4
- package/dist/types-ts4.5/client/TeamProfileCardClient.d.ts +2 -1
- package/dist/types-ts4.5/client/errorUtils.d.ts +2 -1
- package/dist/types-ts4.5/client/types.d.ts +14 -2
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +2 -1
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +2 -1
- package/dist/types-ts4.5/components/Team/TeamProfileCardTrigger.d.ts +7 -2
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/dist/types-ts4.5/util/analytics.d.ts +46 -2
- package/package.json +6 -6
|
@@ -1,20 +1,35 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
+
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; }
|
|
1
4
|
import React, { useEffect } from 'react';
|
|
2
5
|
import { useIntl } from 'react-intl-next';
|
|
3
6
|
import EmptyState from '@atlaskit/empty-state';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
8
|
import messages from '../../messages';
|
|
5
9
|
import { AccessLockSVGWrapper, TeamForbiddenErrorStateWrapper } from '../../styled/TeamCard';
|
|
6
|
-
import { profileCardRendered } from '../../util/analytics';
|
|
10
|
+
import { PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
11
|
+
import { getPageTime } from '../../util/performance';
|
|
7
12
|
import AccessLockSVG from '../Error/AccessLockSVG';
|
|
8
13
|
export default (function (props) {
|
|
9
|
-
var analytics = props.analytics
|
|
14
|
+
var analytics = props.analytics,
|
|
15
|
+
analyticsNext = props.analyticsNext;
|
|
10
16
|
var intl = useIntl();
|
|
11
17
|
useEffect(function () {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
19
|
+
analyticsNext('ui.teamProfileCard.rendered.error', function (duration) {
|
|
20
|
+
return _objectSpread({
|
|
21
|
+
duration: duration,
|
|
22
|
+
firedAt: Math.round(getPageTime())
|
|
23
|
+
}, PACKAGE_META_DATA);
|
|
15
24
|
});
|
|
16
|
-
}
|
|
17
|
-
|
|
25
|
+
} else {
|
|
26
|
+
analytics(function (duration) {
|
|
27
|
+
return profileCardRendered('team', 'error', {
|
|
28
|
+
duration: duration
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, [analytics, analyticsNext]);
|
|
18
33
|
return /*#__PURE__*/React.createElement(TeamForbiddenErrorStateWrapper, {
|
|
19
34
|
testId: "team-profilecard-forbidden-error-state"
|
|
20
35
|
}, /*#__PURE__*/React.createElement(EmptyState, {
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
+
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; }
|
|
1
4
|
import React, { useEffect } from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
6
|
import Spinner from '@atlaskit/spinner';
|
|
3
7
|
import { CardContent, CardHeader, CardWrapper, LoadingWrapper } from '../../styled/TeamTrigger';
|
|
4
|
-
import { profileCardRendered } from '../../util/analytics';
|
|
8
|
+
import { PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
9
|
+
import { getPageTime } from '../../util/performance';
|
|
5
10
|
export default (function (props) {
|
|
6
|
-
var analytics = props.analytics
|
|
11
|
+
var analytics = props.analytics,
|
|
12
|
+
analyticsNext = props.analyticsNext;
|
|
7
13
|
useEffect(function () {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
15
|
+
analyticsNext('ui.teamProfileCard.rendered.spinner', function (duration) {
|
|
16
|
+
return _objectSpread({
|
|
17
|
+
duration: duration,
|
|
18
|
+
firedAt: Math.round(getPageTime())
|
|
19
|
+
}, PACKAGE_META_DATA);
|
|
11
20
|
});
|
|
12
|
-
}
|
|
13
|
-
|
|
21
|
+
} else {
|
|
22
|
+
analytics(function (duration) {
|
|
23
|
+
return profileCardRendered('team', 'spinner', {
|
|
24
|
+
duration: duration
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, [analytics, analyticsNext]);
|
|
14
29
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
15
30
|
testId: "team-profilecard"
|
|
16
31
|
}, /*#__PURE__*/React.createElement(CardHeader, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
@@ -22,24 +22,37 @@ import { AnimatedKudosButton, AnimationWrapper, KudosBlobAnimation } from '../..
|
|
|
22
22
|
import { ErrorWrapper, TeamErrorText } from '../../styled/Error';
|
|
23
23
|
import { ActionButtons, AvatarSection, Description, DescriptionWrapper, MemberCount, MoreButton, TeamName, WrappedButton } from '../../styled/TeamCard';
|
|
24
24
|
import { CardContent, CardHeader, CardWrapper } from '../../styled/TeamTrigger';
|
|
25
|
-
import { actionClicked, errorRetryClicked, moreActionsClicked, moreMembersClicked, profileCardRendered, teamAvatarClicked } from '../../util/analytics';
|
|
25
|
+
import { actionClicked, errorRetryClicked, moreActionsClicked, moreMembersClicked, PACKAGE_META_DATA, profileCardRendered, teamAvatarClicked } from '../../util/analytics';
|
|
26
26
|
import { isBasicClick } from '../../util/click';
|
|
27
|
+
import { getPageTime } from '../../util/performance';
|
|
27
28
|
import { ErrorIllustration } from '../Error';
|
|
28
29
|
import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
29
30
|
import TeamLoadingState from './TeamLoadingState';
|
|
30
31
|
var LARGE_MEMBER_COUNT = 50;
|
|
31
32
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
32
33
|
var avatarGroupMaxCount = 9;
|
|
33
|
-
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
34
|
+
function onMemberClick(callback, userId, analytics, analyticsNext, index, hasHref) {
|
|
34
35
|
return function (event) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
37
|
+
analyticsNext('ui.teamProfileCard.clicked.avatar', function (duration) {
|
|
38
|
+
return _objectSpread({
|
|
39
|
+
duration: duration,
|
|
40
|
+
hasHref: hasHref,
|
|
41
|
+
hasOnClick: !!callback,
|
|
42
|
+
index: index,
|
|
43
|
+
firedAt: Math.round(getPageTime())
|
|
44
|
+
}, PACKAGE_META_DATA);
|
|
41
45
|
});
|
|
42
|
-
}
|
|
46
|
+
} else {
|
|
47
|
+
analytics(function (duration) {
|
|
48
|
+
return teamAvatarClicked({
|
|
49
|
+
duration: duration,
|
|
50
|
+
hasHref: hasHref,
|
|
51
|
+
hasOnClick: !!callback,
|
|
52
|
+
index: index
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
43
56
|
if (callback) {
|
|
44
57
|
callback(userId, event);
|
|
45
58
|
}
|
|
@@ -51,6 +64,7 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
51
64
|
members = _ref.members,
|
|
52
65
|
onUserClick = _ref.onUserClick,
|
|
53
66
|
includingYou = _ref.includingYou,
|
|
67
|
+
analyticsNext = _ref.analyticsNext,
|
|
54
68
|
isTriggeredByKeyboard = _ref.isTriggeredByKeyboard;
|
|
55
69
|
var _useIntl = useIntl(),
|
|
56
70
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -71,15 +85,25 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
71
85
|
var onMoreClick = useCallback(function () {
|
|
72
86
|
var isOpen = isMoreMembersOpen.current;
|
|
73
87
|
if (!isOpen) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
89
|
+
analyticsNext('ui.teamProfileCard.clicked.moreMembers', function (duration) {
|
|
90
|
+
return _objectSpread({
|
|
91
|
+
duration: duration,
|
|
92
|
+
memberCount: count,
|
|
93
|
+
firedAt: Math.round(getPageTime())
|
|
94
|
+
}, PACKAGE_META_DATA);
|
|
78
95
|
});
|
|
79
|
-
}
|
|
96
|
+
} else {
|
|
97
|
+
analytics(function (duration) {
|
|
98
|
+
return moreMembersClicked({
|
|
99
|
+
duration: duration,
|
|
100
|
+
memberCount: count
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
80
104
|
}
|
|
81
105
|
isMoreMembersOpen.current = !isOpen;
|
|
82
|
-
}, [analytics, count]);
|
|
106
|
+
}, [analytics, count, analyticsNext]);
|
|
83
107
|
var showMoreButtonProps = {
|
|
84
108
|
onClick: onMoreClick,
|
|
85
109
|
'aria-label': formatMessage(messages.profileCardMoreMembersLabel, {
|
|
@@ -94,7 +118,7 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
94
118
|
appearance: "stack",
|
|
95
119
|
data: members.map(function (member, index) {
|
|
96
120
|
var href = generateUserLink === null || generateUserLink === void 0 ? void 0 : generateUserLink(member.id);
|
|
97
|
-
var onClick = onMemberClick(onUserClick, member.id, analytics, index, !!generateUserLink);
|
|
121
|
+
var onClick = onMemberClick(onUserClick, member.id, analytics, analyticsNext, index, !!generateUserLink);
|
|
98
122
|
return {
|
|
99
123
|
key: member.id,
|
|
100
124
|
name: member.fullName,
|
|
@@ -119,17 +143,30 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
119
143
|
}
|
|
120
144
|
})));
|
|
121
145
|
};
|
|
122
|
-
function onActionClick(action, analytics, index) {
|
|
146
|
+
function onActionClick(action, analytics, analyticsNext, index) {
|
|
123
147
|
return function (event) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
149
|
+
analyticsNext('ui.teamProfileCard.clicked.action', function (duration) {
|
|
150
|
+
return _objectSpread({
|
|
151
|
+
duration: duration,
|
|
152
|
+
hasHref: !!action.link,
|
|
153
|
+
hasOnClick: !!action.callback,
|
|
154
|
+
index: index,
|
|
155
|
+
actionId: action.id || '',
|
|
156
|
+
firedAt: Math.round(getPageTime())
|
|
157
|
+
}, PACKAGE_META_DATA);
|
|
131
158
|
});
|
|
132
|
-
}
|
|
159
|
+
} else {
|
|
160
|
+
analytics(function (duration) {
|
|
161
|
+
return actionClicked('team', {
|
|
162
|
+
duration: duration,
|
|
163
|
+
hasHref: !!action.link,
|
|
164
|
+
hasOnClick: !!action.callback,
|
|
165
|
+
index: index,
|
|
166
|
+
actionId: action.id || ''
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}
|
|
133
170
|
if (action.callback && isBasicClick(event)) {
|
|
134
171
|
event.preventDefault();
|
|
135
172
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -142,11 +179,12 @@ function onActionClick(action, analytics, index) {
|
|
|
142
179
|
var ActionButton = function ActionButton(_ref2) {
|
|
143
180
|
var action = _ref2.action,
|
|
144
181
|
analytics = _ref2.analytics,
|
|
182
|
+
analyticsNext = _ref2.analyticsNext,
|
|
145
183
|
index = _ref2.index;
|
|
146
184
|
var isGiveKudosActionButton = action.id === GIVE_KUDOS_ACTION_ID;
|
|
147
185
|
var actionButton = /*#__PURE__*/React.createElement(LinkButton, {
|
|
148
186
|
key: action.id || index,
|
|
149
|
-
onClick: onActionClick(action, analytics, index),
|
|
187
|
+
onClick: onActionClick(action, analytics, analyticsNext, index),
|
|
150
188
|
href: action.link || '',
|
|
151
189
|
target: action.target,
|
|
152
190
|
shouldFitContainer: true
|
|
@@ -158,7 +196,8 @@ var ActionButton = function ActionButton(_ref2) {
|
|
|
158
196
|
};
|
|
159
197
|
var ExtraActions = function ExtraActions(_ref3) {
|
|
160
198
|
var actions = _ref3.actions,
|
|
161
|
-
analytics = _ref3.analytics
|
|
199
|
+
analytics = _ref3.analytics,
|
|
200
|
+
analyticsNext = _ref3.analyticsNext;
|
|
162
201
|
var _useState = useState(false),
|
|
163
202
|
_useState2 = _slicedToArray(_useState, 2),
|
|
164
203
|
isOpen = _useState2[0],
|
|
@@ -167,15 +206,25 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
167
206
|
var onMoreClick = useCallback(function (shouldBeOpen) {
|
|
168
207
|
if (shouldBeOpen) {
|
|
169
208
|
// Only fire this event when OPENING the dropdown
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
209
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
210
|
+
analyticsNext('ui.teamProfileCard.clicked.moreActions', function (duration) {
|
|
211
|
+
return _objectSpread({
|
|
212
|
+
duration: duration,
|
|
213
|
+
numActions: count + 2,
|
|
214
|
+
firedAt: Math.round(getPageTime())
|
|
215
|
+
}, PACKAGE_META_DATA);
|
|
174
216
|
});
|
|
175
|
-
}
|
|
217
|
+
} else {
|
|
218
|
+
analytics(function (duration) {
|
|
219
|
+
return moreActionsClicked('team', {
|
|
220
|
+
duration: duration,
|
|
221
|
+
numActions: count + 2
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
176
225
|
}
|
|
177
226
|
setOpen(shouldBeOpen);
|
|
178
|
-
}, [analytics, count]);
|
|
227
|
+
}, [analytics, count, analyticsNext]);
|
|
179
228
|
if (!count) {
|
|
180
229
|
return null;
|
|
181
230
|
}
|
|
@@ -188,7 +237,7 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
188
237
|
content: function content() {
|
|
189
238
|
return /*#__PURE__*/React.createElement(MenuGroup, null, actions.map(function (action, index) {
|
|
190
239
|
return /*#__PURE__*/React.createElement(LinkItem, {
|
|
191
|
-
onClick: onActionClick(action, analytics, index + 2),
|
|
240
|
+
onClick: onActionClick(action, analytics, analyticsNext, index + 2),
|
|
192
241
|
key: action.id || index,
|
|
193
242
|
href: action.link
|
|
194
243
|
}, action.label);
|
|
@@ -212,7 +261,8 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
212
261
|
};
|
|
213
262
|
var ButtonSection = function ButtonSection(_ref4) {
|
|
214
263
|
var actions = _ref4.actions,
|
|
215
|
-
analytics = _ref4.analytics
|
|
264
|
+
analytics = _ref4.analytics,
|
|
265
|
+
analyticsNext = _ref4.analyticsNext;
|
|
216
266
|
if (!actions) {
|
|
217
267
|
return null;
|
|
218
268
|
}
|
|
@@ -222,17 +272,20 @@ var ButtonSection = function ButtonSection(_ref4) {
|
|
|
222
272
|
return /*#__PURE__*/React.createElement(ActionButton, {
|
|
223
273
|
action: action,
|
|
224
274
|
analytics: analytics,
|
|
275
|
+
analyticsNext: analyticsNext,
|
|
225
276
|
index: index,
|
|
226
277
|
key: index
|
|
227
278
|
});
|
|
228
279
|
}), extraActions && /*#__PURE__*/React.createElement(ExtraActions, {
|
|
229
280
|
actions: extraActions,
|
|
230
|
-
analytics: analytics
|
|
281
|
+
analytics: analytics,
|
|
282
|
+
analyticsNext: analyticsNext
|
|
231
283
|
}));
|
|
232
284
|
};
|
|
233
285
|
var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
234
286
|
var actions = _ref5.actions,
|
|
235
287
|
analytics = _ref5.analytics,
|
|
288
|
+
analyticsNext = _ref5.analyticsNext,
|
|
236
289
|
team = _ref5.team,
|
|
237
290
|
viewingUserId = _ref5.viewingUserId,
|
|
238
291
|
generateUserLink = _ref5.generateUserLink,
|
|
@@ -250,17 +303,33 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
250
303
|
return member.id === viewingUserId;
|
|
251
304
|
});
|
|
252
305
|
useEffect(function () {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
306
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
307
|
+
analyticsNext('ui.teamProfileCard.rendered.content', function (duration) {
|
|
308
|
+
var _team$members$length, _team$members;
|
|
309
|
+
return _objectSpread({
|
|
310
|
+
duration: duration,
|
|
311
|
+
numActions: allActions.length,
|
|
312
|
+
memberCount: (_team$members$length = (_team$members = team.members) === null || _team$members === void 0 ? void 0 : _team$members.length) !== null && _team$members$length !== void 0 ? _team$members$length : null,
|
|
313
|
+
includingYou: includingYou !== null && includingYou !== void 0 ? includingYou : null,
|
|
314
|
+
descriptionLength: team.description.length,
|
|
315
|
+
titleLength: team.displayName.length,
|
|
316
|
+
firedAt: Math.round(getPageTime())
|
|
317
|
+
}, PACKAGE_META_DATA);
|
|
262
318
|
});
|
|
263
|
-
}
|
|
319
|
+
} else {
|
|
320
|
+
analytics(function (duration) {
|
|
321
|
+
var _team$members2;
|
|
322
|
+
return profileCardRendered('team', 'content', {
|
|
323
|
+
duration: duration,
|
|
324
|
+
numActions: allActions.length,
|
|
325
|
+
memberCount: (_team$members2 = team.members) === null || _team$members2 === void 0 ? void 0 : _team$members2.length,
|
|
326
|
+
includingYou: includingYou,
|
|
327
|
+
descriptionLength: team.description.length,
|
|
328
|
+
titleLength: team.displayName.length
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
|
|
264
333
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
265
334
|
}, [analytics]);
|
|
266
335
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
@@ -272,6 +341,7 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
272
341
|
content: team.displayName
|
|
273
342
|
}, /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(TeamName, null, team.displayName), team.isVerified && /*#__PURE__*/React.createElement(VerifiedTeamIcon, null))), /*#__PURE__*/React.createElement(TeamMembers, {
|
|
274
343
|
analytics: analytics,
|
|
344
|
+
analyticsNext: analyticsNext,
|
|
275
345
|
members: team.members,
|
|
276
346
|
generateUserLink: generateUserLink,
|
|
277
347
|
includingYou: includingYou,
|
|
@@ -279,32 +349,53 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
279
349
|
isTriggeredByKeyboard: isTriggeredByKeyboard
|
|
280
350
|
}), team.description.trim() && /*#__PURE__*/React.createElement(DescriptionWrapper, null, /*#__PURE__*/React.createElement(Description, null, team.description)), /*#__PURE__*/React.createElement(ButtonSection, {
|
|
281
351
|
actions: allActions,
|
|
282
|
-
analytics: analytics
|
|
352
|
+
analytics: analytics,
|
|
353
|
+
analyticsNext: analyticsNext
|
|
283
354
|
})));
|
|
284
355
|
};
|
|
285
356
|
var ErrorMessage = function ErrorMessage(_ref6) {
|
|
286
357
|
var analytics = _ref6.analytics,
|
|
358
|
+
analyticsNext = _ref6.analyticsNext,
|
|
287
359
|
clientFetchProfile = _ref6.clientFetchProfile,
|
|
288
360
|
isLoading = _ref6.isLoading;
|
|
289
361
|
var hasRetry = !!clientFetchProfile;
|
|
290
362
|
useEffect(function () {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
363
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
364
|
+
analyticsNext('ui.teamProfileCard.rendered.error', function (duration) {
|
|
365
|
+
return _objectSpread({
|
|
366
|
+
duration: duration,
|
|
367
|
+
hasRetry: hasRetry,
|
|
368
|
+
firedAt: Math.round(getPageTime())
|
|
369
|
+
}, PACKAGE_META_DATA);
|
|
295
370
|
});
|
|
296
|
-
}
|
|
297
|
-
|
|
371
|
+
} else {
|
|
372
|
+
analytics(function (duration) {
|
|
373
|
+
return profileCardRendered('team', 'error', {
|
|
374
|
+
duration: duration,
|
|
375
|
+
hasRetry: hasRetry
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}, [analytics, analyticsNext, hasRetry]);
|
|
298
380
|
var retry = useCallback(function () {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
381
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
382
|
+
analyticsNext('ui.teamProfileCard.clicked.errorRetry', function (duration) {
|
|
383
|
+
return _objectSpread({
|
|
384
|
+
duration: duration,
|
|
385
|
+
firedAt: Math.round(getPageTime())
|
|
386
|
+
}, PACKAGE_META_DATA);
|
|
302
387
|
});
|
|
303
|
-
}
|
|
388
|
+
} else {
|
|
389
|
+
analytics(function (duration) {
|
|
390
|
+
return errorRetryClicked({
|
|
391
|
+
duration: duration
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
}
|
|
304
395
|
if (clientFetchProfile) {
|
|
305
396
|
clientFetchProfile();
|
|
306
397
|
}
|
|
307
|
-
}, [analytics, clientFetchProfile]);
|
|
398
|
+
}, [analytics, analyticsNext, clientFetchProfile]);
|
|
308
399
|
return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
309
400
|
testId: "team-profilecard-error"
|
|
310
401
|
}, /*#__PURE__*/React.createElement(ErrorIllustration, null), /*#__PURE__*/React.createElement(Text, {
|
|
@@ -319,6 +410,7 @@ var ErrorMessage = function ErrorMessage(_ref6) {
|
|
|
319
410
|
};
|
|
320
411
|
var TeamProfileCard = function TeamProfileCard(props) {
|
|
321
412
|
var analytics = props.analytics,
|
|
413
|
+
analyticsNext = props.analyticsNext,
|
|
322
414
|
clientFetchProfile = props.clientFetchProfile,
|
|
323
415
|
hasError = props.hasError,
|
|
324
416
|
isLoading = props.isLoading,
|
|
@@ -327,13 +419,15 @@ var TeamProfileCard = function TeamProfileCard(props) {
|
|
|
327
419
|
if (hasError) {
|
|
328
420
|
if ((errorType === null || errorType === void 0 ? void 0 : errorType.reason) === 'TEAMS_FORBIDDEN') {
|
|
329
421
|
return /*#__PURE__*/React.createElement(TeamForbiddenErrorState, {
|
|
330
|
-
analytics: analytics
|
|
422
|
+
analytics: analytics,
|
|
423
|
+
analyticsNext: analyticsNext
|
|
331
424
|
});
|
|
332
425
|
} else {
|
|
333
426
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
334
427
|
testId: "team-profilecard"
|
|
335
428
|
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
336
429
|
analytics: analytics,
|
|
430
|
+
analyticsNext: analyticsNext,
|
|
337
431
|
clientFetchProfile: clientFetchProfile,
|
|
338
432
|
isLoading: isLoading
|
|
339
433
|
}));
|
|
@@ -341,7 +435,8 @@ var TeamProfileCard = function TeamProfileCard(props) {
|
|
|
341
435
|
}
|
|
342
436
|
if (isLoading) {
|
|
343
437
|
return /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
344
|
-
analytics: analytics
|
|
438
|
+
analytics: analytics,
|
|
439
|
+
analyticsNext: analyticsNext
|
|
345
440
|
});
|
|
346
441
|
}
|
|
347
442
|
if (team) {
|