@atlaskit/smart-card 23.7.3 → 23.8.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 +6 -0
- package/dist/cjs/constants.js +14 -2
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
- package/dist/cjs/utils/analytics/analytics.js +128 -96
- package/dist/cjs/utils/analytics/index.js +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +4 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
- package/dist/cjs/view/CardWithUrl/component.js +3 -1
- package/dist/cjs/view/EmbedCard/index.js +6 -2
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +6 -4
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
- package/dist/cjs/view/HoverCard/index.js +6 -3
- package/dist/cjs/view/HoverCard/utils.js +1 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/cjs/view/InlineCard/index.js +2 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
- package/dist/es2019/constants.js +12 -1
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
- package/dist/es2019/utils/analytics/analytics.js +28 -4
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +4 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/EmbedCard/index.js +6 -2
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +8 -6
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
- package/dist/es2019/view/HoverCard/index.js +6 -3
- package/dist/es2019/view/HoverCard/utils.js +0 -1
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/es2019/view/InlineCard/index.js +2 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
- package/dist/esm/constants.js +12 -1
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
- package/dist/esm/utils/analytics/analytics.js +118 -92
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/esm/view/BlockCard/index.js +4 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/EmbedCard/index.js +6 -2
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
- package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +8 -6
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
- package/dist/esm/view/HoverCard/index.js +6 -3
- package/dist/esm/view/HoverCard/utils.js +0 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/esm/view/InlineCard/index.js +2 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
- package/dist/types/constants.d.ts +8 -0
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
- package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
- package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types/utils/analytics/analytics.d.ts +4 -2
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +2 -0
- package/dist/types/utils/mocks.d.ts +4 -2
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
- package/dist/types/view/Card/types.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
- package/dist/types/view/HoverCard/types.d.ts +0 -2
- package/dist/types/view/HoverCard/utils.d.ts +0 -1
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
- package/package.json +5 -5
- package/report.api.md +15 -1
- package/tmp/api-report-tmp.d.ts +8 -4
|
@@ -33,6 +33,8 @@ var _FlexibleCard = _interopRequireDefault(require("../FlexibleCard"));
|
|
|
33
33
|
|
|
34
34
|
var _ = require("../..");
|
|
35
35
|
|
|
36
|
+
var _constants = require("../../constants");
|
|
37
|
+
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
39
|
|
|
38
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -95,7 +97,7 @@ function CardWithUrlContent(_ref) {
|
|
|
95
97
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
96
98
|
analytics.ui.cardClickedEvent({
|
|
97
99
|
id: id,
|
|
98
|
-
display: isFlexibleUi ?
|
|
100
|
+
display: isFlexibleUi ? _constants.CardDisplay.Flexible : appearance,
|
|
99
101
|
status: state.status,
|
|
100
102
|
definitionId: definitionId,
|
|
101
103
|
extensionKey: extensionKey,
|
|
@@ -59,6 +59,7 @@ var EmbedCard = /*#__PURE__*/_react.default.forwardRef(function (_ref, iframeRef
|
|
|
59
59
|
inheritDimensions = _ref.inheritDimensions;
|
|
60
60
|
var data = details && details.data || (0, _jsonld.getEmptyJsonLd)();
|
|
61
61
|
var meta = details && details.meta;
|
|
62
|
+
var extensionKey = (0, _helpers.getExtensionKey)(details);
|
|
62
63
|
|
|
63
64
|
switch (status) {
|
|
64
65
|
case 'pending':
|
|
@@ -104,7 +105,7 @@ var EmbedCard = /*#__PURE__*/_react.default.forwardRef(function (_ref, iframeRef
|
|
|
104
105
|
analytics: analytics,
|
|
105
106
|
origin: 'smartLinkEmbed',
|
|
106
107
|
handleInvoke: handleInvoke,
|
|
107
|
-
extensionKey:
|
|
108
|
+
extensionKey: extensionKey
|
|
108
109
|
});
|
|
109
110
|
return /*#__PURE__*/_react.default.createElement(_BlockCard.BlockCardResolvedView, (0, _extends2.default)({}, resolvedBlockViewProps, {
|
|
110
111
|
isSelected: isSelected,
|
|
@@ -127,7 +128,10 @@ var EmbedCard = /*#__PURE__*/_react.default.forwardRef(function (_ref, iframeRef
|
|
|
127
128
|
isSelected: isSelected,
|
|
128
129
|
onAuthorise: handleAuthorize,
|
|
129
130
|
inheritDimensions: inheritDimensions,
|
|
130
|
-
onClick: handleFrameClick
|
|
131
|
+
onClick: handleFrameClick,
|
|
132
|
+
analytics: analytics,
|
|
133
|
+
extensionKey: extensionKey,
|
|
134
|
+
testId: testId
|
|
131
135
|
}));
|
|
132
136
|
|
|
133
137
|
case 'forbidden':
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.EmbedCardUnauthorisedView = void 0;
|
|
9
11
|
|
|
10
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _UnresolvedView = require("./UnresolvedView");
|
|
13
15
|
|
|
@@ -19,22 +21,36 @@ var _ImageIcon = require("../components/ImageIcon");
|
|
|
19
21
|
|
|
20
22
|
var _UnauthorisedViewContent = _interopRequireDefault(require("../../common/UnauthorisedViewContent"));
|
|
21
23
|
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
22
28
|
var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
23
29
|
var _context$image;
|
|
24
30
|
|
|
25
|
-
var
|
|
31
|
+
var analytics = _ref.analytics,
|
|
32
|
+
link = _ref.link,
|
|
26
33
|
context = _ref.context,
|
|
27
34
|
isSelected = _ref.isSelected,
|
|
28
35
|
_ref$testId = _ref.testId,
|
|
29
36
|
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
30
37
|
onAuthorise = _ref.onAuthorise,
|
|
31
38
|
inheritDimensions = _ref.inheritDimensions,
|
|
32
|
-
onClick = _ref.onClick
|
|
39
|
+
onClick = _ref.onClick,
|
|
40
|
+
extensionKey = _ref.extensionKey;
|
|
33
41
|
|
|
34
42
|
var icon = context && context.icon && /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
|
|
35
43
|
src: typeof context.icon === 'string' ? context.icon : undefined
|
|
36
44
|
});
|
|
37
45
|
|
|
46
|
+
var handleOnAuthorizeClick = (0, _react.useCallback)(function () {
|
|
47
|
+
if (onAuthorise) {
|
|
48
|
+
analytics.track.appAccountAuthStarted({
|
|
49
|
+
extensionKey: extensionKey
|
|
50
|
+
});
|
|
51
|
+
onAuthorise();
|
|
52
|
+
}
|
|
53
|
+
}, [onAuthorise, analytics.track, extensionKey]);
|
|
38
54
|
return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
|
|
39
55
|
href: link,
|
|
40
56
|
icon: icon,
|
|
@@ -55,9 +71,10 @@ var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
|
55
71
|
text: 'connect_unauthorised_account_action',
|
|
56
72
|
testId: 'connect-account'
|
|
57
73
|
},
|
|
58
|
-
onClick:
|
|
74
|
+
onClick: handleOnAuthorizeClick,
|
|
59
75
|
testId: testId
|
|
60
76
|
}, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
77
|
+
analytics: analytics,
|
|
61
78
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
62
79
|
testId: testId
|
|
63
80
|
})));
|
|
@@ -15,6 +15,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _types = require("../../types");
|
|
17
17
|
|
|
18
|
+
var _constants = require("../../../../constants");
|
|
19
|
+
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
21
|
|
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -41,7 +43,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
41
43
|
});
|
|
42
44
|
analytics.ui.renderSuccessEvent({
|
|
43
45
|
status: 'resolved',
|
|
44
|
-
display:
|
|
46
|
+
display: _constants.CardDisplay.EmbedPreview
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
if (onOpen) {
|
|
@@ -50,7 +52,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
50
52
|
}, [analytics.screen, analytics.ui, onOpen, origin]);
|
|
51
53
|
var handleOnOpenFailed = (0, _react.useCallback)(function (error, errorInfo) {
|
|
52
54
|
analytics.ui.renderFailedEvent({
|
|
53
|
-
display:
|
|
55
|
+
display: _constants.CardDisplay.EmbedPreview,
|
|
54
56
|
error: error,
|
|
55
57
|
errorInfo: errorInfo
|
|
56
58
|
});
|
|
@@ -29,7 +29,7 @@ var _HoverCardContent = _interopRequireDefault(require("../components/HoverCardC
|
|
|
29
29
|
|
|
30
30
|
var _styled = require("../styled");
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _constants = require("../../../constants");
|
|
33
33
|
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
35
|
|
|
@@ -43,8 +43,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
43
43
|
var children = _ref.children,
|
|
44
44
|
url = _ref.url,
|
|
45
45
|
analyticsHandler = _ref.analyticsHandler,
|
|
46
|
-
analytics = _ref.analytics
|
|
47
|
-
onAuthorize = _ref.onAuthorize;
|
|
46
|
+
analytics = _ref.analytics;
|
|
48
47
|
var delay = 300;
|
|
49
48
|
|
|
50
49
|
var _React$useState = _react2.default.useState(false),
|
|
@@ -60,6 +59,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
60
59
|
var parentSpan = (0, _react2.useRef)(null);
|
|
61
60
|
var renderers = (0, _renderers.useSmartLinkRenderers)();
|
|
62
61
|
var linkState = (0, _store.useSmartCardState)(url);
|
|
62
|
+
var linkStatus = linkState.status;
|
|
63
63
|
var hoverDisplay = 'card';
|
|
64
64
|
var invokeMethod = 'mouse_hover';
|
|
65
65
|
var setMousePosition = (0, _react2.useCallback)(function (event) {
|
|
@@ -79,12 +79,13 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
79
79
|
analytics.ui.hoverCardDismissedEvent({
|
|
80
80
|
previewDisplay: 'card',
|
|
81
81
|
hoverTime: hoverTime,
|
|
82
|
-
previewInvokeMethod: 'mouse_hover'
|
|
82
|
+
previewInvokeMethod: 'mouse_hover',
|
|
83
|
+
status: linkStatus
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
setIsOpen(false);
|
|
87
|
-
}, [analytics.ui, isOpen]);
|
|
88
|
+
}, [analytics.ui, isOpen, linkStatus]);
|
|
88
89
|
var initHideCard = (0, _react2.useCallback)(function () {
|
|
89
90
|
if (fadeInTimeoutId.current) {
|
|
90
91
|
clearTimeout(fadeInTimeoutId.current);
|
|
@@ -107,7 +108,8 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
107
108
|
cardOpenTime.current = Date.now();
|
|
108
109
|
analytics.ui.hoverCardViewedEvent({
|
|
109
110
|
previewDisplay: hoverDisplay,
|
|
110
|
-
previewInvokeMethod: invokeMethod
|
|
111
|
+
previewInvokeMethod: invokeMethod,
|
|
112
|
+
status: linkStatus
|
|
111
113
|
});
|
|
112
114
|
} //If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
113
115
|
|
|
@@ -122,10 +124,10 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
122
124
|
|
|
123
125
|
setIsOpen(true);
|
|
124
126
|
}, delay);
|
|
125
|
-
}, [isOpen, setMousePosition, analytics.ui]);
|
|
127
|
+
}, [isOpen, setMousePosition, analytics.ui, linkStatus]);
|
|
126
128
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
127
129
|
url: url,
|
|
128
|
-
appearance:
|
|
130
|
+
appearance: _constants.CardDisplay.HoverCardPreview,
|
|
129
131
|
analyticsHandler: analyticsHandler,
|
|
130
132
|
origin: 'smartLinkPreviewHoverCard'
|
|
131
133
|
});
|
|
@@ -161,8 +163,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
161
163
|
onActionClick: onActionClick,
|
|
162
164
|
onResolve: update,
|
|
163
165
|
renderers: renderers,
|
|
164
|
-
url: url
|
|
165
|
-
onAuthorize: onAuthorize
|
|
166
|
+
url: url
|
|
166
167
|
}));
|
|
167
168
|
},
|
|
168
169
|
trigger: function trigger(triggerProps) {
|
|
@@ -78,8 +78,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
78
78
|
onActionClick = _ref.onActionClick,
|
|
79
79
|
onResolve = _ref.onResolve,
|
|
80
80
|
renderers = _ref.renderers,
|
|
81
|
-
url = _ref.url
|
|
82
|
-
onAuthorize = _ref.onAuthorize;
|
|
81
|
+
url = _ref.url;
|
|
83
82
|
var extensionKey = (0, _react.useMemo)(function () {
|
|
84
83
|
return (0, _helpers.getExtensionKey)(cardState.details);
|
|
85
84
|
}, [cardState.details]);
|
|
@@ -87,7 +86,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
87
86
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
88
87
|
analytics.ui.cardClickedEvent({
|
|
89
88
|
id: id,
|
|
90
|
-
display:
|
|
89
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
91
90
|
status: cardState.status,
|
|
92
91
|
isModifierKeyPressed: isModifierKeyPressed,
|
|
93
92
|
actionSubjectId: 'titleGoToLink'
|
|
@@ -130,8 +129,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
130
129
|
|
|
131
130
|
if (cardState.status === 'unauthorized') {
|
|
132
131
|
return /*#__PURE__*/_react.default.createElement(_unauthorised.default, {
|
|
132
|
+
analytics: analytics,
|
|
133
|
+
extensionKey: extensionKey,
|
|
134
|
+
id: id,
|
|
133
135
|
flexibleCardProps: flexibleCardProps,
|
|
134
|
-
|
|
136
|
+
url: url
|
|
135
137
|
});
|
|
136
138
|
} // if metadataStatus is 'errored' simply render using data available (normal path)
|
|
137
139
|
|
|
@@ -77,7 +77,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
77
77
|
// Since this hover view is only rendered on resolved status,
|
|
78
78
|
// there is no need to check for statuses.
|
|
79
79
|
analytics.ui.renderSuccessEvent({
|
|
80
|
-
display:
|
|
80
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
81
81
|
status: cardState.status
|
|
82
82
|
});
|
|
83
83
|
}, [analytics.ui, cardState.status]);
|
|
@@ -33,6 +33,8 @@ var _elements = require("../../../../FlexibleCard/components/elements");
|
|
|
33
33
|
|
|
34
34
|
var _constants = require("../../../../../constants");
|
|
35
35
|
|
|
36
|
+
var _actions = require("../../../../../state/actions");
|
|
37
|
+
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
39
|
|
|
38
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -40,24 +42,40 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
40
42
|
var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
41
43
|
var _cardState$details, _extractProvider;
|
|
42
44
|
|
|
43
|
-
var
|
|
45
|
+
var analytics = _ref.analytics,
|
|
46
|
+
extensionKey = _ref.extensionKey,
|
|
47
|
+
_ref$id = _ref.id,
|
|
48
|
+
id = _ref$id === void 0 ? '' : _ref$id,
|
|
49
|
+
flexibleCardProps = _ref.flexibleCardProps,
|
|
44
50
|
_ref$testId = _ref.testId,
|
|
45
51
|
testId = _ref$testId === void 0 ? 'hover-card-unauthorised-view' : _ref$testId,
|
|
46
|
-
|
|
52
|
+
url = _ref.url;
|
|
47
53
|
var cardState = flexibleCardProps.cardState;
|
|
48
54
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
49
55
|
var providerName = (_extractProvider = (0, _extractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
56
|
+
|
|
57
|
+
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
58
|
+
authorize = _useSmartCardActions.authorize;
|
|
59
|
+
|
|
60
|
+
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
61
|
+
if (authorize) {
|
|
62
|
+
analytics.track.appAccountAuthStarted({
|
|
63
|
+
extensionKey: extensionKey
|
|
64
|
+
});
|
|
65
|
+
authorize(_constants.CardDisplay.HoverCardPreview);
|
|
66
|
+
}
|
|
67
|
+
}, [authorize, extensionKey, analytics.track]);
|
|
50
68
|
var actions = (0, _react.useMemo)(function () {
|
|
51
|
-
return
|
|
69
|
+
return [{
|
|
52
70
|
name: _constants.ActionName.CustomAction,
|
|
53
71
|
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_action, {
|
|
54
72
|
values: {
|
|
55
73
|
context: providerName
|
|
56
74
|
}
|
|
57
75
|
})),
|
|
58
|
-
onClick:
|
|
59
|
-
}]
|
|
60
|
-
}, [
|
|
76
|
+
onClick: handleAuthorize
|
|
77
|
+
}];
|
|
78
|
+
}, [handleAuthorize, providerName]);
|
|
61
79
|
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, (0, _extends2.default)({}, flexibleCardProps, {
|
|
62
80
|
testId: testId
|
|
63
81
|
}), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
|
|
@@ -71,7 +89,8 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
71
89
|
overrideCss: _styled.mainTextStyles,
|
|
72
90
|
testId: "".concat(testId, "-content")
|
|
73
91
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
|
|
74
|
-
providerName: providerName
|
|
92
|
+
providerName: providerName,
|
|
93
|
+
analytics: analytics
|
|
75
94
|
}))), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
|
|
76
95
|
overrideCss: _styled.connectButtonStyles,
|
|
77
96
|
testId: "".concat(testId, "-button")
|
|
@@ -23,7 +23,7 @@ var _analytics2 = require("../../utils/analytics");
|
|
|
23
23
|
|
|
24
24
|
var _HoverCardComponent = require("./components/HoverCardComponent");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _constants = require("../../constants");
|
|
27
27
|
|
|
28
28
|
/** @jsx jsx */
|
|
29
29
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
@@ -37,7 +37,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
37
37
|
var analytics = (0, _analytics.useSmartLinkAnalytics)(url, analyticsHandler, id);
|
|
38
38
|
var onError = (0, _react2.useCallback)(function (error, info) {
|
|
39
39
|
analytics.ui.renderFailedEvent({
|
|
40
|
-
display:
|
|
40
|
+
display: _constants.CardDisplay.HoverCardPreview,
|
|
41
41
|
id: id,
|
|
42
42
|
error: error,
|
|
43
43
|
errorInfo: info
|
|
@@ -53,6 +53,9 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
var HoverCard = (0, _analyticsNext.withAnalyticsContext)({
|
|
56
|
-
source: 'smartLinkPreviewHoverCard'
|
|
56
|
+
source: 'smartLinkPreviewHoverCard',
|
|
57
|
+
attributes: {
|
|
58
|
+
display: _constants.CardDisplay.HoverCardPreview
|
|
59
|
+
}
|
|
57
60
|
})((0, _analyticsNext.withAnalyticsEvents)()(HoverCardWithErrorBoundary));
|
|
58
61
|
exports.HoverCard = HoverCard;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.toActionableMetadata = exports.getSimulatedMetadata =
|
|
8
|
+
exports.toActionableMetadata = exports.getSimulatedMetadata = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -15,9 +15,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
15
15
|
|
|
16
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
|
-
var SMART_CARD_ANALYTICS_DISPLAY = 'flexible';
|
|
19
|
-
exports.SMART_CARD_ANALYTICS_DISPLAY = SMART_CARD_ANALYTICS_DISPLAY;
|
|
20
|
-
|
|
21
18
|
var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
22
19
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
23
20
|
var types = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -125,7 +125,8 @@ var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component) {
|
|
|
125
125
|
if (showAuthTooltip) {
|
|
126
126
|
return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
|
|
127
127
|
url: url,
|
|
128
|
-
onAuthorize: this.props.onAuthorise
|
|
128
|
+
onAuthorize: this.props.onAuthorise,
|
|
129
|
+
id: this.props.id
|
|
129
130
|
}, inlineCardUnauthenticatedView);
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -129,7 +129,8 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
129
129
|
onClick: handleFrameClick,
|
|
130
130
|
onAuthorise: handleAuthorize,
|
|
131
131
|
testId: testIdWithStatus,
|
|
132
|
-
showAuthTooltip: showAuthTooltip
|
|
132
|
+
showAuthTooltip: showAuthTooltip,
|
|
133
|
+
id: id
|
|
133
134
|
});
|
|
134
135
|
|
|
135
136
|
case 'forbidden':
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -9,7 +11,7 @@ exports.default = void 0;
|
|
|
9
11
|
|
|
10
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
13
|
|
|
12
|
-
var _react =
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _reactIntlNext = require("react-intl-next");
|
|
15
17
|
|
|
@@ -17,6 +19,10 @@ var _messages = require("../../messages");
|
|
|
17
19
|
|
|
18
20
|
var _constants = require("../../constants");
|
|
19
21
|
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
20
26
|
/**
|
|
21
27
|
* This component is used in unauthorized views of a smart link.
|
|
22
28
|
* It represents the main text that provides a user with information on how to connect their account
|
|
@@ -24,7 +30,11 @@ var _constants = require("../../constants");
|
|
|
24
30
|
var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
25
31
|
var providerName = _ref.providerName,
|
|
26
32
|
_ref$testId = _ref.testId,
|
|
27
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
33
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId,
|
|
34
|
+
analytics = _ref.analytics;
|
|
35
|
+
var handleLearnMoreClick = (0, _react.useCallback)(function () {
|
|
36
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.ui.learnMoreClickedEvent();
|
|
37
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui]);
|
|
28
38
|
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, {
|
|
29
39
|
values: {
|
|
30
40
|
context: providerName
|
|
@@ -32,7 +42,8 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
32
42
|
})) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
33
43
|
href: _constants.CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
34
44
|
target: "_blank",
|
|
35
|
-
"data-testid": "".concat(testId, "-learn-more")
|
|
45
|
+
"data-testid": "".concat(testId, "-learn-more"),
|
|
46
|
+
onClick: handleLearnMoreClick
|
|
36
47
|
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.learn_more_about_smart_links)));
|
|
37
48
|
};
|
|
38
49
|
|
package/dist/es2019/constants.js
CHANGED
|
@@ -230,4 +230,15 @@ export let MediaPlacement;
|
|
|
230
230
|
(function (MediaPlacement) {
|
|
231
231
|
MediaPlacement["Left"] = "left";
|
|
232
232
|
MediaPlacement["Right"] = "right";
|
|
233
|
-
})(MediaPlacement || (MediaPlacement = {}));
|
|
233
|
+
})(MediaPlacement || (MediaPlacement = {}));
|
|
234
|
+
|
|
235
|
+
export let CardDisplay;
|
|
236
|
+
|
|
237
|
+
(function (CardDisplay) {
|
|
238
|
+
CardDisplay["Inline"] = "inline";
|
|
239
|
+
CardDisplay["Block"] = "block";
|
|
240
|
+
CardDisplay["Embed"] = "embed";
|
|
241
|
+
CardDisplay["EmbedPreview"] = "embedPreview";
|
|
242
|
+
CardDisplay["Flexible"] = "flexible";
|
|
243
|
+
CardDisplay["HoverCardPreview"] = "hoverCardPreview";
|
|
244
|
+
})(CardDisplay || (CardDisplay = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { extractDownloadUrl } from '../detail';
|
|
2
2
|
import { extractPreview, extractProvider } from '@atlaskit/linking-common/extractors';
|
|
3
3
|
import { PreviewAction } from '../../../view/BlockCard';
|
|
4
|
+
import { CardDisplay } from '../../../constants';
|
|
4
5
|
|
|
5
6
|
const getMetadataFromJsonLd = (jsonLd, platform) => {
|
|
6
7
|
const download = extractDownloadUrl(jsonLd);
|
|
@@ -31,7 +32,7 @@ const getInvokeOpts = (key, action, source) => ({
|
|
|
31
32
|
// the actions on the preview state are invoked from the
|
|
32
33
|
// preview card. Hence, we have a `source` for distinguishing
|
|
33
34
|
// between the two.
|
|
34
|
-
source: source ||
|
|
35
|
+
source: source || CardDisplay.EmbedPreview,
|
|
35
36
|
action: {
|
|
36
37
|
type: action,
|
|
37
38
|
promise: () => Promise.resolve()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { getUrl } from '@atlaskit/linking-common';
|
|
3
|
-
import { connectFailedEvent, connectSucceededEvent, context, instrumentEvent, invokeFailedEvent, invokeSucceededEvent, screenAuthPopupEvent, trackAppAccountConnected, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
|
|
3
|
+
import { connectFailedEvent, connectSucceededEvent, context, instrumentEvent, invokeFailedEvent, invokeSucceededEvent, screenAuthPopupEvent, trackAppAccountAuthStarted, trackAppAccountConnected, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiLearnMoreLinkClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
|
|
4
4
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
|
|
5
5
|
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getSubproduct } from '../helpers';
|
|
6
6
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
@@ -359,7 +359,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
359
359
|
resourceType,
|
|
360
360
|
destinationProduct,
|
|
361
361
|
destinationSubproduct,
|
|
362
|
-
location
|
|
362
|
+
location,
|
|
363
|
+
status
|
|
363
364
|
}) => dispatchAnalytics(applyCommonAttributes(uiHoverCardViewedEvent({
|
|
364
365
|
id,
|
|
365
366
|
previewDisplay,
|
|
@@ -369,7 +370,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
369
370
|
destinationProduct,
|
|
370
371
|
destinationSubproduct,
|
|
371
372
|
location,
|
|
372
|
-
previewInvokeMethod
|
|
373
|
+
previewInvokeMethod,
|
|
374
|
+
status
|
|
373
375
|
}), commonAttributes)),
|
|
374
376
|
|
|
375
377
|
/**
|
|
@@ -377,7 +379,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
377
379
|
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
378
380
|
* @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
|
|
379
381
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
380
|
-
* @param extensionKey The extensionKey of the Smart Link
|
|
382
|
+
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
381
383
|
* @param previewInvokeMethod How the preview was triggered.
|
|
382
384
|
* @returns
|
|
383
385
|
*/
|
|
@@ -391,7 +393,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
391
393
|
resourceType,
|
|
392
394
|
destinationProduct,
|
|
393
395
|
destinationSubproduct,
|
|
394
|
-
location
|
|
396
|
+
location,
|
|
397
|
+
status
|
|
395
398
|
}) => dispatchAnalytics(applyCommonAttributes(uiHoverCardDismissedEvent({
|
|
396
399
|
previewDisplay,
|
|
397
400
|
id,
|
|
@@ -402,8 +405,16 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
402
405
|
destinationProduct,
|
|
403
406
|
destinationSubproduct,
|
|
404
407
|
location,
|
|
405
|
-
previewInvokeMethod
|
|
406
|
-
|
|
408
|
+
previewInvokeMethod,
|
|
409
|
+
status
|
|
410
|
+
}), commonAttributes)),
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
414
|
+
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
415
|
+
* @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
|
|
416
|
+
*/
|
|
417
|
+
learnMoreClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes))
|
|
407
418
|
}), [defaultId, commonAttributes, dispatchAnalytics]);
|
|
408
419
|
/** Contains all operational analytics events */
|
|
409
420
|
|
|
@@ -581,7 +592,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
581
592
|
|
|
582
593
|
const track = useMemo(() => ({
|
|
583
594
|
/**
|
|
584
|
-
* This fires an event which represents a user
|
|
595
|
+
* This fires an event which represents a user connecting their account to view a Smart Link.
|
|
585
596
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
586
597
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
587
598
|
* @returns
|
|
@@ -600,6 +611,20 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
600
611
|
destinationProduct,
|
|
601
612
|
destinationSubproduct,
|
|
602
613
|
location
|
|
614
|
+
}), commonAttributes)),
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* This fires an event which represents a user starting the Smart Link connect account process.
|
|
618
|
+
* @param location a location where the Smart Link auth action was initiated.
|
|
619
|
+
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
620
|
+
* @returns
|
|
621
|
+
*/
|
|
622
|
+
appAccountAuthStarted: ({
|
|
623
|
+
extensionKey,
|
|
624
|
+
location
|
|
625
|
+
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountAuthStarted({ ...commonAttributes,
|
|
626
|
+
extensionKey,
|
|
627
|
+
location
|
|
603
628
|
}), commonAttributes))
|
|
604
629
|
}), [commonAttributes, dispatchAnalytics]);
|
|
605
630
|
/** Contains all screen analytics events */
|
|
@@ -203,6 +203,18 @@ export const trackAppAccountConnected = ({
|
|
|
203
203
|
location
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
+
export const trackAppAccountAuthStarted = ({
|
|
207
|
+
extensionKey,
|
|
208
|
+
location
|
|
209
|
+
}) => ({
|
|
210
|
+
action: 'authStarted',
|
|
211
|
+
actionSubject: 'applicationAccount',
|
|
212
|
+
eventType: 'track',
|
|
213
|
+
attributes: { ...context,
|
|
214
|
+
extensionKey,
|
|
215
|
+
location
|
|
216
|
+
}
|
|
217
|
+
});
|
|
206
218
|
export const uiAuthEvent = ({
|
|
207
219
|
definitionId,
|
|
208
220
|
extensionKey,
|
|
@@ -389,7 +401,8 @@ export const uiHoverCardViewedEvent = ({
|
|
|
389
401
|
destinationProduct,
|
|
390
402
|
destinationSubproduct,
|
|
391
403
|
location,
|
|
392
|
-
previewInvokeMethod
|
|
404
|
+
previewInvokeMethod,
|
|
405
|
+
status
|
|
393
406
|
}) => ({
|
|
394
407
|
action: 'viewed',
|
|
395
408
|
actionSubject: 'hoverCard',
|
|
@@ -402,7 +415,8 @@ export const uiHoverCardViewedEvent = ({
|
|
|
402
415
|
destinationProduct,
|
|
403
416
|
destinationSubproduct,
|
|
404
417
|
location,
|
|
405
|
-
previewInvokeMethod
|
|
418
|
+
previewInvokeMethod,
|
|
419
|
+
status
|
|
406
420
|
}
|
|
407
421
|
});
|
|
408
422
|
export const uiHoverCardDismissedEvent = ({
|
|
@@ -414,7 +428,8 @@ export const uiHoverCardDismissedEvent = ({
|
|
|
414
428
|
destinationProduct,
|
|
415
429
|
destinationSubproduct,
|
|
416
430
|
location,
|
|
417
|
-
previewInvokeMethod
|
|
431
|
+
previewInvokeMethod,
|
|
432
|
+
status
|
|
418
433
|
}) => ({
|
|
419
434
|
action: 'dismissed',
|
|
420
435
|
actionSubject: 'hoverCard',
|
|
@@ -428,7 +443,8 @@ export const uiHoverCardDismissedEvent = ({
|
|
|
428
443
|
destinationProduct,
|
|
429
444
|
destinationSubproduct,
|
|
430
445
|
location,
|
|
431
|
-
previewInvokeMethod
|
|
446
|
+
previewInvokeMethod,
|
|
447
|
+
status
|
|
432
448
|
}
|
|
433
449
|
});
|
|
434
450
|
export const uiHoverCardOpenLinkClickedEvent = ({
|
|
@@ -455,4 +471,12 @@ export const uiHoverCardOpenLinkClickedEvent = ({
|
|
|
455
471
|
location,
|
|
456
472
|
previewInvokeMethod
|
|
457
473
|
}
|
|
474
|
+
});
|
|
475
|
+
export const uiLearnMoreLinkClickedEvent = () => ({
|
|
476
|
+
action: 'clicked',
|
|
477
|
+
actionSubject: 'button',
|
|
478
|
+
actionSubjectId: 'learnMore',
|
|
479
|
+
eventType: 'ui',
|
|
480
|
+
attributes: { ...context
|
|
481
|
+
}
|
|
458
482
|
});
|