@atlaskit/profilecard 24.14.0 → 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 +21 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/error-state--default.png +0 -0
- package/__tests__/vr-tests/agent-profilecard.vr.tsx +7 -1
- package/__tests__/vr-tests/user-profilecard.vr.tsx +42 -6
- 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/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +25 -11
- package/dist/cjs/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/cjs/components/Agent/ActionsCompiled.js +150 -0
- package/dist/cjs/components/Agent/AgentDeleteConfirmationModal.js +2 -4
- package/dist/cjs/components/Agent/AgentProfileCard.js +28 -14
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/cjs/components/Agent/AgentProfileCardCompiled.js +257 -0
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.js +9 -8
- package/dist/cjs/components/Agent/ConversationStarters.js +2 -4
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/cjs/components/Error/ErrorMessage.js +3 -3
- 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 +107 -36
- package/dist/cjs/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/cjs/components/User/ProfileCardDetails.js +2 -4
- package/dist/cjs/components/User/ReportingLinesDetails.js +4 -1
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/cjs/components/User/ReportingLinesDetailsCompiled.js +109 -0
- package/dist/cjs/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/cjs/components/common/ProfileCardWrapper.js +9 -8
- package/dist/cjs/components/team-profile-card/main.js +18 -9
- package/dist/cjs/components/team-profile-card/team-actions/more-actions/index.js +2 -4
- package/dist/cjs/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/cjs/styled/CoverImage.compiled.css +2 -0
- package/dist/cjs/styled/CoverImage.js +4 -2
- package/dist/cjs/styled/Error.compiled.css +0 -2
- package/dist/cjs/styled/Error.js +5 -3
- package/dist/cjs/util/analytics.js +57 -2
- 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/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +26 -11
- package/dist/es2019/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/es2019/components/Agent/ActionsCompiled.js +127 -0
- package/dist/es2019/components/Agent/AgentDeleteConfirmationModal.js +1 -2
- package/dist/es2019/components/Agent/AgentProfileCard.js +28 -13
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/es2019/components/Agent/AgentProfileCardCompiled.js +200 -0
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +9 -5
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +7 -2
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.js +8 -7
- package/dist/es2019/components/Agent/ConversationStarters.js +1 -3
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +62 -30
- package/dist/es2019/components/Error/ErrorMessage.js +1 -2
- 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 +75 -12
- package/dist/es2019/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/es2019/components/User/ProfileCardDetails.js +1 -4
- package/dist/es2019/components/User/ReportingLinesDetails.js +4 -1
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/es2019/components/User/ReportingLinesDetailsCompiled.js +96 -0
- package/dist/es2019/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/es2019/components/common/ProfileCardWrapper.js +8 -7
- package/dist/es2019/components/team-profile-card/main.js +19 -9
- package/dist/es2019/components/team-profile-card/team-actions/more-actions/index.js +1 -2
- package/dist/es2019/components/team-profile-card/team-connections/main.js +38 -17
- package/dist/es2019/styled/CoverImage.compiled.css +2 -0
- package/dist/es2019/styled/CoverImage.js +4 -2
- package/dist/es2019/styled/Error.compiled.css +0 -2
- package/dist/es2019/styled/Error.js +6 -4
- package/dist/es2019/util/analytics.js +57 -2
- 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/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +25 -11
- package/dist/esm/components/Agent/ActionsCompiled.compiled.css +19 -0
- package/dist/esm/components/Agent/ActionsCompiled.js +141 -0
- package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +1 -2
- package/dist/esm/components/Agent/AgentProfileCard.js +29 -13
- package/dist/esm/components/Agent/AgentProfileCardCompiled.compiled.css +8 -0
- package/dist/esm/components/Agent/AgentProfileCardCompiled.js +248 -0
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +8 -5
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +6 -2
- package/dist/esm/components/Agent/AgentProfileCardWrapper.compiled.css +1 -0
- package/dist/esm/components/Agent/AgentProfileCardWrapper.js +8 -7
- package/dist/esm/components/Agent/ConversationStarters.js +1 -3
- package/dist/esm/components/Agent/hooks/useAgentActions.js +61 -30
- package/dist/esm/components/Error/ErrorMessage.js +1 -2
- 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 +106 -36
- package/dist/esm/components/User/ProfileCardDetails.compiled.css +0 -1
- package/dist/esm/components/User/ProfileCardDetails.js +1 -4
- package/dist/esm/components/User/ReportingLinesDetails.js +4 -1
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.compiled.css +11 -0
- package/dist/esm/components/User/ReportingLinesDetailsCompiled.js +102 -0
- package/dist/esm/components/common/ProfileCardWrapper.compiled.css +1 -0
- package/dist/esm/components/common/ProfileCardWrapper.js +8 -7
- package/dist/esm/components/team-profile-card/main.js +18 -9
- package/dist/esm/components/team-profile-card/team-actions/more-actions/index.js +1 -2
- package/dist/esm/components/team-profile-card/team-connections/main.js +36 -17
- package/dist/esm/styled/CoverImage.compiled.css +2 -0
- package/dist/esm/styled/CoverImage.js +4 -2
- package/dist/esm/styled/Error.compiled.css +0 -2
- package/dist/esm/styled/Error.js +6 -4
- package/dist/esm/util/analytics.js +57 -2
- 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/Agent/Actions.d.ts +10 -1
- package/dist/types/components/Agent/ActionsCompiled.d.ts +14 -0
- package/dist/types/components/Agent/AgentProfileCard.d.ts +13 -3
- package/dist/types/components/Agent/AgentProfileCardCompiled.d.ts +4 -0
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +12 -1
- 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/components/User/ReportingLinesDetails.d.ts +2 -2
- package/dist/types/components/User/ReportingLinesDetailsCompiled.d.ts +5 -0
- 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/Agent/Actions.d.ts +10 -1
- package/dist/types-ts4.5/components/Agent/ActionsCompiled.d.ts +14 -0
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +13 -3
- package/dist/types-ts4.5/components/Agent/AgentProfileCardCompiled.d.ts +4 -0
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +12 -1
- 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/components/User/ReportingLinesDetails.d.ts +2 -2
- package/dist/types-ts4.5/components/User/ReportingLinesDetailsCompiled.d.ts +5 -0
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/dist/types-ts4.5/util/analytics.d.ts +46 -2
- package/package.json +15 -9
|
@@ -17,22 +17,34 @@ import { AnimatedKudosButton, AnimationWrapper, KudosBlobAnimation } from '../..
|
|
|
17
17
|
import { ErrorWrapper, TeamErrorText } from '../../styled/Error';
|
|
18
18
|
import { ActionButtons, AvatarSection, Description, DescriptionWrapper, MemberCount, MoreButton, TeamName, WrappedButton } from '../../styled/TeamCard';
|
|
19
19
|
import { CardContent, CardHeader, CardWrapper } from '../../styled/TeamTrigger';
|
|
20
|
-
import { actionClicked, errorRetryClicked, moreActionsClicked, moreMembersClicked, profileCardRendered, teamAvatarClicked } from '../../util/analytics';
|
|
20
|
+
import { actionClicked, errorRetryClicked, moreActionsClicked, moreMembersClicked, PACKAGE_META_DATA, profileCardRendered, teamAvatarClicked } from '../../util/analytics';
|
|
21
21
|
import { isBasicClick } from '../../util/click';
|
|
22
|
+
import { getPageTime } from '../../util/performance';
|
|
22
23
|
import { ErrorIllustration } from '../Error';
|
|
23
24
|
import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
24
25
|
import TeamLoadingState from './TeamLoadingState';
|
|
25
26
|
const LARGE_MEMBER_COUNT = 50;
|
|
26
27
|
const GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
27
28
|
const avatarGroupMaxCount = 9;
|
|
28
|
-
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
29
|
+
function onMemberClick(callback, userId, analytics, analyticsNext, index, hasHref) {
|
|
29
30
|
return event => {
|
|
30
|
-
analytics
|
|
31
|
-
duration
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
32
|
+
analyticsNext('ui.teamProfileCard.clicked.avatar', duration => ({
|
|
33
|
+
duration,
|
|
34
|
+
hasHref,
|
|
35
|
+
hasOnClick: !!callback,
|
|
36
|
+
index,
|
|
37
|
+
firedAt: Math.round(getPageTime()),
|
|
38
|
+
...PACKAGE_META_DATA
|
|
39
|
+
}));
|
|
40
|
+
} else {
|
|
41
|
+
analytics(duration => teamAvatarClicked({
|
|
42
|
+
duration,
|
|
43
|
+
hasHref,
|
|
44
|
+
hasOnClick: !!callback,
|
|
45
|
+
index
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
36
48
|
if (callback) {
|
|
37
49
|
callback(userId, event);
|
|
38
50
|
}
|
|
@@ -44,6 +56,7 @@ const TeamMembers = ({
|
|
|
44
56
|
members,
|
|
45
57
|
onUserClick,
|
|
46
58
|
includingYou,
|
|
59
|
+
analyticsNext,
|
|
47
60
|
isTriggeredByKeyboard
|
|
48
61
|
}) => {
|
|
49
62
|
const {
|
|
@@ -68,13 +81,22 @@ const TeamMembers = ({
|
|
|
68
81
|
current: isOpen
|
|
69
82
|
} = isMoreMembersOpen;
|
|
70
83
|
if (!isOpen) {
|
|
71
|
-
analytics
|
|
72
|
-
duration
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
85
|
+
analyticsNext('ui.teamProfileCard.clicked.moreMembers', duration => ({
|
|
86
|
+
duration,
|
|
87
|
+
memberCount: count,
|
|
88
|
+
firedAt: Math.round(getPageTime()),
|
|
89
|
+
...PACKAGE_META_DATA
|
|
90
|
+
}));
|
|
91
|
+
} else {
|
|
92
|
+
analytics(duration => moreMembersClicked({
|
|
93
|
+
duration,
|
|
94
|
+
memberCount: count
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
75
97
|
}
|
|
76
98
|
isMoreMembersOpen.current = !isOpen;
|
|
77
|
-
}, [analytics, count]);
|
|
99
|
+
}, [analytics, count, analyticsNext]);
|
|
78
100
|
const showMoreButtonProps = {
|
|
79
101
|
onClick: onMoreClick,
|
|
80
102
|
'aria-label': formatMessage(messages.profileCardMoreMembersLabel, {
|
|
@@ -89,7 +111,7 @@ const TeamMembers = ({
|
|
|
89
111
|
appearance: "stack",
|
|
90
112
|
data: members.map((member, index) => {
|
|
91
113
|
const href = generateUserLink === null || generateUserLink === void 0 ? void 0 : generateUserLink(member.id);
|
|
92
|
-
const onClick = onMemberClick(onUserClick, member.id, analytics, index, !!generateUserLink);
|
|
114
|
+
const onClick = onMemberClick(onUserClick, member.id, analytics, analyticsNext, index, !!generateUserLink);
|
|
93
115
|
return {
|
|
94
116
|
key: member.id,
|
|
95
117
|
name: member.fullName,
|
|
@@ -112,15 +134,27 @@ const TeamMembers = ({
|
|
|
112
134
|
}
|
|
113
135
|
})));
|
|
114
136
|
};
|
|
115
|
-
function onActionClick(action, analytics, index) {
|
|
137
|
+
function onActionClick(action, analytics, analyticsNext, index) {
|
|
116
138
|
return (event, ...args) => {
|
|
117
|
-
|
|
118
|
-
duration
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
139
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
140
|
+
analyticsNext('ui.teamProfileCard.clicked.action', duration => ({
|
|
141
|
+
duration,
|
|
142
|
+
hasHref: !!action.link,
|
|
143
|
+
hasOnClick: !!action.callback,
|
|
144
|
+
index,
|
|
145
|
+
actionId: action.id || '',
|
|
146
|
+
firedAt: Math.round(getPageTime()),
|
|
147
|
+
...PACKAGE_META_DATA
|
|
148
|
+
}));
|
|
149
|
+
} else {
|
|
150
|
+
analytics(duration => actionClicked('team', {
|
|
151
|
+
duration,
|
|
152
|
+
hasHref: !!action.link,
|
|
153
|
+
hasOnClick: !!action.callback,
|
|
154
|
+
index,
|
|
155
|
+
actionId: action.id || ''
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
124
158
|
if (action.callback && isBasicClick(event)) {
|
|
125
159
|
event.preventDefault();
|
|
126
160
|
action.callback(event, ...args);
|
|
@@ -130,12 +164,13 @@ function onActionClick(action, analytics, index) {
|
|
|
130
164
|
const ActionButton = ({
|
|
131
165
|
action,
|
|
132
166
|
analytics,
|
|
167
|
+
analyticsNext,
|
|
133
168
|
index
|
|
134
169
|
}) => {
|
|
135
170
|
const isGiveKudosActionButton = action.id === GIVE_KUDOS_ACTION_ID;
|
|
136
171
|
const actionButton = /*#__PURE__*/React.createElement(LinkButton, {
|
|
137
172
|
key: action.id || index,
|
|
138
|
-
onClick: onActionClick(action, analytics, index),
|
|
173
|
+
onClick: onActionClick(action, analytics, analyticsNext, index),
|
|
139
174
|
href: action.link || '',
|
|
140
175
|
target: action.target,
|
|
141
176
|
shouldFitContainer: true
|
|
@@ -147,20 +182,30 @@ const ActionButton = ({
|
|
|
147
182
|
};
|
|
148
183
|
const ExtraActions = ({
|
|
149
184
|
actions,
|
|
150
|
-
analytics
|
|
185
|
+
analytics,
|
|
186
|
+
analyticsNext
|
|
151
187
|
}) => {
|
|
152
188
|
const [isOpen, setOpen] = useState(false);
|
|
153
189
|
const count = actions.length;
|
|
154
190
|
const onMoreClick = useCallback(shouldBeOpen => {
|
|
155
191
|
if (shouldBeOpen) {
|
|
156
192
|
// Only fire this event when OPENING the dropdown
|
|
157
|
-
|
|
158
|
-
duration
|
|
159
|
-
|
|
160
|
-
|
|
193
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
194
|
+
analyticsNext('ui.teamProfileCard.clicked.moreActions', duration => ({
|
|
195
|
+
duration,
|
|
196
|
+
numActions: count + 2,
|
|
197
|
+
firedAt: Math.round(getPageTime()),
|
|
198
|
+
...PACKAGE_META_DATA
|
|
199
|
+
}));
|
|
200
|
+
} else {
|
|
201
|
+
analytics(duration => moreActionsClicked('team', {
|
|
202
|
+
duration,
|
|
203
|
+
numActions: count + 2
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
161
206
|
}
|
|
162
207
|
setOpen(shouldBeOpen);
|
|
163
|
-
}, [analytics, count]);
|
|
208
|
+
}, [analytics, count, analyticsNext]);
|
|
164
209
|
if (!count) {
|
|
165
210
|
return null;
|
|
166
211
|
}
|
|
@@ -169,7 +214,7 @@ const ExtraActions = ({
|
|
|
169
214
|
onClose: () => setOpen(false),
|
|
170
215
|
placement: "bottom-start",
|
|
171
216
|
content: () => /*#__PURE__*/React.createElement(MenuGroup, null, actions.map((action, index) => /*#__PURE__*/React.createElement(LinkItem, {
|
|
172
|
-
onClick: onActionClick(action, analytics, index + 2),
|
|
217
|
+
onClick: onActionClick(action, analytics, analyticsNext, index + 2),
|
|
173
218
|
key: action.id || index,
|
|
174
219
|
href: action.link
|
|
175
220
|
}, action.label))),
|
|
@@ -189,7 +234,8 @@ const ExtraActions = ({
|
|
|
189
234
|
};
|
|
190
235
|
const ButtonSection = ({
|
|
191
236
|
actions,
|
|
192
|
-
analytics
|
|
237
|
+
analytics,
|
|
238
|
+
analyticsNext
|
|
193
239
|
}) => {
|
|
194
240
|
if (!actions) {
|
|
195
241
|
return null;
|
|
@@ -199,16 +245,19 @@ const ButtonSection = ({
|
|
|
199
245
|
return /*#__PURE__*/React.createElement(ActionButtons, null, initialActions.map((action, index) => /*#__PURE__*/React.createElement(ActionButton, {
|
|
200
246
|
action: action,
|
|
201
247
|
analytics: analytics,
|
|
248
|
+
analyticsNext: analyticsNext,
|
|
202
249
|
index: index,
|
|
203
250
|
key: index
|
|
204
251
|
})), extraActions && /*#__PURE__*/React.createElement(ExtraActions, {
|
|
205
252
|
actions: extraActions,
|
|
206
|
-
analytics: analytics
|
|
253
|
+
analytics: analytics,
|
|
254
|
+
analyticsNext: analyticsNext
|
|
207
255
|
}));
|
|
208
256
|
};
|
|
209
257
|
const TeamProfilecardContent = ({
|
|
210
258
|
actions,
|
|
211
259
|
analytics,
|
|
260
|
+
analyticsNext,
|
|
212
261
|
team,
|
|
213
262
|
viewingUserId,
|
|
214
263
|
generateUserLink,
|
|
@@ -225,17 +274,34 @@ const TeamProfilecardContent = ({
|
|
|
225
274
|
}, ...(actions || [])];
|
|
226
275
|
const includingYou = team.members && team.members.some(member => member.id === viewingUserId);
|
|
227
276
|
useEffect(() => {
|
|
228
|
-
analytics
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
277
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
278
|
+
analyticsNext('ui.teamProfileCard.rendered.content', duration => {
|
|
279
|
+
var _team$members$length, _team$members;
|
|
280
|
+
return {
|
|
281
|
+
duration,
|
|
282
|
+
numActions: allActions.length,
|
|
283
|
+
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,
|
|
284
|
+
includingYou: includingYou !== null && includingYou !== void 0 ? includingYou : null,
|
|
285
|
+
descriptionLength: team.description.length,
|
|
286
|
+
titleLength: team.displayName.length,
|
|
287
|
+
firedAt: Math.round(getPageTime()),
|
|
288
|
+
...PACKAGE_META_DATA
|
|
289
|
+
};
|
|
237
290
|
});
|
|
238
|
-
}
|
|
291
|
+
} else {
|
|
292
|
+
analytics(duration => {
|
|
293
|
+
var _team$members2;
|
|
294
|
+
return profileCardRendered('team', 'content', {
|
|
295
|
+
duration,
|
|
296
|
+
numActions: allActions.length,
|
|
297
|
+
memberCount: (_team$members2 = team.members) === null || _team$members2 === void 0 ? void 0 : _team$members2.length,
|
|
298
|
+
includingYou,
|
|
299
|
+
descriptionLength: team.description.length,
|
|
300
|
+
titleLength: team.displayName.length
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
239
305
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
240
306
|
}, [analytics]);
|
|
241
307
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
@@ -247,6 +313,7 @@ const TeamProfilecardContent = ({
|
|
|
247
313
|
content: team.displayName
|
|
248
314
|
}, /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(TeamName, null, team.displayName), team.isVerified && /*#__PURE__*/React.createElement(VerifiedTeamIcon, null))), /*#__PURE__*/React.createElement(TeamMembers, {
|
|
249
315
|
analytics: analytics,
|
|
316
|
+
analyticsNext: analyticsNext,
|
|
250
317
|
members: team.members,
|
|
251
318
|
generateUserLink: generateUserLink,
|
|
252
319
|
includingYou: includingYou,
|
|
@@ -254,29 +321,48 @@ const TeamProfilecardContent = ({
|
|
|
254
321
|
isTriggeredByKeyboard: isTriggeredByKeyboard
|
|
255
322
|
}), team.description.trim() && /*#__PURE__*/React.createElement(DescriptionWrapper, null, /*#__PURE__*/React.createElement(Description, null, team.description)), /*#__PURE__*/React.createElement(ButtonSection, {
|
|
256
323
|
actions: allActions,
|
|
257
|
-
analytics: analytics
|
|
324
|
+
analytics: analytics,
|
|
325
|
+
analyticsNext: analyticsNext
|
|
258
326
|
})));
|
|
259
327
|
};
|
|
260
328
|
const ErrorMessage = ({
|
|
261
329
|
analytics,
|
|
330
|
+
analyticsNext,
|
|
262
331
|
clientFetchProfile,
|
|
263
332
|
isLoading
|
|
264
333
|
}) => {
|
|
265
334
|
const hasRetry = !!clientFetchProfile;
|
|
266
335
|
useEffect(() => {
|
|
267
|
-
|
|
268
|
-
duration
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
336
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
337
|
+
analyticsNext('ui.teamProfileCard.rendered.error', duration => ({
|
|
338
|
+
duration,
|
|
339
|
+
hasRetry,
|
|
340
|
+
firedAt: Math.round(getPageTime()),
|
|
341
|
+
...PACKAGE_META_DATA
|
|
342
|
+
}));
|
|
343
|
+
} else {
|
|
344
|
+
analytics(duration => profileCardRendered('team', 'error', {
|
|
345
|
+
duration,
|
|
346
|
+
hasRetry
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
349
|
+
}, [analytics, analyticsNext, hasRetry]);
|
|
272
350
|
const retry = useCallback(() => {
|
|
273
|
-
analytics
|
|
274
|
-
duration
|
|
275
|
-
|
|
351
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
352
|
+
analyticsNext('ui.teamProfileCard.clicked.errorRetry', duration => ({
|
|
353
|
+
duration,
|
|
354
|
+
firedAt: Math.round(getPageTime()),
|
|
355
|
+
...PACKAGE_META_DATA
|
|
356
|
+
}));
|
|
357
|
+
} else {
|
|
358
|
+
analytics(duration => errorRetryClicked({
|
|
359
|
+
duration
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
276
362
|
if (clientFetchProfile) {
|
|
277
363
|
clientFetchProfile();
|
|
278
364
|
}
|
|
279
|
-
}, [analytics, clientFetchProfile]);
|
|
365
|
+
}, [analytics, analyticsNext, clientFetchProfile]);
|
|
280
366
|
return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
281
367
|
testId: "team-profilecard-error"
|
|
282
368
|
}, /*#__PURE__*/React.createElement(ErrorIllustration, null), /*#__PURE__*/React.createElement(Text, {
|
|
@@ -292,6 +378,7 @@ const ErrorMessage = ({
|
|
|
292
378
|
const TeamProfileCard = props => {
|
|
293
379
|
const {
|
|
294
380
|
analytics,
|
|
381
|
+
analyticsNext,
|
|
295
382
|
clientFetchProfile,
|
|
296
383
|
hasError,
|
|
297
384
|
isLoading,
|
|
@@ -301,13 +388,15 @@ const TeamProfileCard = props => {
|
|
|
301
388
|
if (hasError) {
|
|
302
389
|
if ((errorType === null || errorType === void 0 ? void 0 : errorType.reason) === 'TEAMS_FORBIDDEN') {
|
|
303
390
|
return /*#__PURE__*/React.createElement(TeamForbiddenErrorState, {
|
|
304
|
-
analytics: analytics
|
|
391
|
+
analytics: analytics,
|
|
392
|
+
analyticsNext: analyticsNext
|
|
305
393
|
});
|
|
306
394
|
} else {
|
|
307
395
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
308
396
|
testId: "team-profilecard"
|
|
309
397
|
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
310
398
|
analytics: analytics,
|
|
399
|
+
analyticsNext: analyticsNext,
|
|
311
400
|
clientFetchProfile: clientFetchProfile,
|
|
312
401
|
isLoading: isLoading
|
|
313
402
|
}));
|
|
@@ -315,7 +404,8 @@ const TeamProfileCard = props => {
|
|
|
315
404
|
}
|
|
316
405
|
if (isLoading) {
|
|
317
406
|
return /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
318
|
-
analytics: analytics
|
|
407
|
+
analytics: analytics,
|
|
408
|
+
analyticsNext: analyticsNext
|
|
319
409
|
});
|
|
320
410
|
}
|
|
321
411
|
if (team) {
|
|
@@ -5,13 +5,14 @@ import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
|
5
5
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
6
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
8
9
|
import Popup from '@atlaskit/popup';
|
|
9
|
-
|
|
10
|
-
import {
|
|
10
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
11
12
|
import { layers } from '@atlaskit/theme/constants';
|
|
12
13
|
import filterActions from '../../internal/filterActions';
|
|
13
14
|
import messages from '../../messages';
|
|
14
|
-
import { cardTriggered, fireEvent, profileCardRendered } from '../../util/analytics';
|
|
15
|
+
import { cardTriggered, fireEvent, PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
15
16
|
import { isBasicClick } from '../../util/click';
|
|
16
17
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
17
18
|
import { getPageTime } from '../../util/performance';
|
|
@@ -35,10 +36,24 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
35
36
|
fireEvent(this.props.createAnalyticsEvent, payload);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
39
|
+
_defineProperty(this, "fireAnalyticsNext", (eventKey, ...attributes) => {
|
|
40
|
+
// Don't fire any analytics if the component is unmounted
|
|
41
|
+
if (!this._isMounted) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (this.props.fireEvent) {
|
|
45
|
+
this.props.fireEvent(eventKey, ...attributes);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
38
48
|
_defineProperty(this, "fireAnalyticsWithDuration", generator => {
|
|
39
49
|
const event = generator(getPageTime() - this.openTime);
|
|
40
50
|
this.fireAnalytics(event);
|
|
41
51
|
});
|
|
52
|
+
_defineProperty(this, "fireAnalyticsWithDurationNext", (eventKey, generator) => {
|
|
53
|
+
const duration = getPageTime() - this.openTime;
|
|
54
|
+
const attributes = generator(duration);
|
|
55
|
+
this.fireAnalyticsNext(eventKey, attributes);
|
|
56
|
+
});
|
|
42
57
|
_defineProperty(this, "hideProfilecard", (delay = 0) => {
|
|
43
58
|
clearTimeout(this.showTimer);
|
|
44
59
|
clearTimeout(this.hideTimer);
|
|
@@ -78,7 +93,16 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
78
93
|
this.openedByHover = false;
|
|
79
94
|
this.showProfilecard(0);
|
|
80
95
|
if (!this.state.visible) {
|
|
81
|
-
|
|
96
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
97
|
+
this.fireAnalyticsNext('ui.teamProfileCard.triggered', {
|
|
98
|
+
method: 'click',
|
|
99
|
+
...PACKAGE_META_DATA,
|
|
100
|
+
firedAt: Math.round(getPageTime()),
|
|
101
|
+
teamId: this.props.teamId
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
this.fireAnalytics(cardTriggered('team', 'click', this.props.teamId));
|
|
105
|
+
}
|
|
82
106
|
}
|
|
83
107
|
}
|
|
84
108
|
});
|
|
@@ -88,7 +112,16 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
88
112
|
}
|
|
89
113
|
if (!this.state.visible) {
|
|
90
114
|
this.openedByHover = true;
|
|
91
|
-
|
|
115
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
116
|
+
this.fireAnalyticsNext('ui.teamProfileCard.triggered', {
|
|
117
|
+
method: 'hover',
|
|
118
|
+
...PACKAGE_META_DATA,
|
|
119
|
+
firedAt: Math.round(getPageTime()),
|
|
120
|
+
teamId: this.props.teamId
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
this.fireAnalytics(cardTriggered('team', 'hover', this.props.teamId));
|
|
124
|
+
}
|
|
92
125
|
}
|
|
93
126
|
this.showProfilecard(DELAY_MS_SHOW);
|
|
94
127
|
});
|
|
@@ -108,7 +141,16 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
108
141
|
});
|
|
109
142
|
this.showProfilecard(0);
|
|
110
143
|
if (!this.state.visible) {
|
|
111
|
-
|
|
144
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
145
|
+
this.fireAnalyticsNext('ui.teamProfileCard.triggered', {
|
|
146
|
+
method: 'click',
|
|
147
|
+
firedAt: Math.round(getPageTime()),
|
|
148
|
+
teamId: this.props.teamId,
|
|
149
|
+
...PACKAGE_META_DATA
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
this.fireAnalytics(cardTriggered('team', 'click', this.props.teamId));
|
|
153
|
+
}
|
|
112
154
|
}
|
|
113
155
|
}
|
|
114
156
|
});
|
|
@@ -179,7 +221,10 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
179
221
|
const fireEvent = event => {
|
|
180
222
|
this.fireAnalytics(event);
|
|
181
223
|
};
|
|
182
|
-
const
|
|
224
|
+
const fireAnalyticsNext = (eventKey, ...attributes) => {
|
|
225
|
+
this.fireAnalyticsNext(eventKey, ...attributes);
|
|
226
|
+
};
|
|
227
|
+
const requests = Promise.all([this.props.resourceClient.getTeamProfile(teamId, orgId, fireEvent, fireAnalyticsNext), this.props.resourceClient.shouldShowGiveKudos(), this.props.resourceClient.getTeamCentralBaseUrl({
|
|
183
228
|
withOrgContext: true,
|
|
184
229
|
withSiteContext: true
|
|
185
230
|
})]);
|
|
@@ -187,9 +232,17 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
187
232
|
});
|
|
188
233
|
});
|
|
189
234
|
_defineProperty(this, "onErrorBoundary", () => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
235
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
236
|
+
this.fireAnalyticsNext('ui.teamProfileCard.rendered.errorBoundary', {
|
|
237
|
+
...PACKAGE_META_DATA,
|
|
238
|
+
firedAt: Math.round(getPageTime()),
|
|
239
|
+
duration: 0
|
|
240
|
+
});
|
|
241
|
+
} else {
|
|
242
|
+
this.fireAnalytics(profileCardRendered('team', 'errorBoundary', {
|
|
243
|
+
duration: 0
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
193
246
|
this.setState({
|
|
194
247
|
renderError: true
|
|
195
248
|
});
|
|
@@ -212,6 +265,7 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
212
265
|
clientFetchProfile: this.clientFetchProfile,
|
|
213
266
|
actions: this.filterActions(),
|
|
214
267
|
analytics: this.fireAnalyticsWithDuration,
|
|
268
|
+
analyticsNext: this.fireAnalyticsWithDurationNext,
|
|
215
269
|
team: data || undefined,
|
|
216
270
|
generateUserLink,
|
|
217
271
|
onUserClick,
|
|
@@ -221,7 +275,8 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
|
|
|
221
275
|
};
|
|
222
276
|
return /*#__PURE__*/React.createElement("div", this.cardListeners, this.state.visible && /*#__PURE__*/React.createElement(Suspense, {
|
|
223
277
|
fallback: /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
224
|
-
analytics: this.fireAnalyticsWithDuration
|
|
278
|
+
analytics: this.fireAnalyticsWithDuration,
|
|
279
|
+
analyticsNext: this.fireAnalyticsWithDurationNext
|
|
225
280
|
})
|
|
226
281
|
}, /*#__PURE__*/React.createElement(TeamProfileCardLazy, _extends({}, newProps, {
|
|
227
282
|
isLoading: isLoading,
|
|
@@ -372,4 +427,12 @@ _defineProperty(TeamProfileCardTriggerInternal, "defaultProps", {
|
|
|
372
427
|
triggerLinkType: 'link',
|
|
373
428
|
shouldRenderToParent: true
|
|
374
429
|
});
|
|
375
|
-
|
|
430
|
+
const TeamProfileCardTriggerWithAnalytics = props => {
|
|
431
|
+
const {
|
|
432
|
+
fireEvent
|
|
433
|
+
} = useAnalyticsEvents();
|
|
434
|
+
return /*#__PURE__*/React.createElement(TeamProfileCardTriggerInternal, _extends({}, props, {
|
|
435
|
+
fireEvent: fireEvent
|
|
436
|
+
}));
|
|
437
|
+
};
|
|
438
|
+
export default componentWithFG('ptc-enable-profile-card-analytics-refactor', injectIntl(TeamProfileCardTriggerWithAnalytics), withAnalyticsEvents()(injectIntl(TeamProfileCardTriggerInternal)));
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
._18u0ze3t{margin-left:var(--ds-space-0,0)}
|
|
6
6
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
7
7
|
._19pkxy5q{margin-top:var(--ds-space-400,2pc)}
|
|
8
|
-
._19pkze3t{margin-top:var(--ds-space-0,0)}
|
|
9
8
|
._1bguutpp#profilecard-name-label{margin-bottom:var(--ds-space-150,9pt)}
|
|
10
9
|
._1bto1l2s{text-overflow:ellipsis}
|
|
11
10
|
._1hpmutpp#profilecard-name-label{margin-top:var(--ds-space-150,9pt)}
|
|
@@ -7,16 +7,13 @@ import { cx } from '@compiled/react';
|
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import Lozenge from '@atlaskit/lozenge';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
|
|
11
|
-
import { Text } from '@atlaskit/primitives';
|
|
12
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
13
11
|
import relativeDate from '../../internal/relative-date';
|
|
14
12
|
import messages from '../../messages';
|
|
15
13
|
import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
|
|
16
14
|
import { IconLabel } from '../Icon';
|
|
17
15
|
import ReportingLinesDetails from './ReportingLinesDetails';
|
|
18
16
|
const styles = {
|
|
19
|
-
detailedListWrapper: "_19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
|
|
20
17
|
detailedListWrapperNext: "_19pkxy5q _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
|
|
21
18
|
fullNameLabel: "_1reo15vq _18m915vq _11c81ixg _1bto1l2s _o5721q9c",
|
|
22
19
|
noMetaLabel: "_2hwxidpf _18u0idpf _rcujxy5q _1l6uutpp",
|
|
@@ -6,6 +6,7 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
|
6
6
|
import Avatar from '@atlaskit/avatar';
|
|
7
7
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
9
10
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
10
11
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
11
12
|
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
@@ -13,6 +14,7 @@ import messages from '../../messages';
|
|
|
13
14
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
14
15
|
import { PACKAGE_META_DATA, reportingLinesClicked } from '../../util/analytics';
|
|
15
16
|
import { getPageTime } from '../../util/performance';
|
|
17
|
+
import { default as ReportingLinesDetailsCompiled } from './ReportingLinesDetailsCompiled';
|
|
16
18
|
function getProfileHref(userId, profileUrl) {
|
|
17
19
|
return profileUrl ? profileUrl + userId : undefined;
|
|
18
20
|
}
|
|
@@ -122,4 +124,5 @@ const ReportingLinesDetails = props => {
|
|
|
122
124
|
showMoreButtonProps: showMoreButtonProps
|
|
123
125
|
})));
|
|
124
126
|
};
|
|
125
|
-
|
|
127
|
+
const ReportingLinesDetailsExport = componentWithFG('profilecard_primitives_compiled', ReportingLinesDetailsCompiled, ReportingLinesDetails);
|
|
128
|
+
export default ReportingLinesDetailsExport;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
3
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
4
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
5
|
+
._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
|
|
6
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
7
|
+
._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
|
|
8
|
+
._otyrze3t{margin-bottom:var(--ds-space-0,0)}
|
|
9
|
+
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
10
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
11
|
+
._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
|