@atlaskit/profilecard 24.13.6 → 24.14.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 +19 -0
- package/__tests__/vr-tests/__snapshots__/agent-profilecard/agent-profile-card-example--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/alternate-actions--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/best-case-profile--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/bot-case-profile--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/error-state--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/error-state-not-found--default.png +0 -0
- package/__tests__/vr-tests/__snapshots__/user-profilecard/worst-case-profile--default.png +0 -0
- package/__tests__/vr-tests/agent-profilecard.vr.tsx +5 -0
- package/__tests__/vr-tests/user-profilecard.vr.tsx +17 -0
- package/afm-cc/tsconfig.json +6 -0
- package/afm-dev-agents/tsconfig.json +6 -0
- package/afm-jira/tsconfig.json +6 -0
- package/afm-passionfruit/tsconfig.json +6 -0
- package/afm-post-office/tsconfig.json +6 -0
- package/afm-rovo-extension/tsconfig.json +6 -0
- package/afm-townsquare/tsconfig.json +6 -0
- package/dist/cjs/client/ProfileCardClient.js +2 -2
- package/dist/cjs/client/UserProfileCardClient.js +45 -11
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCard.js +3 -0
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/cjs/components/Error/ErrorMessage.js +18 -7
- package/dist/cjs/components/User/OverflowProfileCardButtons.js +22 -7
- package/dist/cjs/components/User/ProfileCard.js +80 -28
- package/dist/cjs/components/User/ProfileCardDetails.js +3 -2
- package/dist/cjs/components/User/ProfileCardResourced.js +40 -16
- package/dist/cjs/components/User/ProfileCardTrigger.js +53 -13
- package/dist/cjs/components/User/ReportingLinesDetails.js +37 -12
- package/dist/cjs/components/User/UserLoadingState.js +15 -3
- package/dist/cjs/components/common/LoadingState.js +17 -3
- package/dist/cjs/components/common/ProfileCardTrigger.js +29 -7
- package/dist/cjs/components/common/ProfileCardWrapper.js +4 -2
- package/dist/cjs/components/team-profile-card/main.js +1 -1
- package/dist/cjs/components/team-profile-card/team-connections/main.js +3 -19
- 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/mocks/mock-profile-client.js +10 -0
- package/dist/cjs/mocks/profile-data.js +2 -2
- package/dist/cjs/mocks/reporting-lines-data.js +4 -3
- 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 +7 -3
- package/dist/es2019/client/ProfileCardClient.js +2 -2
- package/dist/es2019/client/UserProfileCardClient.js +50 -13
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCard.js +3 -0
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/es2019/components/Error/ErrorMessage.js +17 -6
- package/dist/es2019/components/User/OverflowProfileCardButtons.js +18 -7
- package/dist/es2019/components/User/ProfileCard.js +72 -25
- package/dist/es2019/components/User/ProfileCardDetails.js +3 -2
- package/dist/es2019/components/User/ProfileCardResourced.js +25 -4
- package/dist/es2019/components/User/ProfileCardTrigger.js +55 -14
- package/dist/es2019/components/User/ReportingLinesDetails.js +31 -10
- package/dist/es2019/components/User/UserLoadingState.js +14 -4
- package/dist/es2019/components/common/LoadingState.js +16 -4
- package/dist/es2019/components/common/ProfileCardTrigger.js +26 -7
- package/dist/es2019/components/common/ProfileCardWrapper.js +4 -2
- package/dist/es2019/components/team-profile-card/main.js +1 -1
- package/dist/es2019/components/team-profile-card/team-connections/main.js +3 -18
- 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/mocks/mock-profile-client.js +6 -0
- package/dist/es2019/mocks/profile-data.js +1 -1
- package/dist/es2019/mocks/reporting-lines-data.js +2 -2
- 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 +6 -2
- package/dist/esm/client/ProfileCardClient.js +2 -2
- package/dist/esm/client/UserProfileCardClient.js +46 -12
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCard.js +3 -0
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/esm/components/Error/ErrorMessage.js +19 -6
- package/dist/esm/components/User/OverflowProfileCardButtons.js +23 -8
- package/dist/esm/components/User/ProfileCard.js +80 -28
- package/dist/esm/components/User/ProfileCardDetails.js +3 -2
- package/dist/esm/components/User/ProfileCardResourced.js +40 -16
- package/dist/esm/components/User/ProfileCardTrigger.js +54 -14
- package/dist/esm/components/User/ReportingLinesDetails.js +38 -12
- package/dist/esm/components/User/UserLoadingState.js +16 -4
- package/dist/esm/components/common/LoadingState.js +18 -4
- package/dist/esm/components/common/ProfileCardTrigger.js +30 -8
- package/dist/esm/components/common/ProfileCardWrapper.js +4 -2
- package/dist/esm/components/team-profile-card/main.js +1 -1
- package/dist/esm/components/team-profile-card/team-connections/main.js +3 -18
- 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/mocks/mock-profile-client.js +10 -0
- package/dist/esm/mocks/profile-data.js +1 -1
- package/dist/esm/mocks/reporting-lines-data.js +2 -2
- 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 +6 -2
- package/dist/types/client/ProfileCardClient.d.ts +2 -1
- package/dist/types/client/TeamCentralCardClient.d.ts +2 -2
- package/dist/types/client/UserProfileCardClient.d.ts +2 -1
- package/dist/types/components/Error/ErrorMessage.d.ts +2 -0
- package/dist/types/components/User/ProfileCard.d.ts +3 -2
- package/dist/types/components/User/ProfileCardResourced.d.ts +4 -2
- package/dist/types/components/User/UserLoadingState.d.ts +3 -1
- package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types/components/common/LoadingState.d.ts +3 -1
- package/dist/types/components/common/ProfileCardWrapper.d.ts +2 -1
- package/dist/types/components/common/types.d.ts +3 -0
- package/dist/types/mocks/profile-data.d.ts +1 -0
- package/dist/types/types.d.ts +13 -6
- package/dist/types/util/analytics.d.ts +5 -0
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +2 -1
- package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +2 -2
- package/dist/types-ts4.5/client/UserProfileCardClient.d.ts +2 -1
- package/dist/types-ts4.5/components/Error/ErrorMessage.d.ts +2 -0
- package/dist/types-ts4.5/components/User/ProfileCard.d.ts +3 -2
- package/dist/types-ts4.5/components/User/ProfileCardResourced.d.ts +4 -2
- package/dist/types-ts4.5/components/User/UserLoadingState.d.ts +3 -1
- package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/common/LoadingState.d.ts +3 -1
- package/dist/types-ts4.5/components/common/ProfileCardWrapper.d.ts +2 -1
- package/dist/types-ts4.5/components/common/types.d.ts +3 -0
- package/dist/types-ts4.5/mocks/profile-data.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +13 -6
- package/dist/types-ts4.5/util/analytics.d.ts +5 -0
- package/package.json +12 -10
|
@@ -5,9 +5,10 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.ProfilecardInternal = void 0;
|
|
8
|
+
exports.default = exports.ProfilecardInternal = exports.LoadingView = void 0;
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -15,7 +16,9 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
15
16
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
16
17
|
var _new = require("@atlaskit/button/new");
|
|
17
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
18
20
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
21
|
+
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
19
22
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
23
|
var _messages = _interopRequireDefault(require("../../messages"));
|
|
21
24
|
var _Card = require("../../styled/Card");
|
|
@@ -27,6 +30,8 @@ var _Error = require("../Error");
|
|
|
27
30
|
var _OverflowProfileCardButtons = require("./OverflowProfileCardButtons");
|
|
28
31
|
var _ProfileCardDetails = require("./ProfileCardDetails");
|
|
29
32
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
33
|
+
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; }
|
|
34
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
30
35
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
31
36
|
var useKudos = function useKudos(cloudId, userId, teamCentralBaseUrl, openKudosDrawer) {
|
|
32
37
|
var kudosUrl = (0, _react.useMemo)(function () {
|
|
@@ -67,6 +72,8 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
|
|
|
67
72
|
_useState2 = (0, _slicedToArray2.default)(_useState, 1),
|
|
68
73
|
openTime = _useState2[0];
|
|
69
74
|
var createAnalyticsEvent = props.createAnalyticsEvent;
|
|
75
|
+
var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
76
|
+
fireEventNext = _useAnalyticsEvents.fireEvent;
|
|
70
77
|
var fireAnalytics = (0, _react.useCallback)(function (payload) {
|
|
71
78
|
if (createAnalyticsEvent) {
|
|
72
79
|
(0, _analytics.fireEvent)(createAnalyticsEvent, payload);
|
|
@@ -77,6 +84,11 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
|
|
|
77
84
|
var event = generator(elapsed);
|
|
78
85
|
fireAnalytics(event);
|
|
79
86
|
}, [fireAnalytics, openTime]);
|
|
87
|
+
var fireAnalyticsWithDurationNext = (0, _react.useCallback)(function (eventKey, generator) {
|
|
88
|
+
var duration = (0, _performance.getPageTime)() - openTime;
|
|
89
|
+
var attributes = generator(duration);
|
|
90
|
+
fireEventNext(eventKey, attributes);
|
|
91
|
+
}, [openTime, fireEventNext]);
|
|
80
92
|
var _useKudos = useKudos(props.cloudId, props.userId, props.teamCentralBaseUrl, props.openKudosDrawer),
|
|
81
93
|
kudosAction = _useKudos.kudosAction;
|
|
82
94
|
var _props$actions = props.actions,
|
|
@@ -97,24 +109,36 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
|
|
|
97
109
|
var canRender = !hasError && !isLoading && !!(fullName || status === 'closed');
|
|
98
110
|
(0, _react.useEffect)(function () {
|
|
99
111
|
if (canRender) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
113
|
+
fireAnalyticsWithDurationNext('ui.profilecard.rendered.content', function (duration) {
|
|
114
|
+
return _objectSpread({
|
|
115
|
+
duration: duration,
|
|
116
|
+
numActions: realActions.length,
|
|
117
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
118
|
+
}, _analytics.PACKAGE_META_DATA);
|
|
104
119
|
});
|
|
105
|
-
}
|
|
120
|
+
} else {
|
|
121
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
122
|
+
return (0, _analytics.profileCardRendered)('user', 'content', {
|
|
123
|
+
duration: duration,
|
|
124
|
+
numActions: realActions.length
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
106
128
|
}
|
|
107
|
-
}, [canRender, fireAnalyticsWithDuration, realActions]);
|
|
129
|
+
}, [canRender, fireAnalyticsWithDuration, fireAnalyticsWithDurationNext, realActions]);
|
|
108
130
|
if (hasError) {
|
|
109
131
|
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(_Error.ErrorMessage, {
|
|
110
132
|
reload: props.clientFetchProfile,
|
|
111
133
|
errorType: props.errorType || null,
|
|
112
|
-
fireAnalytics: fireAnalytics
|
|
134
|
+
fireAnalytics: fireAnalytics,
|
|
135
|
+
fireAnalyticsNext: fireEventNext
|
|
113
136
|
}));
|
|
114
137
|
}
|
|
115
138
|
if (isLoading) {
|
|
116
139
|
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(LoadingView, {
|
|
117
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
140
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
141
|
+
fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
|
|
118
142
|
}));
|
|
119
143
|
}
|
|
120
144
|
if (!canRender) {
|
|
@@ -130,36 +154,53 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
|
|
|
130
154
|
borderColor: "var(--ds-shadow-overlay, ".concat(_colors.N0, ")")
|
|
131
155
|
})), /*#__PURE__*/_react.default.createElement(_Card.CardContent, null, /*#__PURE__*/_react.default.createElement(_ProfileCardDetails.ProfileCardDetails, (0, _extends2.default)({}, props, {
|
|
132
156
|
status: status,
|
|
133
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
157
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
158
|
+
fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
|
|
134
159
|
})), realActions && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Card.ActionsFlexSpacer, null), /*#__PURE__*/_react.default.createElement(Actions, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('jfp_a11y_team_profile_card_actions_label') && {
|
|
135
160
|
fullName: fullName
|
|
136
161
|
}, {
|
|
137
162
|
fullName: fullName,
|
|
138
163
|
actions: realActions,
|
|
139
164
|
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
140
|
-
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard
|
|
165
|
+
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
|
|
166
|
+
fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
|
|
141
167
|
}))))));
|
|
142
168
|
};
|
|
143
169
|
var Actions = function Actions(_ref) {
|
|
144
170
|
var actions = _ref.actions,
|
|
145
171
|
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
|
|
172
|
+
fireAnalyticsWithDurationNext = _ref.fireAnalyticsWithDurationNext,
|
|
146
173
|
isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
|
|
147
174
|
fullName = _ref.fullName;
|
|
148
175
|
var onActionClick = (0, _react.useCallback)(function (action, args, event, index) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
176
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
177
|
+
fireAnalyticsWithDurationNext('ui.profilecard.clicked.action', function (duration) {
|
|
178
|
+
return _objectSpread({
|
|
179
|
+
method: 'click',
|
|
180
|
+
firedAt: Math.round((0, _performance.getPageTime)()),
|
|
181
|
+
duration: duration,
|
|
182
|
+
hasHref: !!action.link,
|
|
183
|
+
hasOnClick: !!action.callback,
|
|
184
|
+
index: index,
|
|
185
|
+
actionId: action.id || 'no-id-specified'
|
|
186
|
+
}, _analytics.PACKAGE_META_DATA);
|
|
156
187
|
});
|
|
157
|
-
}
|
|
188
|
+
} else {
|
|
189
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
190
|
+
return (0, _analytics.actionClicked)('user', {
|
|
191
|
+
duration: duration,
|
|
192
|
+
hasHref: !!action.link,
|
|
193
|
+
hasOnClick: !!action.callback,
|
|
194
|
+
index: index,
|
|
195
|
+
actionId: action.id || 'no-id-specified'
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
158
199
|
if (action.callback && (0, _click.isBasicClick)(event)) {
|
|
159
200
|
event.preventDefault();
|
|
160
201
|
action.callback.apply(action, [event].concat((0, _toConsumableArray2.default)(args)));
|
|
161
202
|
}
|
|
162
|
-
}, [fireAnalyticsWithDuration]);
|
|
203
|
+
}, [fireAnalyticsWithDuration, fireAnalyticsWithDurationNext]);
|
|
163
204
|
if (!actions || actions.length === 0) {
|
|
164
205
|
return null;
|
|
165
206
|
}
|
|
@@ -193,6 +234,7 @@ var Actions = function Actions(_ref) {
|
|
|
193
234
|
}), overflowActions && /*#__PURE__*/_react.default.createElement(_OverflowProfileCardButtons.OverflowProfileCardButtons, (0, _extends2.default)({
|
|
194
235
|
actions: overflowActions,
|
|
195
236
|
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
237
|
+
fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext,
|
|
196
238
|
onItemClick: function onItemClick(action, args, event, index) {
|
|
197
239
|
return onActionClick(action, args, event, index + _OverflowProfileCardButtons.ACTION_OVERFLOW_THRESHOLD);
|
|
198
240
|
}
|
|
@@ -200,17 +242,27 @@ var Actions = function Actions(_ref) {
|
|
|
200
242
|
fullName: fullName
|
|
201
243
|
})));
|
|
202
244
|
};
|
|
203
|
-
var LoadingView = function LoadingView(_ref2) {
|
|
204
|
-
var fireAnalyticsWithDuration = _ref2.fireAnalyticsWithDuration
|
|
245
|
+
var LoadingView = exports.LoadingView = function LoadingView(_ref2) {
|
|
246
|
+
var fireAnalyticsWithDuration = _ref2.fireAnalyticsWithDuration,
|
|
247
|
+
fireAnalyticsWithDurationNext = _ref2.fireAnalyticsWithDurationNext;
|
|
205
248
|
(0, _react.useEffect)(function () {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
249
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
250
|
+
fireAnalyticsWithDurationNext('ui.profilecard.rendered.spinner', function (duration) {
|
|
251
|
+
return _objectSpread({
|
|
252
|
+
firedAt: Math.round((0, _performance.getPageTime)()),
|
|
253
|
+
duration: duration
|
|
254
|
+
}, _analytics.PACKAGE_META_DATA);
|
|
255
|
+
});
|
|
256
|
+
} else {
|
|
257
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
258
|
+
return (0, _analytics.profileCardRendered)('user', 'spinner', {
|
|
259
|
+
duration: duration
|
|
260
|
+
});
|
|
209
261
|
});
|
|
210
|
-
}
|
|
211
|
-
}, [fireAnalyticsWithDuration]);
|
|
262
|
+
}
|
|
263
|
+
}, [fireAnalyticsWithDuration, fireAnalyticsWithDurationNext]);
|
|
212
264
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.SpinnerContainer, {
|
|
213
265
|
testId: "profilecard-spinner-container"
|
|
214
266
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, null));
|
|
215
267
|
};
|
|
216
|
-
var _default = exports.default = (0, _analyticsNext.withAnalyticsEvents)()(ProfilecardInternal);
|
|
268
|
+
var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithFG)('ptc-enable-profile-card-analytics-refactor', ProfilecardInternal, (0, _analyticsNext.withAnalyticsEvents)()(ProfilecardInternal));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ProfileCardDetails.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ProfileCardDetails.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -140,6 +140,7 @@ var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetail
|
|
|
140
140
|
reportingLines: props.reportingLines,
|
|
141
141
|
reportingLinesProfileUrl: props.reportingLinesProfileUrl,
|
|
142
142
|
onReportingLinesClick: props.onReportingLinesClick,
|
|
143
|
-
fireAnalyticsWithDuration: props.fireAnalyticsWithDuration
|
|
143
|
+
fireAnalyticsWithDuration: props.fireAnalyticsWithDuration,
|
|
144
|
+
fireAnalyticsWithDurationNext: props.fireAnalyticsWithDurationNext
|
|
144
145
|
}));
|
|
145
146
|
};
|
|
@@ -17,6 +17,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
19
|
var _giveKudos = require("@atlaskit/give-kudos");
|
|
20
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
21
|
+
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
20
22
|
var _filterActions = _interopRequireDefault(require("../../internal/filterActions"));
|
|
21
23
|
var _UserTrigger = require("../../styled/UserTrigger");
|
|
22
24
|
var _analytics = require("../../util/analytics");
|
|
@@ -57,10 +59,23 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
57
59
|
(0, _analytics.fireEvent)(_this.props.createAnalyticsEvent, payload);
|
|
58
60
|
}
|
|
59
61
|
});
|
|
62
|
+
(0, _defineProperty2.default)(_this, "fireAnalyticsNext", function (eventKey) {
|
|
63
|
+
// Don't fire analytics if the component is unmounted
|
|
64
|
+
if (!_this._isMounted) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (_this.props.fireEvent) {
|
|
68
|
+
var _this$props;
|
|
69
|
+
for (var _len2 = arguments.length, attributes = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
70
|
+
attributes[_key2 - 1] = arguments[_key2];
|
|
71
|
+
}
|
|
72
|
+
(_this$props = _this.props).fireEvent.apply(_this$props, [eventKey].concat(attributes));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
60
75
|
(0, _defineProperty2.default)(_this, "clientFetchProfile", function () {
|
|
61
|
-
var _this$
|
|
62
|
-
cloudId = _this$
|
|
63
|
-
userId = _this$
|
|
76
|
+
var _this$props2 = _this.props,
|
|
77
|
+
cloudId = _this$props2.cloudId,
|
|
78
|
+
userId = _this$props2.userId;
|
|
64
79
|
var isLoading = _this.state.isLoading;
|
|
65
80
|
if (isLoading === true) {
|
|
66
81
|
// don't fetch data when fetching is in process
|
|
@@ -71,7 +86,7 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
71
86
|
hasError: false,
|
|
72
87
|
data: null
|
|
73
88
|
}, function () {
|
|
74
|
-
var requests = Promise.all([_this.props.resourceClient.getProfile(cloudId, userId, _this.fireAnalytics), _this.props.resourceClient.getReportingLines(userId), _this.props.resourceClient.shouldShowGiveKudos(), _this.props.resourceClient.getTeamCentralBaseUrl({
|
|
89
|
+
var requests = Promise.all([_this.props.resourceClient.getProfile(cloudId, userId, _this.fireAnalytics, _this.fireAnalyticsNext), _this.props.resourceClient.getReportingLines(userId), _this.props.resourceClient.shouldShowGiveKudos(), _this.props.resourceClient.getTeamCentralBaseUrl({
|
|
75
90
|
withOrgContext: true,
|
|
76
91
|
withSiteContext: true
|
|
77
92
|
})]);
|
|
@@ -110,10 +125,10 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
125
|
}, {
|
|
111
126
|
key: "componentDidUpdate",
|
|
112
127
|
value: function componentDidUpdate(prevProps) {
|
|
113
|
-
var _this$
|
|
114
|
-
userId = _this$
|
|
115
|
-
cloudId = _this$
|
|
116
|
-
resourceClient = _this$
|
|
128
|
+
var _this$props3 = this.props,
|
|
129
|
+
userId = _this$props3.userId,
|
|
130
|
+
cloudId = _this$props3.cloudId,
|
|
131
|
+
resourceClient = _this$props3.resourceClient;
|
|
117
132
|
if (userId !== prevProps.userId || cloudId !== prevProps.cloudId || resourceClient !== prevProps.resourceClient) {
|
|
118
133
|
this.setState({
|
|
119
134
|
isLoading: undefined
|
|
@@ -163,15 +178,16 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
163
178
|
reportingLinesData = _this$state.reportingLinesData,
|
|
164
179
|
isKudosEnabled = _this$state.isKudosEnabled,
|
|
165
180
|
teamCentralBaseUrl = _this$state.teamCentralBaseUrl;
|
|
166
|
-
var _this$
|
|
167
|
-
onReportingLinesClick = _this$
|
|
168
|
-
cloudId = _this$
|
|
169
|
-
userId = _this$
|
|
170
|
-
addFlag = _this$
|
|
181
|
+
var _this$props4 = this.props,
|
|
182
|
+
onReportingLinesClick = _this$props4.onReportingLinesClick,
|
|
183
|
+
cloudId = _this$props4.cloudId,
|
|
184
|
+
userId = _this$props4.userId,
|
|
185
|
+
addFlag = _this$props4.addFlag;
|
|
171
186
|
var isFetchingOrNotStartToFetchYet = isLoading === true || isLoading === undefined;
|
|
172
187
|
if (isFetchingOrNotStartToFetchYet) {
|
|
173
188
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.CardWrapper, null, /*#__PURE__*/_react.default.createElement(_UserLoadingState.default, {
|
|
174
|
-
fireAnalytics: this.fireAnalytics
|
|
189
|
+
fireAnalytics: this.fireAnalytics,
|
|
190
|
+
fireAnalyticsNext: this.fireAnalyticsNext
|
|
175
191
|
}));
|
|
176
192
|
} else if (hasError) {
|
|
177
193
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.CardWrapper, {
|
|
@@ -179,7 +195,8 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
179
195
|
}, /*#__PURE__*/_react.default.createElement(_Error.ErrorMessage, {
|
|
180
196
|
errorType: error,
|
|
181
197
|
reload: this.clientFetchProfile,
|
|
182
|
-
fireAnalytics: this.fireAnalytics
|
|
198
|
+
fireAnalytics: this.fireAnalytics,
|
|
199
|
+
fireAnalyticsNext: this.fireAnalyticsNext
|
|
183
200
|
}));
|
|
184
201
|
}
|
|
185
202
|
var newProps = _objectSpread(_objectSpread({
|
|
@@ -219,4 +236,11 @@ var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
219
236
|
actions: []
|
|
220
237
|
});
|
|
221
238
|
var ProfileCardResourcedInternal = exports.ProfileCardResourcedInternal = ProfileCardResourced;
|
|
222
|
-
var
|
|
239
|
+
var ProfileCardResourcedWithAnalytics = function ProfileCardResourcedWithAnalytics(props) {
|
|
240
|
+
var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
241
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
242
|
+
return /*#__PURE__*/_react.default.createElement(ProfileCardResourced, (0, _extends2.default)({
|
|
243
|
+
fireEvent: fireEvent
|
|
244
|
+
}, props));
|
|
245
|
+
};
|
|
246
|
+
var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithFG)('ptc-enable-profile-card-analytics-refactor', ProfileCardResourcedWithAnalytics, (0, _analyticsNext.withAnalyticsEvents)()(ProfileCardResourced));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ProfileCardTrigger.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ProfileCardTrigger.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -23,12 +23,14 @@ var _giveKudos = require("@atlaskit/give-kudos");
|
|
|
23
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
24
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
25
25
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
26
|
+
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
26
27
|
var _constants = require("@atlaskit/theme/constants");
|
|
27
28
|
var _filterActions = _interopRequireDefault(require("../../internal/filterActions"));
|
|
28
29
|
var _getLabelMessage = _interopRequireDefault(require("../../internal/getLabelMessage"));
|
|
29
30
|
var _UserTrigger = require("../../styled/UserTrigger");
|
|
30
31
|
var _analytics = require("../../util/analytics");
|
|
31
32
|
var _config = require("../../util/config");
|
|
33
|
+
var _performance = require("../../util/performance");
|
|
32
34
|
var _AgentProfileCardResourced = require("../Agent/AgentProfileCardResourced");
|
|
33
35
|
var _lazyProfileCard = require("./lazyProfileCard");
|
|
34
36
|
var _UserLoadingState = _interopRequireDefault(require("./UserLoadingState"));
|
|
@@ -156,6 +158,8 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
156
158
|
isTriggeredUsingKeyboard = _useState18[0],
|
|
157
159
|
setTriggeredUsingKeyboard = _useState18[1];
|
|
158
160
|
var triggerRef = (0, _react.useRef)(null);
|
|
161
|
+
var _useAnalyticsEventsNe = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
|
|
162
|
+
fireEventNext = _useAnalyticsEventsNe.fireEvent;
|
|
159
163
|
(0, _react.useEffect)(function () {
|
|
160
164
|
isMounted.current = true;
|
|
161
165
|
return function () {
|
|
@@ -174,6 +178,17 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
174
178
|
setShouldShowGiveKudos(false);
|
|
175
179
|
setTeamCentralBaseUrl(undefined);
|
|
176
180
|
}, [userId]);
|
|
181
|
+
|
|
182
|
+
// Create a wrapper function that has the same interface as fireEventNext but includes isMounted check
|
|
183
|
+
var fireAnalyticsNext = (0, _react.useCallback)(function (eventKey) {
|
|
184
|
+
if (!isMounted.current) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
for (var _len = arguments.length, attributes = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
188
|
+
attributes[_key - 1] = arguments[_key];
|
|
189
|
+
}
|
|
190
|
+
fireEventNext.apply(void 0, [eventKey].concat(attributes));
|
|
191
|
+
}, [fireEventNext]);
|
|
177
192
|
var fireAnalytics = (0, _react.useCallback)(function (payload) {
|
|
178
193
|
// Don't fire any analytics if the component is unmounted
|
|
179
194
|
if (!isMounted.current) {
|
|
@@ -237,7 +252,7 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
237
252
|
setError(null);
|
|
238
253
|
setData(null);
|
|
239
254
|
_context.prev = 6;
|
|
240
|
-
requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics), resourceClient.getReportingLines(userId), resourceClient.shouldShowGiveKudos(), resourceClient.getTeamCentralBaseUrl({
|
|
255
|
+
requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics, fireAnalyticsNext), resourceClient.getReportingLines(userId), resourceClient.shouldShowGiveKudos(), resourceClient.getTeamCentralBaseUrl({
|
|
241
256
|
withOrgContext: true,
|
|
242
257
|
withSiteContext: true
|
|
243
258
|
})]);
|
|
@@ -257,7 +272,7 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
257
272
|
return _context.stop();
|
|
258
273
|
}
|
|
259
274
|
}, _callee, null, [[6, 14]]);
|
|
260
|
-
})), [cloudId, fireAnalytics, isLoading, resourceClient, userId, handleClientSuccess, handleClientError]);
|
|
275
|
+
})), [cloudId, fireAnalytics, fireAnalyticsNext, isLoading, resourceClient, userId, handleClientSuccess, handleClientError]);
|
|
261
276
|
var showProfilecard = (0, _react.useCallback)(function () {
|
|
262
277
|
clearTimeout(hideTimer.current);
|
|
263
278
|
clearTimeout(showTimer.current);
|
|
@@ -276,25 +291,46 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
276
291
|
event.stopPropagation();
|
|
277
292
|
showProfilecard();
|
|
278
293
|
if (!visible) {
|
|
279
|
-
|
|
294
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
295
|
+
fireAnalyticsNext('ui.profilecard.triggered', _objectSpread({
|
|
296
|
+
method: 'click',
|
|
297
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
298
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
299
|
+
} else {
|
|
300
|
+
fireAnalytics((0, _analytics.cardTriggered)('user', 'click'));
|
|
301
|
+
}
|
|
280
302
|
}
|
|
281
|
-
}, [fireAnalytics, showProfilecard, visible]);
|
|
303
|
+
}, [fireAnalytics, fireAnalyticsNext, showProfilecard, visible]);
|
|
282
304
|
var onMouseEnter = (0, _react.useCallback)(function () {
|
|
283
305
|
showProfilecard();
|
|
284
306
|
if (!visible) {
|
|
285
|
-
|
|
307
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
308
|
+
fireAnalyticsNext('ui.profilecard.triggered', _objectSpread({
|
|
309
|
+
method: 'hover',
|
|
310
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
311
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
312
|
+
} else {
|
|
313
|
+
fireAnalytics((0, _analytics.cardTriggered)('user', 'hover'));
|
|
314
|
+
}
|
|
286
315
|
}
|
|
287
|
-
}, [fireAnalytics, showProfilecard, visible]);
|
|
316
|
+
}, [fireAnalytics, fireAnalyticsNext, showProfilecard, visible]);
|
|
288
317
|
var onKeyPress = (0, _react.useCallback)(function (event) {
|
|
289
318
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
290
319
|
event.preventDefault();
|
|
291
320
|
setTriggeredUsingKeyboard(true);
|
|
292
321
|
showProfilecard();
|
|
293
322
|
if (!visible) {
|
|
294
|
-
|
|
323
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
324
|
+
fireAnalyticsNext('ui.profilecard.triggered', _objectSpread({
|
|
325
|
+
method: 'click',
|
|
326
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
327
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
328
|
+
} else {
|
|
329
|
+
fireAnalytics((0, _analytics.cardTriggered)('user', 'click'));
|
|
330
|
+
}
|
|
295
331
|
}
|
|
296
332
|
}
|
|
297
|
-
}, [fireAnalytics, showProfilecard, visible]);
|
|
333
|
+
}, [fireAnalytics, fireAnalyticsNext, showProfilecard, visible]);
|
|
298
334
|
var onFocus = (0, _react.useCallback)(function () {
|
|
299
335
|
showProfilecard();
|
|
300
336
|
}, [showProfilecard]);
|
|
@@ -374,7 +410,8 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
374
410
|
offset: offset !== null && offset !== void 0 ? offset : [0, 8],
|
|
375
411
|
content: function content() {
|
|
376
412
|
return /*#__PURE__*/_react.default.createElement("div", wrapperProps, showLoading ? /*#__PURE__*/_react.default.createElement(LoadingView, {
|
|
377
|
-
fireAnalytics: fireAnalytics
|
|
413
|
+
fireAnalytics: fireAnalytics,
|
|
414
|
+
fireAnalyticsNext: fireAnalyticsNext
|
|
378
415
|
}) : visible && /*#__PURE__*/_react.default.createElement(ProfileCardContent, {
|
|
379
416
|
profilecardProps: profilecardProps,
|
|
380
417
|
isAgent: !!(data !== null && data !== void 0 && data.isAgent),
|
|
@@ -449,7 +486,8 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
449
486
|
offset: offset !== null && offset !== void 0 ? offset : [0, 8],
|
|
450
487
|
content: function content() {
|
|
451
488
|
return /*#__PURE__*/_react.default.createElement("div", wrapperProps, showLoading ? /*#__PURE__*/_react.default.createElement(LoadingView, {
|
|
452
|
-
fireAnalytics: fireAnalytics
|
|
489
|
+
fireAnalytics: fireAnalytics,
|
|
490
|
+
fireAnalyticsNext: fireAnalyticsNext
|
|
453
491
|
}) : visible && /*#__PURE__*/_react.default.createElement(ProfileCardContent, {
|
|
454
492
|
profilecardProps: profilecardProps,
|
|
455
493
|
isAgent: !!(data !== null && data !== void 0 && data.isAgent),
|
|
@@ -515,10 +553,12 @@ function ProfilecardTriggerNext(_ref2) {
|
|
|
515
553
|
})));
|
|
516
554
|
}
|
|
517
555
|
var LoadingView = function LoadingView(_ref4) {
|
|
518
|
-
var fireAnalytics = _ref4.fireAnalytics
|
|
556
|
+
var fireAnalytics = _ref4.fireAnalytics,
|
|
557
|
+
fireAnalyticsNext = _ref4.fireAnalyticsNext;
|
|
519
558
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.CardWrapper, {
|
|
520
559
|
testId: "profilecard.profilecardtrigger.loading"
|
|
521
560
|
}, /*#__PURE__*/_react.default.createElement(_UserLoadingState.default, {
|
|
522
|
-
fireAnalytics: fireAnalytics
|
|
561
|
+
fireAnalytics: fireAnalytics,
|
|
562
|
+
fireAnalyticsNext: fireAnalyticsNext
|
|
523
563
|
}));
|
|
524
564
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ReportingLinesDetails.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ReportingLinesDetails.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -8,16 +8,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
require("./ReportingLinesDetails.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _react = _interopRequireDefault(require("react"));
|
|
12
13
|
var _reactIntlNext = require("react-intl-next");
|
|
13
14
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
14
15
|
var _avatarGroup = _interopRequireDefault(require("@atlaskit/avatar-group"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _primitives = require("@atlaskit/primitives");
|
|
16
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
19
|
var _messages = _interopRequireDefault(require("../../messages"));
|
|
18
20
|
var _ReportingLines = require("../../styled/ReportingLines");
|
|
19
21
|
var _analytics = require("../../util/analytics");
|
|
20
|
-
|
|
22
|
+
var _performance = require("../../util/performance");
|
|
23
|
+
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; }
|
|
24
|
+
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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
21
25
|
function getProfileHref(userId, profileUrl) {
|
|
22
26
|
return profileUrl ? profileUrl + userId : undefined;
|
|
23
27
|
}
|
|
@@ -39,6 +43,7 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
39
43
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
40
44
|
formatMessage = _useIntl.formatMessage;
|
|
41
45
|
var fireAnalyticsWithDuration = props.fireAnalyticsWithDuration,
|
|
46
|
+
fireAnalyticsWithDurationNext = props.fireAnalyticsWithDurationNext,
|
|
42
47
|
_props$reportingLines = props.reportingLines,
|
|
43
48
|
reportingLines = _props$reportingLines === void 0 ? {} : _props$reportingLines,
|
|
44
49
|
reportingLinesProfileUrl = props.reportingLinesProfileUrl,
|
|
@@ -51,12 +56,22 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
51
56
|
var hasReports = reports.length > 0;
|
|
52
57
|
var getReportingLinesOnClick = function getReportingLinesOnClick(user, userType) {
|
|
53
58
|
return onReportingLinesClick ? function () {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
60
|
+
fireAnalyticsWithDurationNext('ui.profilecard.clicked.reportingLines', function (duration) {
|
|
61
|
+
return _objectSpread({
|
|
62
|
+
duration: duration,
|
|
63
|
+
userType: userType,
|
|
64
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
65
|
+
}, _analytics.PACKAGE_META_DATA);
|
|
58
66
|
});
|
|
59
|
-
}
|
|
67
|
+
} else {
|
|
68
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
69
|
+
return (0, _analytics.reportingLinesClicked)({
|
|
70
|
+
duration: duration,
|
|
71
|
+
userType: userType
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
60
75
|
onReportingLinesClick(user);
|
|
61
76
|
} : undefined;
|
|
62
77
|
};
|
|
@@ -65,12 +80,22 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
|
|
|
65
80
|
if (onReportingLinesClick) {
|
|
66
81
|
shouldPreventDefault = onReportingLinesClick(user) === false;
|
|
67
82
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
84
|
+
fireAnalyticsWithDurationNext('ui.profilecard.clicked.reportingLines', function (duration) {
|
|
85
|
+
return _objectSpread({
|
|
86
|
+
duration: duration,
|
|
87
|
+
userType: userType,
|
|
88
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
89
|
+
}, _analytics.PACKAGE_META_DATA);
|
|
72
90
|
});
|
|
73
|
-
}
|
|
91
|
+
} else {
|
|
92
|
+
fireAnalyticsWithDuration(function (duration) {
|
|
93
|
+
return (0, _analytics.reportingLinesClicked)({
|
|
94
|
+
duration: duration,
|
|
95
|
+
userType: userType
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
74
99
|
if (shouldPreventDefault) {
|
|
75
100
|
return;
|
|
76
101
|
}
|
|
@@ -6,16 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
12
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
11
13
|
var _UserTrigger = require("../../styled/UserTrigger");
|
|
12
14
|
var _analytics = require("../../util/analytics");
|
|
15
|
+
var _performance = require("../../util/performance");
|
|
13
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
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; }
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
14
19
|
var UserLoadingState = function UserLoadingState(_ref) {
|
|
15
|
-
var fireAnalytics = _ref.fireAnalytics
|
|
20
|
+
var fireAnalytics = _ref.fireAnalytics,
|
|
21
|
+
fireAnalyticsNext = _ref.fireAnalyticsNext;
|
|
16
22
|
(0, _react.useEffect)(function () {
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
24
|
+
fireAnalyticsNext('ui.profilecard.rendered.spinner', _objectSpread({
|
|
25
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
26
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
27
|
+
} else {
|
|
28
|
+
fireAnalytics((0, _analytics.profileCardRendered)('user', 'spinner'));
|
|
29
|
+
}
|
|
30
|
+
}, [fireAnalytics, fireAnalyticsNext]);
|
|
19
31
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.SpinnerContainer, null, /*#__PURE__*/_react.default.createElement(_spinner.default, null));
|
|
20
32
|
};
|
|
21
33
|
var _default = exports.default = UserLoadingState;
|
|
@@ -6,18 +6,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.LoadingState = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
12
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
11
13
|
var _UserTrigger = require("../../styled/UserTrigger");
|
|
12
14
|
var _analytics = require("../../util/analytics");
|
|
15
|
+
var _performance = require("../../util/performance");
|
|
13
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
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; }
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
14
19
|
var LoadingState = exports.LoadingState = function LoadingState(_ref) {
|
|
15
20
|
var fireAnalytics = _ref.fireAnalytics,
|
|
21
|
+
fireAnalyticsNext = _ref.fireAnalyticsNext,
|
|
16
22
|
profileType = _ref.profileType;
|
|
17
23
|
(0, _react.useEffect)(function () {
|
|
18
|
-
if (
|
|
19
|
-
|
|
24
|
+
if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
|
|
25
|
+
if (fireAnalyticsNext) {
|
|
26
|
+
fireAnalyticsNext("ui.".concat((0, _analytics.getActionSubject)(profileType), ".rendered.spinner"), _objectSpread({
|
|
27
|
+
firedAt: Math.round((0, _performance.getPageTime)())
|
|
28
|
+
}, _analytics.PACKAGE_META_DATA));
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
if (fireAnalytics) {
|
|
32
|
+
fireAnalytics((0, _analytics.profileCardRendered)(profileType, 'spinner'));
|
|
33
|
+
}
|
|
20
34
|
}
|
|
21
|
-
}, [fireAnalytics, profileType]);
|
|
35
|
+
}, [fireAnalytics, fireAnalyticsNext, profileType]);
|
|
22
36
|
return /*#__PURE__*/_react.default.createElement(_UserTrigger.SpinnerContainer, null, /*#__PURE__*/_react.default.createElement(_spinner.default, null));
|
|
23
37
|
};
|