@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
|
@@ -4,7 +4,6 @@ import { useCallback, useMemo } from 'react';
|
|
|
4
4
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
5
5
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
|
|
6
6
|
import { auth } from '@atlaskit/outbound-auth-flow-client';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { SmartLinkStatus } from '../../constants';
|
|
10
9
|
import { startUfoExperience } from '../analytics';
|
|
@@ -100,32 +99,16 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
100
99
|
var services = getServices(details);
|
|
101
100
|
// When authentication is triggered, let GAS know!
|
|
102
101
|
if (status === 'unauthorized') {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
} else {
|
|
109
|
-
analytics.ui.authEvent({
|
|
110
|
-
display: appearance,
|
|
111
|
-
definitionId: definitionId,
|
|
112
|
-
extensionKey: extensionKey
|
|
113
|
-
});
|
|
114
|
-
}
|
|
102
|
+
fireEvent('ui.button.clicked.connectAccount', {
|
|
103
|
+
display: appearance,
|
|
104
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
105
|
+
});
|
|
115
106
|
}
|
|
116
107
|
if (status === 'forbidden') {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
} else {
|
|
123
|
-
analytics.ui.authAlternateAccountEvent({
|
|
124
|
-
display: appearance,
|
|
125
|
-
definitionId: definitionId,
|
|
126
|
-
extensionKey: extensionKey
|
|
127
|
-
});
|
|
128
|
-
}
|
|
108
|
+
fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
|
|
109
|
+
display: appearance,
|
|
110
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
111
|
+
});
|
|
129
112
|
}
|
|
130
113
|
if (services.length > 0) {
|
|
131
114
|
fireEvent('screen.consentModal.viewed', {
|
|
@@ -154,23 +137,15 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
154
137
|
reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
|
|
155
138
|
});
|
|
156
139
|
if (err.type === 'auth_window_closed') {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
162
|
-
} else {
|
|
163
|
-
analytics.ui.closedAuthEvent({
|
|
164
|
-
display: appearance,
|
|
165
|
-
definitionId: definitionId,
|
|
166
|
-
extensionKey: extensionKey
|
|
167
|
-
});
|
|
168
|
-
}
|
|
140
|
+
fireEvent('ui.consentModal.closed', {
|
|
141
|
+
display: appearance,
|
|
142
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
143
|
+
});
|
|
169
144
|
}
|
|
170
145
|
reload();
|
|
171
146
|
});
|
|
172
147
|
}
|
|
173
|
-
}, [getSmartLinkState,
|
|
148
|
+
}, [getSmartLinkState, id, reload, fireEvent]);
|
|
174
149
|
var invoke = useCallback( /*#__PURE__*/function () {
|
|
175
150
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(opts, appearance) {
|
|
176
151
|
var key, action, source;
|
|
@@ -5,8 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
7
|
import { getUrl } from '@atlaskit/linking-common';
|
|
8
|
-
import { context, invokeFailedEvent as _invokeFailedEvent, invokeSucceededEvent as _invokeSucceededEvent, uiActionClickedEvent,
|
|
9
|
-
import { uiServerActionClicked } from '../../utils/analytics/analytics';
|
|
8
|
+
import { context, invokeFailedEvent as _invokeFailedEvent, invokeSucceededEvent as _invokeSucceededEvent, uiActionClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent } from '../../utils/analytics';
|
|
10
9
|
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
|
|
11
10
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
|
|
12
11
|
import { useDispatchAnalytics } from './useDispatchAnalytics';
|
|
@@ -65,60 +64,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
65
64
|
/** Contains all ui analytics events */
|
|
66
65
|
var ui = useMemo(function () {
|
|
67
66
|
return {
|
|
68
|
-
/**
|
|
69
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
70
|
-
* call to action with no current authenticated account. (i.e. Connect to Preview).
|
|
71
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
72
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
73
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
74
|
-
* @returns
|
|
75
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
76
|
-
*/
|
|
77
|
-
authEvent: function authEvent(_ref) {
|
|
78
|
-
var display = _ref.display,
|
|
79
|
-
extensionKey = _ref.extensionKey,
|
|
80
|
-
definitionId = _ref.definitionId,
|
|
81
|
-
resourceType = _ref.resourceType,
|
|
82
|
-
destinationProduct = _ref.destinationProduct,
|
|
83
|
-
destinationSubproduct = _ref.destinationSubproduct,
|
|
84
|
-
location = _ref.location;
|
|
85
|
-
return dispatchAnalytics(applyCommonAttributes(uiAuthEvent({
|
|
86
|
-
display: display,
|
|
87
|
-
extensionKey: extensionKey,
|
|
88
|
-
definitionId: definitionId,
|
|
89
|
-
resourceType: resourceType,
|
|
90
|
-
destinationProduct: destinationProduct,
|
|
91
|
-
destinationSubproduct: destinationSubproduct,
|
|
92
|
-
location: location
|
|
93
|
-
}), commonAttributes));
|
|
94
|
-
},
|
|
95
|
-
/**
|
|
96
|
-
* This fires an event that represents when a user clicks on the authentication
|
|
97
|
-
* call to action with a forbidden authenticated account. (i.e. Try another account).
|
|
98
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
99
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
100
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
101
|
-
* @returns
|
|
102
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
103
|
-
*/
|
|
104
|
-
authAlternateAccountEvent: function authAlternateAccountEvent(_ref2) {
|
|
105
|
-
var display = _ref2.display,
|
|
106
|
-
extensionKey = _ref2.extensionKey,
|
|
107
|
-
definitionId = _ref2.definitionId,
|
|
108
|
-
resourceType = _ref2.resourceType,
|
|
109
|
-
destinationProduct = _ref2.destinationProduct,
|
|
110
|
-
destinationSubproduct = _ref2.destinationSubproduct,
|
|
111
|
-
location = _ref2.location;
|
|
112
|
-
return dispatchAnalytics(applyCommonAttributes(uiAuthAlternateAccountEvent({
|
|
113
|
-
display: display,
|
|
114
|
-
extensionKey: extensionKey,
|
|
115
|
-
definitionId: definitionId,
|
|
116
|
-
resourceType: resourceType,
|
|
117
|
-
destinationProduct: destinationProduct,
|
|
118
|
-
destinationSubproduct: destinationSubproduct,
|
|
119
|
-
location: location
|
|
120
|
-
}), commonAttributes));
|
|
121
|
-
},
|
|
122
67
|
/**
|
|
123
68
|
* This fires an event that represents when a user
|
|
124
69
|
* click a button.
|
|
@@ -133,43 +78,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
133
78
|
eventType: 'ui'
|
|
134
79
|
}, commonAttributes));
|
|
135
80
|
},
|
|
136
|
-
/**
|
|
137
|
-
* This fires an event that represents when a user clicks on a Smart Link.
|
|
138
|
-
* @param id The unique ID for this Smart Link.
|
|
139
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
140
|
-
* @param status What status the Smart Link is currently in (e.g. resolved, unresolved)
|
|
141
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
142
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
143
|
-
* @param isModifierKeyPressed Whether a modifier key was pressed when clicking the Smart Link.
|
|
144
|
-
* @param location Where the Smart Link is currently rendered.
|
|
145
|
-
* @param destinationProduct The product the Smart Link is linked to.
|
|
146
|
-
* @returns
|
|
147
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
148
|
-
*/
|
|
149
|
-
cardClickedEvent: function cardClickedEvent(_ref3) {
|
|
150
|
-
var id = _ref3.id,
|
|
151
|
-
display = _ref3.display,
|
|
152
|
-
status = _ref3.status,
|
|
153
|
-
definitionId = _ref3.definitionId,
|
|
154
|
-
extensionKey = _ref3.extensionKey,
|
|
155
|
-
isModifierKeyPressed = _ref3.isModifierKeyPressed,
|
|
156
|
-
location = _ref3.location,
|
|
157
|
-
destinationProduct = _ref3.destinationProduct,
|
|
158
|
-
destinationSubproduct = _ref3.destinationSubproduct,
|
|
159
|
-
actionSubjectId = _ref3.actionSubjectId;
|
|
160
|
-
return dispatchAnalytics(applyCommonAttributes(uiCardClickedEvent({
|
|
161
|
-
id: id,
|
|
162
|
-
display: display,
|
|
163
|
-
status: status,
|
|
164
|
-
definitionId: definitionId,
|
|
165
|
-
extensionKey: extensionKey,
|
|
166
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
167
|
-
location: location,
|
|
168
|
-
destinationProduct: destinationProduct,
|
|
169
|
-
destinationSubproduct: destinationSubproduct,
|
|
170
|
-
actionSubjectId: actionSubjectId
|
|
171
|
-
}), commonAttributes));
|
|
172
|
-
},
|
|
173
81
|
/**
|
|
174
82
|
* This fires an event that represents when a user clicks on a Smart Link action.
|
|
175
83
|
* Note: This also starts the UFO smart-link-action-invocation experience.
|
|
@@ -179,16 +87,16 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
179
87
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
180
88
|
* @returns
|
|
181
89
|
*/
|
|
182
|
-
actionClickedEvent: function actionClickedEvent(
|
|
183
|
-
var id =
|
|
184
|
-
actionType =
|
|
185
|
-
display =
|
|
186
|
-
overrideExtensionKey =
|
|
187
|
-
definitionId =
|
|
188
|
-
resourceType =
|
|
189
|
-
destinationProduct =
|
|
190
|
-
destinationSubproduct =
|
|
191
|
-
location =
|
|
90
|
+
actionClickedEvent: function actionClickedEvent(_ref) {
|
|
91
|
+
var id = _ref.id,
|
|
92
|
+
actionType = _ref.actionType,
|
|
93
|
+
display = _ref.display,
|
|
94
|
+
overrideExtensionKey = _ref.extensionKey,
|
|
95
|
+
definitionId = _ref.definitionId,
|
|
96
|
+
resourceType = _ref.resourceType,
|
|
97
|
+
destinationProduct = _ref.destinationProduct,
|
|
98
|
+
destinationSubproduct = _ref.destinationSubproduct,
|
|
99
|
+
location = _ref.location;
|
|
192
100
|
var extensionKey = overrideExtensionKey !== null && overrideExtensionKey !== void 0 ? overrideExtensionKey : extractedExtensionKey;
|
|
193
101
|
dispatchAnalytics(applyCommonAttributes(uiActionClickedEvent({
|
|
194
102
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
@@ -202,60 +110,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
202
110
|
location: location
|
|
203
111
|
}), commonAttributes));
|
|
204
112
|
},
|
|
205
|
-
/**
|
|
206
|
-
* This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
|
|
207
|
-
* https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
|
|
208
|
-
* @param previewDisplay What format the preview is in.
|
|
209
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
210
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
211
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
212
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
213
|
-
*/
|
|
214
|
-
hoverCardOpenLinkClickedEvent: function hoverCardOpenLinkClickedEvent(_ref5) {
|
|
215
|
-
var previewDisplay = _ref5.previewDisplay,
|
|
216
|
-
definitionId = _ref5.definitionId,
|
|
217
|
-
extensionKey = _ref5.extensionKey,
|
|
218
|
-
destinationProduct = _ref5.destinationProduct,
|
|
219
|
-
destinationSubproduct = _ref5.destinationSubproduct,
|
|
220
|
-
location = _ref5.location,
|
|
221
|
-
previewInvokeMethod = _ref5.previewInvokeMethod;
|
|
222
|
-
dispatchAnalytics(applyCommonAttributes(uiHoverCardOpenLinkClickedEvent({
|
|
223
|
-
id: defaultId,
|
|
224
|
-
previewDisplay: previewDisplay,
|
|
225
|
-
definitionId: definitionId,
|
|
226
|
-
extensionKey: extensionKey,
|
|
227
|
-
destinationProduct: destinationProduct,
|
|
228
|
-
destinationSubproduct: destinationSubproduct,
|
|
229
|
-
location: location,
|
|
230
|
-
previewInvokeMethod: previewInvokeMethod
|
|
231
|
-
}), commonAttributes));
|
|
232
|
-
},
|
|
233
|
-
/**
|
|
234
|
-
* This fires an event that represents when a user closed the authentication window without authenticating after opening it.
|
|
235
|
-
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
236
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
237
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
238
|
-
* @returns
|
|
239
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
240
|
-
*/
|
|
241
|
-
closedAuthEvent: function closedAuthEvent(_ref6) {
|
|
242
|
-
var display = _ref6.display,
|
|
243
|
-
extensionKey = _ref6.extensionKey,
|
|
244
|
-
definitionId = _ref6.definitionId,
|
|
245
|
-
resourceType = _ref6.resourceType,
|
|
246
|
-
destinationProduct = _ref6.destinationProduct,
|
|
247
|
-
destinationSubproduct = _ref6.destinationSubproduct,
|
|
248
|
-
location = _ref6.location;
|
|
249
|
-
return dispatchAnalytics(applyCommonAttributes(uiClosedAuthEvent({
|
|
250
|
-
display: display,
|
|
251
|
-
extensionKey: extensionKey,
|
|
252
|
-
definitionId: definitionId,
|
|
253
|
-
resourceType: resourceType,
|
|
254
|
-
destinationProduct: destinationProduct,
|
|
255
|
-
destinationSubproduct: destinationSubproduct,
|
|
256
|
-
location: location
|
|
257
|
-
}), commonAttributes));
|
|
258
|
-
},
|
|
259
113
|
/**
|
|
260
114
|
* This fires an event that represents when a user close a modal.
|
|
261
115
|
* @param data A partial analytics event payload
|
|
@@ -278,18 +132,18 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
278
132
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
279
133
|
* @param canBeDatasource An indicator that shows that a smart link can be converted to a datasource
|
|
280
134
|
*/
|
|
281
|
-
renderSuccessEvent: function renderSuccessEvent(
|
|
282
|
-
var display =
|
|
283
|
-
status =
|
|
284
|
-
id =
|
|
285
|
-
extensionKey =
|
|
286
|
-
definitionId =
|
|
287
|
-
resourceType =
|
|
288
|
-
destinationProduct =
|
|
289
|
-
destinationSubproduct =
|
|
290
|
-
location =
|
|
291
|
-
|
|
292
|
-
canBeDatasource =
|
|
135
|
+
renderSuccessEvent: function renderSuccessEvent(_ref2) {
|
|
136
|
+
var display = _ref2.display,
|
|
137
|
+
status = _ref2.status,
|
|
138
|
+
id = _ref2.id,
|
|
139
|
+
extensionKey = _ref2.extensionKey,
|
|
140
|
+
definitionId = _ref2.definitionId,
|
|
141
|
+
resourceType = _ref2.resourceType,
|
|
142
|
+
destinationProduct = _ref2.destinationProduct,
|
|
143
|
+
destinationSubproduct = _ref2.destinationSubproduct,
|
|
144
|
+
location = _ref2.location,
|
|
145
|
+
_ref2$canBeDatasource = _ref2.canBeDatasource,
|
|
146
|
+
canBeDatasource = _ref2$canBeDatasource === void 0 ? false : _ref2$canBeDatasource;
|
|
293
147
|
var experienceId = id ? id : defaultId;
|
|
294
148
|
succeedUfoExperience('smart-link-rendered', experienceId, {
|
|
295
149
|
extensionKey: extensionKey,
|
|
@@ -319,17 +173,17 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
319
173
|
* @param error: An error representing why the Smart Link render failed.
|
|
320
174
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
321
175
|
*/
|
|
322
|
-
renderFailedEvent: function renderFailedEvent(
|
|
323
|
-
var display =
|
|
324
|
-
id =
|
|
325
|
-
error =
|
|
326
|
-
errorInfo =
|
|
327
|
-
extensionKey =
|
|
328
|
-
definitionId =
|
|
329
|
-
resourceType =
|
|
330
|
-
destinationProduct =
|
|
331
|
-
destinationSubproduct =
|
|
332
|
-
location =
|
|
176
|
+
renderFailedEvent: function renderFailedEvent(_ref3) {
|
|
177
|
+
var display = _ref3.display,
|
|
178
|
+
id = _ref3.id,
|
|
179
|
+
error = _ref3.error,
|
|
180
|
+
errorInfo = _ref3.errorInfo,
|
|
181
|
+
extensionKey = _ref3.extensionKey,
|
|
182
|
+
definitionId = _ref3.definitionId,
|
|
183
|
+
resourceType = _ref3.resourceType,
|
|
184
|
+
destinationProduct = _ref3.destinationProduct,
|
|
185
|
+
destinationSubproduct = _ref3.destinationSubproduct,
|
|
186
|
+
location = _ref3.location;
|
|
333
187
|
var experienceId = id ? id : defaultId;
|
|
334
188
|
// Start and fail the smart-link-rendered experience. If it has already
|
|
335
189
|
// been started nothing happens.
|
|
@@ -347,111 +201,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
347
201
|
destinationSubproduct: destinationSubproduct,
|
|
348
202
|
location: location
|
|
349
203
|
}), commonAttributes));
|
|
350
|
-
},
|
|
351
|
-
/**
|
|
352
|
-
* This fires an event that represents a hover preview being opened.
|
|
353
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
354
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
355
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
356
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
357
|
-
* @returns
|
|
358
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
359
|
-
*/
|
|
360
|
-
hoverCardViewedEvent: function hoverCardViewedEvent(_ref9) {
|
|
361
|
-
var previewDisplay = _ref9.previewDisplay,
|
|
362
|
-
previewInvokeMethod = _ref9.previewInvokeMethod,
|
|
363
|
-
id = _ref9.id,
|
|
364
|
-
extensionKey = _ref9.extensionKey,
|
|
365
|
-
definitionId = _ref9.definitionId,
|
|
366
|
-
resourceType = _ref9.resourceType,
|
|
367
|
-
destinationProduct = _ref9.destinationProduct,
|
|
368
|
-
destinationSubproduct = _ref9.destinationSubproduct,
|
|
369
|
-
location = _ref9.location,
|
|
370
|
-
status = _ref9.status;
|
|
371
|
-
return dispatchAnalytics(applyCommonAttributes(uiHoverCardViewedEvent({
|
|
372
|
-
id: id,
|
|
373
|
-
previewDisplay: previewDisplay,
|
|
374
|
-
extensionKey: extensionKey,
|
|
375
|
-
definitionId: definitionId,
|
|
376
|
-
resourceType: resourceType,
|
|
377
|
-
destinationProduct: destinationProduct,
|
|
378
|
-
destinationSubproduct: destinationSubproduct,
|
|
379
|
-
location: location,
|
|
380
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
381
|
-
status: status
|
|
382
|
-
}), commonAttributes));
|
|
383
|
-
},
|
|
384
|
-
/**
|
|
385
|
-
* This fires an event that represents a hover preview being dismissed.
|
|
386
|
-
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
387
|
-
* @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
|
|
388
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
389
|
-
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
390
|
-
* @param previewInvokeMethod How the preview was triggered.
|
|
391
|
-
* @returns
|
|
392
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
393
|
-
*/
|
|
394
|
-
hoverCardDismissedEvent: function hoverCardDismissedEvent(_ref10) {
|
|
395
|
-
var id = _ref10.id,
|
|
396
|
-
previewDisplay = _ref10.previewDisplay,
|
|
397
|
-
hoverTime = _ref10.hoverTime,
|
|
398
|
-
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
399
|
-
extensionKey = _ref10.extensionKey,
|
|
400
|
-
definitionId = _ref10.definitionId,
|
|
401
|
-
resourceType = _ref10.resourceType,
|
|
402
|
-
destinationProduct = _ref10.destinationProduct,
|
|
403
|
-
destinationSubproduct = _ref10.destinationSubproduct,
|
|
404
|
-
location = _ref10.location,
|
|
405
|
-
status = _ref10.status;
|
|
406
|
-
return dispatchAnalytics(applyCommonAttributes(uiHoverCardDismissedEvent({
|
|
407
|
-
previewDisplay: previewDisplay,
|
|
408
|
-
id: id,
|
|
409
|
-
hoverTime: hoverTime,
|
|
410
|
-
extensionKey: extensionKey,
|
|
411
|
-
definitionId: definitionId,
|
|
412
|
-
resourceType: resourceType,
|
|
413
|
-
destinationProduct: destinationProduct,
|
|
414
|
-
destinationSubproduct: destinationSubproduct,
|
|
415
|
-
location: location,
|
|
416
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
417
|
-
status: status
|
|
418
|
-
}), commonAttributes));
|
|
419
|
-
},
|
|
420
|
-
/**
|
|
421
|
-
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
422
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
423
|
-
* @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
|
|
424
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
425
|
-
*/
|
|
426
|
-
learnMoreClickedEvent: function learnMoreClickedEvent() {
|
|
427
|
-
return dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes));
|
|
428
|
-
},
|
|
429
|
-
/**
|
|
430
|
-
* Fires an event that represent a click was performed on a Status Lozenge
|
|
431
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
432
|
-
*/
|
|
433
|
-
smartLinkLozengeActionClickedEvent: function smartLinkLozengeActionClickedEvent() {
|
|
434
|
-
return dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusLozengeButtonClicked(), commonAttributes));
|
|
435
|
-
},
|
|
436
|
-
/**
|
|
437
|
-
* Fires an event that represent a click was performed on a Status Lozenge's dropdown item
|
|
438
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
439
|
-
*/
|
|
440
|
-
smartLinkLozengeActionListItemClickedEvent: function smartLinkLozengeActionListItemClickedEvent() {
|
|
441
|
-
return dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusListItemButtonClicked(), commonAttributes));
|
|
442
|
-
},
|
|
443
|
-
/**
|
|
444
|
-
* Fires an event that represent a click was performed on a Status Lozenge open preview button
|
|
445
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
446
|
-
*/
|
|
447
|
-
smartLinkLozengeActionErrorOpenPreviewClickedEvent: function smartLinkLozengeActionErrorOpenPreviewClickedEvent() {
|
|
448
|
-
return dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusOpenPreviewButtonClicked(), commonAttributes));
|
|
449
|
-
},
|
|
450
|
-
/**
|
|
451
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
452
|
-
*/
|
|
453
|
-
smartLinkServerActionClickedEvent: function smartLinkServerActionClickedEvent(props) {
|
|
454
|
-
return dispatchAnalytics(applyCommonAttributes(uiServerActionClicked(props), commonAttributes));
|
|
455
204
|
}
|
|
456
205
|
};
|
|
457
206
|
}, [dispatchAnalytics, commonAttributes, defaultId, extractedExtensionKey]);
|
|
@@ -466,16 +215,16 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
466
215
|
* @param actionType The type of action invoked, e.g. PreviewAction
|
|
467
216
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
468
217
|
*/
|
|
469
|
-
invokeSucceededEvent: function invokeSucceededEvent(
|
|
470
|
-
var id =
|
|
471
|
-
actionType =
|
|
472
|
-
display =
|
|
473
|
-
extensionKey =
|
|
474
|
-
definitionId =
|
|
475
|
-
resourceType =
|
|
476
|
-
destinationProduct =
|
|
477
|
-
destinationSubproduct =
|
|
478
|
-
location =
|
|
218
|
+
invokeSucceededEvent: function invokeSucceededEvent(_ref4) {
|
|
219
|
+
var id = _ref4.id,
|
|
220
|
+
actionType = _ref4.actionType,
|
|
221
|
+
display = _ref4.display,
|
|
222
|
+
extensionKey = _ref4.extensionKey,
|
|
223
|
+
definitionId = _ref4.definitionId,
|
|
224
|
+
resourceType = _ref4.resourceType,
|
|
225
|
+
destinationProduct = _ref4.destinationProduct,
|
|
226
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
227
|
+
location = _ref4.location;
|
|
479
228
|
dispatchAnalytics(applyCommonAttributes(_invokeSucceededEvent({
|
|
480
229
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
481
230
|
actionType: actionType,
|
|
@@ -496,17 +245,17 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
|
|
|
496
245
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
497
246
|
* @param reason The reason the invocation failed.
|
|
498
247
|
*/
|
|
499
|
-
invokeFailedEvent: function invokeFailedEvent(
|
|
500
|
-
var id =
|
|
501
|
-
actionType =
|
|
502
|
-
display =
|
|
503
|
-
reason =
|
|
504
|
-
extensionKey =
|
|
505
|
-
definitionId =
|
|
506
|
-
resourceType =
|
|
507
|
-
destinationProduct =
|
|
508
|
-
destinationSubproduct =
|
|
509
|
-
location =
|
|
248
|
+
invokeFailedEvent: function invokeFailedEvent(_ref5) {
|
|
249
|
+
var id = _ref5.id,
|
|
250
|
+
actionType = _ref5.actionType,
|
|
251
|
+
display = _ref5.display,
|
|
252
|
+
reason = _ref5.reason,
|
|
253
|
+
extensionKey = _ref5.extensionKey,
|
|
254
|
+
definitionId = _ref5.definitionId,
|
|
255
|
+
resourceType = _ref5.resourceType,
|
|
256
|
+
destinationProduct = _ref5.destinationProduct,
|
|
257
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
258
|
+
location = _ref5.location;
|
|
510
259
|
dispatchAnalytics(applyCommonAttributes(_invokeFailedEvent({
|
|
511
260
|
id: id !== null && id !== void 0 ? id : defaultId,
|
|
512
261
|
actionType: actionType,
|