@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* ReportingLinesDetailsCompiled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./ReportingLinesDetailsCompiled.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
6
|
+
import Avatar from '@atlaskit/avatar';
|
|
7
|
+
import AvatarGroup from '@atlaskit/avatar-group';
|
|
8
|
+
import { cx } from '@atlaskit/css';
|
|
9
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import messages from '../../messages';
|
|
11
|
+
import { ManagerName, ManagerSection, OffsetWrapper, ReportingLinesSection } from '../../styled/ReportingLines';
|
|
12
|
+
import { reportingLinesClicked } from '../../util/analytics';
|
|
13
|
+
function getProfileHref(userId, profileUrl) {
|
|
14
|
+
return profileUrl ? profileUrl + userId : undefined;
|
|
15
|
+
}
|
|
16
|
+
const styles = {
|
|
17
|
+
reportingLinesButton: "_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bfhksm61 _irr3166n",
|
|
18
|
+
reportingLinesHeadingDefaultStyles: "_11c81vhk _syaz1fxt _k48p1pd9 _otyru2gc",
|
|
19
|
+
reportingLinesHeadingStyles: "_otyrze3t"
|
|
20
|
+
};
|
|
21
|
+
const avatarGroupMaxCount = 5;
|
|
22
|
+
const ReportingLinesDetails = props => {
|
|
23
|
+
var _manager$pii, _manager$pii2;
|
|
24
|
+
const {
|
|
25
|
+
formatMessage
|
|
26
|
+
} = useIntl();
|
|
27
|
+
const {
|
|
28
|
+
fireAnalyticsWithDuration,
|
|
29
|
+
reportingLines = {},
|
|
30
|
+
reportingLinesProfileUrl,
|
|
31
|
+
onReportingLinesClick
|
|
32
|
+
} = props;
|
|
33
|
+
const {
|
|
34
|
+
managers = [],
|
|
35
|
+
reports = []
|
|
36
|
+
} = reportingLines;
|
|
37
|
+
const manager = managers.length >= 1 ? managers[0] : undefined;
|
|
38
|
+
const hasReports = reports.length > 0;
|
|
39
|
+
const getReportingLinesOnClick = (user, userType) => onReportingLinesClick ? () => {
|
|
40
|
+
fireAnalyticsWithDuration(duration => reportingLinesClicked({
|
|
41
|
+
duration,
|
|
42
|
+
userType
|
|
43
|
+
}));
|
|
44
|
+
onReportingLinesClick(user);
|
|
45
|
+
} : undefined;
|
|
46
|
+
const onReportingLinksClick = (user, userType, href) => {
|
|
47
|
+
let shouldPreventDefault = false;
|
|
48
|
+
if (onReportingLinesClick) {
|
|
49
|
+
shouldPreventDefault = onReportingLinesClick(user) === false;
|
|
50
|
+
}
|
|
51
|
+
fireAnalyticsWithDuration(duration => reportingLinesClicked({
|
|
52
|
+
duration,
|
|
53
|
+
userType
|
|
54
|
+
}));
|
|
55
|
+
if (shouldPreventDefault) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (href) {
|
|
59
|
+
window.location.href = href;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const showMoreButtonProps = {
|
|
63
|
+
'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
|
|
64
|
+
count: reports.length - avatarGroupMaxCount + 1
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, manager && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
68
|
+
xcss: cx(styles.reportingLinesHeadingDefaultStyles, styles.reportingLinesHeadingStyles)
|
|
69
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.managerSectionHeading)), /*#__PURE__*/React.createElement(OffsetWrapper, null, /*#__PURE__*/React.createElement(Pressable, {
|
|
70
|
+
onClick: () => onReportingLinksClick(manager, 'manager', getProfileHref(manager.accountIdentifier, reportingLinesProfileUrl)),
|
|
71
|
+
isDisabled: !onReportingLinesClick,
|
|
72
|
+
xcss: styles.reportingLinesButton
|
|
73
|
+
}, /*#__PURE__*/React.createElement(ManagerSection, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
74
|
+
size: "xsmall",
|
|
75
|
+
src: (_manager$pii = manager.pii) === null || _manager$pii === void 0 ? void 0 : _manager$pii.picture
|
|
76
|
+
}), /*#__PURE__*/React.createElement(ManagerName, null, (_manager$pii2 = manager.pii) === null || _manager$pii2 === void 0 ? void 0 : _manager$pii2.name))))), hasReports && /*#__PURE__*/React.createElement(ReportingLinesSection, null, /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
xcss: styles.reportingLinesHeadingDefaultStyles
|
|
78
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.directReportsSectionHeading)), /*#__PURE__*/React.createElement(AvatarGroup, {
|
|
79
|
+
appearance: "stack",
|
|
80
|
+
size: "small",
|
|
81
|
+
data: reports.map(member => {
|
|
82
|
+
var _member$pii, _member$pii2;
|
|
83
|
+
return {
|
|
84
|
+
key: member.accountIdentifier,
|
|
85
|
+
name: ((_member$pii = member.pii) === null || _member$pii === void 0 ? void 0 : _member$pii.name) || '',
|
|
86
|
+
src: (_member$pii2 = member.pii) === null || _member$pii2 === void 0 ? void 0 : _member$pii2.picture,
|
|
87
|
+
href: getProfileHref(member.accountIdentifier, reportingLinesProfileUrl),
|
|
88
|
+
onClick: getReportingLinesOnClick(member, 'direct-report')
|
|
89
|
+
};
|
|
90
|
+
}),
|
|
91
|
+
maxCount: avatarGroupMaxCount,
|
|
92
|
+
testId: "profilecard-reports-avatar-group",
|
|
93
|
+
showMoreButtonProps: showMoreButtonProps
|
|
94
|
+
})));
|
|
95
|
+
};
|
|
96
|
+
export default ReportingLinesDetails;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._1bsb1gwv{width:360px}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
/* ProfileCardWrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./ProfileCardWrapper.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
1
4
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
width: '360px'
|
|
7
|
-
});
|
|
5
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
|
+
const styles = {
|
|
7
|
+
wrapper: "_1bsb1gwv"
|
|
8
|
+
};
|
|
8
9
|
export const ProfileCardWrapper = ({
|
|
9
10
|
children,
|
|
10
11
|
testId
|
|
11
12
|
}) => {
|
|
12
13
|
return /*#__PURE__*/React.createElement(Box, {
|
|
13
|
-
xcss: styles,
|
|
14
|
+
xcss: styles.wrapper,
|
|
14
15
|
testId: testId
|
|
15
16
|
}, children);
|
|
16
17
|
};
|
|
@@ -9,7 +9,9 @@ import AvatarGroup from '@atlaskit/avatar-group';
|
|
|
9
9
|
import Heading from '@atlaskit/heading';
|
|
10
10
|
import LinkItem from '@atlaskit/menu/link-item';
|
|
11
11
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { Box, Flex, Inline, Pressable, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
14
|
+
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
|
|
13
15
|
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
14
16
|
import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
|
|
15
17
|
import { fireEvent } from '../../util/analytics';
|
|
@@ -72,24 +74,31 @@ export const TeamProfileCard = ({
|
|
|
72
74
|
const {
|
|
73
75
|
createAnalyticsEvent
|
|
74
76
|
} = useAnalyticsEvents();
|
|
77
|
+
const {
|
|
78
|
+
fireEvent: fireEventNext
|
|
79
|
+
} = useAnalyticsEventsNext();
|
|
75
80
|
// Ensure that the current container is not the only connection for this team before showing the "Where we work" section
|
|
76
81
|
const hasOtherTeamConnections = useMemo(() => teamContainers.filter(tc => tc.id === containerId).length < teamContainers.length, [containerId, teamContainers]);
|
|
77
82
|
|
|
78
83
|
// TODO: set isNewLayout to be true when clean up 'team-bi-directional-container-connection' experiment
|
|
79
84
|
const isNewLayout = Boolean(props.isKudosEnabled || props.otherActions);
|
|
80
85
|
const onClick = useCallback(() => {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
87
|
+
fireEventNext('ui.button.clicked.viewTeamProfileButton', {});
|
|
88
|
+
} else {
|
|
89
|
+
if (createAnalyticsEvent) {
|
|
90
|
+
fireEvent(createAnalyticsEvent, {
|
|
91
|
+
action: 'clicked',
|
|
92
|
+
actionSubject: 'button',
|
|
93
|
+
actionSubjectId: 'viewTeamProfileButton',
|
|
94
|
+
attributes: {}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
88
97
|
}
|
|
89
98
|
if (!isNewLayout) {
|
|
90
99
|
window.open(teamProfileUrl, '_blank');
|
|
91
100
|
}
|
|
92
|
-
}, [createAnalyticsEvent, teamProfileUrl, isNewLayout]);
|
|
101
|
+
}, [createAnalyticsEvent, teamProfileUrl, isNewLayout, fireEventNext]);
|
|
93
102
|
if (isNewLayout) {
|
|
94
103
|
return /*#__PURE__*/React.createElement(Box, {
|
|
95
104
|
xcss: styles.wrapperStyles,
|
|
@@ -174,7 +183,8 @@ export const TeamProfileCard = ({
|
|
|
174
183
|
testId: "team-app-tile",
|
|
175
184
|
alt: "team-app-tile",
|
|
176
185
|
xcss: styles.teamAppTileStyles
|
|
177
|
-
})
|
|
186
|
+
}),
|
|
187
|
+
testId: "team-profile-card-profile-link-item"
|
|
178
188
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
179
189
|
maxLines: 1,
|
|
180
190
|
color: "color.text"
|
|
@@ -5,8 +5,7 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
5
5
|
import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
|
|
6
6
|
import { MenuGroup, Section } from '@atlaskit/menu';
|
|
7
7
|
import Popup from '@atlaskit/popup';
|
|
8
|
-
|
|
9
|
-
import { Box } from '@atlaskit/primitives';
|
|
8
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
9
|
import { messages } from './messages';
|
|
11
10
|
export const MoreActions = ({
|
|
12
11
|
actions,
|
|
@@ -4,7 +4,9 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
6
|
import { LinkItem } from '@atlaskit/menu';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
|
|
8
10
|
import { ContainerIcon, getContainerProperties } from '@atlaskit/teams-public';
|
|
9
11
|
import { fireEvent } from '../../../util/analytics';
|
|
10
12
|
const styles = {
|
|
@@ -30,16 +32,25 @@ export const TeamConnections = ({
|
|
|
30
32
|
const {
|
|
31
33
|
createAnalyticsEvent
|
|
32
34
|
} = useAnalyticsEvents();
|
|
35
|
+
const {
|
|
36
|
+
fireEvent: fireEventNext
|
|
37
|
+
} = useAnalyticsEventsNext();
|
|
33
38
|
const onClick = useCallback(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
actionSubject: 'teamConnectionItem',
|
|
37
|
-
actionSubjectId: 'teamProfileCard',
|
|
38
|
-
attributes: {
|
|
39
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
40
|
+
fireEventNext('ui.teamConnectionItem.clicked.teamProfileCard', {
|
|
39
41
|
container: containerType
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
42
|
+
});
|
|
43
|
+
} else {
|
|
44
|
+
fireEvent(createAnalyticsEvent, {
|
|
45
|
+
action: 'clicked',
|
|
46
|
+
actionSubject: 'teamConnectionItem',
|
|
47
|
+
actionSubjectId: 'teamProfileCard',
|
|
48
|
+
attributes: {
|
|
49
|
+
container: containerType
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [containerType, createAnalyticsEvent, fireEventNext]);
|
|
43
54
|
return /*#__PURE__*/React.createElement(LinkItem, {
|
|
44
55
|
href: link,
|
|
45
56
|
onClick: onClick,
|
|
@@ -87,16 +98,25 @@ export const NewTeamConnections = ({
|
|
|
87
98
|
const {
|
|
88
99
|
createAnalyticsEvent
|
|
89
100
|
} = useAnalyticsEvents();
|
|
101
|
+
const {
|
|
102
|
+
fireEvent: fireEventNext
|
|
103
|
+
} = useAnalyticsEventsNext();
|
|
90
104
|
const onClick = useCallback(() => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
actionSubject: 'teamConnectionItem',
|
|
94
|
-
actionSubjectId: 'teamProfileCard',
|
|
95
|
-
attributes: {
|
|
105
|
+
if (fg('ptc-enable-profile-card-analytics-refactor')) {
|
|
106
|
+
fireEventNext('ui.teamConnectionItem.clicked.teamProfileCard', {
|
|
96
107
|
container: containerType
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
fireEvent(createAnalyticsEvent, {
|
|
111
|
+
action: 'clicked',
|
|
112
|
+
actionSubject: 'teamConnectionItem',
|
|
113
|
+
actionSubjectId: 'teamProfileCard',
|
|
114
|
+
attributes: {
|
|
115
|
+
container: containerType
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, [containerType, createAnalyticsEvent, fireEventNext]);
|
|
100
120
|
return /*#__PURE__*/React.createElement(LinkItem, {
|
|
101
121
|
href: link,
|
|
102
122
|
onClick: onClick,
|
|
@@ -120,7 +140,8 @@ export const NewTeamConnections = ({
|
|
|
120
140
|
backgroundColor: 'color.background.neutral.subtle',
|
|
121
141
|
xcss: styles.containerTypeIconButtonStyles,
|
|
122
142
|
testId: "container-type-icon"
|
|
123
|
-
}, icon)
|
|
143
|
+
}, icon),
|
|
144
|
+
testId: "team-connection-item"
|
|
124
145
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
125
146
|
maxLines: 1,
|
|
126
147
|
color: "color.text"
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
._1e0c1txw{display:flex}
|
|
7
7
|
._1reo15vq{overflow-x:hidden}
|
|
8
8
|
._4cvr1h6o{align-items:center}
|
|
9
|
+
._4t3i1osq{height:100%}
|
|
9
10
|
._4t3i1qr7{height:8pc}
|
|
10
11
|
._4t3i1wug{height:auto}
|
|
12
|
+
._5ral1dfr{object-fit:cover}
|
|
11
13
|
._kqswh2mm{position:relative}
|
|
12
14
|
._qrwq12b0{border-top-right-radius:var(--ds-radius-small,4px)}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import "./CoverImage.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
7
|
const styles = {
|
|
7
8
|
container: "_1reo15vq _18m915vq _1bsb1osq _4t3i1qr7 _kqswh2mm _13li12b0 _qrwq12b0 _1e0c1txw _1bah1h6o _4cvr1h6o",
|
|
8
|
-
image: "_1bsbnklw _4t3i1wug"
|
|
9
|
+
image: "_1bsbnklw _4t3i1wug",
|
|
10
|
+
imageNext: "_4t3i1osq _5ral1dfr"
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -26,6 +28,6 @@ export const CoverImage = ({
|
|
|
26
28
|
ref: imgRef,
|
|
27
29
|
src: src,
|
|
28
30
|
alt: alt,
|
|
29
|
-
xcss: styles.image
|
|
31
|
+
xcss: fg('cover-header-image-team-profilecard') ? styles.imageNext : styles.image
|
|
30
32
|
}));
|
|
31
33
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
1
|
._19bv1ejb{padding-left:var(--ds-space-300,24px)}
|
|
3
2
|
._19pku2gc{margin-top:var(--ds-space-100,8px)}
|
|
4
3
|
._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
|
|
5
4
|
._n3td1ejb{padding-bottom:var(--ds-space-300,24px)}
|
|
6
|
-
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
7
5
|
._syaz1wmz{color:var(--ds-text-subtlest,#6b778c)}
|
|
8
6
|
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
9
7
|
._y3gn1h6o{text-align:center}
|
|
@@ -4,19 +4,21 @@ import "./Error.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { cx } from '@atlaskit/css';
|
|
7
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { N200 } from '@atlaskit/theme/colors';
|
|
9
9
|
const styles = {
|
|
10
10
|
errorWrapper: "_y3gn1h6o _ca0q1ejb _u5f31ejb _n3td1ejb _19bv1ejb",
|
|
11
|
-
errorTitle: "
|
|
11
|
+
errorTitle: "_19pku2gc",
|
|
12
12
|
teamErrorText: "_syaz1wmz _19pku2gc"
|
|
13
13
|
};
|
|
14
14
|
export const ErrorWrapper = props => /*#__PURE__*/React.createElement(Box, _extends({
|
|
15
15
|
xcss: cx(styles.errorWrapper)
|
|
16
16
|
}, props));
|
|
17
17
|
export const ErrorTitle = props => /*#__PURE__*/React.createElement(Box, {
|
|
18
|
-
xcss:
|
|
19
|
-
},
|
|
18
|
+
xcss: styles.errorTitle
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20
|
+
color: "color.text"
|
|
21
|
+
}, props.children));
|
|
20
22
|
export const TeamErrorText = props => /*#__PURE__*/React.createElement(Box, {
|
|
21
23
|
xcss: cx(styles.teamErrorText)
|
|
22
24
|
}, props.children);
|
|
@@ -4,7 +4,7 @@ import { getPageTime } from './performance';
|
|
|
4
4
|
const ANALYTICS_CHANNEL = 'peopleTeams';
|
|
5
5
|
export const PACKAGE_META_DATA = {
|
|
6
6
|
packageName: "@atlaskit/profilecard",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
const runItLater = cb => {
|
|
10
10
|
const requestIdleCallback = window.requestIdleCallback;
|
|
@@ -45,7 +45,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
45
45
|
actionSubjectId,
|
|
46
46
|
attributes: {
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "
|
|
48
|
+
packageVersion: "0.0.0-development",
|
|
49
49
|
...attributes,
|
|
50
50
|
firedAt: Math.round(getPageTime())
|
|
51
51
|
}
|
|
@@ -62,6 +62,11 @@ export const getActionSubject = type => {
|
|
|
62
62
|
return 'user';
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
69
|
+
*/
|
|
65
70
|
export const cardTriggered = (type, method, teamId) => {
|
|
66
71
|
return createEvent('ui', 'triggered', getActionSubject(type), undefined, {
|
|
67
72
|
method,
|
|
@@ -70,13 +75,63 @@ export const cardTriggered = (type, method, teamId) => {
|
|
|
70
75
|
} : {})
|
|
71
76
|
});
|
|
72
77
|
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @private
|
|
81
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
82
|
+
*/
|
|
73
83
|
export const teamRequestAnalytics = (action, attributes) => createEvent('operational', action, TEAM_SUBJECT, 'request', attributes);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @private
|
|
87
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
88
|
+
*/
|
|
74
89
|
export const userRequestAnalytics = (action, attributes) => createEvent('operational', action, USER_SUBJECT, 'request', attributes);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @private
|
|
93
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
94
|
+
*/
|
|
75
95
|
export const profileCardRendered = (type, actionSubjectId, attributes) => createEvent('ui', 'rendered', getActionSubject(type), actionSubjectId, attributes);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @private
|
|
99
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
100
|
+
*/
|
|
76
101
|
export const actionClicked = (type, attributes) => createEvent('ui', 'clicked', getActionSubject(type), 'action', attributes);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @private
|
|
105
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
106
|
+
*/
|
|
77
107
|
export const reportingLinesClicked = attributes => createEvent('ui', 'clicked', USER_SUBJECT, 'reportingLines', attributes);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @private
|
|
111
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
112
|
+
*/
|
|
78
113
|
export const moreActionsClicked = (type, attributes) => createEvent('ui', 'clicked', getActionSubject(type), 'moreActions', attributes);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @private
|
|
117
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
118
|
+
*/
|
|
79
119
|
export const teamAvatarClicked = attributes => createEvent('ui', 'clicked', TEAM_SUBJECT, 'avatar', attributes);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @private
|
|
123
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
124
|
+
*/
|
|
80
125
|
export const moreMembersClicked = attributes => createEvent('ui', 'clicked', TEAM_SUBJECT, 'moreMembers', attributes);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @private
|
|
129
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
130
|
+
*/
|
|
81
131
|
export const errorRetryClicked = attributes => createEvent('ui', 'clicked', TEAM_SUBJECT, 'errorRetry', attributes);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @private
|
|
135
|
+
* @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
|
|
136
|
+
*/
|
|
82
137
|
export const agentRequestAnalytics = (action, actionSubjectId, attributes) => createEvent('operational', action, AGENT_SUBJECT, actionSubjectId || 'request', attributes);
|
|
@@ -42,8 +42,8 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
42
42
|
}
|
|
43
43
|
}, {
|
|
44
44
|
key: "getTeamProfile",
|
|
45
|
-
value: function getTeamProfile(teamId, orgId, analytics) {
|
|
46
|
-
return this.teamClient.getProfile(teamId, orgId, analytics);
|
|
45
|
+
value: function getTeamProfile(teamId, orgId, analytics, analyticsNext) {
|
|
46
|
+
return this.teamClient.getProfile(teamId, orgId, analytics, analyticsNext);
|
|
47
47
|
}
|
|
48
48
|
}, {
|
|
49
49
|
key: "getReportingLines",
|
|
@@ -147,27 +147,27 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
147
147
|
}()
|
|
148
148
|
}, {
|
|
149
149
|
key: "getRovoAgentProfile",
|
|
150
|
-
value: function getRovoAgentProfile(id, analytics) {
|
|
150
|
+
value: function getRovoAgentProfile(id, analytics, analyticsNext) {
|
|
151
151
|
var _this$rovoAgentClient2;
|
|
152
|
-
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics);
|
|
152
|
+
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics, analyticsNext);
|
|
153
153
|
}
|
|
154
154
|
}, {
|
|
155
155
|
key: "getRovoAgentPermissions",
|
|
156
|
-
value: function getRovoAgentPermissions(id, fireAnalytics) {
|
|
156
|
+
value: function getRovoAgentPermissions(id, fireAnalytics, analyticsNext) {
|
|
157
157
|
var _this$rovoAgentClient3;
|
|
158
|
-
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics);
|
|
158
|
+
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics, analyticsNext);
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
161
161
|
key: "deleteAgent",
|
|
162
|
-
value: function deleteAgent(id, analytics) {
|
|
162
|
+
value: function deleteAgent(id, analytics, analyticsNext) {
|
|
163
163
|
var _this$rovoAgentClient4;
|
|
164
|
-
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics);
|
|
164
|
+
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics, analyticsNext);
|
|
165
165
|
}
|
|
166
166
|
}, {
|
|
167
167
|
key: "setFavouriteAgent",
|
|
168
|
-
value: function setFavouriteAgent(id, isFavourite, analytics) {
|
|
168
|
+
value: function setFavouriteAgent(id, isFavourite, analytics, analyticsNext) {
|
|
169
169
|
var _this$rovoAgentClient5;
|
|
170
|
-
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics);
|
|
170
|
+
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics, analyticsNext);
|
|
171
171
|
}
|
|
172
172
|
}]);
|
|
173
173
|
}();
|