@atlaskit/profilecard 24.40.2 → 24.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/afm-cc/tsconfig.json +0 -6
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +8 -25
- package/dist/cjs/components/Agent/AgentProfileCard.js +6 -3
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/cjs/components/Team/TeamForbiddenErrorState.js +8 -18
- package/dist/cjs/components/Team/TeamLoadingState.js +8 -18
- package/dist/cjs/components/Team/TeamProfileCard.js +76 -162
- package/dist/cjs/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/cjs/components/User/OverflowProfileCardButtons.js +9 -19
- package/dist/cjs/components/User/ProfileCard.js +37 -85
- package/dist/cjs/components/User/ProfileCardDetails.js +3 -4
- package/dist/cjs/components/User/ProfileCardResourced.js +10 -3
- package/dist/cjs/components/User/ProfileCardTrigger.js +20 -11
- package/dist/cjs/components/User/ReportingLinesDetails.js +15 -35
- package/dist/cjs/components/common/ProfileCardTrigger.js +9 -17
- package/dist/cjs/components/common/ProfileCardWrapper.js +1 -1
- package/dist/cjs/components/team-profile-card/main.js +5 -21
- package/dist/cjs/components/team-profile-card/team-connections/main.js +7 -23
- package/dist/cjs/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/cjs/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/cjs/styled/Card.js +1 -1
- package/dist/cjs/styled/CoverImage.js +1 -1
- package/dist/cjs/styled/Error.js +1 -1
- package/dist/cjs/styled/ReportingLines.js +1 -1
- package/dist/cjs/styled/TeamCard.js +1 -1
- package/dist/cjs/styled/TeamTrigger.js +1 -1
- package/dist/cjs/styled/UserTrigger.js +1 -1
- package/dist/cjs/util/analytics.js +3 -31
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +8 -26
- package/dist/es2019/components/Agent/AgentProfileCard.js +5 -3
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +20 -73
- package/dist/es2019/components/Team/TeamForbiddenErrorState.js +8 -16
- package/dist/es2019/components/Team/TeamLoadingState.js +8 -16
- package/dist/es2019/components/Team/TeamProfileCard.js +72 -146
- package/dist/es2019/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/es2019/components/User/OverflowProfileCardButtons.js +9 -17
- package/dist/es2019/components/User/ProfileCard.js +35 -79
- package/dist/es2019/components/User/ProfileCardDetails.js +3 -4
- package/dist/es2019/components/User/ProfileCardResourced.js +10 -3
- package/dist/es2019/components/User/ProfileCardTrigger.js +12 -3
- package/dist/es2019/components/User/ReportingLinesDetails.js +14 -30
- package/dist/es2019/components/common/ProfileCardTrigger.js +9 -17
- package/dist/es2019/components/common/ProfileCardWrapper.js +1 -1
- package/dist/es2019/components/team-profile-card/main.js +5 -22
- package/dist/es2019/components/team-profile-card/team-connections/main.js +7 -24
- package/dist/es2019/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/es2019/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/es2019/styled/Card.js +1 -1
- package/dist/es2019/styled/CoverImage.js +1 -1
- package/dist/es2019/styled/Error.js +1 -1
- package/dist/es2019/styled/ReportingLines.js +1 -1
- package/dist/es2019/styled/TeamCard.js +1 -1
- package/dist/es2019/styled/TeamTrigger.js +1 -1
- package/dist/es2019/styled/UserTrigger.js +1 -1
- package/dist/es2019/util/analytics.js +2 -29
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +8 -25
- package/dist/esm/components/Agent/AgentProfileCard.js +6 -3
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCardWrapper.js +1 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +20 -72
- package/dist/esm/components/Team/TeamForbiddenErrorState.js +9 -19
- package/dist/esm/components/Team/TeamLoadingState.js +9 -19
- package/dist/esm/components/Team/TeamProfileCard.js +77 -163
- package/dist/esm/components/Team/TeamProfileCardTrigger.js +2 -4
- package/dist/esm/components/User/OverflowProfileCardButtons.js +10 -20
- package/dist/esm/components/User/ProfileCard.js +38 -86
- package/dist/esm/components/User/ProfileCardDetails.js +3 -4
- package/dist/esm/components/User/ProfileCardResourced.js +10 -3
- package/dist/esm/components/User/ProfileCardTrigger.js +20 -11
- package/dist/esm/components/User/ReportingLinesDetails.js +16 -36
- package/dist/esm/components/common/ProfileCardTrigger.js +10 -18
- package/dist/esm/components/common/ProfileCardWrapper.js +1 -1
- package/dist/esm/components/team-profile-card/main.js +5 -21
- package/dist/esm/components/team-profile-card/team-connections/main.js +7 -23
- package/dist/esm/components/team-profile-card/team-containers-skeleton/index.js +1 -1
- package/dist/esm/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.js +1 -1
- package/dist/esm/styled/Card.js +1 -1
- package/dist/esm/styled/CoverImage.js +1 -1
- package/dist/esm/styled/Error.js +1 -1
- package/dist/esm/styled/ReportingLines.js +1 -1
- package/dist/esm/styled/TeamCard.js +1 -1
- package/dist/esm/styled/TeamTrigger.js +1 -1
- package/dist/esm/styled/UserTrigger.js +1 -1
- package/dist/esm/util/analytics.js +2 -31
- package/dist/types/components/Agent/AgentProfileCard.d.ts +1 -1
- package/dist/types/components/Agent/AgentProfileCardResourced.d.ts +2 -0
- package/dist/types/components/Agent/lazyAgentProfileCard.d.ts +1 -1
- package/dist/types/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types/components/User/ProfileCard.d.ts +2 -3
- package/dist/types/components/User/ProfileCardTrigger.d.ts +1 -1
- package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types/components/common/types.d.ts +1 -3
- package/dist/types/types.d.ts +26 -10
- package/dist/types/util/analytics.d.ts +2 -17
- package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +2 -0
- package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +1 -2
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +1 -2
- package/dist/types-ts4.5/components/User/ProfileCard.d.ts +2 -3
- package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +1 -1
- package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +1 -1
- package/dist/types-ts4.5/components/common/types.d.ts +1 -3
- package/dist/types-ts4.5/types.d.ts +26 -10
- package/dist/types-ts4.5/util/analytics.d.ts +2 -17
- package/package.json +10 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* TeamCard.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* TeamCard.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./TeamCard.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* TeamTrigger.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* TeamTrigger.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./TeamTrigger.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* UserTrigger.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* UserTrigger.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
// PLEASE NOTE: This file is sync-loaded with the trigger components. Only add components here that
|
|
3
3
|
// are necessary for the main render of the trigger component to help maintain bundle size.
|
|
4
4
|
/* eslint-disable @atlaskit/design-system/no-styled-tagged-template-expression -- needs manual remediation */
|
|
@@ -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
|
-
packageVersion: "
|
|
8
|
-
};
|
|
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
|
-
});
|
|
4
|
+
packageVersion: "0.0.0-development"
|
|
30
5
|
};
|
|
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';
|
|
@@ -45,7 +18,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
45
18
|
actionSubjectId,
|
|
46
19
|
attributes: {
|
|
47
20
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "
|
|
21
|
+
packageVersion: "0.0.0-development",
|
|
49
22
|
...attributes,
|
|
50
23
|
firedAt: Math.round(getPageTime())
|
|
51
24
|
}
|
|
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
|
|
|
4
4
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
5
5
|
var addHeaders = function addHeaders(headers) {
|
|
6
6
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
7
|
-
headers.append('atl-client-version', "
|
|
7
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
59
59
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
60
60
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
61
61
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
62
|
-
headers.append('atl-client-version', "
|
|
62
|
+
headers.append('atl-client-version', "0.0.0-development");
|
|
63
63
|
return headers;
|
|
64
64
|
};
|
|
65
65
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Actions.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* Actions.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import "./Actions.compiled.css";
|
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AgentProfileCard.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* AgentProfileCard.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
@@ -48,7 +48,9 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
48
48
|
onDeleteAgent = _ref.onDeleteAgent,
|
|
49
49
|
hideMoreActions = _ref.hideMoreActions,
|
|
50
50
|
_ref$hideAiDisclaimer = _ref.hideAiDisclaimer,
|
|
51
|
-
hideAiDisclaimer = _ref$hideAiDisclaimer === void 0 ? false : _ref$hideAiDisclaimer
|
|
51
|
+
hideAiDisclaimer = _ref$hideAiDisclaimer === void 0 ? false : _ref$hideAiDisclaimer,
|
|
52
|
+
_ref$hideConversation = _ref.hideConversationStarters,
|
|
53
|
+
hideConversationStarters = _ref$hideConversation === void 0 ? false : _ref$hideConversation;
|
|
52
54
|
var _useAgentUrlActions = useAgentUrlActions({
|
|
53
55
|
cloudId: cloudId || '',
|
|
54
56
|
source: 'agentProfileCard'
|
|
@@ -172,6 +174,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
172
174
|
}));
|
|
173
175
|
}
|
|
174
176
|
var isRovoDev = agent.creator_type === 'ROVO_DEV';
|
|
177
|
+
var shouldShowConversationStarters = !(isRovoDev && fg('rovo_dev_themed_identity_card')) && !(fg('jira_ai_hide_conversation_starters_profilecard') && hideConversationStarters);
|
|
175
178
|
return /*#__PURE__*/React.createElement(AgentProfileCardWrapper, null, /*#__PURE__*/React.createElement(Box, {
|
|
176
179
|
xcss: styles.cardContainerStyles
|
|
177
180
|
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
@@ -229,7 +232,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
229
232
|
}), " ", /*#__PURE__*/React.createElement(Text, {
|
|
230
233
|
size: "small",
|
|
231
234
|
color: "color.text.subtlest"
|
|
232
|
-
}, formatMessage(messages.aiDisclaimer)))),
|
|
235
|
+
}, formatMessage(messages.aiDisclaimer)))), shouldShowConversationStarters && /*#__PURE__*/React.createElement(Box, {
|
|
233
236
|
xcss: styles.conversationStartersWrapper
|
|
234
237
|
}, /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
235
238
|
isAgentDefault: agent.is_default,
|
|
@@ -151,6 +151,7 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
151
151
|
cloudId: props.cloudId,
|
|
152
152
|
onDeleteAgent: props.onDeleteAgent,
|
|
153
153
|
hideMoreActions: props.hideMoreActions,
|
|
154
|
-
hideAiDisclaimer: props.hideAiDisclaimer
|
|
154
|
+
hideAiDisclaimer: props.hideAiDisclaimer,
|
|
155
|
+
hideConversationStarters: props.hideConversationStarters
|
|
155
156
|
}));
|
|
156
157
|
};
|
|
@@ -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
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AgentProfileCardWrapper.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* AgentProfileCardWrapper.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import "./AgentProfileCardWrapper.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -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, {
|