@atlaskit/smart-card 32.4.0 → 32.5.1
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 +24 -0
- package/analytics.spec.yaml +100 -0
- package/dist/cjs/state/actions/index.js +35 -11
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/cjs/utils/analytics/analytics.js +21 -1
- package/dist/cjs/utils/analytics/index.js +3 -0
- package/dist/cjs/view/CardWithUrl/component.js +32 -10
- package/dist/cjs/view/CardWithUrl/loader.js +19 -6
- package/dist/cjs/view/LinkUrl/index.js +12 -5
- package/dist/es2019/state/actions/index.js +35 -11
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/es2019/utils/analytics/analytics.js +21 -1
- package/dist/es2019/utils/analytics/index.js +4 -0
- package/dist/es2019/view/CardWithUrl/component.js +32 -10
- package/dist/es2019/view/CardWithUrl/loader.js +20 -6
- package/dist/es2019/view/LinkUrl/index.js +9 -3
- package/dist/esm/state/actions/index.js +35 -11
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/esm/utils/analytics/analytics.js +21 -1
- package/dist/esm/utils/analytics/index.js +4 -0
- package/dist/esm/view/CardWithUrl/component.js +32 -10
- package/dist/esm/view/CardWithUrl/loader.js +19 -6
- package/dist/esm/view/LinkUrl/index.js +11 -4
- package/dist/types/common/analytics/generated/analytics.types.d.ts +38 -1
- package/dist/types/state/analytics/useLinkClicked.d.ts +1 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
- package/dist/types/utils/analytics/analytics.d.ts +15 -0
- package/dist/types/utils/analytics/click.d.ts +3 -8
- package/dist/types/utils/analytics/index.d.ts +3 -0
- package/dist/types/utils/analytics/types.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-footer-block/icons/info/index.d.ts +2 -2
- package/dist/types/view/LinkUrl/index.d.ts +4 -0
- package/dist/types/view/LinkUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +38 -1
- package/dist/types-ts4.5/state/analytics/useLinkClicked.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +15 -0
- package/dist/types-ts4.5/utils/analytics/click.d.ts +3 -8
- package/dist/types-ts4.5/utils/analytics/index.d.ts +3 -0
- package/dist/types-ts4.5/utils/analytics/types.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-footer-block/icons/info/index.d.ts +2 -2
- package/dist/types-ts4.5/view/LinkUrl/index.d.ts +4 -0
- package/dist/types-ts4.5/view/LinkUrl/types.d.ts +1 -0
- package/package.json +13 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 32.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171430](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171430)
|
|
8
|
+
[`d100d121a8a38`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d100d121a8a38) -
|
|
9
|
+
[ux] Update editor's links to use design system's standards
|
|
10
|
+
|
|
11
|
+
## 32.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#168911](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168911)
|
|
16
|
+
[`bc902797bc22b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc902797bc22b) -
|
|
17
|
+
Migrate operational analytics event
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#171994](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171994)
|
|
22
|
+
[`be58e4bb2e387`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/be58e4bb2e387) -
|
|
23
|
+
Migrating usages of UNSAFE types and entrypoints that have been renamed in `@atlaskit/icon` and
|
|
24
|
+
`@atlaskit/icon-lab`.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 32.4.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -344,3 +344,103 @@ events:
|
|
|
344
344
|
required: false
|
|
345
345
|
type: string
|
|
346
346
|
description: The definitionId of the Smart Link resolver invoked.
|
|
347
|
+
- smartLink connectSucceeded:
|
|
348
|
+
type: operational
|
|
349
|
+
description:
|
|
350
|
+
fires an event that represents an account successfully being connected via a Smart Link.
|
|
351
|
+
attributes:
|
|
352
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
353
|
+
definitionId:
|
|
354
|
+
required: false
|
|
355
|
+
type: string
|
|
356
|
+
description: The definitionId of the Smart Link resolver invoked.
|
|
357
|
+
- smartLink connectFailed:
|
|
358
|
+
type: operational
|
|
359
|
+
description: fires an event that represents an account unsuccessfully being connected.
|
|
360
|
+
attributes:
|
|
361
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
362
|
+
reason:
|
|
363
|
+
required: false
|
|
364
|
+
description: The reason why the Smart Link connect account failed.
|
|
365
|
+
type: string
|
|
366
|
+
definitionId:
|
|
367
|
+
required: false
|
|
368
|
+
type: string
|
|
369
|
+
description: The definitionId of the Smart Link resolver invoked.
|
|
370
|
+
- smartLink resolved:
|
|
371
|
+
type: operational
|
|
372
|
+
description: fires an event which represents a Smart Link request succeeding.
|
|
373
|
+
attributes:
|
|
374
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
375
|
+
status:
|
|
376
|
+
type:
|
|
377
|
+
[
|
|
378
|
+
'pending',
|
|
379
|
+
'resolving',
|
|
380
|
+
'resolved',
|
|
381
|
+
'errored',
|
|
382
|
+
'fallback',
|
|
383
|
+
'unauthorized',
|
|
384
|
+
'forbidden',
|
|
385
|
+
'not_found',
|
|
386
|
+
]
|
|
387
|
+
description: The status of the link resolution at the time of the event.
|
|
388
|
+
required: false
|
|
389
|
+
definitionId:
|
|
390
|
+
required: false
|
|
391
|
+
type: string
|
|
392
|
+
description: The definitionId of the Smart Link resolver invoked.
|
|
393
|
+
duration:
|
|
394
|
+
required: false
|
|
395
|
+
type: number
|
|
396
|
+
- smartLink unresolved:
|
|
397
|
+
type: operational
|
|
398
|
+
description: fires an event which represents a Smart Link request failing.
|
|
399
|
+
attributes:
|
|
400
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
401
|
+
status:
|
|
402
|
+
type:
|
|
403
|
+
[
|
|
404
|
+
'pending',
|
|
405
|
+
'resolving',
|
|
406
|
+
'resolved',
|
|
407
|
+
'errored',
|
|
408
|
+
'fallback',
|
|
409
|
+
'unauthorized',
|
|
410
|
+
'forbidden',
|
|
411
|
+
'not_found',
|
|
412
|
+
]
|
|
413
|
+
description: The status of the link resolution at the time of the event.
|
|
414
|
+
required: false
|
|
415
|
+
definitionId:
|
|
416
|
+
required: false
|
|
417
|
+
type: string
|
|
418
|
+
description: The definitionId of the Smart Link resolver invoked.
|
|
419
|
+
error:
|
|
420
|
+
required: false
|
|
421
|
+
description: The reason why the Smart Link connect account failed.
|
|
422
|
+
type: object
|
|
423
|
+
reason:
|
|
424
|
+
required: true
|
|
425
|
+
type: string
|
|
426
|
+
- smartLink chunkLoadFailed:
|
|
427
|
+
type: operational
|
|
428
|
+
description: fires an event that represents when a Smart Link renders unsuccessfully.
|
|
429
|
+
attributes:
|
|
430
|
+
<<: [*PackageMetaDataContext, *CommonContext]
|
|
431
|
+
display:
|
|
432
|
+
required: true
|
|
433
|
+
type: ['inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview']
|
|
434
|
+
description: Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
435
|
+
definitionId:
|
|
436
|
+
required: false
|
|
437
|
+
type: string
|
|
438
|
+
description: The definitionId of the Smart Link resolver invoked.
|
|
439
|
+
error:
|
|
440
|
+
required: true
|
|
441
|
+
description: An error representing why the Smart Link render failed.
|
|
442
|
+
type: object
|
|
443
|
+
errorInfo:
|
|
444
|
+
required: true
|
|
445
|
+
description: Additional details about the error including the stack trace.
|
|
446
|
+
type: object
|
|
@@ -11,8 +11,10 @@ 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");
|
|
14
15
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
15
16
|
var _constants = require("../../constants");
|
|
17
|
+
var _analytics = require("../analytics");
|
|
16
18
|
var _helpers = require("../helpers");
|
|
17
19
|
var _useInvokeClientAction = _interopRequireDefault(require("../hooks/use-invoke-client-action"));
|
|
18
20
|
var _useResolve = _interopRequireDefault(require("../hooks/use-resolve"));
|
|
@@ -126,19 +128,41 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
|
|
|
126
128
|
fireEvent('track.applicationAccount.connected', {
|
|
127
129
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
128
130
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart-card-migrate-operational-analytics')) {
|
|
132
|
+
(0, _analytics.startUfoExperience)('smart-link-authenticated', id, {
|
|
133
|
+
extensionKey: extensionKey,
|
|
134
|
+
status: 'success'
|
|
135
|
+
});
|
|
136
|
+
fireEvent('operational.smartLink.connectSucceeded', {
|
|
137
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
analytics.operational.connectSucceededEvent({
|
|
141
|
+
id: id,
|
|
142
|
+
definitionId: definitionId,
|
|
143
|
+
extensionKey: extensionKey
|
|
144
|
+
});
|
|
145
|
+
}
|
|
134
146
|
reload();
|
|
135
147
|
}, function (err) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart-card-migrate-operational-analytics')) {
|
|
149
|
+
var _err$type;
|
|
150
|
+
(0, _analytics.startUfoExperience)('smart-link-authenticated', id, {
|
|
151
|
+
extensionKey: extensionKey,
|
|
152
|
+
status: err.type
|
|
153
|
+
});
|
|
154
|
+
fireEvent('operational.smartLink.connectFailed', {
|
|
155
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
156
|
+
reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
|
|
157
|
+
});
|
|
158
|
+
} else {
|
|
159
|
+
analytics.operational.connectFailedEvent({
|
|
160
|
+
id: id,
|
|
161
|
+
definitionId: definitionId,
|
|
162
|
+
extensionKey: extensionKey,
|
|
163
|
+
reason: err.type
|
|
164
|
+
});
|
|
165
|
+
}
|
|
142
166
|
if (err.type === 'auth_window_closed') {
|
|
143
167
|
analytics.ui.closedAuthEvent({
|
|
144
168
|
display: appearance,
|
|
@@ -518,6 +518,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
518
518
|
* @param id The unique ID for this Smart Link.
|
|
519
519
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
520
520
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
521
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
521
522
|
*/
|
|
522
523
|
connectSucceededEvent: function connectSucceededEvent(_ref13) {
|
|
523
524
|
var id = _ref13.id,
|
|
@@ -548,6 +549,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
548
549
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
549
550
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
550
551
|
* @param reason The reason why the Smart Link connect account failed.
|
|
552
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
551
553
|
*/
|
|
552
554
|
connectFailedEvent: function connectFailedEvent(_ref14) {
|
|
553
555
|
var id = _ref14.id,
|
|
@@ -582,6 +584,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
582
584
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
583
585
|
* @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
|
|
584
586
|
* @param error An error representing why the Smart Link request failed.
|
|
587
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
585
588
|
*/
|
|
586
589
|
instrument: function instrument(_ref15) {
|
|
587
590
|
var id = _ref15.id,
|
|
@@ -609,11 +612,12 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
|
|
|
609
612
|
}
|
|
610
613
|
},
|
|
611
614
|
/**
|
|
612
|
-
* This fires an event that represents when a Smart Link renders
|
|
615
|
+
* This fires an event that represents when a Smart Link renders unsuccessfully.
|
|
613
616
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
614
617
|
* @param id The unique ID for this Smart Link.
|
|
615
618
|
* @param error: An error representing why the Smart Link render failed.
|
|
616
619
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
620
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
617
621
|
*/
|
|
618
622
|
chunkloadFailedEvent: function chunkloadFailedEvent(_ref16) {
|
|
619
623
|
var display = _ref16.display,
|
|
@@ -17,7 +17,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
17
17
|
var context = exports.context = {
|
|
18
18
|
componentName: 'smart-cards',
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "32.
|
|
20
|
+
packageVersion: "32.5.1"
|
|
21
21
|
};
|
|
22
22
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
23
23
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -64,6 +64,10 @@ var fireSmartLinkEvent = exports.fireSmartLinkEvent = function fireSmartLinkEven
|
|
|
64
64
|
createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
70
|
+
*/
|
|
67
71
|
var resolvedEvent = exports.resolvedEvent = function resolvedEvent(props) {
|
|
68
72
|
return {
|
|
69
73
|
action: 'resolved',
|
|
@@ -72,6 +76,10 @@ var resolvedEvent = exports.resolvedEvent = function resolvedEvent(props) {
|
|
|
72
76
|
attributes: _objectSpread(_objectSpread({}, props), context)
|
|
73
77
|
};
|
|
74
78
|
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
82
|
+
*/
|
|
75
83
|
var unresolvedEvent = exports.unresolvedEvent = function unresolvedEvent(_ref) {
|
|
76
84
|
var id = _ref.id,
|
|
77
85
|
definitionId = _ref.definitionId,
|
|
@@ -166,6 +174,10 @@ var invokeFailedEvent = exports.invokeFailedEvent = function invokeFailedEvent(_
|
|
|
166
174
|
})
|
|
167
175
|
};
|
|
168
176
|
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
180
|
+
*/
|
|
169
181
|
var connectSucceededEvent = exports.connectSucceededEvent = function connectSucceededEvent(_ref4) {
|
|
170
182
|
var definitionId = _ref4.definitionId,
|
|
171
183
|
extensionKey = _ref4.extensionKey,
|
|
@@ -185,6 +197,10 @@ var connectSucceededEvent = exports.connectSucceededEvent = function connectSucc
|
|
|
185
197
|
})
|
|
186
198
|
};
|
|
187
199
|
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
203
|
+
*/
|
|
188
204
|
var connectFailedEvent = exports.connectFailedEvent = function connectFailedEvent(_ref5) {
|
|
189
205
|
var definitionId = _ref5.definitionId,
|
|
190
206
|
extensionKey = _ref5.extensionKey,
|
|
@@ -468,6 +484,10 @@ var uiLearnMoreLinkClickedEvent = exports.uiLearnMoreLinkClickedEvent = function
|
|
|
468
484
|
attributes: _objectSpread({}, context)
|
|
469
485
|
};
|
|
470
486
|
};
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
490
|
+
*/
|
|
471
491
|
var chunkloadFailedEvent = exports.chunkloadFailedEvent = function chunkloadFailedEvent(_ref16) {
|
|
472
492
|
var display = _ref16.display,
|
|
473
493
|
error = _ref16.error,
|
|
@@ -154,6 +154,9 @@ var _performance = require("../performance");
|
|
|
154
154
|
var _analytics = require("./analytics");
|
|
155
155
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
156
156
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
157
|
+
/**
|
|
158
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
159
|
+
*/
|
|
157
160
|
var instrumentEvent = exports.instrumentEvent = function instrumentEvent(_ref) {
|
|
158
161
|
var id = _ref.id,
|
|
159
162
|
status = _ref.status,
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.CardWithUrlContent = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
12
13
|
var _constants = require("../../constants");
|
|
13
14
|
var _state = require("../../state");
|
|
@@ -128,18 +129,39 @@ function Component(_ref) {
|
|
|
128
129
|
(0, _react.useEffect)(function () {
|
|
129
130
|
measure.mark(id, state.status);
|
|
130
131
|
if (state.status !== 'pending' && state.status !== 'resolving') {
|
|
131
|
-
var _state$error;
|
|
132
132
|
measure.create(id, state.status);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart-card-migrate-operational-analytics')) {
|
|
134
|
+
var _state$error;
|
|
135
|
+
if (state.status === 'resolved') {
|
|
136
|
+
var _measure$getMeasure$d, _measure$getMeasure;
|
|
137
|
+
fireEvent('operational.smartLink.resolved', {
|
|
138
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
139
|
+
duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(id, state.status)) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null
|
|
140
|
+
});
|
|
141
|
+
} else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError') {
|
|
142
|
+
fireEvent('operational.smartLink.unresolved', {
|
|
143
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
144
|
+
reason: state.status,
|
|
145
|
+
error: state.error === undefined ? null : {
|
|
146
|
+
name: state.error.name,
|
|
147
|
+
kind: state.error.kind,
|
|
148
|
+
type: state.error.type
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
var _state$error2;
|
|
154
|
+
analytics.operational.instrument({
|
|
155
|
+
id: id,
|
|
156
|
+
status: state.status,
|
|
157
|
+
definitionId: definitionId,
|
|
158
|
+
extensionKey: extensionKey !== null && extensionKey !== void 0 ? extensionKey : (_state$error2 = state.error) === null || _state$error2 === void 0 ? void 0 : _state$error2.extensionKey,
|
|
159
|
+
resourceType: resourceType,
|
|
160
|
+
error: state.error
|
|
161
|
+
});
|
|
162
|
+
}
|
|
141
163
|
}
|
|
142
|
-
}, [id, appearance, state.status, state.error, definitionId, extensionKey, resourceType, analytics.operational]);
|
|
164
|
+
}, [id, appearance, state.status, state.error, definitionId, extensionKey, resourceType, analytics.operational, fireEvent]);
|
|
143
165
|
|
|
144
166
|
// NB: once the smart-card has rendered into an end state, we capture
|
|
145
167
|
// this as a successful render. These can be one of:
|
|
@@ -12,6 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _reactErrorBoundary = require("react-error-boundary");
|
|
13
13
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
14
14
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
15
17
|
var _analytics = require("../../state/analytics");
|
|
16
18
|
var _utils = require("../../utils");
|
|
17
19
|
var _flexible = require("../../utils/flexible");
|
|
@@ -32,6 +34,8 @@ function CardWithURLRenderer(props) {
|
|
|
32
34
|
}),
|
|
33
35
|
_useState2 = (0, _slicedToArray2.default)(_useState, 1),
|
|
34
36
|
id = _useState2[0];
|
|
37
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
38
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
35
39
|
(0, _react.useEffect)(function () {
|
|
36
40
|
// ComponentWillUnmount
|
|
37
41
|
return function () {
|
|
@@ -78,11 +82,20 @@ function CardWithURLRenderer(props) {
|
|
|
78
82
|
// to the reliability of the smart-card front-end components.
|
|
79
83
|
// Likewise, chunk loading errors are not caused by a failure of smart-card rendering.
|
|
80
84
|
if (error.name === 'ChunkLoadError') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart-card-migrate-operational-analytics')) {
|
|
86
|
+
fireEvent('operational.smartLink.chunkLoadFailed', {
|
|
87
|
+
display: appearance,
|
|
88
|
+
error: error,
|
|
89
|
+
errorInfo: errorInfo,
|
|
90
|
+
definitionId: null
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
analytics.operational.chunkloadFailedEvent({
|
|
94
|
+
display: appearance,
|
|
95
|
+
error: error,
|
|
96
|
+
errorInfo: errorInfo
|
|
97
|
+
});
|
|
98
|
+
}
|
|
86
99
|
} else if (error.name !== 'APIError') {
|
|
87
100
|
analytics.ui.renderFailedEvent({
|
|
88
101
|
display: isFlexibleUi ? 'flexible' : appearance,
|
|
@@ -96,7 +109,7 @@ function CardWithURLRenderer(props) {
|
|
|
96
109
|
url: url !== null && url !== void 0 ? url : '',
|
|
97
110
|
err: error
|
|
98
111
|
});
|
|
99
|
-
}, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
|
|
112
|
+
}, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi, fireEvent]);
|
|
100
113
|
if (!url) {
|
|
101
114
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
102
115
|
}
|
|
@@ -4,23 +4,27 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports.LinkComponent = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
11
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
|
+
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
15
|
var _click = require("../../utils/analytics/click");
|
|
13
16
|
var _LinkAnalyticsContext = require("../../utils/analytics/LinkAnalyticsContext");
|
|
14
17
|
var _LinkWarningModal = _interopRequireDefault(require("./LinkWarningModal"));
|
|
15
18
|
var _useLinkWarningModal2 = require("./LinkWarningModal/hooks/use-link-warning-modal");
|
|
16
|
-
var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
19
|
+
var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLinkComponent"],
|
|
17
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
21
|
var PACKAGE_DATA = {
|
|
19
22
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "32.
|
|
23
|
+
packageVersion: "32.5.1",
|
|
21
24
|
componentName: 'linkUrl'
|
|
22
25
|
};
|
|
23
|
-
var
|
|
26
|
+
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
27
|
+
var LinkComponent = exports.LinkComponent = (0, _click.withLinkClickedEvent)(_link.default);
|
|
24
28
|
var LinkUrl = function LinkUrl(_ref) {
|
|
25
29
|
var href = _ref.href,
|
|
26
30
|
children = _ref.children,
|
|
@@ -29,17 +33,20 @@ var LinkUrl = function LinkUrl(_ref) {
|
|
|
29
33
|
_onClick = _ref.onClick,
|
|
30
34
|
_ref$testId = _ref.testId,
|
|
31
35
|
testId = _ref$testId === void 0 ? 'link-with-safety' : _ref$testId,
|
|
36
|
+
_ref$isLinkComponent = _ref.isLinkComponent,
|
|
37
|
+
isLinkComponent = _ref$isLinkComponent === void 0 ? false : _ref$isLinkComponent,
|
|
32
38
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
33
39
|
var _useLinkWarningModal = (0, _useLinkWarningModal2.useLinkWarningModal)(),
|
|
34
40
|
isLinkSafe = _useLinkWarningModal.isLinkSafe,
|
|
35
41
|
showSafetyWarningModal = _useLinkWarningModal.showSafetyWarningModal,
|
|
36
42
|
linkWarningModalProps = (0, _objectWithoutProperties2.default)(_useLinkWarningModal, _excluded2);
|
|
43
|
+
var Link = isLinkComponent && (0, _platformFeatureFlags.fg)('platform_editor_hyperlink_underline') ? LinkComponent : Anchor;
|
|
37
44
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_LinkAnalyticsContext.LinkAnalyticsContext, {
|
|
38
45
|
url: href,
|
|
39
46
|
display: "url"
|
|
40
47
|
}, /*#__PURE__*/_react.default.createElement(Link, (0, _extends2.default)({
|
|
41
48
|
"data-testid": testId,
|
|
42
|
-
href: href,
|
|
49
|
+
href: href || '',
|
|
43
50
|
onClick: function onClick(e) {
|
|
44
51
|
if (!checkSafety) {
|
|
45
52
|
_onClick && _onClick(e);
|
|
@@ -2,8 +2,10 @@ import { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
3
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
|
|
4
4
|
import { auth } from '@atlaskit/outbound-auth-flow-client';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
6
7
|
import { SmartLinkStatus } from '../../constants';
|
|
8
|
+
import { startUfoExperience } from '../analytics';
|
|
7
9
|
import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
|
|
8
10
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
9
11
|
import useResolve from '../hooks/use-resolve';
|
|
@@ -107,19 +109,41 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
107
109
|
fireEvent('track.applicationAccount.connected', {
|
|
108
110
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
109
111
|
});
|
|
110
|
-
analytics
|
|
111
|
-
id,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
}
|
|
115
127
|
reload();
|
|
116
128
|
}, err => {
|
|
117
|
-
analytics
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
+
}
|
|
123
147
|
if (err.type === 'auth_window_closed') {
|
|
124
148
|
analytics.ui.closedAuthEvent({
|
|
125
149
|
display: appearance,
|
|
@@ -492,6 +492,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
492
492
|
* @param id The unique ID for this Smart Link.
|
|
493
493
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
494
494
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
495
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
495
496
|
*/
|
|
496
497
|
connectSucceededEvent: ({
|
|
497
498
|
id,
|
|
@@ -524,6 +525,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
524
525
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
525
526
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
526
527
|
* @param reason The reason why the Smart Link connect account failed.
|
|
528
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
527
529
|
*/
|
|
528
530
|
connectFailedEvent: ({
|
|
529
531
|
id,
|
|
@@ -560,6 +562,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
560
562
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
561
563
|
* @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
|
|
562
564
|
* @param error An error representing why the Smart Link request failed.
|
|
565
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
563
566
|
*/
|
|
564
567
|
instrument: ({
|
|
565
568
|
id,
|
|
@@ -589,11 +592,12 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
589
592
|
}
|
|
590
593
|
},
|
|
591
594
|
/**
|
|
592
|
-
* This fires an event that represents when a Smart Link renders
|
|
595
|
+
* This fires an event that represents when a Smart Link renders unsuccessfully.
|
|
593
596
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
594
597
|
* @param id The unique ID for this Smart Link.
|
|
595
598
|
* @param error: An error representing why the Smart Link render failed.
|
|
596
599
|
* @param errorInfo: Additional details about the error including the stack trace.
|
|
600
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
597
601
|
*/
|
|
598
602
|
chunkloadFailedEvent: ({
|
|
599
603
|
display,
|
|
@@ -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.
|
|
7
|
+
packageVersion: "32.5.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -51,6 +51,10 @@ 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
|
+
*/
|
|
54
58
|
export const resolvedEvent = props => ({
|
|
55
59
|
action: 'resolved',
|
|
56
60
|
actionSubject: 'smartLink',
|
|
@@ -60,6 +64,10 @@ export const resolvedEvent = props => ({
|
|
|
60
64
|
...context
|
|
61
65
|
}
|
|
62
66
|
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
70
|
+
*/
|
|
63
71
|
export const unresolvedEvent = ({
|
|
64
72
|
id,
|
|
65
73
|
definitionId,
|
|
@@ -163,6 +171,10 @@ export const invokeFailedEvent = ({
|
|
|
163
171
|
}
|
|
164
172
|
};
|
|
165
173
|
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
177
|
+
*/
|
|
166
178
|
export const connectSucceededEvent = ({
|
|
167
179
|
definitionId,
|
|
168
180
|
extensionKey,
|
|
@@ -182,6 +194,10 @@ export const connectSucceededEvent = ({
|
|
|
182
194
|
location
|
|
183
195
|
}
|
|
184
196
|
});
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
200
|
+
*/
|
|
185
201
|
export const connectFailedEvent = ({
|
|
186
202
|
definitionId,
|
|
187
203
|
extensionKey,
|
|
@@ -465,6 +481,10 @@ export const uiLearnMoreLinkClickedEvent = () => ({
|
|
|
465
481
|
...context
|
|
466
482
|
}
|
|
467
483
|
});
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
|
|
487
|
+
*/
|
|
468
488
|
export const chunkloadFailedEvent = ({
|
|
469
489
|
display,
|
|
470
490
|
error,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { getMeasure } from '../performance';
|
|
2
2
|
import { resolvedEvent, unresolvedEvent } from './analytics';
|
|
3
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
|
+
*/
|
|
4
8
|
export const instrumentEvent = ({
|
|
5
9
|
id,
|
|
6
10
|
status,
|