@atlaskit/smart-card 32.7.7 → 32.7.9
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 +16 -0
- package/analytics.spec.yaml +31 -5
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -6
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +59 -306
- package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
- 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 -23
- package/dist/cjs/view/CardWithUrl/loader.js +14 -5
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
- 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/HoverCardComponent.js +2 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/cjs/view/HoverCard/index.js +15 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/es2019/state/actions/index.js +13 -38
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +7 -239
- package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
- 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 -24
- package/dist/es2019/view/CardWithUrl/loader.js +9 -1
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
- 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/HoverCardComponent.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/es2019/view/HoverCard/index.js +10 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +60 -307
- package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
- 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 -24
- package/dist/esm/view/CardWithUrl/loader.js +14 -5
- package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
- 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/HoverCardComponent.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/esm/view/HoverCard/index.js +14 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- 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/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- 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/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 32.7.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171388](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171388)
|
|
8
|
+
[`87d9dab6e4f6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/87d9dab6e4f6d) -
|
|
9
|
+
Add definitionId and resourceType to SmartLinkAnalyticsContext and migrate EmbedModal analytics
|
|
10
|
+
|
|
11
|
+
## 32.7.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#178101](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178101)
|
|
16
|
+
[`cdea830cdccf2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cdea830cdccf2) -
|
|
17
|
+
FF clean up platform_migrate-some-ui-events-smart-card
|
|
18
|
+
|
|
3
19
|
## 32.7.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -381,6 +381,19 @@ events:
|
|
|
381
381
|
required: false
|
|
382
382
|
type: string
|
|
383
383
|
description: The definitionId of the Smart Link resolver invoked.
|
|
384
|
+
- embedPreviewModal viewed:
|
|
385
|
+
type: screen
|
|
386
|
+
description: Fires an event that represents when a user view a modal.
|
|
387
|
+
attributes:
|
|
388
|
+
<<: [ *PackageMetaDataContext, *CommonContext ]
|
|
389
|
+
origin:
|
|
390
|
+
required: false
|
|
391
|
+
type: [ 'smartLinkCard', 'smartLinkEmbed', 'smartLinkInline', 'smartLinkPreviewHoverCard' ]
|
|
392
|
+
description: The origin of the event
|
|
393
|
+
size:
|
|
394
|
+
required: false
|
|
395
|
+
type: [ 'large', 'small' ]
|
|
396
|
+
description: The size of the modal
|
|
384
397
|
- smartLink connectSucceeded:
|
|
385
398
|
type: operational
|
|
386
399
|
description:
|
|
@@ -629,6 +642,23 @@ events:
|
|
|
629
642
|
required: false
|
|
630
643
|
type: string
|
|
631
644
|
description: The definitionId of the Smart Link resolver invoked.
|
|
645
|
+
- modal closed (embedPreview):
|
|
646
|
+
type: ui
|
|
647
|
+
description: Fires an event that represents when a user close a modal.
|
|
648
|
+
attributes:
|
|
649
|
+
<<: [ *PackageMetaDataContext, *CommonContext ]
|
|
650
|
+
origin:
|
|
651
|
+
required: false
|
|
652
|
+
type: [ 'smartLinkCard', 'smartLinkEmbed', 'smartLinkInline', 'smartLinkPreviewHoverCard' ]
|
|
653
|
+
description: The origin of the event
|
|
654
|
+
previewTime:
|
|
655
|
+
required: false
|
|
656
|
+
type: number
|
|
657
|
+
description: Duration that user spent on the preview.
|
|
658
|
+
size:
|
|
659
|
+
required: false
|
|
660
|
+
type: [ 'large', 'small' ]
|
|
661
|
+
description: The size of the modal
|
|
632
662
|
- button clicked (learnMore):
|
|
633
663
|
type: ui
|
|
634
664
|
description:
|
|
@@ -695,15 +725,11 @@ events:
|
|
|
695
725
|
required: true
|
|
696
726
|
type: [ 'inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview' ]
|
|
697
727
|
description: Whether the card was an Inline, Block, Embed or Flexible UI
|
|
698
|
-
definitionId:
|
|
699
|
-
required: false
|
|
700
|
-
type: string
|
|
701
|
-
description: The definitionId of the Smart Link resolver invoked.
|
|
702
728
|
- smartLink renderFailed:
|
|
703
729
|
type: ui
|
|
704
730
|
description: fires an event that represents when a Smart Link renders unsuccessfully.
|
|
705
731
|
attributes:
|
|
706
|
-
<<: [ *PackageMetaDataContext, *CommonContext
|
|
732
|
+
<<: [ *PackageMetaDataContext, *CommonContext]
|
|
707
733
|
display:
|
|
708
734
|
required: true
|
|
709
735
|
type: [ 'inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview' ]
|
|
@@ -34,6 +34,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
34
34
|
var src = (_extractPreviewData = (0, _linkExtractors.extractPreview)(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
|
|
35
35
|
if (src) {
|
|
36
36
|
var url = (0, _linkExtractors.extractLink)(data);
|
|
37
|
+
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
37
38
|
return {
|
|
38
39
|
actionFn: function () {
|
|
39
40
|
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -43,7 +44,10 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
43
44
|
case 0:
|
|
44
45
|
return _context.abrupt("return", (0, _utils.openEmbedModal)({
|
|
45
46
|
fireEvent: fireEvent,
|
|
47
|
+
extensionKey: extensionKey,
|
|
48
|
+
id: id,
|
|
46
49
|
invokeDownloadAction: (0, _extractInvokeDownloadAction.extractInvokeDownloadAction)(param),
|
|
50
|
+
invokeViewAction: (0, _extractInvokeViewAction.extractInvokeViewAction)(param, true),
|
|
47
51
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
|
|
48
52
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
49
53
|
linkIcon: (0, _icon.extractLinkIcon)(response),
|
|
@@ -52,8 +56,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
52
56
|
origin: origin,
|
|
53
57
|
src: src,
|
|
54
58
|
title: (0, _linkExtractors.extractTitle)(data),
|
|
55
|
-
url: url
|
|
56
|
-
invokeViewAction: (0, _extractInvokeViewAction.extractInvokeViewAction)(param, true)
|
|
59
|
+
url: url
|
|
57
60
|
}));
|
|
58
61
|
case 1:
|
|
59
62
|
case "end":
|
|
@@ -68,11 +71,9 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
68
71
|
}(),
|
|
69
72
|
actionSubjectId: 'invokePreviewScreen',
|
|
70
73
|
actionType: _index.ActionName.PreviewAction,
|
|
71
|
-
definitionId: (0, _helpers.getDefinitionId)(response),
|
|
72
74
|
display: display,
|
|
73
|
-
extensionKey:
|
|
74
|
-
id: id
|
|
75
|
-
resourceType: (0, _helpers.getResourceType)(response)
|
|
75
|
+
extensionKey: extensionKey,
|
|
76
|
+
id: id
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
79
|
};
|
|
@@ -11,7 +11,6 @@ var _react = require("react");
|
|
|
11
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
12
12
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
13
13
|
var _outboundAuthFlowClient = require("@atlaskit/outbound-auth-flow-client");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _constants = require("../../constants");
|
|
17
16
|
var _analytics = require("../analytics");
|
|
@@ -107,32 +106,16 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
|
|
|
107
106
|
var services = (0, _helpers.getServices)(details);
|
|
108
107
|
// When authentication is triggered, let GAS know!
|
|
109
108
|
if (status === 'unauthorized') {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
} else {
|
|
116
|
-
analytics.ui.authEvent({
|
|
117
|
-
display: appearance,
|
|
118
|
-
definitionId: definitionId,
|
|
119
|
-
extensionKey: extensionKey
|
|
120
|
-
});
|
|
121
|
-
}
|
|
109
|
+
fireEvent('ui.button.clicked.connectAccount', {
|
|
110
|
+
display: appearance,
|
|
111
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
112
|
+
});
|
|
122
113
|
}
|
|
123
114
|
if (status === 'forbidden') {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
} else {
|
|
130
|
-
analytics.ui.authAlternateAccountEvent({
|
|
131
|
-
display: appearance,
|
|
132
|
-
definitionId: definitionId,
|
|
133
|
-
extensionKey: extensionKey
|
|
134
|
-
});
|
|
135
|
-
}
|
|
115
|
+
fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
|
|
116
|
+
display: appearance,
|
|
117
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
118
|
+
});
|
|
136
119
|
}
|
|
137
120
|
if (services.length > 0) {
|
|
138
121
|
fireEvent('screen.consentModal.viewed', {
|
|
@@ -161,23 +144,15 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
|
|
|
161
144
|
reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
|
|
162
145
|
});
|
|
163
146
|
if (err.type === 'auth_window_closed') {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
});
|
|
169
|
-
} else {
|
|
170
|
-
analytics.ui.closedAuthEvent({
|
|
171
|
-
display: appearance,
|
|
172
|
-
definitionId: definitionId,
|
|
173
|
-
extensionKey: extensionKey
|
|
174
|
-
});
|
|
175
|
-
}
|
|
147
|
+
fireEvent('ui.consentModal.closed', {
|
|
148
|
+
display: appearance,
|
|
149
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
150
|
+
});
|
|
176
151
|
}
|
|
177
152
|
reload();
|
|
178
153
|
});
|
|
179
154
|
}
|
|
180
|
-
}, [getSmartLinkState,
|
|
155
|
+
}, [getSmartLinkState, id, reload, fireEvent]);
|
|
181
156
|
var invoke = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
182
157
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(opts, appearance) {
|
|
183
158
|
var key, action, source;
|
|
@@ -11,7 +11,6 @@ var _react = require("react");
|
|
|
11
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
12
12
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
13
13
|
var _analytics = require("../../utils/analytics");
|
|
14
|
-
var _analytics2 = require("../../utils/analytics/analytics");
|
|
15
14
|
var _helpers = require("../helpers");
|
|
16
15
|
var _ufoExperiences = require("./ufoExperiences");
|
|
17
16
|
var _useDispatchAnalytics2 = require("./useDispatchAnalytics");
|
|
@@ -72,64 +71,11 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
72
71
|
/** Contains all ui analytics events */
|
|
73
72
|
var ui = (0, _react.useMemo)(function () {
|
|
74
73
|
return {
|
|
75
|
-
/**
|
|
76
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
77
|
-
* call to action with no current authenticated account. (i.e. Connect to Preview).
|
|
78
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
79
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
80
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
81
|
-
* @returns
|
|
82
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
83
|
-
*/
|
|
84
|
-
authEvent: function authEvent(_ref) {
|
|
85
|
-
var display = _ref.display,
|
|
86
|
-
extensionKey = _ref.extensionKey,
|
|
87
|
-
definitionId = _ref.definitionId,
|
|
88
|
-
resourceType = _ref.resourceType,
|
|
89
|
-
destinationProduct = _ref.destinationProduct,
|
|
90
|
-
destinationSubproduct = _ref.destinationSubproduct,
|
|
91
|
-
location = _ref.location;
|
|
92
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiAuthEvent)({
|
|
93
|
-
display: display,
|
|
94
|
-
extensionKey: extensionKey,
|
|
95
|
-
definitionId: definitionId,
|
|
96
|
-
resourceType: resourceType,
|
|
97
|
-
destinationProduct: destinationProduct,
|
|
98
|
-
destinationSubproduct: destinationSubproduct,
|
|
99
|
-
location: location
|
|
100
|
-
}), commonAttributes));
|
|
101
|
-
},
|
|
102
|
-
/**
|
|
103
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
104
|
-
* call to action with a forbidden authenticated account. (i.e. Try another account).
|
|
105
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
106
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
107
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
108
|
-
* @returns
|
|
109
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
110
|
-
*/
|
|
111
|
-
authAlternateAccountEvent: function authAlternateAccountEvent(_ref2) {
|
|
112
|
-
var display = _ref2.display,
|
|
113
|
-
extensionKey = _ref2.extensionKey,
|
|
114
|
-
definitionId = _ref2.definitionId,
|
|
115
|
-
resourceType = _ref2.resourceType,
|
|
116
|
-
destinationProduct = _ref2.destinationProduct,
|
|
117
|
-
destinationSubproduct = _ref2.destinationSubproduct,
|
|
118
|
-
location = _ref2.location;
|
|
119
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiAuthAlternateAccountEvent)({
|
|
120
|
-
display: display,
|
|
121
|
-
extensionKey: extensionKey,
|
|
122
|
-
definitionId: definitionId,
|
|
123
|
-
resourceType: resourceType,
|
|
124
|
-
destinationProduct: destinationProduct,
|
|
125
|
-
destinationSubproduct: destinationSubproduct,
|
|
126
|
-
location: location
|
|
127
|
-
}), commonAttributes));
|
|
128
|
-
},
|
|
129
74
|
/**
|
|
130
75
|
* This fires an event that represents when a user
|
|
131
76
|
* click a button.
|
|
132
77
|
* @param data A partial analytics event payload
|
|
78
|
+
* @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
|
|
133
79
|
*/
|
|
134
80
|
buttonClickedEvent: function buttonClickedEvent(data) {
|
|
135
81
|
return dispatchAnalytics(applyCommonAttributes({
|
|
@@ -140,43 +86,6 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
140
86
|
eventType: 'ui'
|
|
141
87
|
}, commonAttributes));
|
|
142
88
|
},
|
|
143
|
-
/**
|
|
144
|
-
* This fires an event that represents when a user clicks on a Smart Link.
|
|
145
|
-
* @param id The unique ID for this Smart Link.
|
|
146
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
147
|
-
* @param status What status the Smart Link is currently in (e.g. resolved, unresolved)
|
|
148
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
149
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
150
|
-
* @param isModifierKeyPressed Whether a modifier key was pressed when clicking the Smart Link.
|
|
151
|
-
* @param location Where the Smart Link is currently rendered.
|
|
152
|
-
* @param destinationProduct The product the Smart Link is linked to.
|
|
153
|
-
* @returns
|
|
154
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
155
|
-
*/
|
|
156
|
-
cardClickedEvent: function cardClickedEvent(_ref3) {
|
|
157
|
-
var id = _ref3.id,
|
|
158
|
-
display = _ref3.display,
|
|
159
|
-
status = _ref3.status,
|
|
160
|
-
definitionId = _ref3.definitionId,
|
|
161
|
-
extensionKey = _ref3.extensionKey,
|
|
162
|
-
isModifierKeyPressed = _ref3.isModifierKeyPressed,
|
|
163
|
-
location = _ref3.location,
|
|
164
|
-
destinationProduct = _ref3.destinationProduct,
|
|
165
|
-
destinationSubproduct = _ref3.destinationSubproduct,
|
|
166
|
-
actionSubjectId = _ref3.actionSubjectId;
|
|
167
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiCardClickedEvent)({
|
|
168
|
-
id: id,
|
|
169
|
-
display: display,
|
|
170
|
-
status: status,
|
|
171
|
-
definitionId: definitionId,
|
|
172
|
-
extensionKey: extensionKey,
|
|
173
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
174
|
-
location: location,
|
|
175
|
-
destinationProduct: destinationProduct,
|
|
176
|
-
destinationSubproduct: destinationSubproduct,
|
|
177
|
-
actionSubjectId: actionSubjectId
|
|
178
|
-
}), commonAttributes));
|
|
179
|
-
},
|
|
180
89
|
/**
|
|
181
90
|
* This fires an event that represents when a user clicks on a Smart Link action.
|
|
182
91
|
* Note: This also starts the UFO smart-link-action-invocation experience.
|
|
@@ -186,16 +95,16 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
186
95
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
187
96
|
* @returns
|
|
188
97
|
*/
|
|
189
|
-
actionClickedEvent: function actionClickedEvent(
|
|
190
|
-
var id =
|
|
191
|
-
actionType =
|
|
192
|
-
display =
|
|
193
|
-
overrideExtensionKey =
|
|
194
|
-
definitionId =
|
|
195
|
-
resourceType =
|
|
196
|
-
destinationProduct =
|
|
197
|
-
destinationSubproduct =
|
|
198
|
-
location =
|
|
98
|
+
actionClickedEvent: function actionClickedEvent(_ref) {
|
|
99
|
+
var id = _ref.id,
|
|
100
|
+
actionType = _ref.actionType,
|
|
101
|
+
display = _ref.display,
|
|
102
|
+
overrideExtensionKey = _ref.extensionKey,
|
|
103
|
+
definitionId = _ref.definitionId,
|
|
104
|
+
resourceType = _ref.resourceType,
|
|
105
|
+
destinationProduct = _ref.destinationProduct,
|
|
106
|
+
destinationSubproduct = _ref.destinationSubproduct,
|
|
107
|
+
location = _ref.location;
|
|
199
108
|
var extensionKey = overrideExtensionKey !== null && overrideExtensionKey !== void 0 ? overrideExtensionKey : extractedExtensionKey;
|
|
200
109
|
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiActionClickedEvent)({
|
|
201
110
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
@@ -209,63 +118,10 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
209
118
|
location: location
|
|
210
119
|
}), commonAttributes));
|
|
211
120
|
},
|
|
212
|
-
/**
|
|
213
|
-
* This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
|
|
214
|
-
* https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
|
|
215
|
-
* @param previewDisplay What format the preview is in.
|
|
216
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
217
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
218
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
219
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
220
|
-
*/
|
|
221
|
-
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(_ref5) {
|
|
222
|
-
var previewDisplay = _ref5.previewDisplay,
|
|
223
|
-
definitionId = _ref5.definitionId,
|
|
224
|
-
extensionKey = _ref5.extensionKey,
|
|
225
|
-
destinationProduct = _ref5.destinationProduct,
|
|
226
|
-
destinationSubproduct = _ref5.destinationSubproduct,
|
|
227
|
-
location = _ref5.location,
|
|
228
|
-
previewInvokeMethod = _ref5.previewInvokeMethod;
|
|
229
|
-
dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardOpenLinkClickedEvent)({
|
|
230
|
-
id: defaultId,
|
|
231
|
-
previewDisplay: previewDisplay,
|
|
232
|
-
definitionId: definitionId,
|
|
233
|
-
extensionKey: extensionKey,
|
|
234
|
-
destinationProduct: destinationProduct,
|
|
235
|
-
destinationSubproduct: destinationSubproduct,
|
|
236
|
-
location: location,
|
|
237
|
-
previewInvokeMethod: previewInvokeMethod
|
|
238
|
-
}), commonAttributes));
|
|
239
|
-
},
|
|
240
|
-
/**
|
|
241
|
-
* This fires an event that represents when a user closed the authentication window without authenticating after opening it.
|
|
242
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
243
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
244
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
245
|
-
* @returns
|
|
246
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
247
|
-
*/
|
|
248
|
-
closedAuthEvent: function closedAuthEvent(_ref6) {
|
|
249
|
-
var display = _ref6.display,
|
|
250
|
-
extensionKey = _ref6.extensionKey,
|
|
251
|
-
definitionId = _ref6.definitionId,
|
|
252
|
-
resourceType = _ref6.resourceType,
|
|
253
|
-
destinationProduct = _ref6.destinationProduct,
|
|
254
|
-
destinationSubproduct = _ref6.destinationSubproduct,
|
|
255
|
-
location = _ref6.location;
|
|
256
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiClosedAuthEvent)({
|
|
257
|
-
display: display,
|
|
258
|
-
extensionKey: extensionKey,
|
|
259
|
-
definitionId: definitionId,
|
|
260
|
-
resourceType: resourceType,
|
|
261
|
-
destinationProduct: destinationProduct,
|
|
262
|
-
destinationSubproduct: destinationSubproduct,
|
|
263
|
-
location: location
|
|
264
|
-
}), commonAttributes));
|
|
265
|
-
},
|
|
266
121
|
/**
|
|
267
122
|
* This fires an event that represents when a user close a modal.
|
|
268
123
|
* @param data A partial analytics event payload
|
|
124
|
+
* @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
|
|
269
125
|
*/
|
|
270
126
|
modalClosedEvent: function modalClosedEvent(data) {
|
|
271
127
|
return dispatchAnalytics(applyCommonAttributes({
|
|
@@ -284,19 +140,20 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
284
140
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
285
141
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
286
142
|
* @param canBeDatasource An indicator that shows that a smart link can be converted to a datasource
|
|
143
|
+
* @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
|
|
287
144
|
*/
|
|
288
|
-
renderSuccessEvent: function renderSuccessEvent(
|
|
289
|
-
var display =
|
|
290
|
-
status =
|
|
291
|
-
id =
|
|
292
|
-
extensionKey =
|
|
293
|
-
definitionId =
|
|
294
|
-
resourceType =
|
|
295
|
-
destinationProduct =
|
|
296
|
-
destinationSubproduct =
|
|
297
|
-
location =
|
|
298
|
-
|
|
299
|
-
canBeDatasource =
|
|
145
|
+
renderSuccessEvent: function renderSuccessEvent(_ref2) {
|
|
146
|
+
var display = _ref2.display,
|
|
147
|
+
status = _ref2.status,
|
|
148
|
+
id = _ref2.id,
|
|
149
|
+
extensionKey = _ref2.extensionKey,
|
|
150
|
+
definitionId = _ref2.definitionId,
|
|
151
|
+
resourceType = _ref2.resourceType,
|
|
152
|
+
destinationProduct = _ref2.destinationProduct,
|
|
153
|
+
destinationSubproduct = _ref2.destinationSubproduct,
|
|
154
|
+
location = _ref2.location,
|
|
155
|
+
_ref2$canBeDatasource = _ref2.canBeDatasource,
|
|
156
|
+
canBeDatasource = _ref2$canBeDatasource === void 0 ? false : _ref2$canBeDatasource;
|
|
300
157
|
var experienceId = id ? id : defaultId;
|
|
301
158
|
(0, _ufoExperiences.succeedUfoExperience)('smart-link-rendered', experienceId, {
|
|
302
159
|
extensionKey: extensionKey,
|
|
@@ -325,18 +182,19 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
325
182
|
* @param id The unique ID for this Smart Link.
|
|
326
183
|
* @param error: An error representing why the Smart Link render failed.
|
|
327
184
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
185
|
+
* @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
|
|
328
186
|
*/
|
|
329
|
-
renderFailedEvent: function renderFailedEvent(
|
|
330
|
-
var display =
|
|
331
|
-
id =
|
|
332
|
-
error =
|
|
333
|
-
errorInfo =
|
|
334
|
-
extensionKey =
|
|
335
|
-
definitionId =
|
|
336
|
-
resourceType =
|
|
337
|
-
destinationProduct =
|
|
338
|
-
destinationSubproduct =
|
|
339
|
-
location =
|
|
187
|
+
renderFailedEvent: function renderFailedEvent(_ref3) {
|
|
188
|
+
var display = _ref3.display,
|
|
189
|
+
id = _ref3.id,
|
|
190
|
+
error = _ref3.error,
|
|
191
|
+
errorInfo = _ref3.errorInfo,
|
|
192
|
+
extensionKey = _ref3.extensionKey,
|
|
193
|
+
definitionId = _ref3.definitionId,
|
|
194
|
+
resourceType = _ref3.resourceType,
|
|
195
|
+
destinationProduct = _ref3.destinationProduct,
|
|
196
|
+
destinationSubproduct = _ref3.destinationSubproduct,
|
|
197
|
+
location = _ref3.location;
|
|
340
198
|
var experienceId = id ? id : defaultId;
|
|
341
199
|
// Start and fail the smart-link-rendered experience. If it has already
|
|
342
200
|
// been started nothing happens.
|
|
@@ -354,111 +212,6 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
354
212
|
destinationSubproduct: destinationSubproduct,
|
|
355
213
|
location: location
|
|
356
214
|
}), commonAttributes));
|
|
357
|
-
},
|
|
358
|
-
/**
|
|
359
|
-
* This fires an event that represents a hover preview being opened.
|
|
360
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
361
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
362
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
363
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
364
|
-
* @returns
|
|
365
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
366
|
-
*/
|
|
367
|
-
hoverCardViewedEvent: function hoverCardViewedEvent(_ref9) {
|
|
368
|
-
var previewDisplay = _ref9.previewDisplay,
|
|
369
|
-
previewInvokeMethod = _ref9.previewInvokeMethod,
|
|
370
|
-
id = _ref9.id,
|
|
371
|
-
extensionKey = _ref9.extensionKey,
|
|
372
|
-
definitionId = _ref9.definitionId,
|
|
373
|
-
resourceType = _ref9.resourceType,
|
|
374
|
-
destinationProduct = _ref9.destinationProduct,
|
|
375
|
-
destinationSubproduct = _ref9.destinationSubproduct,
|
|
376
|
-
location = _ref9.location,
|
|
377
|
-
status = _ref9.status;
|
|
378
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardViewedEvent)({
|
|
379
|
-
id: id,
|
|
380
|
-
previewDisplay: previewDisplay,
|
|
381
|
-
extensionKey: extensionKey,
|
|
382
|
-
definitionId: definitionId,
|
|
383
|
-
resourceType: resourceType,
|
|
384
|
-
destinationProduct: destinationProduct,
|
|
385
|
-
destinationSubproduct: destinationSubproduct,
|
|
386
|
-
location: location,
|
|
387
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
388
|
-
status: status
|
|
389
|
-
}), commonAttributes));
|
|
390
|
-
},
|
|
391
|
-
/**
|
|
392
|
-
* This fires an event that represents a hover preview being dismissed.
|
|
393
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
394
|
-
* @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
|
|
395
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
396
|
-
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
397
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
398
|
-
* @returns
|
|
399
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
400
|
-
*/
|
|
401
|
-
hoverCardDismissedEvent: function hoverCardDismissedEvent(_ref10) {
|
|
402
|
-
var id = _ref10.id,
|
|
403
|
-
previewDisplay = _ref10.previewDisplay,
|
|
404
|
-
hoverTime = _ref10.hoverTime,
|
|
405
|
-
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
406
|
-
extensionKey = _ref10.extensionKey,
|
|
407
|
-
definitionId = _ref10.definitionId,
|
|
408
|
-
resourceType = _ref10.resourceType,
|
|
409
|
-
destinationProduct = _ref10.destinationProduct,
|
|
410
|
-
destinationSubproduct = _ref10.destinationSubproduct,
|
|
411
|
-
location = _ref10.location,
|
|
412
|
-
status = _ref10.status;
|
|
413
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiHoverCardDismissedEvent)({
|
|
414
|
-
previewDisplay: previewDisplay,
|
|
415
|
-
id: id,
|
|
416
|
-
hoverTime: hoverTime,
|
|
417
|
-
extensionKey: extensionKey,
|
|
418
|
-
definitionId: definitionId,
|
|
419
|
-
resourceType: resourceType,
|
|
420
|
-
destinationProduct: destinationProduct,
|
|
421
|
-
destinationSubproduct: destinationSubproduct,
|
|
422
|
-
location: location,
|
|
423
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
424
|
-
status: status
|
|
425
|
-
}), commonAttributes));
|
|
426
|
-
},
|
|
427
|
-
/**
|
|
428
|
-
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
429
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
430
|
-
* @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
|
|
431
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
432
|
-
*/
|
|
433
|
-
learnMoreClickedEvent: function learnMoreClickedEvent() {
|
|
434
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiLearnMoreLinkClickedEvent)(), commonAttributes));
|
|
435
|
-
},
|
|
436
|
-
/**
|
|
437
|
-
* Fires an event that represent a click was performed on a Status Lozenge
|
|
438
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
439
|
-
*/
|
|
440
|
-
smartLinkLozengeActionClickedEvent: function smartLinkLozengeActionClickedEvent() {
|
|
441
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiSmartLinkStatusLozengeButtonClicked)(), commonAttributes));
|
|
442
|
-
},
|
|
443
|
-
/**
|
|
444
|
-
* Fires an event that represent a click was performed on a Status Lozenge's dropdown item
|
|
445
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
446
|
-
*/
|
|
447
|
-
smartLinkLozengeActionListItemClickedEvent: function smartLinkLozengeActionListItemClickedEvent() {
|
|
448
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiSmartLinkStatusListItemButtonClicked)(), commonAttributes));
|
|
449
|
-
},
|
|
450
|
-
/**
|
|
451
|
-
* Fires an event that represent a click was performed on a Status Lozenge open preview button
|
|
452
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
453
|
-
*/
|
|
454
|
-
smartLinkLozengeActionErrorOpenPreviewClickedEvent: function smartLinkLozengeActionErrorOpenPreviewClickedEvent() {
|
|
455
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics.uiSmartLinkStatusOpenPreviewButtonClicked)(), commonAttributes));
|
|
456
|
-
},
|
|
457
|
-
/**
|
|
458
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
459
|
-
*/
|
|
460
|
-
smartLinkServerActionClickedEvent: function smartLinkServerActionClickedEvent(props) {
|
|
461
|
-
return dispatchAnalytics(applyCommonAttributes((0, _analytics2.uiServerActionClicked)(props), commonAttributes));
|
|
462
215
|
}
|
|
463
216
|
};
|
|
464
217
|
}, [dispatchAnalytics, commonAttributes, defaultId, extractedExtensionKey]);
|
|
@@ -473,16 +226,16 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
473
226
|
* @param actionType The type of action invoked, e.g. PreviewAction
|
|
474
227
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
475
228
|
*/
|
|
476
|
-
invokeSucceededEvent: function invokeSucceededEvent(
|
|
477
|
-
var id =
|
|
478
|
-
actionType =
|
|
479
|
-
display =
|
|
480
|
-
extensionKey =
|
|
481
|
-
definitionId =
|
|
482
|
-
resourceType =
|
|
483
|
-
destinationProduct =
|
|
484
|
-
destinationSubproduct =
|
|
485
|
-
location =
|
|
229
|
+
invokeSucceededEvent: function invokeSucceededEvent(_ref4) {
|
|
230
|
+
var id = _ref4.id,
|
|
231
|
+
actionType = _ref4.actionType,
|
|
232
|
+
display = _ref4.display,
|
|
233
|
+
extensionKey = _ref4.extensionKey,
|
|
234
|
+
definitionId = _ref4.definitionId,
|
|
235
|
+
resourceType = _ref4.resourceType,
|
|
236
|
+
destinationProduct = _ref4.destinationProduct,
|
|
237
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
238
|
+
location = _ref4.location;
|
|
486
239
|
dispatchAnalytics(applyCommonAttributes((0, _analytics.invokeSucceededEvent)({
|
|
487
240
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
488
241
|
actionType: actionType,
|
|
@@ -503,17 +256,17 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
503
256
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
504
257
|
* @param reason The reason the invocation failed.
|
|
505
258
|
*/
|
|
506
|
-
invokeFailedEvent: function invokeFailedEvent(
|
|
507
|
-
var id =
|
|
508
|
-
actionType =
|
|
509
|
-
display =
|
|
510
|
-
reason =
|
|
511
|
-
extensionKey =
|
|
512
|
-
definitionId =
|
|
513
|
-
resourceType =
|
|
514
|
-
destinationProduct =
|
|
515
|
-
destinationSubproduct =
|
|
516
|
-
location =
|
|
259
|
+
invokeFailedEvent: function invokeFailedEvent(_ref5) {
|
|
260
|
+
var id = _ref5.id,
|
|
261
|
+
actionType = _ref5.actionType,
|
|
262
|
+
display = _ref5.display,
|
|
263
|
+
reason = _ref5.reason,
|
|
264
|
+
extensionKey = _ref5.extensionKey,
|
|
265
|
+
definitionId = _ref5.definitionId,
|
|
266
|
+
resourceType = _ref5.resourceType,
|
|
267
|
+
destinationProduct = _ref5.destinationProduct,
|
|
268
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
269
|
+
location = _ref5.location;
|
|
517
270
|
dispatchAnalytics(applyCommonAttributes((0, _analytics.invokeFailedEvent)({
|
|
518
271
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
519
272
|
actionType: actionType,
|
|
@@ -535,7 +288,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
535
288
|
return {
|
|
536
289
|
/**
|
|
537
290
|
* This fires an event that represents when a user view a modal.
|
|
538
|
-
* @
|
|
291
|
+
* @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
|
|
539
292
|
*/
|
|
540
293
|
modalViewedEvent: function modalViewedEvent(data) {
|
|
541
294
|
return dispatchAnalytics(applyCommonAttributes({
|