@atlaskit/profilecard 24.41.0 → 24.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/afm-cc/tsconfig.json +0 -6
- package/dist/cjs/components/Agent/Actions.js +7 -24
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/cjs/components/Team/TeamForbiddenErrorState.js +8 -18
- package/dist/cjs/components/Team/TeamLoadingState.js +8 -18
- package/dist/cjs/components/Team/TeamProfileCard.js +76 -162
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/cjs/components/User/OverflowProfileCardButtons.js +9 -19
- package/dist/cjs/components/User/ProfileCard.js +37 -85
- package/dist/cjs/components/User/ProfileCardDetails.js +1 -2
- package/dist/cjs/components/User/ReportingLinesDetails.js +14 -34
- package/dist/cjs/components/common/ProfileCardTrigger.js +9 -17
- package/dist/cjs/components/team-profile-card/main.js +4 -20
- package/dist/cjs/components/team-profile-card/team-connections/main.js +6 -22
- package/dist/cjs/util/analytics.js +1 -29
- package/dist/es2019/components/Agent/Actions.js +7 -25
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +20 -73
- package/dist/es2019/components/Team/TeamForbiddenErrorState.js +8 -16
- package/dist/es2019/components/Team/TeamLoadingState.js +8 -16
- package/dist/es2019/components/Team/TeamProfileCard.js +72 -146
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/es2019/components/User/OverflowProfileCardButtons.js +9 -17
- package/dist/es2019/components/User/ProfileCard.js +35 -79
- package/dist/es2019/components/User/ProfileCardDetails.js +1 -2
- package/dist/es2019/components/User/ReportingLinesDetails.js +13 -29
- package/dist/es2019/components/common/ProfileCardTrigger.js +9 -17
- package/dist/es2019/components/team-profile-card/main.js +4 -21
- package/dist/es2019/components/team-profile-card/team-connections/main.js +6 -23
- package/dist/es2019/util/analytics.js +0 -27
- package/dist/esm/components/Agent/Actions.js +7 -24
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/esm/components/Team/TeamForbiddenErrorState.js +9 -19
- package/dist/esm/components/Team/TeamLoadingState.js +9 -19
- package/dist/esm/components/Team/TeamProfileCard.js +77 -163
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/esm/components/User/OverflowProfileCardButtons.js +10 -20
- package/dist/esm/components/User/ProfileCard.js +38 -86
- package/dist/esm/components/User/ProfileCardDetails.js +1 -2
- package/dist/esm/components/User/ReportingLinesDetails.js +15 -35
- package/dist/esm/components/common/ProfileCardTrigger.js +10 -18
- package/dist/esm/components/team-profile-card/main.js +4 -20
- package/dist/esm/components/team-profile-card/team-connections/main.js +6 -22
- package/dist/esm/util/analytics.js +0 -29
- package/dist/types/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types/components/User/ProfileCard.d.ts +2 -3
- package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types/components/common/types.d.ts +1 -3
- package/dist/types/types.d.ts +3 -10
- package/dist/types/util/analytics.d.ts +2 -17
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types-ts4.5/components/User/ProfileCard.d.ts +2 -3
- package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/common/types.d.ts +1 -3
- package/dist/types-ts4.5/types.d.ts +3 -10
- package/dist/types-ts4.5/util/analytics.d.ts +2 -17
- package/package.json +2 -7
|
@@ -6,11 +6,10 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
|
6
6
|
import Avatar from '@atlaskit/avatar';
|
|
7
7
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
8
8
|
import { cx } from '@atlaskit/css';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
11
10
|
import messages from '../../messages';
|
|
12
11
|
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
13
|
-
import { PACKAGE_META_DATA
|
|
12
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
14
13
|
import { getPageTime } from '../../util/performance';
|
|
15
14
|
function getProfileHref(userId, profileUrl) {
|
|
16
15
|
return profileUrl ? profileUrl + userId : undefined;
|
|
@@ -28,7 +27,6 @@ const ReportingLinesDetails = props => {
|
|
|
28
27
|
} = useIntl();
|
|
29
28
|
const {
|
|
30
29
|
fireAnalyticsWithDuration,
|
|
31
|
-
fireAnalyticsWithDurationNext,
|
|
32
30
|
reportingLines = {},
|
|
33
31
|
reportingLinesProfileUrl,
|
|
34
32
|
onReportingLinesClick
|
|
@@ -40,19 +38,12 @@ const ReportingLinesDetails = props => {
|
|
|
40
38
|
const manager = managers.length >= 1 ? managers[0] : undefined;
|
|
41
39
|
const hasReports = reports.length > 0;
|
|
42
40
|
const getReportingLinesOnClick = (user, userType) => onReportingLinesClick ? () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}));
|
|
50
|
-
} else {
|
|
51
|
-
fireAnalyticsWithDuration(duration => reportingLinesClicked({
|
|
52
|
-
duration,
|
|
53
|
-
userType
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
41
|
+
fireAnalyticsWithDuration('ui.profilecard.clicked.reportingLines', duration => ({
|
|
42
|
+
duration,
|
|
43
|
+
userType,
|
|
44
|
+
firedAt: Math.round(getPageTime()),
|
|
45
|
+
...PACKAGE_META_DATA
|
|
46
|
+
}));
|
|
56
47
|
onReportingLinesClick(user);
|
|
57
48
|
} : undefined;
|
|
58
49
|
const onReportingLinksClick = (user, userType, href) => {
|
|
@@ -60,19 +51,12 @@ const ReportingLinesDetails = props => {
|
|
|
60
51
|
if (onReportingLinesClick) {
|
|
61
52
|
shouldPreventDefault = onReportingLinesClick(user) === false;
|
|
62
53
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}));
|
|
70
|
-
} else {
|
|
71
|
-
fireAnalyticsWithDuration(duration => reportingLinesClicked({
|
|
72
|
-
duration,
|
|
73
|
-
userType
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
54
|
+
fireAnalyticsWithDuration('ui.profilecard.clicked.reportingLines', duration => ({
|
|
55
|
+
duration,
|
|
56
|
+
userType,
|
|
57
|
+
firedAt: Math.round(getPageTime()),
|
|
58
|
+
...PACKAGE_META_DATA
|
|
59
|
+
}));
|
|
76
60
|
if (shouldPreventDefault) {
|
|
77
61
|
return;
|
|
78
62
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import Popup from '@atlaskit/popup';
|
|
5
4
|
import { layers } from '@atlaskit/theme/constants';
|
|
6
|
-
import {
|
|
5
|
+
import { getActionSubject, PACKAGE_META_DATA } from '../../util/analytics';
|
|
7
6
|
import { getPageTime } from '../../util/performance';
|
|
8
7
|
import { useProfileInfo } from '../../util/useProfileInfo';
|
|
9
8
|
import { LoadingState } from './LoadingState';
|
|
@@ -21,7 +20,6 @@ function ProfileCardTriggerInner({
|
|
|
21
20
|
profileCardType,
|
|
22
21
|
testId,
|
|
23
22
|
fireAnalytics,
|
|
24
|
-
fireAnalyticsNext,
|
|
25
23
|
...popupProps
|
|
26
24
|
}, ref) {
|
|
27
25
|
var _popupProps$autoFocus;
|
|
@@ -61,22 +59,16 @@ function ProfileCardTriggerInner({
|
|
|
61
59
|
if (!visible) {
|
|
62
60
|
getProfileData === null || getProfileData === void 0 ? void 0 : getProfileData();
|
|
63
61
|
setVisible(true);
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
if (fireAnalytics) {
|
|
74
|
-
fireAnalytics(cardTriggered(profileCardType, trigger));
|
|
75
|
-
}
|
|
62
|
+
if (fireAnalytics) {
|
|
63
|
+
fireAnalytics(`ui.${getActionSubject(profileCardType)}.triggered`, {
|
|
64
|
+
method: trigger,
|
|
65
|
+
...PACKAGE_META_DATA,
|
|
66
|
+
firedAt: Math.round(getPageTime())
|
|
67
|
+
});
|
|
76
68
|
}
|
|
77
69
|
}
|
|
78
70
|
}, showDelay);
|
|
79
|
-
}, [showDelay, visible, getProfileData, fireAnalytics, profileCardType, trigger
|
|
71
|
+
}, [showDelay, visible, getProfileData, fireAnalytics, profileCardType, trigger]);
|
|
80
72
|
const onMouseEnter = useCallback(() => {
|
|
81
73
|
showProfilecard();
|
|
82
74
|
}, [showProfilecard]);
|
|
@@ -113,7 +105,7 @@ function ProfileCardTriggerInner({
|
|
|
113
105
|
}, isLoading ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
|
|
114
106
|
testId: "profilecard.profilecardtrigger.loading"
|
|
115
107
|
}, /*#__PURE__*/React.createElement(LoadingState, {
|
|
116
|
-
fireAnalytics:
|
|
108
|
+
fireAnalytics: fireAnalytics,
|
|
117
109
|
profileType: profileCardType
|
|
118
110
|
})) : renderProfileCard({
|
|
119
111
|
profileData,
|
|
@@ -5,17 +5,14 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
9
8
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
10
9
|
import Heading from '@atlaskit/heading';
|
|
11
10
|
import LinkItem from '@atlaskit/menu/link-item';
|
|
12
11
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
12
|
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
15
|
-
import { useAnalyticsEvents
|
|
13
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
16
14
|
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
17
15
|
import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
|
|
18
|
-
import { fireEvent } from '../../util/analytics';
|
|
19
16
|
import TeamAppTile from '../common/assets/TeamAppTile.svg';
|
|
20
17
|
import { TeamActions } from './team-actions';
|
|
21
18
|
import { TeamConnections } from './team-connections/main';
|
|
@@ -52,27 +49,13 @@ export const TeamProfileCard = ({
|
|
|
52
49
|
loading
|
|
53
50
|
} = useTeamContainers(teamId);
|
|
54
51
|
const {
|
|
55
|
-
|
|
52
|
+
fireEvent
|
|
56
53
|
} = useAnalyticsEvents();
|
|
57
|
-
const {
|
|
58
|
-
fireEvent: fireEventNext
|
|
59
|
-
} = useAnalyticsEventsNext();
|
|
60
54
|
// Ensure that the current container is not the only connection for this team before showing the "Where we work" section
|
|
61
55
|
const hasOtherTeamConnections = useMemo(() => teamContainers.filter(tc => tc.id === containerId).length < teamContainers.length, [containerId, teamContainers]);
|
|
62
56
|
const onClick = useCallback(() => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} else {
|
|
66
|
-
if (createAnalyticsEvent) {
|
|
67
|
-
fireEvent(createAnalyticsEvent, {
|
|
68
|
-
action: 'clicked',
|
|
69
|
-
actionSubject: 'button',
|
|
70
|
-
actionSubjectId: 'viewTeamProfileButton',
|
|
71
|
-
attributes: {}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}, [createAnalyticsEvent, fireEventNext]);
|
|
57
|
+
fireEvent('ui.button.clicked.viewTeamProfileButton', {});
|
|
58
|
+
}, [fireEvent]);
|
|
76
59
|
return /*#__PURE__*/React.createElement(Box, {
|
|
77
60
|
xcss: styles.wrapperStyles,
|
|
78
61
|
testId: `team-card-${teamId}`
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
import "./main.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
5
|
import { LinkItem } from '@atlaskit/menu';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
6
|
import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
|
|
9
|
-
import { useAnalyticsEvents
|
|
7
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
10
8
|
import { ContainerIcon, getContainerProperties } from '@atlaskit/teams-public';
|
|
11
|
-
import { fireEvent } from '../../../util/analytics';
|
|
12
9
|
const styles = {
|
|
13
10
|
containerTypeIconButtonStyles: "_18u01wug _4t3i7vkz _1bsb7vkz"
|
|
14
11
|
};
|
|
@@ -28,27 +25,13 @@ export const TeamConnections = ({
|
|
|
28
25
|
isDisplayedOnProfileCard: true
|
|
29
26
|
});
|
|
30
27
|
const {
|
|
31
|
-
|
|
28
|
+
fireEvent
|
|
32
29
|
} = useAnalyticsEvents();
|
|
33
|
-
const {
|
|
34
|
-
fireEvent: fireEventNext
|
|
35
|
-
} = useAnalyticsEventsNext();
|
|
36
30
|
const onClick = useCallback(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} else {
|
|
42
|
-
fireEvent(createAnalyticsEvent, {
|
|
43
|
-
action: 'clicked',
|
|
44
|
-
actionSubject: 'teamConnectionItem',
|
|
45
|
-
actionSubjectId: 'teamProfileCard',
|
|
46
|
-
attributes: {
|
|
47
|
-
container: containerType
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}, [containerType, createAnalyticsEvent, fireEventNext]);
|
|
31
|
+
fireEvent('ui.teamConnectionItem.clicked.teamProfileCard', {
|
|
32
|
+
container: containerType
|
|
33
|
+
});
|
|
34
|
+
}, [containerType, fireEvent]);
|
|
52
35
|
return /*#__PURE__*/React.createElement(LinkItem, {
|
|
53
36
|
href: link,
|
|
54
37
|
onClick: onClick,
|
|
@@ -1,35 +1,8 @@
|
|
|
1
1
|
import { getPageTime } from './performance';
|
|
2
|
-
|
|
3
|
-
/** Below lines are copied from teams common analytics */
|
|
4
|
-
const ANALYTICS_CHANNEL = 'peopleTeams';
|
|
5
2
|
export const PACKAGE_META_DATA = {
|
|
6
3
|
packageName: "@atlaskit/profilecard",
|
|
7
4
|
packageVersion: "0.0.0-development"
|
|
8
5
|
};
|
|
9
|
-
const runItLater = cb => {
|
|
10
|
-
const requestIdleCallback = window.requestIdleCallback;
|
|
11
|
-
if (typeof requestIdleCallback === 'function') {
|
|
12
|
-
return requestIdleCallback(cb);
|
|
13
|
-
}
|
|
14
|
-
if (typeof window.requestAnimationFrame === 'function') {
|
|
15
|
-
return window.requestAnimationFrame(cb);
|
|
16
|
-
}
|
|
17
|
-
return () => setTimeout(cb);
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @private
|
|
21
|
-
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
22
|
-
*/
|
|
23
|
-
export const fireEvent = (createAnalyticsEvent, body) => {
|
|
24
|
-
if (!createAnalyticsEvent) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
runItLater(() => {
|
|
28
|
-
createAnalyticsEvent(body).fire(ANALYTICS_CHANNEL);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
/** Above lines are copied from teams common analytics */
|
|
32
|
-
|
|
33
6
|
const TEAM_SUBJECT = 'teamProfileCard';
|
|
34
7
|
const USER_SUBJECT = 'profilecard';
|
|
35
8
|
const AGENT_SUBJECT = 'rovoAgentProfilecard';
|
|
@@ -6,13 +6,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
9
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
9
|
import Button from '@atlaskit/button/new';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
10
|
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
13
11
|
import { AgentDropdownMenu } from '@atlaskit/rovo-agent-components/ui/AgentDropdownMenu';
|
|
14
|
-
import { useAnalyticsEvents
|
|
15
|
-
import { fireEvent } from '../../util/analytics';
|
|
12
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
16
13
|
import { AgentDeleteConfirmationModal } from './AgentDeleteConfirmationModal';
|
|
17
14
|
var styles = {
|
|
18
15
|
chatToAgentButtonContainer: "_1bsb1osq",
|
|
@@ -33,9 +30,7 @@ export var AgentActions = function AgentActions(_ref) {
|
|
|
33
30
|
var _useIntl = useIntl(),
|
|
34
31
|
formatMessage = _useIntl.formatMessage;
|
|
35
32
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
36
|
-
|
|
37
|
-
var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
|
|
38
|
-
fireEventNext = _useAnalyticsEventsNe.fireEvent;
|
|
33
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
39
34
|
var _useState = useState(false),
|
|
40
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
36
|
isDeleteModalOpen = _useState2[0],
|
|
@@ -66,24 +61,12 @@ export var AgentActions = function AgentActions(_ref) {
|
|
|
66
61
|
}, _callee);
|
|
67
62
|
})), [agent.id, resourceClient]);
|
|
68
63
|
var handleDeleteAgent = useCallback(function () {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
fireEvent(createAnalyticsEvent, {
|
|
76
|
-
action: 'clicked',
|
|
77
|
-
actionSubject: 'button',
|
|
78
|
-
actionSubjectId: 'deleteAgentButton',
|
|
79
|
-
attributes: {
|
|
80
|
-
agentId: agent.id,
|
|
81
|
-
source: 'agentProfileCard'
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
64
|
+
fireEvent('ui.button.clicked.deleteAgentButton', {
|
|
65
|
+
agentId: agent.id,
|
|
66
|
+
source: 'agentProfileCard'
|
|
67
|
+
});
|
|
85
68
|
setIsDeleteModalOpen(true);
|
|
86
|
-
}, [agent.id,
|
|
69
|
+
}, [agent.id, fireEvent]);
|
|
87
70
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
|
|
88
71
|
space: "space.100",
|
|
89
72
|
xcss: styles.actionsWrapperStyles
|
|
@@ -174,7 +174,7 @@ export var AgentProfileCardTrigger = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
174
174
|
trigger: "hover",
|
|
175
175
|
renderProfileCard: renderProfileCard,
|
|
176
176
|
fetchProfile: fetchAgentProfile,
|
|
177
|
-
|
|
177
|
+
fireAnalytics: fireEvent,
|
|
178
178
|
profileCardType: "agent"
|
|
179
179
|
}));
|
|
180
180
|
});
|
|
@@ -3,13 +3,11 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
6
|
import { getATLContextUrl } from '@atlaskit/atlassian-context';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
10
9
|
import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
|
|
11
|
-
import { useAnalyticsEvents
|
|
12
|
-
import { fireEvent } from '../../../util/analytics';
|
|
10
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
13
11
|
import { encodeParamsToUrl } from '../../../util/url';
|
|
14
12
|
import { getAtlassianStudioAgentDuplicateUrl, getAtlassianStudioAgentEditUrl } from '../utils';
|
|
15
13
|
export var firstCharUpper = function firstCharUpper(str) {
|
|
@@ -32,72 +30,34 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
|
32
30
|
var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
|
|
33
31
|
publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
|
|
34
32
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
35
|
-
|
|
36
|
-
var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
|
|
37
|
-
fireEventNext = _useAnalyticsEventsNe.fireEvent;
|
|
33
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
38
34
|
var onEditAgent = useCallback(function (agentId) {
|
|
39
35
|
var url = getAtlassianStudioAgentEditUrl(cloudId, agentId);
|
|
40
36
|
window.open(url, '_blank', 'noopener, noreferrer');
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} else {
|
|
47
|
-
fireEvent(createAnalyticsEvent, {
|
|
48
|
-
action: 'clicked',
|
|
49
|
-
actionSubject: 'button',
|
|
50
|
-
actionSubjectId: 'editAgentButton',
|
|
51
|
-
attributes: {
|
|
52
|
-
agentId: agentId,
|
|
53
|
-
source: source
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}, [cloudId, createAnalyticsEvent, fireEventNext, source]);
|
|
37
|
+
fireEvent('ui.button.clicked.editAgentButton', {
|
|
38
|
+
agentId: agentId,
|
|
39
|
+
source: source
|
|
40
|
+
});
|
|
41
|
+
}, [cloudId, fireEvent, source]);
|
|
58
42
|
var onCopyAgent = function onCopyAgent(agentId) {
|
|
59
43
|
var url = "".concat(window.location.origin, "/people/agent/").concat(agentId);
|
|
60
44
|
var urlWithParams = encodeParamsToUrl(url, {
|
|
61
45
|
cloudId: cloudId
|
|
62
46
|
});
|
|
63
47
|
navigator.clipboard.writeText(urlWithParams);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
fireEvent(createAnalyticsEvent, {
|
|
71
|
-
action: 'clicked',
|
|
72
|
-
actionSubject: 'button',
|
|
73
|
-
actionSubjectId: 'copyAgentLinkButton',
|
|
74
|
-
attributes: {
|
|
75
|
-
agentId: agentId,
|
|
76
|
-
source: source
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
48
|
+
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
49
|
+
agentId: agentId,
|
|
50
|
+
source: source
|
|
51
|
+
});
|
|
80
52
|
};
|
|
81
53
|
var onDuplicateAgent = useCallback(function (agentId) {
|
|
82
54
|
var url = getAtlassianStudioAgentDuplicateUrl(cloudId, agentId);
|
|
83
55
|
window.open(url, '_blank', 'noopener, noreferrer');
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} else {
|
|
90
|
-
fireEvent(createAnalyticsEvent, {
|
|
91
|
-
action: 'clicked',
|
|
92
|
-
actionSubject: 'button',
|
|
93
|
-
actionSubjectId: 'duplicateAgentButton',
|
|
94
|
-
attributes: {
|
|
95
|
-
agentId: agentId,
|
|
96
|
-
source: source
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}, [cloudId, createAnalyticsEvent, fireEventNext, source]);
|
|
56
|
+
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
57
|
+
agentId: agentId,
|
|
58
|
+
source: source
|
|
59
|
+
});
|
|
60
|
+
}, [cloudId, fireEvent, source]);
|
|
101
61
|
var onConversationStarter = function onConversationStarter(_ref4) {
|
|
102
62
|
var agentId = _ref4.agentId,
|
|
103
63
|
prompt = _ref4.prompt;
|
|
@@ -172,22 +132,10 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
|
172
132
|
} else {
|
|
173
133
|
window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
|
|
174
134
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
});
|
|
180
|
-
} else {
|
|
181
|
-
fireEvent(createAnalyticsEvent, {
|
|
182
|
-
action: 'clicked',
|
|
183
|
-
actionSubject: 'button',
|
|
184
|
-
actionSubjectId: 'viewAgentFullProfileButton',
|
|
185
|
-
attributes: {
|
|
186
|
-
agentId: agentId,
|
|
187
|
-
source: source
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
135
|
+
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
136
|
+
agentId: agentId,
|
|
137
|
+
source: source
|
|
138
|
+
});
|
|
191
139
|
};
|
|
192
140
|
return {
|
|
193
141
|
onEditAgent: onEditAgent,
|
|
@@ -4,32 +4,22 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl-next';
|
|
6
6
|
import EmptyState from '@atlaskit/empty-state';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import messages from '../../messages';
|
|
9
8
|
import { AccessLockSVGWrapper, TeamForbiddenErrorStateWrapper } from '../../styled/TeamCard';
|
|
10
|
-
import { PACKAGE_META_DATA
|
|
9
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
11
10
|
import { getPageTime } from '../../util/performance';
|
|
12
11
|
import AccessLockSVG from '../Error/AccessLockSVG';
|
|
13
12
|
export default (function (props) {
|
|
14
|
-
var analytics = props.analytics
|
|
15
|
-
analyticsNext = props.analyticsNext;
|
|
13
|
+
var analytics = props.analytics;
|
|
16
14
|
var intl = useIntl();
|
|
17
15
|
useEffect(function () {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} else {
|
|
26
|
-
analytics(function (duration) {
|
|
27
|
-
return profileCardRendered('team', 'error', {
|
|
28
|
-
duration: duration
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}, [analytics, analyticsNext]);
|
|
16
|
+
analytics('ui.teamProfileCard.rendered.error', function (duration) {
|
|
17
|
+
return _objectSpread({
|
|
18
|
+
duration: duration,
|
|
19
|
+
firedAt: Math.round(getPageTime())
|
|
20
|
+
}, PACKAGE_META_DATA);
|
|
21
|
+
});
|
|
22
|
+
}, [analytics]);
|
|
33
23
|
return /*#__PURE__*/React.createElement(TeamForbiddenErrorStateWrapper, {
|
|
34
24
|
testId: "team-profilecard-forbidden-error-state"
|
|
35
25
|
}, /*#__PURE__*/React.createElement(EmptyState, {
|
|
@@ -2,30 +2,20 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import Spinner from '@atlaskit/spinner';
|
|
7
6
|
import { CardContent, CardHeader, CardWrapper, LoadingWrapper } from '../../styled/TeamTrigger';
|
|
8
|
-
import { PACKAGE_META_DATA
|
|
7
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
9
8
|
import { getPageTime } from '../../util/performance';
|
|
10
9
|
export default (function (props) {
|
|
11
|
-
var analytics = props.analytics
|
|
12
|
-
analyticsNext = props.analyticsNext;
|
|
10
|
+
var analytics = props.analytics;
|
|
13
11
|
useEffect(function () {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} else {
|
|
22
|
-
analytics(function (duration) {
|
|
23
|
-
return profileCardRendered('team', 'spinner', {
|
|
24
|
-
duration: duration
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}, [analytics, analyticsNext]);
|
|
12
|
+
analytics('ui.teamProfileCard.rendered.spinner', function (duration) {
|
|
13
|
+
return _objectSpread({
|
|
14
|
+
duration: duration,
|
|
15
|
+
firedAt: Math.round(getPageTime())
|
|
16
|
+
}, PACKAGE_META_DATA);
|
|
17
|
+
});
|
|
18
|
+
}, [analytics]);
|
|
29
19
|
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
30
20
|
testId: "team-profilecard"
|
|
31
21
|
}, /*#__PURE__*/React.createElement(CardHeader, {
|