@atlaskit/smart-card 32.7.7 → 32.7.8
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 +8 -0
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +54 -305
- package/dist/cjs/utils/analytics/analytics.js +27 -301
- package/dist/cjs/utils/analytics/index.js +0 -66
- package/dist/cjs/view/CardWithUrl/component.js +7 -22
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/es2019/state/actions/index.js +13 -38
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +2 -238
- package/dist/es2019/utils/analytics/analytics.js +2 -286
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +8 -23
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +55 -306
- package/dist/esm/utils/analytics/analytics.js +26 -300
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +8 -23
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types/utils/analytics/analytics.d.ts +1 -51
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -60
- package/dist/types/utils/mocks.d.ts +0 -12
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/package.json +2 -5
|
@@ -10,7 +10,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
12
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
15
14
|
var _constants = require("../../../constants");
|
|
16
15
|
var _analytics2 = require("../../../state/analytics");
|
|
@@ -68,17 +67,13 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
68
67
|
var isAISummaryEnabled = (0, _aiSummary.getIsAISummaryEnabled)(isAdminHubAIEnabled, cardState.details);
|
|
69
68
|
var services = (0, _helpers.getServices)(linkState.details);
|
|
70
69
|
var statusRef = (0, _react.useRef)(linkStatus);
|
|
71
|
-
var analyticsRef = (0, _react.useRef)(analytics);
|
|
72
70
|
var fireEventRef = (0, _react.useRef)(fireEvent);
|
|
73
71
|
var definitionIdRef = (0, _react.useRef)(definitionId);
|
|
74
72
|
(0, _react.useEffect)(function () {
|
|
75
73
|
/**
|
|
76
|
-
* Must access
|
|
74
|
+
* Must access object value via ref because its not stable
|
|
77
75
|
* and it can trigger useEffect to re-run below
|
|
78
76
|
*/
|
|
79
|
-
if (analyticsRef.current !== analytics) {
|
|
80
|
-
analyticsRef.current = analytics;
|
|
81
|
-
}
|
|
82
77
|
if (statusRef.current !== linkStatus) {
|
|
83
78
|
statusRef.current = linkStatus;
|
|
84
79
|
}
|
|
@@ -88,66 +83,39 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
88
83
|
if (definitionIdRef.current !== definitionId) {
|
|
89
84
|
definitionIdRef.current = definitionId;
|
|
90
85
|
}
|
|
91
|
-
}, [
|
|
86
|
+
}, [linkStatus, fireEvent, definitionId]);
|
|
92
87
|
(0, _react.useEffect)(function () {
|
|
88
|
+
var _definitionIdRef$curr;
|
|
93
89
|
var previewDisplay = 'card';
|
|
94
90
|
var previewInvokeMethod = 'mouse_hover';
|
|
95
91
|
var cardOpenTime = Date.now();
|
|
96
92
|
var fireEventCurrent = fireEventRef.current;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
fireEventCurrent('ui.hoverCard.viewed', {
|
|
94
|
+
previewDisplay: previewDisplay,
|
|
95
|
+
previewInvokeMethod: previewInvokeMethod,
|
|
96
|
+
definitionId: (_definitionIdRef$curr = definitionIdRef.current) !== null && _definitionIdRef$curr !== void 0 ? _definitionIdRef$curr : null
|
|
97
|
+
});
|
|
98
|
+
return function () {
|
|
99
|
+
var _definitionIdRef$curr2;
|
|
100
|
+
var hoverTime = Date.now() - cardOpenTime;
|
|
101
|
+
fireEventCurrent('ui.hoverCard.dismissed', {
|
|
106
102
|
previewDisplay: previewDisplay,
|
|
107
103
|
previewInvokeMethod: previewInvokeMethod,
|
|
108
|
-
|
|
104
|
+
hoverTime: hoverTime,
|
|
105
|
+
definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
|
|
109
106
|
});
|
|
110
|
-
}
|
|
111
|
-
return function () {
|
|
112
|
-
var hoverTime = Date.now() - cardOpenTime;
|
|
113
|
-
if ((0, _platformFeatureFlags.fg)('platform_migrate-some-ui-events-smart-card')) {
|
|
114
|
-
var _definitionIdRef$curr2;
|
|
115
|
-
fireEventCurrent('ui.hoverCard.dismissed', {
|
|
116
|
-
previewDisplay: previewDisplay,
|
|
117
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
118
|
-
hoverTime: hoverTime,
|
|
119
|
-
definitionId: (_definitionIdRef$curr2 = definitionIdRef.current) !== null && _definitionIdRef$curr2 !== void 0 ? _definitionIdRef$curr2 : null
|
|
120
|
-
});
|
|
121
|
-
} else {
|
|
122
|
-
analyticsRef.current.ui.hoverCardDismissedEvent({
|
|
123
|
-
previewDisplay: previewDisplay,
|
|
124
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
125
|
-
hoverTime: hoverTime,
|
|
126
|
-
status: statusRef.current
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
107
|
};
|
|
130
108
|
}, []);
|
|
131
109
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
132
110
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
} else {
|
|
141
|
-
analytics.ui.cardClickedEvent({
|
|
142
|
-
id: id,
|
|
143
|
-
display: _constants.CardDisplay.HoverCardPreview,
|
|
144
|
-
status: cardState.status,
|
|
145
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
146
|
-
actionSubjectId: 'titleGoToLink'
|
|
147
|
-
});
|
|
148
|
-
}
|
|
111
|
+
fireEvent('ui.smartLink.clicked.titleGoToLink', {
|
|
112
|
+
id: id,
|
|
113
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
114
|
+
isModifierKeyPressed: isModifierKeyPressed,
|
|
115
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
116
|
+
});
|
|
149
117
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
150
|
-
}, [createAnalyticsEvent,
|
|
118
|
+
}, [createAnalyticsEvent, id, fireEvent, definitionId]);
|
|
151
119
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
152
120
|
var _getMetadata = (0, _utils2.getMetadata)(extensionKey, data),
|
|
153
121
|
subtitle = _getMetadata.subtitle;
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "32.7.
|
|
23
|
+
packageVersion: "32.7.8",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -9,7 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
14
13
|
var _constants = require("../../constants");
|
|
15
14
|
var _messages = require("../../messages");
|
|
@@ -23,17 +22,12 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
23
22
|
var providerName = _ref.providerName,
|
|
24
23
|
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
25
24
|
_ref$testId = _ref.testId,
|
|
26
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
27
|
-
analytics = _ref.analytics;
|
|
25
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
28
26
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
29
27
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
30
28
|
var handleLearnMoreClick = (0, _react.useCallback)(function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
analytics === null || analytics === void 0 || analytics.ui.learnMoreClickedEvent();
|
|
35
|
-
}
|
|
36
|
-
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui, fireEvent]);
|
|
29
|
+
fireEvent('ui.button.clicked.learnMore', {});
|
|
30
|
+
}, [fireEvent]);
|
|
37
31
|
var learnMoreMessage = isProductIntegrationSupported ? _messages.messages.learn_more_about_connecting_account : _messages.messages.learn_more_about_smart_links;
|
|
38
32
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, providerName ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_description, {
|
|
39
33
|
values: {
|
|
@@ -2,7 +2,6 @@ import { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
3
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
|
|
4
4
|
import { auth } from '@atlaskit/outbound-auth-flow-client';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
7
6
|
import { SmartLinkStatus } from '../../constants';
|
|
8
7
|
import { startUfoExperience } from '../analytics';
|
|
@@ -88,32 +87,16 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
88
87
|
const services = getServices(details);
|
|
89
88
|
// When authentication is triggered, let GAS know!
|
|
90
89
|
if (status === 'unauthorized') {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
} else {
|
|
97
|
-
analytics.ui.authEvent({
|
|
98
|
-
display: appearance,
|
|
99
|
-
definitionId,
|
|
100
|
-
extensionKey
|
|
101
|
-
});
|
|
102
|
-
}
|
|
90
|
+
fireEvent('ui.button.clicked.connectAccount', {
|
|
91
|
+
display: appearance,
|
|
92
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
93
|
+
});
|
|
103
94
|
}
|
|
104
95
|
if (status === 'forbidden') {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
} else {
|
|
111
|
-
analytics.ui.authAlternateAccountEvent({
|
|
112
|
-
display: appearance,
|
|
113
|
-
definitionId,
|
|
114
|
-
extensionKey
|
|
115
|
-
});
|
|
116
|
-
}
|
|
96
|
+
fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
|
|
97
|
+
display: appearance,
|
|
98
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
99
|
+
});
|
|
117
100
|
}
|
|
118
101
|
if (services.length > 0) {
|
|
119
102
|
fireEvent('screen.consentModal.viewed', {
|
|
@@ -142,23 +125,15 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
142
125
|
reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
|
|
143
126
|
});
|
|
144
127
|
if (err.type === 'auth_window_closed') {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
} else {
|
|
151
|
-
analytics.ui.closedAuthEvent({
|
|
152
|
-
display: appearance,
|
|
153
|
-
definitionId,
|
|
154
|
-
extensionKey
|
|
155
|
-
});
|
|
156
|
-
}
|
|
128
|
+
fireEvent('ui.consentModal.closed', {
|
|
129
|
+
display: appearance,
|
|
130
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
131
|
+
});
|
|
157
132
|
}
|
|
158
133
|
reload();
|
|
159
134
|
});
|
|
160
135
|
}
|
|
161
|
-
}, [getSmartLinkState,
|
|
136
|
+
}, [getSmartLinkState, id, reload, fireEvent]);
|
|
162
137
|
const invoke = useCallback(async (opts, appearance) => {
|
|
163
138
|
const {
|
|
164
139
|
key,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
3
|
import { getUrl } from '@atlaskit/linking-common';
|
|
4
|
-
import { context, invokeFailedEvent, invokeSucceededEvent, uiActionClickedEvent,
|
|
5
|
-
import { uiServerActionClicked } from '../../utils/analytics/analytics';
|
|
4
|
+
import { context, invokeFailedEvent, invokeSucceededEvent, uiActionClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
|
|
6
5
|
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
|
|
7
6
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
|
|
8
7
|
import { useDispatchAnalytics } from './useDispatchAnalytics';
|
|
@@ -57,58 +56,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
57
56
|
|
|
58
57
|
/** Contains all ui analytics events */
|
|
59
58
|
const ui = useMemo(() => ({
|
|
60
|
-
/**
|
|
61
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
62
|
-
* call to action with no current authenticated account. (i.e. Connect to Preview).
|
|
63
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
64
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
65
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
66
|
-
* @returns
|
|
67
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
68
|
-
*/
|
|
69
|
-
authEvent: ({
|
|
70
|
-
display,
|
|
71
|
-
extensionKey,
|
|
72
|
-
definitionId,
|
|
73
|
-
resourceType,
|
|
74
|
-
destinationProduct,
|
|
75
|
-
destinationSubproduct,
|
|
76
|
-
location
|
|
77
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiAuthEvent({
|
|
78
|
-
display,
|
|
79
|
-
extensionKey,
|
|
80
|
-
definitionId,
|
|
81
|
-
resourceType,
|
|
82
|
-
destinationProduct,
|
|
83
|
-
destinationSubproduct,
|
|
84
|
-
location
|
|
85
|
-
}), commonAttributes)),
|
|
86
|
-
/**
|
|
87
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
88
|
-
* call to action with a forbidden authenticated account. (i.e. Try another account).
|
|
89
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
90
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
91
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
92
|
-
* @returns
|
|
93
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
94
|
-
*/
|
|
95
|
-
authAlternateAccountEvent: ({
|
|
96
|
-
display,
|
|
97
|
-
extensionKey,
|
|
98
|
-
definitionId,
|
|
99
|
-
resourceType,
|
|
100
|
-
destinationProduct,
|
|
101
|
-
destinationSubproduct,
|
|
102
|
-
location
|
|
103
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiAuthAlternateAccountEvent({
|
|
104
|
-
display,
|
|
105
|
-
extensionKey,
|
|
106
|
-
definitionId,
|
|
107
|
-
resourceType,
|
|
108
|
-
destinationProduct,
|
|
109
|
-
destinationSubproduct,
|
|
110
|
-
location
|
|
111
|
-
}), commonAttributes)),
|
|
112
59
|
/**
|
|
113
60
|
* This fires an event that represents when a user
|
|
114
61
|
* click a button.
|
|
@@ -124,42 +71,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
124
71
|
},
|
|
125
72
|
eventType: 'ui'
|
|
126
73
|
}, commonAttributes)),
|
|
127
|
-
/**
|
|
128
|
-
* This fires an event that represents when a user clicks on a Smart Link.
|
|
129
|
-
* @param id The unique ID for this Smart Link.
|
|
130
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
131
|
-
* @param status What status the Smart Link is currently in (e.g. resolved, unresolved)
|
|
132
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
133
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
134
|
-
* @param isModifierKeyPressed Whether a modifier key was pressed when clicking the Smart Link.
|
|
135
|
-
* @param location Where the Smart Link is currently rendered.
|
|
136
|
-
* @param destinationProduct The product the Smart Link is linked to.
|
|
137
|
-
* @returns
|
|
138
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
139
|
-
*/
|
|
140
|
-
cardClickedEvent: ({
|
|
141
|
-
id,
|
|
142
|
-
display,
|
|
143
|
-
status,
|
|
144
|
-
definitionId,
|
|
145
|
-
extensionKey,
|
|
146
|
-
isModifierKeyPressed,
|
|
147
|
-
location,
|
|
148
|
-
destinationProduct,
|
|
149
|
-
destinationSubproduct,
|
|
150
|
-
actionSubjectId
|
|
151
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiCardClickedEvent({
|
|
152
|
-
id,
|
|
153
|
-
display,
|
|
154
|
-
status,
|
|
155
|
-
definitionId,
|
|
156
|
-
extensionKey,
|
|
157
|
-
isModifierKeyPressed,
|
|
158
|
-
location,
|
|
159
|
-
destinationProduct,
|
|
160
|
-
destinationSubproduct,
|
|
161
|
-
actionSubjectId
|
|
162
|
-
}), commonAttributes)),
|
|
163
74
|
/**
|
|
164
75
|
* This fires an event that represents when a user clicks on a Smart Link action.
|
|
165
76
|
* Note: This also starts the UFO smart-link-action-invocation experience.
|
|
@@ -193,60 +104,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
193
104
|
location
|
|
194
105
|
}), commonAttributes));
|
|
195
106
|
},
|
|
196
|
-
/**
|
|
197
|
-
* This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
|
|
198
|
-
* https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
|
|
199
|
-
* @param previewDisplay What format the preview is in.
|
|
200
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
201
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
202
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
203
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
204
|
-
*/
|
|
205
|
-
hoverCardOpenLinkClickedEvent: ({
|
|
206
|
-
previewDisplay,
|
|
207
|
-
definitionId,
|
|
208
|
-
extensionKey,
|
|
209
|
-
destinationProduct,
|
|
210
|
-
destinationSubproduct,
|
|
211
|
-
location,
|
|
212
|
-
previewInvokeMethod
|
|
213
|
-
}) => {
|
|
214
|
-
dispatchAnalytics(applyCommonAttributes(uiHoverCardOpenLinkClickedEvent({
|
|
215
|
-
id: defaultId,
|
|
216
|
-
previewDisplay,
|
|
217
|
-
definitionId,
|
|
218
|
-
extensionKey,
|
|
219
|
-
destinationProduct,
|
|
220
|
-
destinationSubproduct,
|
|
221
|
-
location,
|
|
222
|
-
previewInvokeMethod
|
|
223
|
-
}), commonAttributes));
|
|
224
|
-
},
|
|
225
|
-
/**
|
|
226
|
-
* This fires an event that represents when a user closed the authentication window without authenticating after opening it.
|
|
227
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
228
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
229
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
230
|
-
* @returns
|
|
231
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
232
|
-
*/
|
|
233
|
-
closedAuthEvent: ({
|
|
234
|
-
display,
|
|
235
|
-
extensionKey,
|
|
236
|
-
definitionId,
|
|
237
|
-
resourceType,
|
|
238
|
-
destinationProduct,
|
|
239
|
-
destinationSubproduct,
|
|
240
|
-
location
|
|
241
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiClosedAuthEvent({
|
|
242
|
-
display,
|
|
243
|
-
extensionKey,
|
|
244
|
-
definitionId,
|
|
245
|
-
resourceType,
|
|
246
|
-
destinationProduct,
|
|
247
|
-
destinationSubproduct,
|
|
248
|
-
location
|
|
249
|
-
}), commonAttributes)),
|
|
250
107
|
/**
|
|
251
108
|
* This fires an event that represents when a user close a modal.
|
|
252
109
|
* @param data A partial analytics event payload
|
|
@@ -340,100 +197,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
340
197
|
destinationSubproduct,
|
|
341
198
|
location
|
|
342
199
|
}), commonAttributes));
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* This fires an event that represents a hover preview being opened.
|
|
346
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
347
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
348
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
349
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
350
|
-
* @returns
|
|
351
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
352
|
-
*/
|
|
353
|
-
hoverCardViewedEvent: ({
|
|
354
|
-
previewDisplay,
|
|
355
|
-
previewInvokeMethod,
|
|
356
|
-
id,
|
|
357
|
-
extensionKey,
|
|
358
|
-
definitionId,
|
|
359
|
-
resourceType,
|
|
360
|
-
destinationProduct,
|
|
361
|
-
destinationSubproduct,
|
|
362
|
-
location,
|
|
363
|
-
status
|
|
364
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiHoverCardViewedEvent({
|
|
365
|
-
id,
|
|
366
|
-
previewDisplay,
|
|
367
|
-
extensionKey,
|
|
368
|
-
definitionId,
|
|
369
|
-
resourceType,
|
|
370
|
-
destinationProduct,
|
|
371
|
-
destinationSubproduct,
|
|
372
|
-
location,
|
|
373
|
-
previewInvokeMethod,
|
|
374
|
-
status
|
|
375
|
-
}), commonAttributes)),
|
|
376
|
-
/**
|
|
377
|
-
* This fires an event that represents a hover preview being dismissed.
|
|
378
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
379
|
-
* @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
|
|
380
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
381
|
-
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
382
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
383
|
-
* @returns
|
|
384
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
385
|
-
*/
|
|
386
|
-
hoverCardDismissedEvent: ({
|
|
387
|
-
id,
|
|
388
|
-
previewDisplay,
|
|
389
|
-
hoverTime,
|
|
390
|
-
previewInvokeMethod,
|
|
391
|
-
extensionKey,
|
|
392
|
-
definitionId,
|
|
393
|
-
resourceType,
|
|
394
|
-
destinationProduct,
|
|
395
|
-
destinationSubproduct,
|
|
396
|
-
location,
|
|
397
|
-
status
|
|
398
|
-
}) => dispatchAnalytics(applyCommonAttributes(uiHoverCardDismissedEvent({
|
|
399
|
-
previewDisplay,
|
|
400
|
-
id,
|
|
401
|
-
hoverTime,
|
|
402
|
-
extensionKey,
|
|
403
|
-
definitionId,
|
|
404
|
-
resourceType,
|
|
405
|
-
destinationProduct,
|
|
406
|
-
destinationSubproduct,
|
|
407
|
-
location,
|
|
408
|
-
previewInvokeMethod,
|
|
409
|
-
status
|
|
410
|
-
}), commonAttributes)),
|
|
411
|
-
/**
|
|
412
|
-
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
413
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
414
|
-
* @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
|
|
415
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
416
|
-
*/
|
|
417
|
-
learnMoreClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes)),
|
|
418
|
-
/**
|
|
419
|
-
* Fires an event that represent a click was performed on a Status Lozenge
|
|
420
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
421
|
-
*/
|
|
422
|
-
smartLinkLozengeActionClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusLozengeButtonClicked(), commonAttributes)),
|
|
423
|
-
/**
|
|
424
|
-
* Fires an event that represent a click was performed on a Status Lozenge's dropdown item
|
|
425
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
426
|
-
*/
|
|
427
|
-
smartLinkLozengeActionListItemClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusListItemButtonClicked(), commonAttributes)),
|
|
428
|
-
/**
|
|
429
|
-
* Fires an event that represent a click was performed on a Status Lozenge open preview button
|
|
430
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
431
|
-
*/
|
|
432
|
-
smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusOpenPreviewButtonClicked(), commonAttributes)),
|
|
433
|
-
/**
|
|
434
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
435
|
-
*/
|
|
436
|
-
smartLinkServerActionClickedEvent: props => dispatchAnalytics(applyCommonAttributes(uiServerActionClicked(props), commonAttributes))
|
|
200
|
+
}
|
|
437
201
|
}), [dispatchAnalytics, commonAttributes, defaultId, extractedExtensionKey]);
|
|
438
202
|
|
|
439
203
|
/** Contains all operational analytics events */
|