@atlaskit/profilecard 24.40.2 → 24.42.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 +23 -0
- package/afm-cc/tsconfig.json +0 -6
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +8 -25
- package/dist/cjs/components/Agent/AgentProfileCard.js +6 -3
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/cjs/components/Team/TeamForbiddenErrorState.js +8 -18
- package/dist/cjs/components/Team/TeamLoadingState.js +8 -18
- package/dist/cjs/components/Team/TeamProfileCard.js +76 -162
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/cjs/components/User/OverflowProfileCardButtons.js +9 -19
- package/dist/cjs/components/User/ProfileCard.js +37 -85
- package/dist/cjs/components/User/ProfileCardDetails.js +3 -4
- package/dist/cjs/components/User/ProfileCardResourced.js +10 -3
- package/dist/cjs/components/User/ProfileCardTrigger.js +20 -11
- package/dist/cjs/components/User/ReportingLinesDetails.js +15 -35
- package/dist/cjs/components/common/ProfileCardTrigger.js +9 -17
- package/dist/cjs/components/common/ProfileCardWrapper.js +1 -1
- package/dist/cjs/components/team-profile-card/main.js +5 -21
- package/dist/cjs/components/team-profile-card/team-connections/main.js +7 -23
- package/dist/cjs/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/cjs/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/cjs/styled/Card.js +1 -1
- package/dist/cjs/styled/CoverImage.js +1 -1
- package/dist/cjs/styled/Error.js +1 -1
- package/dist/cjs/styled/ReportingLines.js +1 -1
- package/dist/cjs/styled/TeamCard.js +1 -1
- package/dist/cjs/styled/TeamTrigger.js +1 -1
- package/dist/cjs/styled/UserTrigger.js +1 -1
- package/dist/cjs/util/analytics.js +3 -31
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +8 -26
- package/dist/es2019/components/Agent/AgentProfileCard.js +5 -3
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +20 -73
- package/dist/es2019/components/Team/TeamForbiddenErrorState.js +8 -16
- package/dist/es2019/components/Team/TeamLoadingState.js +8 -16
- package/dist/es2019/components/Team/TeamProfileCard.js +72 -146
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/es2019/components/User/OverflowProfileCardButtons.js +9 -17
- package/dist/es2019/components/User/ProfileCard.js +35 -79
- package/dist/es2019/components/User/ProfileCardDetails.js +3 -4
- package/dist/es2019/components/User/ProfileCardResourced.js +10 -3
- package/dist/es2019/components/User/ProfileCardTrigger.js +12 -3
- package/dist/es2019/components/User/ReportingLinesDetails.js +14 -30
- package/dist/es2019/components/common/ProfileCardTrigger.js +9 -17
- package/dist/es2019/components/common/ProfileCardWrapper.js +1 -1
- package/dist/es2019/components/team-profile-card/main.js +5 -22
- package/dist/es2019/components/team-profile-card/team-connections/main.js +7 -24
- package/dist/es2019/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/es2019/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/es2019/styled/Card.js +1 -1
- package/dist/es2019/styled/CoverImage.js +1 -1
- package/dist/es2019/styled/Error.js +1 -1
- package/dist/es2019/styled/ReportingLines.js +1 -1
- package/dist/es2019/styled/TeamCard.js +1 -1
- package/dist/es2019/styled/TeamTrigger.js +1 -1
- package/dist/es2019/styled/UserTrigger.js +1 -1
- package/dist/es2019/util/analytics.js +2 -29
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +8 -25
- package/dist/esm/components/Agent/AgentProfileCard.js +6 -3
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/esm/components/Team/TeamForbiddenErrorState.js +9 -19
- package/dist/esm/components/Team/TeamLoadingState.js +9 -19
- package/dist/esm/components/Team/TeamProfileCard.js +77 -163
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/esm/components/User/OverflowProfileCardButtons.js +10 -20
- package/dist/esm/components/User/ProfileCard.js +38 -86
- package/dist/esm/components/User/ProfileCardDetails.js +3 -4
- package/dist/esm/components/User/ProfileCardResourced.js +10 -3
- package/dist/esm/components/User/ProfileCardTrigger.js +20 -11
- package/dist/esm/components/User/ReportingLinesDetails.js +16 -36
- package/dist/esm/components/common/ProfileCardTrigger.js +10 -18
- package/dist/esm/components/common/ProfileCardWrapper.js +1 -1
- package/dist/esm/components/team-profile-card/main.js +5 -21
- package/dist/esm/components/team-profile-card/team-connections/main.js +7 -23
- package/dist/esm/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/esm/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/esm/styled/Card.js +1 -1
- package/dist/esm/styled/CoverImage.js +1 -1
- package/dist/esm/styled/Error.js +1 -1
- package/dist/esm/styled/ReportingLines.js +1 -1
- package/dist/esm/styled/TeamCard.js +1 -1
- package/dist/esm/styled/TeamTrigger.js +1 -1
- package/dist/esm/styled/UserTrigger.js +1 -1
- package/dist/esm/util/analytics.js +2 -31
- package/dist/types/components/Agent/AgentProfileCard.d.ts +1 -1
- package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +2 -0
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -1
- package/dist/types/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types/components/User/ProfileCard.d.ts +2 -3
- package/dist/types/components/User/ProfileCardTrigger.d.ts +1 -1
- package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types/components/common/types.d.ts +1 -3
- package/dist/types/types.d.ts +26 -10
- package/dist/types/util/analytics.d.ts +2 -17
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +2 -0
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types-ts4.5/components/User/ProfileCard.d.ts +2 -3
- package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +1 -1
- package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/common/types.d.ts +1 -3
- package/dist/types-ts4.5/types.d.ts +26 -10
- package/dist/types-ts4.5/util/analytics.d.ts +2 -17
- package/package.json +10 -9
|
@@ -23,7 +23,7 @@ import { AnimatedKudosButton, AnimationWrapper, KudosBlobAnimation } from '../..
|
|
|
23
23
|
import { ErrorWrapper, TeamErrorText } from '../../styled/Error';
|
|
24
24
|
import { ActionButtons, ArchiveLozengeWrapper, AvatarSection, Description, DescriptionWrapper, MemberCount, MoreButton, TeamName, WrappedButton } from '../../styled/TeamCard';
|
|
25
25
|
import { CardContent, CardHeader, CardWrapper } from '../../styled/TeamTrigger';
|
|
26
|
-
import {
|
|
26
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
27
27
|
import { isBasicClick } from '../../util/click';
|
|
28
28
|
import { getPageTime } from '../../util/performance';
|
|
29
29
|
import { ErrorIllustration } from '../Error';
|
|
@@ -32,28 +32,17 @@ import TeamLoadingState from './TeamLoadingState';
|
|
|
32
32
|
var LARGE_MEMBER_COUNT = 50;
|
|
33
33
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
34
34
|
var avatarGroupMaxCount = 9;
|
|
35
|
-
function onMemberClick(callback, userId, analytics,
|
|
35
|
+
function onMemberClick(callback, userId, analytics, index, hasHref) {
|
|
36
36
|
return function (event) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
} else {
|
|
48
|
-
analytics(function (duration) {
|
|
49
|
-
return teamAvatarClicked({
|
|
50
|
-
duration: duration,
|
|
51
|
-
hasHref: hasHref,
|
|
52
|
-
hasOnClick: !!callback,
|
|
53
|
-
index: index
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
37
|
+
analytics('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);
|
|
45
|
+
});
|
|
57
46
|
if (callback) {
|
|
58
47
|
callback(userId, event);
|
|
59
48
|
}
|
|
@@ -66,7 +55,6 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
66
55
|
isArchived = _ref.isArchived,
|
|
67
56
|
onUserClick = _ref.onUserClick,
|
|
68
57
|
includingYou = _ref.includingYou,
|
|
69
|
-
analyticsNext = _ref.analyticsNext,
|
|
70
58
|
isTriggeredByKeyboard = _ref.isTriggeredByKeyboard;
|
|
71
59
|
var _useIntl = useIntl(),
|
|
72
60
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -87,25 +75,16 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
87
75
|
var onMoreClick = useCallback(function () {
|
|
88
76
|
var isOpen = isMoreMembersOpen.current;
|
|
89
77
|
if (!isOpen) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
-
} else {
|
|
99
|
-
analytics(function (duration) {
|
|
100
|
-
return moreMembersClicked({
|
|
101
|
-
duration: duration,
|
|
102
|
-
memberCount: count
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
78
|
+
analytics('ui.teamProfileCard.clicked.moreMembers', function (duration) {
|
|
79
|
+
return _objectSpread({
|
|
80
|
+
duration: duration,
|
|
81
|
+
memberCount: count,
|
|
82
|
+
firedAt: Math.round(getPageTime())
|
|
83
|
+
}, PACKAGE_META_DATA);
|
|
84
|
+
});
|
|
106
85
|
}
|
|
107
86
|
isMoreMembersOpen.current = !isOpen;
|
|
108
|
-
}, [analytics, count
|
|
87
|
+
}, [analytics, count]);
|
|
109
88
|
var showMoreButtonProps = {
|
|
110
89
|
onClick: onMoreClick,
|
|
111
90
|
'aria-label': formatMessage(messages.profileCardMoreMembersLabel, {
|
|
@@ -123,7 +102,7 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
123
102
|
appearance: "stack",
|
|
124
103
|
data: members.map(function (member, index) {
|
|
125
104
|
var href = generateUserLink === null || generateUserLink === void 0 ? void 0 : generateUserLink(member.id);
|
|
126
|
-
var onClick = onMemberClick(onUserClick, member.id, analytics,
|
|
105
|
+
var onClick = onMemberClick(onUserClick, member.id, analytics, index, !!generateUserLink);
|
|
127
106
|
return {
|
|
128
107
|
key: member.id,
|
|
129
108
|
name: member.fullName,
|
|
@@ -148,30 +127,18 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
148
127
|
}
|
|
149
128
|
})));
|
|
150
129
|
};
|
|
151
|
-
function onActionClick(action, analytics,
|
|
130
|
+
function onActionClick(action, analytics, index) {
|
|
152
131
|
return function (event) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
});
|
|
164
|
-
} else {
|
|
165
|
-
analytics(function (duration) {
|
|
166
|
-
return actionClicked('team', {
|
|
167
|
-
duration: duration,
|
|
168
|
-
hasHref: !!action.link,
|
|
169
|
-
hasOnClick: !!action.callback,
|
|
170
|
-
index: index,
|
|
171
|
-
actionId: action.id || ''
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
}
|
|
132
|
+
analytics('ui.teamProfileCard.clicked.action', function (duration) {
|
|
133
|
+
return _objectSpread({
|
|
134
|
+
duration: duration,
|
|
135
|
+
hasHref: !!action.link,
|
|
136
|
+
hasOnClick: !!action.callback,
|
|
137
|
+
index: index,
|
|
138
|
+
actionId: action.id || '',
|
|
139
|
+
firedAt: Math.round(getPageTime())
|
|
140
|
+
}, PACKAGE_META_DATA);
|
|
141
|
+
});
|
|
175
142
|
if (action.callback && isBasicClick(event)) {
|
|
176
143
|
event.preventDefault();
|
|
177
144
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -184,12 +151,11 @@ function onActionClick(action, analytics, analyticsNext, index) {
|
|
|
184
151
|
var ActionButton = function ActionButton(_ref2) {
|
|
185
152
|
var action = _ref2.action,
|
|
186
153
|
analytics = _ref2.analytics,
|
|
187
|
-
analyticsNext = _ref2.analyticsNext,
|
|
188
154
|
index = _ref2.index;
|
|
189
155
|
var isGiveKudosActionButton = action.id === GIVE_KUDOS_ACTION_ID;
|
|
190
156
|
var actionButton = /*#__PURE__*/React.createElement(LinkButton, {
|
|
191
157
|
key: action.id || index,
|
|
192
|
-
onClick: onActionClick(action, analytics,
|
|
158
|
+
onClick: onActionClick(action, analytics, index),
|
|
193
159
|
href: action.link || '',
|
|
194
160
|
target: action.target,
|
|
195
161
|
shouldFitContainer: true
|
|
@@ -201,8 +167,7 @@ var ActionButton = function ActionButton(_ref2) {
|
|
|
201
167
|
};
|
|
202
168
|
var ExtraActions = function ExtraActions(_ref3) {
|
|
203
169
|
var actions = _ref3.actions,
|
|
204
|
-
analytics = _ref3.analytics
|
|
205
|
-
analyticsNext = _ref3.analyticsNext;
|
|
170
|
+
analytics = _ref3.analytics;
|
|
206
171
|
var _useState = useState(false),
|
|
207
172
|
_useState2 = _slicedToArray(_useState, 2),
|
|
208
173
|
isOpen = _useState2[0],
|
|
@@ -211,25 +176,16 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
211
176
|
var onMoreClick = useCallback(function (shouldBeOpen) {
|
|
212
177
|
if (shouldBeOpen) {
|
|
213
178
|
// Only fire this event when OPENING the dropdown
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
});
|
|
222
|
-
} else {
|
|
223
|
-
analytics(function (duration) {
|
|
224
|
-
return moreActionsClicked('team', {
|
|
225
|
-
duration: duration,
|
|
226
|
-
numActions: count + 2
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
179
|
+
analytics('ui.teamProfileCard.clicked.moreActions', function (duration) {
|
|
180
|
+
return _objectSpread({
|
|
181
|
+
duration: duration,
|
|
182
|
+
numActions: count + 2,
|
|
183
|
+
firedAt: Math.round(getPageTime())
|
|
184
|
+
}, PACKAGE_META_DATA);
|
|
185
|
+
});
|
|
230
186
|
}
|
|
231
187
|
setOpen(shouldBeOpen);
|
|
232
|
-
}, [analytics, count
|
|
188
|
+
}, [analytics, count]);
|
|
233
189
|
if (!count) {
|
|
234
190
|
return null;
|
|
235
191
|
}
|
|
@@ -242,7 +198,7 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
242
198
|
content: function content() {
|
|
243
199
|
return /*#__PURE__*/React.createElement(MenuGroup, null, actions.map(function (action, index) {
|
|
244
200
|
return /*#__PURE__*/React.createElement(LinkItem, {
|
|
245
|
-
onClick: onActionClick(action, analytics,
|
|
201
|
+
onClick: onActionClick(action, analytics, index + 2),
|
|
246
202
|
key: action.id || index,
|
|
247
203
|
href: action.link
|
|
248
204
|
}, action.label);
|
|
@@ -266,8 +222,7 @@ var ExtraActions = function ExtraActions(_ref3) {
|
|
|
266
222
|
};
|
|
267
223
|
var ButtonSection = function ButtonSection(_ref4) {
|
|
268
224
|
var actions = _ref4.actions,
|
|
269
|
-
analytics = _ref4.analytics
|
|
270
|
-
analyticsNext = _ref4.analyticsNext;
|
|
225
|
+
analytics = _ref4.analytics;
|
|
271
226
|
if (!actions) {
|
|
272
227
|
return null;
|
|
273
228
|
}
|
|
@@ -277,20 +232,17 @@ var ButtonSection = function ButtonSection(_ref4) {
|
|
|
277
232
|
return /*#__PURE__*/React.createElement(ActionButton, {
|
|
278
233
|
action: action,
|
|
279
234
|
analytics: analytics,
|
|
280
|
-
analyticsNext: analyticsNext,
|
|
281
235
|
index: index,
|
|
282
236
|
key: index
|
|
283
237
|
});
|
|
284
238
|
}), extraActions && /*#__PURE__*/React.createElement(ExtraActions, {
|
|
285
239
|
actions: extraActions,
|
|
286
|
-
analytics: analytics
|
|
287
|
-
analyticsNext: analyticsNext
|
|
240
|
+
analytics: analytics
|
|
288
241
|
}));
|
|
289
242
|
};
|
|
290
243
|
var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
291
244
|
var actions = _ref5.actions,
|
|
292
245
|
analytics = _ref5.analytics,
|
|
293
|
-
analyticsNext = _ref5.analyticsNext,
|
|
294
246
|
team = _ref5.team,
|
|
295
247
|
viewingUserId = _ref5.viewingUserId,
|
|
296
248
|
generateUserLink = _ref5.generateUserLink,
|
|
@@ -309,35 +261,21 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
309
261
|
return member.id === viewingUserId;
|
|
310
262
|
});
|
|
311
263
|
useEffect(function () {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var _team$members2;
|
|
328
|
-
return profileCardRendered('team', 'content', {
|
|
329
|
-
duration: duration,
|
|
330
|
-
numActions: allActions.length,
|
|
331
|
-
memberCount: (_team$members2 = team.members) === null || _team$members2 === void 0 ? void 0 : _team$members2.length,
|
|
332
|
-
includingYou: includingYou,
|
|
333
|
-
descriptionLength: team.description.length,
|
|
334
|
-
titleLength: team.displayName.length
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
340
|
-
}, [analytics]);
|
|
264
|
+
analytics('ui.teamProfileCard.rendered.content', function (duration) {
|
|
265
|
+
var _team$members$length, _team$members;
|
|
266
|
+
return _objectSpread({
|
|
267
|
+
duration: duration,
|
|
268
|
+
numActions: allActions.length,
|
|
269
|
+
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,
|
|
270
|
+
includingYou: includingYou !== null && includingYou !== void 0 ? includingYou : null,
|
|
271
|
+
descriptionLength: team.description.length,
|
|
272
|
+
titleLength: team.displayName.length,
|
|
273
|
+
firedAt: Math.round(getPageTime())
|
|
274
|
+
}, PACKAGE_META_DATA);
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
278
|
+
[analytics]);
|
|
341
279
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
342
280
|
testId: "team-profilecard"
|
|
343
281
|
}, /*#__PURE__*/React.createElement(CardHeader, {
|
|
@@ -348,7 +286,6 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
348
286
|
content: team.displayName
|
|
349
287
|
}, /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(TeamName, null, team.displayName), team.isVerified && /*#__PURE__*/React.createElement(VerifiedTeamIcon, null))), /*#__PURE__*/React.createElement(TeamMembers, {
|
|
350
288
|
analytics: analytics,
|
|
351
|
-
analyticsNext: analyticsNext,
|
|
352
289
|
members: team.members,
|
|
353
290
|
isArchived: isTeamArchived,
|
|
354
291
|
generateUserLink: generateUserLink,
|
|
@@ -357,53 +294,34 @@ var TeamProfilecardContent = function TeamProfilecardContent(_ref5) {
|
|
|
357
294
|
isTriggeredByKeyboard: isTriggeredByKeyboard
|
|
358
295
|
}), team.description.trim() && /*#__PURE__*/React.createElement(DescriptionWrapper, null, /*#__PURE__*/React.createElement(Description, null, team.description)), /*#__PURE__*/React.createElement(ButtonSection, {
|
|
359
296
|
actions: allActions,
|
|
360
|
-
analytics: analytics
|
|
361
|
-
analyticsNext: analyticsNext
|
|
297
|
+
analytics: analytics
|
|
362
298
|
})));
|
|
363
299
|
};
|
|
364
300
|
var ErrorMessage = function ErrorMessage(_ref6) {
|
|
365
301
|
var analytics = _ref6.analytics,
|
|
366
|
-
analyticsNext = _ref6.analyticsNext,
|
|
367
302
|
clientFetchProfile = _ref6.clientFetchProfile,
|
|
368
303
|
isLoading = _ref6.isLoading;
|
|
369
304
|
var hasRetry = !!clientFetchProfile;
|
|
370
305
|
useEffect(function () {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
} else {
|
|
380
|
-
analytics(function (duration) {
|
|
381
|
-
return profileCardRendered('team', 'error', {
|
|
382
|
-
duration: duration,
|
|
383
|
-
hasRetry: hasRetry
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
}, [analytics, analyticsNext, hasRetry]);
|
|
306
|
+
analytics('ui.teamProfileCard.rendered.error', function (duration) {
|
|
307
|
+
return _objectSpread({
|
|
308
|
+
duration: duration,
|
|
309
|
+
hasRetry: hasRetry,
|
|
310
|
+
firedAt: Math.round(getPageTime())
|
|
311
|
+
}, PACKAGE_META_DATA);
|
|
312
|
+
});
|
|
313
|
+
}, [analytics, hasRetry]);
|
|
388
314
|
var retry = useCallback(function () {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
});
|
|
396
|
-
} else {
|
|
397
|
-
analytics(function (duration) {
|
|
398
|
-
return errorRetryClicked({
|
|
399
|
-
duration: duration
|
|
400
|
-
});
|
|
401
|
-
});
|
|
402
|
-
}
|
|
315
|
+
analytics('ui.teamProfileCard.clicked.errorRetry', function (duration) {
|
|
316
|
+
return _objectSpread({
|
|
317
|
+
duration: duration,
|
|
318
|
+
firedAt: Math.round(getPageTime())
|
|
319
|
+
}, PACKAGE_META_DATA);
|
|
320
|
+
});
|
|
403
321
|
if (clientFetchProfile) {
|
|
404
322
|
clientFetchProfile();
|
|
405
323
|
}
|
|
406
|
-
}, [analytics,
|
|
324
|
+
}, [analytics, clientFetchProfile]);
|
|
407
325
|
return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
408
326
|
testId: "team-profilecard-error"
|
|
409
327
|
}, /*#__PURE__*/React.createElement(ErrorIllustration, null), /*#__PURE__*/React.createElement(Text, {
|
|
@@ -422,7 +340,6 @@ var ErrorMessage = function ErrorMessage(_ref6) {
|
|
|
422
340
|
*/
|
|
423
341
|
var TeamProfileCard = function TeamProfileCard(props) {
|
|
424
342
|
var analytics = props.analytics,
|
|
425
|
-
analyticsNext = props.analyticsNext,
|
|
426
343
|
clientFetchProfile = props.clientFetchProfile,
|
|
427
344
|
hasError = props.hasError,
|
|
428
345
|
isLoading = props.isLoading,
|
|
@@ -431,15 +348,13 @@ var TeamProfileCard = function TeamProfileCard(props) {
|
|
|
431
348
|
if (hasError) {
|
|
432
349
|
if ((errorType === null || errorType === void 0 ? void 0 : errorType.reason) === 'TEAMS_FORBIDDEN') {
|
|
433
350
|
return /*#__PURE__*/React.createElement(TeamForbiddenErrorState, {
|
|
434
|
-
analytics: analytics
|
|
435
|
-
analyticsNext: analyticsNext
|
|
351
|
+
analytics: analytics
|
|
436
352
|
});
|
|
437
353
|
} else {
|
|
438
354
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
439
355
|
testId: "team-profilecard"
|
|
440
356
|
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
441
357
|
analytics: analytics,
|
|
442
|
-
analyticsNext: analyticsNext,
|
|
443
358
|
clientFetchProfile: clientFetchProfile,
|
|
444
359
|
isLoading: isLoading
|
|
445
360
|
}));
|
|
@@ -447,8 +362,7 @@ var TeamProfileCard = function TeamProfileCard(props) {
|
|
|
447
362
|
}
|
|
448
363
|
if (isLoading) {
|
|
449
364
|
return /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
450
|
-
analytics: analytics
|
|
451
|
-
analyticsNext: analyticsNext
|
|
365
|
+
analytics: analytics
|
|
452
366
|
});
|
|
453
367
|
}
|
|
454
368
|
if (team) {
|
|
@@ -246,8 +246,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
246
246
|
var newProps = {
|
|
247
247
|
clientFetchProfile: _this.clientFetchProfile,
|
|
248
248
|
actions: _this.filterActions(),
|
|
249
|
-
analytics:
|
|
250
|
-
analyticsNext: _this.fireAnalyticsWithDuration,
|
|
249
|
+
analytics: _this.fireAnalyticsWithDuration,
|
|
251
250
|
team: data || undefined,
|
|
252
251
|
generateUserLink: generateUserLink,
|
|
253
252
|
onUserClick: onUserClick,
|
|
@@ -257,8 +256,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
257
256
|
};
|
|
258
257
|
return /*#__PURE__*/React.createElement("div", _this.cardListeners, _this.state.visible && /*#__PURE__*/React.createElement(Suspense, {
|
|
259
258
|
fallback: /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
260
|
-
analytics:
|
|
261
|
-
analyticsNext: _this.fireAnalyticsWithDuration
|
|
259
|
+
analytics: _this.fireAnalyticsWithDuration
|
|
262
260
|
})
|
|
263
261
|
}, /*#__PURE__*/React.createElement(TeamProfileCardLazy, _extends({}, newProps, {
|
|
264
262
|
isLoading: isLoading,
|
|
@@ -13,7 +13,7 @@ import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import messages from '../../messages';
|
|
15
15
|
import { OverflowActionButtonsWrapper } from '../../styled/Card';
|
|
16
|
-
import {
|
|
16
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
17
17
|
import { getPageTime } from '../../util/performance';
|
|
18
18
|
export var ACTION_OVERFLOW_THRESHOLD = 2;
|
|
19
19
|
export var OverflowProfileCardButtons = function OverflowProfileCardButtons(props) {
|
|
@@ -23,33 +23,23 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
|
|
|
23
23
|
setOpen = _useState2[1];
|
|
24
24
|
var actions = props.actions,
|
|
25
25
|
onItemClick = props.onItemClick,
|
|
26
|
-
fireAnalyticsWithDuration = props.fireAnalyticsWithDuration
|
|
27
|
-
fireAnalyticsWithDurationNext = props.fireAnalyticsWithDurationNext;
|
|
26
|
+
fireAnalyticsWithDuration = props.fireAnalyticsWithDuration;
|
|
28
27
|
var numActions = actions.length + ACTION_OVERFLOW_THRESHOLD;
|
|
29
28
|
var onOpenChange = useCallback(function (_ref) {
|
|
30
29
|
var nextOpen = _ref.isOpen;
|
|
31
30
|
setOpen(function (prevOpen) {
|
|
32
31
|
if (nextOpen && !prevOpen) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
fireAnalyticsWithDuration(function (duration) {
|
|
43
|
-
return moreActionsClicked('user', {
|
|
44
|
-
duration: duration,
|
|
45
|
-
numActions: numActions
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
32
|
+
fireAnalyticsWithDuration('ui.profilecard.clicked.moreActions', function (duration) {
|
|
33
|
+
return _objectSpread({
|
|
34
|
+
duration: duration,
|
|
35
|
+
numActions: numActions,
|
|
36
|
+
firedAt: Math.round(getPageTime())
|
|
37
|
+
}, PACKAGE_META_DATA);
|
|
38
|
+
});
|
|
49
39
|
}
|
|
50
40
|
return nextOpen;
|
|
51
41
|
});
|
|
52
|
-
}, [numActions, fireAnalyticsWithDuration
|
|
42
|
+
}, [numActions, fireAnalyticsWithDuration]);
|
|
53
43
|
return /*#__PURE__*/React.createElement(OverflowActionButtonsWrapper, {
|
|
54
44
|
testId: "profilecard-actions-overflow"
|
|
55
45
|
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|