@atlaskit/smart-card 32.5.1 → 32.6.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/analytics.spec.yaml +163 -0
  3. package/dist/cjs/state/actions/index.js +53 -49
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +14 -128
  5. package/dist/cjs/utils/analytics/analytics.js +150 -234
  6. package/dist/cjs/utils/analytics/index.js +1 -89
  7. package/dist/cjs/view/CardWithUrl/component.js +37 -40
  8. package/dist/cjs/view/CardWithUrl/loader.js +7 -16
  9. package/dist/cjs/view/EmbedCard/index.js +19 -44
  10. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +12 -3
  11. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +11 -2
  12. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +10 -2
  13. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +64 -20
  14. package/dist/cjs/view/LinkUrl/index.js +1 -1
  15. package/dist/cjs/view/common/Metadata.js +1 -1
  16. package/dist/cjs/view/common/UnauthorisedViewContent.js +10 -2
  17. package/dist/es2019/state/actions/index.js +53 -49
  18. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +15 -136
  19. package/dist/es2019/utils/analytics/analytics.js +43 -133
  20. package/dist/es2019/utils/analytics/index.js +1 -61
  21. package/dist/es2019/view/CardWithUrl/component.js +37 -40
  22. package/dist/es2019/view/CardWithUrl/loader.js +7 -16
  23. package/dist/es2019/view/EmbedCard/index.js +20 -45
  24. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +12 -3
  25. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +11 -2
  26. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +11 -2
  27. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +63 -20
  28. package/dist/es2019/view/LinkUrl/index.js +1 -1
  29. package/dist/es2019/view/common/Metadata.js +1 -1
  30. package/dist/es2019/view/common/UnauthorisedViewContent.js +11 -2
  31. package/dist/esm/state/actions/index.js +53 -49
  32. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +15 -129
  33. package/dist/esm/utils/analytics/analytics.js +149 -233
  34. package/dist/esm/utils/analytics/index.js +1 -59
  35. package/dist/esm/view/CardWithUrl/component.js +37 -40
  36. package/dist/esm/view/CardWithUrl/loader.js +7 -16
  37. package/dist/esm/view/EmbedCard/index.js +19 -44
  38. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +12 -3
  39. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +11 -2
  40. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +10 -2
  41. package/dist/esm/view/HoverCard/components/HoverCardContent.js +65 -21
  42. package/dist/esm/view/LinkUrl/index.js +1 -1
  43. package/dist/esm/view/common/Metadata.js +1 -1
  44. package/dist/esm/view/common/UnauthorisedViewContent.js +10 -2
  45. package/dist/types/common/analytics/generated/analytics.types.d.ts +83 -1
  46. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +15 -38
  47. package/dist/types/state/hooks/useSmartLink.d.ts +0 -4
  48. package/dist/types/utils/analytics/analytics.d.ts +32 -16
  49. package/dist/types/utils/analytics/index.d.ts +1 -7
  50. package/dist/types/utils/analytics/types.d.ts +22 -22
  51. package/dist/types/utils/mocks.d.ts +0 -4
  52. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +83 -1
  53. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +15 -38
  54. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -4
  55. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +32 -16
  56. package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -7
  57. package/dist/types-ts4.5/utils/analytics/types.d.ts +22 -22
  58. package/dist/types-ts4.5/utils/mocks.d.ts +0 -4
  59. package/package.json +12 -15
@@ -88,18 +88,32 @@ export const useSmartCardActions = (id, url, analytics) => {
88
88
  const services = getServices(details);
89
89
  // When authentication is triggered, let GAS know!
90
90
  if (status === 'unauthorized') {
91
- analytics.ui.authEvent({
92
- display: appearance,
93
- definitionId,
94
- extensionKey
95
- });
91
+ if (fg('platform_migrate-some-ui-events-smart-card')) {
92
+ fireEvent('ui.button.clicked.connectAccount', {
93
+ display: appearance,
94
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
95
+ });
96
+ } else {
97
+ analytics.ui.authEvent({
98
+ display: appearance,
99
+ definitionId,
100
+ extensionKey
101
+ });
102
+ }
96
103
  }
97
104
  if (status === 'forbidden') {
98
- analytics.ui.authAlternateAccountEvent({
99
- display: appearance,
100
- definitionId,
101
- extensionKey
102
- });
105
+ if (fg('platform_migrate-some-ui-events-smart-card')) {
106
+ fireEvent('ui.smartLink.clicked.tryAnotherAccount', {
107
+ display: appearance,
108
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
109
+ });
110
+ } else {
111
+ analytics.ui.authAlternateAccountEvent({
112
+ display: appearance,
113
+ definitionId,
114
+ extensionKey
115
+ });
116
+ }
103
117
  }
104
118
  if (services.length > 0) {
105
119
  fireEvent('screen.consentModal.viewed', {
@@ -109,52 +123,42 @@ export const useSmartCardActions = (id, url, analytics) => {
109
123
  fireEvent('track.applicationAccount.connected', {
110
124
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
111
125
  });
112
- if (fg('platform_smart-card-migrate-operational-analytics')) {
113
- startUfoExperience('smart-link-authenticated', id, {
114
- extensionKey,
115
- status: 'success'
116
- });
117
- fireEvent('operational.smartLink.connectSucceeded', {
118
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
119
- });
120
- } else {
121
- analytics.operational.connectSucceededEvent({
122
- id,
123
- definitionId,
124
- extensionKey
125
- });
126
- }
126
+ startUfoExperience('smart-link-authenticated', id, {
127
+ extensionKey,
128
+ status: 'success'
129
+ });
130
+ fireEvent('operational.smartLink.connectSucceeded', {
131
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
132
+ });
127
133
  reload();
128
134
  }, err => {
129
- if (fg('platform_smart-card-migrate-operational-analytics')) {
130
- var _err$type;
131
- startUfoExperience('smart-link-authenticated', id, {
132
- extensionKey,
133
- status: err.type
134
- });
135
- fireEvent('operational.smartLink.connectFailed', {
136
- definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
137
- reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
138
- });
139
- } else {
140
- analytics.operational.connectFailedEvent({
141
- id,
142
- definitionId,
143
- extensionKey,
144
- reason: err.type
145
- });
146
- }
135
+ var _err$type;
136
+ startUfoExperience('smart-link-authenticated', id, {
137
+ extensionKey,
138
+ status: err.type
139
+ });
140
+ fireEvent('operational.smartLink.connectFailed', {
141
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
142
+ reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
143
+ });
147
144
  if (err.type === 'auth_window_closed') {
148
- analytics.ui.closedAuthEvent({
149
- display: appearance,
150
- definitionId,
151
- extensionKey
152
- });
145
+ if (fg('platform_migrate-some-ui-events-smart-card')) {
146
+ fireEvent('ui.consentModal.closed', {
147
+ display: appearance,
148
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
149
+ });
150
+ } else {
151
+ analytics.ui.closedAuthEvent({
152
+ display: appearance,
153
+ definitionId,
154
+ extensionKey
155
+ });
156
+ }
153
157
  }
154
158
  reload();
155
159
  });
156
160
  }
157
- }, [getSmartLinkState, analytics.ui, analytics.operational, id, reload, fireEvent]);
161
+ }, [getSmartLinkState, analytics.ui, id, reload, fireEvent]);
158
162
  const invoke = useCallback(async (opts, appearance) => {
159
163
  const {
160
164
  key,
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useSmartLinkContext } from '@atlaskit/link-provider';
3
3
  import { getUrl } from '@atlaskit/linking-common';
4
- import { chunkloadFailedEvent, connectFailedEvent, connectSucceededEvent, context, instrumentEvent, invokeFailedEvent, invokeSucceededEvent, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiLearnMoreLinkClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from '../../utils/analytics';
4
+ import { context, invokeFailedEvent, invokeSucceededEvent, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiLearnMoreLinkClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from '../../utils/analytics';
5
5
  import { uiServerActionClicked } from '../../utils/analytics/analytics';
6
6
  import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
7
7
  import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
@@ -64,6 +64,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
64
64
  * @param definitionId The definitionId of the Smart Link resolver invoked.
65
65
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
66
66
  * @returns
67
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
67
68
  */
68
69
  authEvent: ({
69
70
  display,
@@ -89,6 +90,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
89
90
  * @param definitionId The definitionId of the Smart Link resolver invoked.
90
91
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
91
92
  * @returns
93
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
92
94
  */
93
95
  authAlternateAccountEvent: ({
94
96
  display,
@@ -133,6 +135,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
133
135
  * @param location Where the Smart Link is currently rendered.
134
136
  * @param destinationProduct The product the Smart Link is linked to.
135
137
  * @returns
138
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
136
139
  */
137
140
  cardClickedEvent: ({
138
141
  id,
@@ -197,6 +200,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
197
200
  * @param definitionId The definitionId of the Smart Link resolver invoked.
198
201
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
199
202
  * @param previewInvokeMethod How the preview was triggered.
203
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
200
204
  */
201
205
  hoverCardOpenLinkClickedEvent: ({
202
206
  previewDisplay,
@@ -224,6 +228,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
224
228
  * @param definitionId The definitionId of the Smart Link resolver invoked.
225
229
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
226
230
  * @returns
231
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
227
232
  */
228
233
  closedAuthEvent: ({
229
234
  display,
@@ -343,6 +348,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
343
348
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
344
349
  * @param previewInvokeMethod How the preview was triggered.
345
350
  * @returns
351
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
346
352
  */
347
353
  hoverCardViewedEvent: ({
348
354
  previewDisplay,
@@ -375,6 +381,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
375
381
  * @param extensionKey The extensionKey of the Smart Link resolver invoked.
376
382
  * @param previewInvokeMethod How the preview was triggered.
377
383
  * @returns
384
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
378
385
  */
379
386
  hoverCardDismissedEvent: ({
380
387
  id,
@@ -405,20 +412,27 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
405
412
  * Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
406
413
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
407
414
  * @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
415
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
408
416
  */
409
417
  learnMoreClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes)),
410
418
  /**
411
419
  * Fires an event that represent a click was performed on a Status Lozenge
420
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
412
421
  */
413
422
  smartLinkLozengeActionClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusLozengeButtonClicked(), commonAttributes)),
414
423
  /**
415
424
  * Fires an event that represent a click was performed on a Status Lozenge's dropdown item
425
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
416
426
  */
417
427
  smartLinkLozengeActionListItemClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusListItemButtonClicked(), commonAttributes)),
418
428
  /**
419
429
  * Fires an event that represent a click was performed on a Status Lozenge open preview button
430
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
420
431
  */
421
432
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusOpenPreviewButtonClicked(), commonAttributes)),
433
+ /**
434
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
435
+ */
422
436
  smartLinkServerActionClickedEvent: props => dispatchAnalytics(applyCommonAttributes(uiServerActionClicked(props), commonAttributes))
423
437
  }), [dispatchAnalytics, commonAttributes, defaultId, extractedExtensionKey]);
424
438
 
@@ -486,141 +500,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
486
500
  destinationSubproduct,
487
501
  location
488
502
  }), commonAttributes));
489
- },
490
- /**
491
- * This fires an event that represents an account successfully being connected via a Smart Link.
492
- * @param id The unique ID for this Smart Link.
493
- * @param definitionId The definitionId of the Smart Link resolver invoked.
494
- * @param extensionKey The extensionKey of the Smart Link resovler invoked.
495
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
496
- */
497
- connectSucceededEvent: ({
498
- id,
499
- extensionKey,
500
- definitionId,
501
- resourceType,
502
- destinationProduct,
503
- destinationSubproduct,
504
- location
505
- }) => {
506
- const experienceId = id ? id : defaultId;
507
- startUfoExperience('smart-link-authenticated', experienceId, {
508
- extensionKey,
509
- status: 'success'
510
- });
511
- dispatchAnalytics(applyCommonAttributes(connectSucceededEvent({
512
- ...commonAttributes,
513
- id: experienceId,
514
- extensionKey,
515
- definitionId,
516
- resourceType,
517
- destinationProduct,
518
- destinationSubproduct,
519
- location
520
- }), commonAttributes));
521
- },
522
- /**
523
- * This fires an event that represents an account unsuccessfully being connected.
524
- * @param id The unique ID for this Smart Link.
525
- * @param definitionId The definitionId of the Smart Link resolver invoked.
526
- * @param extensionKey The extensionKey of the Smart Link resovler invoked.
527
- * @param reason The reason why the Smart Link connect account failed.
528
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
529
- */
530
- connectFailedEvent: ({
531
- id,
532
- reason,
533
- extensionKey,
534
- definitionId,
535
- resourceType,
536
- destinationProduct,
537
- destinationSubproduct,
538
- location
539
- }) => {
540
- const experienceId = id ? id : defaultId;
541
- startUfoExperience('smart-link-authenticated', experienceId, {
542
- extensionKey,
543
- status: reason
544
- });
545
- dispatchAnalytics(applyCommonAttributes(connectFailedEvent({
546
- ...commonAttributes,
547
- id: experienceId,
548
- reason,
549
- extensionKey,
550
- definitionId,
551
- resourceType,
552
- destinationProduct,
553
- destinationSubproduct,
554
- location
555
- }), commonAttributes));
556
- },
557
- /**
558
- * This fires an event which represents a Smart Link request succeeding or failing based on the status.
559
- * @param id The unique ID for this Smart Link.
560
- * @param status The status of the Smart Link.
561
- * @param definitionId The definitionId of the Smart Link resolver invoked.
562
- * @param extensionKey The extensionKey of the Smart Link resovler invoked.
563
- * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
564
- * @param error An error representing why the Smart Link request failed.
565
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
566
- */
567
- instrument: ({
568
- id,
569
- status,
570
- extensionKey,
571
- definitionId,
572
- resourceType,
573
- destinationProduct,
574
- destinationSubproduct,
575
- location,
576
- error
577
- }) => {
578
- const event = instrumentEvent({
579
- ...commonAttributes,
580
- id,
581
- status,
582
- extensionKey,
583
- definitionId,
584
- resourceType,
585
- destinationProduct,
586
- destinationSubproduct,
587
- location,
588
- error
589
- });
590
- if (event) {
591
- dispatchAnalytics(applyCommonAttributes(event, commonAttributes));
592
- }
593
- },
594
- /**
595
- * This fires an event that represents when a Smart Link renders unsuccessfully.
596
- * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
597
- * @param id The unique ID for this Smart Link.
598
- * @param error: An error representing why the Smart Link render failed.
599
- * @param errorInfo: Additional details about the error including the stack trace.
600
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
601
- */
602
- chunkloadFailedEvent: ({
603
- display,
604
- error,
605
- errorInfo,
606
- extensionKey,
607
- definitionId,
608
- resourceType,
609
- destinationProduct,
610
- destinationSubproduct,
611
- location
612
- }) => {
613
- dispatchAnalytics(applyCommonAttributes(chunkloadFailedEvent({
614
- display,
615
- error,
616
- errorInfo,
617
- extensionKey,
618
- definitionId,
619
- resourceType,
620
- destinationProduct,
621
- destinationSubproduct,
622
- location
623
- }), commonAttributes));
624
503
  }
625
504
  }), [defaultId, commonAttributes, dispatchAnalytics]);
626
505
 
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "32.5.1"
7
+ packageVersion: "32.6.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -51,66 +51,6 @@ export const fireSmartLinkEvent = (payload, createAnalyticsEvent) => {
51
51
  createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
52
52
  }
53
53
  };
54
-
55
- /**
56
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
57
- */
58
- export const resolvedEvent = props => ({
59
- action: 'resolved',
60
- actionSubject: 'smartLink',
61
- eventType: 'operational',
62
- attributes: {
63
- ...props,
64
- ...context
65
- }
66
- });
67
-
68
- /**
69
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
70
- */
71
- export const unresolvedEvent = ({
72
- id,
73
- definitionId,
74
- extensionKey,
75
- resourceType,
76
- destinationSubproduct,
77
- destinationProduct,
78
- error,
79
- status,
80
- location
81
- }) => ({
82
- action: 'unresolved',
83
- actionSubject: 'smartLink',
84
- eventType: 'operational',
85
- attributes: {
86
- id,
87
- ...context,
88
- ...(definitionId ? {
89
- definitionId
90
- } : {}),
91
- ...(extensionKey ? {
92
- extensionKey
93
- } : {}),
94
- ...(resourceType ? {
95
- resourceType
96
- } : {}),
97
- ...(destinationSubproduct ? {
98
- destinationSubproduct
99
- } : {}),
100
- ...(destinationProduct ? {
101
- destinationProduct
102
- } : {}),
103
- ...(location ? {
104
- location
105
- } : {}),
106
- reason: status,
107
- error: error ? {
108
- message: error === null || error === void 0 ? void 0 : error.message,
109
- kind: error === null || error === void 0 ? void 0 : error.kind,
110
- type: error === null || error === void 0 ? void 0 : error.type
111
- } : undefined
112
- }
113
- });
114
54
  export const invokeSucceededEvent = ({
115
55
  id,
116
56
  actionType,
@@ -173,53 +113,8 @@ export const invokeFailedEvent = ({
173
113
  };
174
114
 
175
115
  /**
176
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
116
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
177
117
  */
178
- export const connectSucceededEvent = ({
179
- definitionId,
180
- extensionKey,
181
- destinationProduct,
182
- destinationSubproduct,
183
- location
184
- }) => ({
185
- action: 'connectSucceeded',
186
- actionSubject: 'smartLink',
187
- eventType: 'operational',
188
- attributes: {
189
- ...context,
190
- definitionId,
191
- extensionKey,
192
- destinationProduct,
193
- destinationSubproduct,
194
- location
195
- }
196
- });
197
-
198
- /**
199
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
200
- */
201
- export const connectFailedEvent = ({
202
- definitionId,
203
- extensionKey,
204
- destinationProduct,
205
- destinationSubproduct,
206
- location,
207
- reason
208
- }) => ({
209
- action: 'connectFailed',
210
- actionSubject: 'smartLink',
211
- actionSubjectId: reason,
212
- eventType: 'operational',
213
- attributes: {
214
- ...context,
215
- reason,
216
- extensionKey,
217
- definitionId,
218
- destinationProduct,
219
- destinationSubproduct,
220
- location
221
- }
222
- });
223
118
  export const uiAuthEvent = ({
224
119
  definitionId,
225
120
  extensionKey,
@@ -242,6 +137,10 @@ export const uiAuthEvent = ({
242
137
  display
243
138
  }
244
139
  });
140
+
141
+ /**
142
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
143
+ */
245
144
  export const uiAuthAlternateAccountEvent = ({
246
145
  definitionId,
247
146
  extensionKey,
@@ -264,6 +163,10 @@ export const uiAuthAlternateAccountEvent = ({
264
163
  display
265
164
  }
266
165
  });
166
+
167
+ /**
168
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
169
+ */
267
170
  export const uiCardClickedEvent = ({
268
171
  id,
269
172
  display,
@@ -319,6 +222,10 @@ export const uiActionClickedEvent = ({
319
222
  location
320
223
  }
321
224
  });
225
+
226
+ /**
227
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
228
+ */
322
229
  export const uiClosedAuthEvent = ({
323
230
  display,
324
231
  extensionKey,
@@ -390,6 +297,10 @@ export const uiRenderFailedEvent = ({
390
297
  location
391
298
  }
392
299
  });
300
+
301
+ /**
302
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
303
+ */
393
304
  export const uiHoverCardViewedEvent = ({
394
305
  id,
395
306
  previewDisplay,
@@ -417,6 +328,10 @@ export const uiHoverCardViewedEvent = ({
417
328
  status
418
329
  }
419
330
  });
331
+
332
+ /**
333
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
334
+ */
420
335
  export const uiHoverCardDismissedEvent = ({
421
336
  id,
422
337
  previewDisplay,
@@ -446,6 +361,10 @@ export const uiHoverCardDismissedEvent = ({
446
361
  status
447
362
  }
448
363
  });
364
+
365
+ /**
366
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
367
+ */
449
368
  export const uiHoverCardOpenLinkClickedEvent = ({
450
369
  id,
451
370
  previewDisplay,
@@ -472,6 +391,10 @@ export const uiHoverCardOpenLinkClickedEvent = ({
472
391
  previewInvokeMethod
473
392
  }
474
393
  });
394
+
395
+ /**
396
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
397
+ */
475
398
  export const uiLearnMoreLinkClickedEvent = () => ({
476
399
  action: 'clicked',
477
400
  actionSubject: 'button',
@@ -483,33 +406,8 @@ export const uiLearnMoreLinkClickedEvent = () => ({
483
406
  });
484
407
 
485
408
  /**
486
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
409
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
487
410
  */
488
- export const chunkloadFailedEvent = ({
489
- display,
490
- error,
491
- errorInfo,
492
- extensionKey,
493
- definitionId,
494
- destinationProduct,
495
- destinationSubproduct,
496
- location
497
- }) => ({
498
- action: 'chunkLoadFailed',
499
- actionSubject: 'smartLink',
500
- eventType: 'operational',
501
- attributes: {
502
- ...context,
503
- error,
504
- errorInfo,
505
- display,
506
- extensionKey,
507
- definitionId,
508
- destinationProduct,
509
- destinationSubproduct,
510
- location
511
- }
512
- });
513
411
  export const uiSmartLinkStatusLozengeButtonClicked = () => ({
514
412
  action: 'clicked',
515
413
  actionSubject: 'button',
@@ -519,6 +417,10 @@ export const uiSmartLinkStatusLozengeButtonClicked = () => ({
519
417
  ...context
520
418
  }
521
419
  });
420
+
421
+ /**
422
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
423
+ */
522
424
  export const uiSmartLinkStatusListItemButtonClicked = () => ({
523
425
  action: 'clicked',
524
426
  actionSubject: 'button',
@@ -528,6 +430,10 @@ export const uiSmartLinkStatusListItemButtonClicked = () => ({
528
430
  ...context
529
431
  }
530
432
  });
433
+
434
+ /**
435
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
436
+ */
531
437
  export const uiSmartLinkStatusOpenPreviewButtonClicked = () => ({
532
438
  action: 'clicked',
533
439
  actionSubject: 'button',
@@ -537,6 +443,10 @@ export const uiSmartLinkStatusOpenPreviewButtonClicked = () => ({
537
443
  ...context
538
444
  }
539
445
  });
446
+
447
+ /**
448
+ * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
449
+ */
540
450
  export const uiServerActionClicked = ({
541
451
  smartLinkActionType
542
452
  }) => {
@@ -1,61 +1 @@
1
- import { getMeasure } from '../performance';
2
- import { resolvedEvent, unresolvedEvent } from './analytics';
3
- export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, chunkloadFailedEvent, connectSucceededEvent, connectFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from './analytics';
4
-
5
- /**
6
- * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
7
- */
8
- export const instrumentEvent = ({
9
- id,
10
- status,
11
- extensionKey,
12
- definitionId,
13
- resourceType,
14
- destinationProduct,
15
- destinationSubproduct,
16
- location,
17
- error
18
- }) => {
19
- const measure = getMeasure(id, status) || {
20
- duration: undefined
21
- };
22
- if (status === 'resolved') {
23
- const event = resolvedEvent({
24
- id,
25
- extensionKey,
26
- definitionId,
27
- resourceType,
28
- destinationProduct,
29
- destinationSubproduct,
30
- location
31
- });
32
- return {
33
- ...event,
34
- attributes: {
35
- ...event.attributes,
36
- duration: measure.duration
37
- }
38
- };
39
- } else {
40
- if ((error === null || error === void 0 ? void 0 : error.type) !== 'ResolveUnsupportedError') {
41
- const event = unresolvedEvent({
42
- id,
43
- status,
44
- extensionKey,
45
- definitionId,
46
- resourceType,
47
- destinationProduct,
48
- destinationSubproduct,
49
- location,
50
- error
51
- });
52
- return {
53
- ...event,
54
- attributes: {
55
- ...event.attributes,
56
- duration: measure.duration
57
- }
58
- };
59
- }
60
- }
61
- };
1
+ export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from './analytics';