@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
|
@@ -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) {
|
|
@@ -6,6 +6,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
9
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
13
|
import React, { Suspense } from 'react';
|
|
@@ -13,13 +15,14 @@ import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
|
13
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
14
16
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
15
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
16
19
|
import Popup from '@atlaskit/popup';
|
|
17
|
-
|
|
18
|
-
import {
|
|
20
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
21
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
19
22
|
import { layers } from '@atlaskit/theme/constants';
|
|
20
23
|
import _filterActions from '../../internal/filterActions';
|
|
21
24
|
import messages from '../../messages';
|
|
22
|
-
import { cardTriggered, fireEvent, profileCardRendered } from '../../util/analytics';
|
|
25
|
+
import { cardTriggered, fireEvent, PACKAGE_META_DATA, profileCardRendered } from '../../util/analytics';
|
|
23
26
|
import { isBasicClick } from '../../util/click';
|
|
24
27
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
25
28
|
import { getPageTime } from '../../util/performance';
|
|
@@ -48,10 +51,28 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
48
51
|
fireEvent(_this.props.createAnalyticsEvent, payload);
|
|
49
52
|
}
|
|
50
53
|
});
|
|
54
|
+
_defineProperty(_this, "fireAnalyticsNext", function (eventKey) {
|
|
55
|
+
// Don't fire any analytics if the component is unmounted
|
|
56
|
+
if (!_this._isMounted) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (_this.props.fireEvent) {
|
|
60
|
+
var _this$props;
|
|
61
|
+
for (var _len2 = arguments.length, attributes = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
62
|
+
attributes[_key2 - 1] = arguments[_key2];
|
|
63
|
+
}
|
|
64
|
+
(_this$props = _this.props).fireEvent.apply(_this$props, [eventKey].concat(attributes));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
51
67
|
_defineProperty(_this, "fireAnalyticsWithDuration", function (generator) {
|
|
52
68
|
var event = generator(getPageTime() - _this.openTime);
|
|
53
69
|
_this.fireAnalytics(event);
|
|
54
70
|
});
|
|
71
|
+
_defineProperty(_this, "fireAnalyticsWithDurationNext", function (eventKey, generator) {
|
|
72
|
+
var duration = getPageTime() - _this.openTime;
|
|
73
|
+
var attributes = generator(duration);
|
|
74
|
+
_this.fireAnalyticsNext(eventKey, attributes);
|
|
75
|
+
});
|
|
55
76
|
_defineProperty(_this, "hideProfilecard", function () {
|
|
56
77
|
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
57
78
|
clearTimeout(_this.showTimer);
|
|
@@ -93,7 +114,16 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
93
114
|
_this.openedByHover = false;
|
|
94
115
|
_this.showProfilecard(0);
|
|
95
116
|
if (!_this.state.visible) {
|
|
96
|
-
|
|
117
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
118
|
+
_this.fireAnalyticsNext('ui.teamProfileCard.triggered', _objectSpread(_objectSpread({
|
|
119
|
+
method: 'click'
|
|
120
|
+
}, PACKAGE_META_DATA), {}, {
|
|
121
|
+
firedAt: Math.round(getPageTime()),
|
|
122
|
+
teamId: _this.props.teamId
|
|
123
|
+
}));
|
|
124
|
+
} else {
|
|
125
|
+
_this.fireAnalytics(cardTriggered('team', 'click', _this.props.teamId));
|
|
126
|
+
}
|
|
97
127
|
}
|
|
98
128
|
}
|
|
99
129
|
});
|
|
@@ -103,7 +133,16 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
103
133
|
}
|
|
104
134
|
if (!_this.state.visible) {
|
|
105
135
|
_this.openedByHover = true;
|
|
106
|
-
|
|
136
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
137
|
+
_this.fireAnalyticsNext('ui.teamProfileCard.triggered', _objectSpread(_objectSpread({
|
|
138
|
+
method: 'hover'
|
|
139
|
+
}, PACKAGE_META_DATA), {}, {
|
|
140
|
+
firedAt: Math.round(getPageTime()),
|
|
141
|
+
teamId: _this.props.teamId
|
|
142
|
+
}));
|
|
143
|
+
} else {
|
|
144
|
+
_this.fireAnalytics(cardTriggered('team', 'hover', _this.props.teamId));
|
|
145
|
+
}
|
|
107
146
|
}
|
|
108
147
|
_this.showProfilecard(DELAY_MS_SHOW);
|
|
109
148
|
});
|
|
@@ -123,7 +162,15 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
123
162
|
});
|
|
124
163
|
_this.showProfilecard(0);
|
|
125
164
|
if (!_this.state.visible) {
|
|
126
|
-
|
|
165
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
166
|
+
_this.fireAnalyticsNext('ui.teamProfileCard.triggered', _objectSpread({
|
|
167
|
+
method: 'click',
|
|
168
|
+
firedAt: Math.round(getPageTime()),
|
|
169
|
+
teamId: _this.props.teamId
|
|
170
|
+
}, PACKAGE_META_DATA));
|
|
171
|
+
} else {
|
|
172
|
+
_this.fireAnalytics(cardTriggered('team', 'click', _this.props.teamId));
|
|
173
|
+
}
|
|
127
174
|
}
|
|
128
175
|
}
|
|
129
176
|
});
|
|
@@ -176,9 +223,9 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
176
223
|
isTriggeredByKeyboard: false
|
|
177
224
|
});
|
|
178
225
|
_defineProperty(_this, "clientFetchProfile", function () {
|
|
179
|
-
var _this$
|
|
180
|
-
orgId = _this$
|
|
181
|
-
teamId = _this$
|
|
226
|
+
var _this$props2 = _this.props,
|
|
227
|
+
orgId = _this$props2.orgId,
|
|
228
|
+
teamId = _this$props2.teamId;
|
|
182
229
|
var isLoading = _this.state.isLoading;
|
|
183
230
|
if (isLoading === true) {
|
|
184
231
|
// don't fetch data when fetching is in process
|
|
@@ -191,13 +238,20 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
191
238
|
var fireEvent = function fireEvent(event) {
|
|
192
239
|
_this.fireAnalytics(event);
|
|
193
240
|
};
|
|
194
|
-
var
|
|
241
|
+
var fireAnalyticsNext = function fireAnalyticsNext(eventKey) {
|
|
242
|
+
var _this2;
|
|
243
|
+
for (var _len3 = arguments.length, attributes = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
244
|
+
attributes[_key3 - 1] = arguments[_key3];
|
|
245
|
+
}
|
|
246
|
+
(_this2 = _this).fireAnalyticsNext.apply(_this2, [eventKey].concat(attributes));
|
|
247
|
+
};
|
|
248
|
+
var requests = Promise.all([_this.props.resourceClient.getTeamProfile(teamId, orgId, fireEvent, fireAnalyticsNext), _this.props.resourceClient.shouldShowGiveKudos(), _this.props.resourceClient.getTeamCentralBaseUrl({
|
|
195
249
|
withOrgContext: true,
|
|
196
250
|
withSiteContext: true
|
|
197
251
|
})]);
|
|
198
252
|
requests.then(function (res) {
|
|
199
|
-
var
|
|
200
|
-
return (
|
|
253
|
+
var _this3;
|
|
254
|
+
return (_this3 = _this).handleClientSuccess.apply(_this3, _toConsumableArray(res));
|
|
201
255
|
}, function (err) {
|
|
202
256
|
return _this.handleClientError(err);
|
|
203
257
|
}).catch(function (err) {
|
|
@@ -206,20 +260,27 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
206
260
|
});
|
|
207
261
|
});
|
|
208
262
|
_defineProperty(_this, "onErrorBoundary", function () {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
263
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
264
|
+
_this.fireAnalyticsNext('ui.teamProfileCard.rendered.errorBoundary', _objectSpread(_objectSpread({}, PACKAGE_META_DATA), {}, {
|
|
265
|
+
firedAt: Math.round(getPageTime()),
|
|
266
|
+
duration: 0
|
|
267
|
+
}));
|
|
268
|
+
} else {
|
|
269
|
+
_this.fireAnalytics(profileCardRendered('team', 'errorBoundary', {
|
|
270
|
+
duration: 0
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
212
273
|
_this.setState({
|
|
213
274
|
renderError: true
|
|
214
275
|
});
|
|
215
276
|
});
|
|
216
277
|
_defineProperty(_this, "renderProfileCard", function () {
|
|
217
|
-
var _this$
|
|
218
|
-
generateUserLink = _this$
|
|
219
|
-
onUserClick = _this$
|
|
220
|
-
viewingUserId = _this$
|
|
221
|
-
viewProfileLink = _this$
|
|
222
|
-
viewProfileOnClick = _this$
|
|
278
|
+
var _this$props3 = _this.props,
|
|
279
|
+
generateUserLink = _this$props3.generateUserLink,
|
|
280
|
+
onUserClick = _this$props3.onUserClick,
|
|
281
|
+
viewingUserId = _this$props3.viewingUserId,
|
|
282
|
+
viewProfileLink = _this$props3.viewProfileLink,
|
|
283
|
+
viewProfileOnClick = _this$props3.viewProfileOnClick;
|
|
223
284
|
var _this$state = _this.state,
|
|
224
285
|
data = _this$state.data,
|
|
225
286
|
error = _this$state.error,
|
|
@@ -229,6 +290,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
229
290
|
clientFetchProfile: _this.clientFetchProfile,
|
|
230
291
|
actions: _this.filterActions(),
|
|
231
292
|
analytics: _this.fireAnalyticsWithDuration,
|
|
293
|
+
analyticsNext: _this.fireAnalyticsWithDurationNext,
|
|
232
294
|
team: data || undefined,
|
|
233
295
|
generateUserLink: generateUserLink,
|
|
234
296
|
onUserClick: onUserClick,
|
|
@@ -238,7 +300,8 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
238
300
|
};
|
|
239
301
|
return /*#__PURE__*/React.createElement("div", _this.cardListeners, _this.state.visible && /*#__PURE__*/React.createElement(Suspense, {
|
|
240
302
|
fallback: /*#__PURE__*/React.createElement(TeamLoadingState, {
|
|
241
|
-
analytics: _this.fireAnalyticsWithDuration
|
|
303
|
+
analytics: _this.fireAnalyticsWithDuration,
|
|
304
|
+
analyticsNext: _this.fireAnalyticsWithDurationNext
|
|
242
305
|
})
|
|
243
306
|
}, /*#__PURE__*/React.createElement(TeamProfileCardLazy, _extends({}, newProps, {
|
|
244
307
|
isLoading: isLoading,
|
|
@@ -264,11 +327,11 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
264
327
|
}));
|
|
265
328
|
});
|
|
266
329
|
_defineProperty(_this, "renderTrigger", function (triggerProps) {
|
|
267
|
-
var _this$
|
|
268
|
-
children = _this$
|
|
269
|
-
intl = _this$
|
|
270
|
-
triggerLinkType = _this$
|
|
271
|
-
viewProfileLink = _this$
|
|
330
|
+
var _this$props4 = _this.props,
|
|
331
|
+
children = _this$props4.children,
|
|
332
|
+
intl = _this$props4.intl,
|
|
333
|
+
triggerLinkType = _this$props4.triggerLinkType,
|
|
334
|
+
viewProfileLink = _this$props4.viewProfileLink;
|
|
272
335
|
if (triggerLinkType === 'none') {
|
|
273
336
|
return /*#__PURE__*/React.createElement(React.Fragment, null, _this.renderKudosLauncher(), /*#__PURE__*/React.createElement(Box, _extends({
|
|
274
337
|
as: "span",
|
|
@@ -303,10 +366,10 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
303
366
|
}, {
|
|
304
367
|
key: "componentDidUpdate",
|
|
305
368
|
value: function componentDidUpdate(prevProps) {
|
|
306
|
-
var _this$
|
|
307
|
-
orgId = _this$
|
|
308
|
-
teamId = _this$
|
|
309
|
-
resourceClient = _this$
|
|
369
|
+
var _this$props5 = this.props,
|
|
370
|
+
orgId = _this$props5.orgId,
|
|
371
|
+
teamId = _this$props5.teamId,
|
|
372
|
+
resourceClient = _this$props5.resourceClient;
|
|
310
373
|
var visible = this.state.visible;
|
|
311
374
|
|
|
312
375
|
// just re-fetching data when the card opens
|
|
@@ -352,14 +415,14 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
352
415
|
}, {
|
|
353
416
|
key: "filterActions",
|
|
354
417
|
value: function filterActions() {
|
|
355
|
-
var
|
|
418
|
+
var _this4 = this;
|
|
356
419
|
var actions = _filterActions(this.props.actions, this.state.data);
|
|
357
420
|
if (this.state.shouldShowGiveKudos) {
|
|
358
421
|
var kudosAction = {
|
|
359
422
|
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.giveKudosButton),
|
|
360
423
|
id: 'give-kudos',
|
|
361
424
|
callback: function callback() {
|
|
362
|
-
|
|
425
|
+
_this4.openKudosDrawer();
|
|
363
426
|
},
|
|
364
427
|
link: this.kudosUrl()
|
|
365
428
|
};
|
|
@@ -370,7 +433,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
370
433
|
}, {
|
|
371
434
|
key: "renderPopup",
|
|
372
435
|
value: function renderPopup() {
|
|
373
|
-
var
|
|
436
|
+
var _this5 = this;
|
|
374
437
|
if (this.state.renderError) {
|
|
375
438
|
return this.props.children;
|
|
376
439
|
}
|
|
@@ -382,7 +445,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
382
445
|
placement: this.props.position,
|
|
383
446
|
content: this.renderProfileCard,
|
|
384
447
|
trigger: function trigger(triggerProps) {
|
|
385
|
-
return
|
|
448
|
+
return _this5.renderTrigger(triggerProps);
|
|
386
449
|
},
|
|
387
450
|
zIndex: layers.modal(),
|
|
388
451
|
shouldFlip: true,
|
|
@@ -408,4 +471,11 @@ _defineProperty(TeamProfileCardTriggerInternal, "defaultProps", {
|
|
|
408
471
|
triggerLinkType: 'link',
|
|
409
472
|
shouldRenderToParent: true
|
|
410
473
|
});
|
|
411
|
-
|
|
474
|
+
var TeamProfileCardTriggerWithAnalytics = function TeamProfileCardTriggerWithAnalytics(props) {
|
|
475
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
476
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
477
|
+
return /*#__PURE__*/React.createElement(TeamProfileCardTriggerInternal, _extends({}, props, {
|
|
478
|
+
fireEvent: fireEvent
|
|
479
|
+
}));
|
|
480
|
+
};
|
|
481
|
+
export default componentWithFG('ptc-enable-profile-card-analytics-refactor', injectIntl(TeamProfileCardTriggerWithAnalytics), withAnalyticsEvents()(injectIntl(TeamProfileCardTriggerInternal)));
|