@atlaskit/smart-card 30.4.0 → 30.4.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 +8 -0
- package/dist/cjs/state/actions/index.js +4 -11
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +6 -81
- package/dist/cjs/utils/analytics/analytics.js +104 -216
- package/dist/cjs/utils/analytics/index.js +0 -12
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +3 -11
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +2 -9
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +11 -31
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +10 -39
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +2 -10
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +1 -98
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/actions/index.js +4 -11
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +3 -78
- package/dist/es2019/utils/analytics/analytics.js +1 -118
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +4 -12
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +2 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +11 -31
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +10 -39
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +2 -10
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +1 -79
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/actions/index.js +4 -11
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +8 -83
- package/dist/esm/utils/analytics/analytics.js +103 -215
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +4 -12
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +2 -9
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +11 -31
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +10 -39
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +2 -10
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +1 -98
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -49
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -16
- package/dist/types/utils/analytics/analytics.d.ts +1 -32
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -1
- package/dist/types/utils/mocks.d.ts +0 -16
- package/dist/types/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +1 -49
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -16
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -32
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -1
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -16
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +1 -1
- package/package.json +2 -5
|
@@ -11,7 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
13
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _messages = require("../../../../messages");
|
|
17
16
|
var _UnauthorisedViewContent = _interopRequireDefault(require("../../../common/UnauthorisedViewContent"));
|
|
@@ -34,16 +33,10 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
34
33
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
35
34
|
var handleOnAuthorizeClick = (0, _react.useCallback)(function () {
|
|
36
35
|
if (onAuthorize) {
|
|
37
|
-
|
|
38
|
-
fireEvent('track.applicationAccount.authStarted', {});
|
|
39
|
-
} else {
|
|
40
|
-
analytics.track.appAccountAuthStarted({
|
|
41
|
-
extensionKey: extensionKey
|
|
42
|
-
});
|
|
43
|
-
}
|
|
36
|
+
fireEvent('track.applicationAccount.authStarted', {});
|
|
44
37
|
onAuthorize();
|
|
45
38
|
}
|
|
46
|
-
}, [onAuthorize,
|
|
39
|
+
}, [onAuthorize, fireEvent]);
|
|
47
40
|
var content = (0, _react.useMemo)(function () {
|
|
48
41
|
if (onAuthorize) {
|
|
49
42
|
var _context$text;
|
|
@@ -12,7 +12,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
17
16
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
18
17
|
var _useInvoke = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke"));
|
|
@@ -52,28 +51,16 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
52
51
|
analytics === null || analytics === void 0 || analytics.ui.smartLinkServerActionClickedEvent({
|
|
53
52
|
smartLinkActionType: smartLinkActionType
|
|
54
53
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionStarted({
|
|
61
|
-
smartLinkActionType: smartLinkActionType
|
|
62
|
-
});
|
|
63
|
-
}
|
|
54
|
+
fireEvent('track.smartLinkQuickAction.started', {
|
|
55
|
+
smartLinkActionType: smartLinkActionType
|
|
56
|
+
});
|
|
64
57
|
request = (0, _createInvokeRequest.default)(action);
|
|
65
58
|
_context.next = 9;
|
|
66
59
|
return invoke(request);
|
|
67
60
|
case 9:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionSuccess({
|
|
74
|
-
smartLinkActionType: smartLinkActionType
|
|
75
|
-
});
|
|
76
|
-
}
|
|
61
|
+
fireEvent('track.smartLinkQuickAction.success', {
|
|
62
|
+
smartLinkActionType: smartLinkActionType
|
|
63
|
+
});
|
|
77
64
|
if (!(action.reload && action.reload.url)) {
|
|
78
65
|
_context.next = 13;
|
|
79
66
|
break;
|
|
@@ -91,24 +78,17 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
91
78
|
_context.prev = 17;
|
|
92
79
|
_context.t0 = _context["catch"](2);
|
|
93
80
|
setIsLoading(false);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionFailed({
|
|
101
|
-
smartLinkActionType: smartLinkActionType,
|
|
102
|
-
reason: (0, _utils.getInvokeFailureReason)(_context.t0)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
81
|
+
fireEvent('track.smartLinkQuickAction.failed', {
|
|
82
|
+
smartLinkActionType: smartLinkActionType,
|
|
83
|
+
reason: (0, _utils.getInvokeFailureReason)(_context.t0)
|
|
84
|
+
});
|
|
105
85
|
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback();
|
|
106
86
|
case 22:
|
|
107
87
|
case "end":
|
|
108
88
|
return _context.stop();
|
|
109
89
|
}
|
|
110
90
|
}, _callee, null, [[2, 17]]);
|
|
111
|
-
})), [action, analytics === null || analytics === void 0 ? void 0 : analytics.
|
|
91
|
+
})), [action, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
112
92
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
113
93
|
isLoading: isLoading,
|
|
114
94
|
onClick: handleClick
|
|
@@ -12,7 +12,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
14
|
var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
17
16
|
var _extractLozengeActionItems = _interopRequireDefault(require("../../../../../../extractors/action/extract-lozenge-action-items"));
|
|
18
17
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
@@ -104,15 +103,9 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
104
103
|
break;
|
|
105
104
|
}
|
|
106
105
|
analytics === null || analytics === void 0 || analytics.ui.smartLinkLozengeActionClickedEvent();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
} else {
|
|
112
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionStarted({
|
|
113
|
-
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
114
|
-
});
|
|
115
|
-
}
|
|
106
|
+
fireEvent('track.smartLinkQuickAction.started', {
|
|
107
|
+
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
108
|
+
});
|
|
116
109
|
if (!(!isLoaded && action !== null && action !== void 0 && action.read)) {
|
|
117
110
|
_context.next = 24;
|
|
118
111
|
break;
|
|
@@ -127,11 +120,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
127
120
|
setItems(validItems);
|
|
128
121
|
setIsLoaded(true);
|
|
129
122
|
if ((validItems === null || validItems === void 0 ? void 0 : validItems.length) === 0) {
|
|
130
|
-
|
|
131
|
-
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.permissionLoadErrorAnalyticsPayload);
|
|
132
|
-
} else {
|
|
133
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionFailed(_lozengeActionAnalytics.permissionLoadErrorAnalyticsPayload);
|
|
134
|
-
}
|
|
123
|
+
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.permissionLoadErrorAnalyticsPayload);
|
|
135
124
|
setErrorMessage(_types.LozengeActionErrorMessages.noData);
|
|
136
125
|
setIsLoaded(false);
|
|
137
126
|
}
|
|
@@ -142,11 +131,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
142
131
|
_context.t0 = _context["catch"](5);
|
|
143
132
|
setErrorMessage(_types.LozengeActionErrorMessages.unknown);
|
|
144
133
|
setIsLoaded(false);
|
|
145
|
-
|
|
146
|
-
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.unknownLoadErrorAnalyticsPayload);
|
|
147
|
-
} else {
|
|
148
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionFailed(_lozengeActionAnalytics.unknownLoadErrorAnalyticsPayload);
|
|
149
|
-
}
|
|
134
|
+
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.unknownLoadErrorAnalyticsPayload);
|
|
150
135
|
case 21:
|
|
151
136
|
_context.prev = 21;
|
|
152
137
|
setIsLoading(false);
|
|
@@ -199,15 +184,9 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
199
184
|
setIsLoaded(false);
|
|
200
185
|
setIsOpen(false);
|
|
201
186
|
setItems([]);
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
});
|
|
206
|
-
} else {
|
|
207
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionSuccess({
|
|
208
|
-
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
209
|
-
});
|
|
210
|
-
}
|
|
187
|
+
fireEvent('track.smartLinkQuickAction.success', {
|
|
188
|
+
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
189
|
+
});
|
|
211
190
|
if (!url) {
|
|
212
191
|
_context2.next = 17;
|
|
213
192
|
break;
|
|
@@ -223,18 +202,10 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
223
202
|
setIsLoading(false);
|
|
224
203
|
if ((0, _utils.isInvokeCustomError)(_context2.t0)) {
|
|
225
204
|
setErrorMessage(_context2.t0.message);
|
|
226
|
-
|
|
227
|
-
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.validationUpdateErrorAnalyticsPayload);
|
|
228
|
-
} else {
|
|
229
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionFailed(_lozengeActionAnalytics.validationUpdateErrorAnalyticsPayload);
|
|
230
|
-
}
|
|
205
|
+
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.validationUpdateErrorAnalyticsPayload);
|
|
231
206
|
} else {
|
|
232
207
|
setErrorMessage(_types.LozengeActionErrorMessages.updateFailed);
|
|
233
|
-
|
|
234
|
-
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.unknownUpdateErrorAnalyticsPayload);
|
|
235
|
-
} else {
|
|
236
|
-
analytics === null || analytics === void 0 || analytics.track.smartLinkQuickActionFailed(_lozengeActionAnalytics.unknownUpdateErrorAnalyticsPayload);
|
|
237
|
-
}
|
|
208
|
+
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.unknownUpdateErrorAnalyticsPayload);
|
|
238
209
|
}
|
|
239
210
|
case 23:
|
|
240
211
|
case "end":
|
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
15
14
|
var _constants = require("../../../../../constants");
|
|
16
15
|
var _messages = require("../../../../../messages");
|
|
@@ -27,7 +26,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
27
26
|
var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
28
27
|
var _cardState$details, _extractProvider;
|
|
29
28
|
var analytics = _ref.analytics,
|
|
30
|
-
extensionKey = _ref.extensionKey,
|
|
31
29
|
_ref$id = _ref.id,
|
|
32
30
|
id = _ref$id === void 0 ? '' : _ref$id,
|
|
33
31
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
@@ -44,16 +42,10 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
44
42
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
45
43
|
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
46
44
|
if (authorize) {
|
|
47
|
-
|
|
48
|
-
fireEvent('track.applicationAccount.authStarted', {});
|
|
49
|
-
} else {
|
|
50
|
-
analytics.track.appAccountAuthStarted({
|
|
51
|
-
extensionKey: extensionKey
|
|
52
|
-
});
|
|
53
|
-
}
|
|
45
|
+
fireEvent('track.applicationAccount.authStarted', {});
|
|
54
46
|
authorize(_constants.CardDisplay.HoverCardPreview);
|
|
55
47
|
}
|
|
56
|
-
}, [authorize,
|
|
48
|
+
}, [authorize, fireEvent]);
|
|
57
49
|
var actions = (0, _react.useMemo)(function () {
|
|
58
50
|
return [{
|
|
59
51
|
name: _constants.ActionName.CustomAction,
|
|
@@ -5,19 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.InlineCardUnauthorizedView = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
9
|
var _react = _interopRequireDefault(require("react"));
|
|
17
10
|
var _reactIntlNext = require("react-intl-next");
|
|
18
11
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
19
12
|
var _lockFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/lock-filled"));
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
14
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
23
15
|
var _messages = require("../../../messages");
|
|
@@ -27,14 +19,12 @@ var _Icon = require("../Icon");
|
|
|
27
19
|
var _IconAndTitleLayout = require("../IconAndTitleLayout");
|
|
28
20
|
var _styled = require("../styled");
|
|
29
21
|
var _withFrameStyleControl = _interopRequireDefault(require("../utils/withFrameStyleControl"));
|
|
30
|
-
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
31
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
22
|
var FallbackUnauthorizedIcon = /*#__PURE__*/_react.default.createElement(_Icon.AKIconWrapper, null, /*#__PURE__*/_react.default.createElement(_lockFilled.default, {
|
|
33
23
|
label: "error",
|
|
34
24
|
size: "small",
|
|
35
25
|
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
36
26
|
}));
|
|
37
|
-
var
|
|
27
|
+
var InlineCardUnauthorizedView = exports.InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref) {
|
|
38
28
|
var url = _ref.url,
|
|
39
29
|
id = _ref.id,
|
|
40
30
|
icon = _ref.icon,
|
|
@@ -90,91 +80,4 @@ var InlineCardUnauthorizedViewNew = function InlineCardUnauthorizedViewNew(_ref)
|
|
|
90
80
|
}, inlineCardUnauthenticatedView);
|
|
91
81
|
}
|
|
92
82
|
return inlineCardUnauthenticatedView;
|
|
93
|
-
};
|
|
94
|
-
var InlineCardUnauthorizedViewOld = /*#__PURE__*/function (_React$Component) {
|
|
95
|
-
(0, _inherits2.default)(InlineCardUnauthorizedViewOld, _React$Component);
|
|
96
|
-
var _super = _createSuper(InlineCardUnauthorizedViewOld);
|
|
97
|
-
function InlineCardUnauthorizedViewOld() {
|
|
98
|
-
var _this;
|
|
99
|
-
(0, _classCallCheck2.default)(this, InlineCardUnauthorizedViewOld);
|
|
100
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
101
|
-
args[_key] = arguments[_key];
|
|
102
|
-
}
|
|
103
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
104
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "frameRef", /*#__PURE__*/_react.default.createRef());
|
|
105
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleConnectAccount", function (event) {
|
|
106
|
-
var _this$props = _this.props,
|
|
107
|
-
analytics = _this$props.analytics,
|
|
108
|
-
extensionKey = _this$props.extensionKey,
|
|
109
|
-
onAuthorise = _this$props.onAuthorise;
|
|
110
|
-
event.preventDefault();
|
|
111
|
-
event.stopPropagation();
|
|
112
|
-
if (onAuthorise) {
|
|
113
|
-
analytics === null || analytics === void 0 || analytics.track.appAccountAuthStarted({
|
|
114
|
-
extensionKey: extensionKey
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
return onAuthorise();
|
|
118
|
-
});
|
|
119
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderActionButton", function () {
|
|
120
|
-
var _this$props2 = _this.props,
|
|
121
|
-
onAuthorise = _this$props2.onAuthorise,
|
|
122
|
-
context = _this$props2.context;
|
|
123
|
-
var ActionButton = (0, _withFrameStyleControl.default)(_button.default, _this.frameRef);
|
|
124
|
-
return onAuthorise ? /*#__PURE__*/_react.default.createElement(ActionButton, {
|
|
125
|
-
spacing: "none",
|
|
126
|
-
component: _styled.IconStyledButton,
|
|
127
|
-
onClick: _this.handleConnectAccount,
|
|
128
|
-
testId: "button-connect-account"
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_link_account_card_name, {
|
|
130
|
-
values: {
|
|
131
|
-
context: context
|
|
132
|
-
}
|
|
133
|
-
}))) : undefined;
|
|
134
|
-
});
|
|
135
|
-
return _this;
|
|
136
|
-
}
|
|
137
|
-
(0, _createClass2.default)(InlineCardUnauthorizedViewOld, [{
|
|
138
|
-
key: "render",
|
|
139
|
-
value: function render() {
|
|
140
|
-
var _this$props3 = this.props,
|
|
141
|
-
url = _this$props3.url,
|
|
142
|
-
icon = _this$props3.icon,
|
|
143
|
-
onAuthorise = _this$props3.onAuthorise,
|
|
144
|
-
onClick = _this$props3.onClick,
|
|
145
|
-
isSelected = _this$props3.isSelected,
|
|
146
|
-
_this$props3$testId = _this$props3.testId,
|
|
147
|
-
testId = _this$props3$testId === void 0 ? 'inline-card-unauthorized-view' : _this$props3$testId,
|
|
148
|
-
_this$props3$showAuth = _this$props3.showAuthTooltip,
|
|
149
|
-
showAuthTooltip = _this$props3$showAuth === void 0 ? false : _this$props3$showAuth,
|
|
150
|
-
truncateInline = _this$props3.truncateInline;
|
|
151
|
-
var inlineCardUnauthenticatedView = /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
152
|
-
testId: testId,
|
|
153
|
-
isSelected: isSelected,
|
|
154
|
-
ref: this.frameRef,
|
|
155
|
-
truncateInline: truncateInline
|
|
156
|
-
}, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
|
|
157
|
-
icon: icon ? icon : FallbackUnauthorizedIcon,
|
|
158
|
-
title: url,
|
|
159
|
-
link: url,
|
|
160
|
-
onClick: onClick,
|
|
161
|
-
titleColor: "var(--ds-text-subtle, ".concat(_colors.N500, ")")
|
|
162
|
-
}), this.renderActionButton());
|
|
163
|
-
if (onAuthorise && showAuthTooltip) {
|
|
164
|
-
return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
|
|
165
|
-
url: url,
|
|
166
|
-
id: this.props.id
|
|
167
|
-
}, inlineCardUnauthenticatedView);
|
|
168
|
-
}
|
|
169
|
-
return inlineCardUnauthenticatedView;
|
|
170
|
-
}
|
|
171
|
-
}]);
|
|
172
|
-
return InlineCardUnauthorizedViewOld;
|
|
173
|
-
}(_react.default.Component);
|
|
174
|
-
var InlineCardUnauthorizedView = exports.InlineCardUnauthorizedView = function InlineCardUnauthorizedView(props) {
|
|
175
|
-
if ((0, _platformFeatureFlags.fg)('smart-card-migrate-track-analytics')) {
|
|
176
|
-
return /*#__PURE__*/_react.default.createElement(InlineCardUnauthorizedViewNew, props);
|
|
177
|
-
} else {
|
|
178
|
-
return /*#__PURE__*/_react.default.createElement(InlineCardUnauthorizedViewOld, props);
|
|
179
|
-
}
|
|
180
83
|
};
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "30.4.
|
|
20
|
+
packageVersion: "30.4.1",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -112,16 +112,9 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
auth(services[0].url).then(() => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
-
} else {
|
|
120
|
-
analytics.track.appAccountConnected({
|
|
121
|
-
definitionId,
|
|
122
|
-
extensionKey
|
|
123
|
-
});
|
|
124
|
-
}
|
|
115
|
+
fireEvent('track.applicationAccount.connected', {
|
|
116
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
117
|
+
});
|
|
125
118
|
analytics.operational.connectSucceededEvent({
|
|
126
119
|
id,
|
|
127
120
|
definitionId,
|
|
@@ -145,7 +138,7 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
145
138
|
reload();
|
|
146
139
|
});
|
|
147
140
|
}
|
|
148
|
-
}, [getSmartLinkState, analytics.ui, analytics.screen, analytics.
|
|
141
|
+
}, [getSmartLinkState, analytics.ui, analytics.screen, analytics.operational, id, reload, fireEvent]);
|
|
149
142
|
const invoke = useCallback(async (opts, appearance) => {
|
|
150
143
|
const {
|
|
151
144
|
key,
|
|
@@ -1,8 +1,8 @@
|
|
|
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, screenAuthPopupEvent,
|
|
5
|
-
import {
|
|
4
|
+
import { chunkloadFailedEvent, connectFailedEvent, connectSucceededEvent, context, instrumentEvent, invokeFailedEvent, invokeSucceededEvent, screenAuthPopupEvent, uiActionClickedEvent, uiAuthAlternateAccountEvent, uiAuthEvent, uiCardClickedEvent, uiClosedAuthEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiHoverCardViewedEvent, uiLearnMoreLinkClickedEvent, uiRenderFailedEvent, uiRenderSuccessEvent, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from '../../utils/analytics';
|
|
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';
|
|
8
8
|
import { useDispatchAnalytics } from './useDispatchAnalytics';
|
|
@@ -620,80 +620,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
620
620
|
}
|
|
621
621
|
}), [defaultId, commonAttributes, dispatchAnalytics]);
|
|
622
622
|
|
|
623
|
-
/** Contains all track analytics events */
|
|
624
|
-
const track = useMemo(() => ({
|
|
625
|
-
/**
|
|
626
|
-
* This fires an event which represents a user connecting their account to view a Smart Link.
|
|
627
|
-
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
628
|
-
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
629
|
-
* @returns
|
|
630
|
-
* @deprecated
|
|
631
|
-
*/
|
|
632
|
-
appAccountConnected: ({
|
|
633
|
-
extensionKey,
|
|
634
|
-
definitionId,
|
|
635
|
-
resourceType,
|
|
636
|
-
destinationProduct,
|
|
637
|
-
destinationSubproduct,
|
|
638
|
-
location
|
|
639
|
-
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountConnected({
|
|
640
|
-
...commonAttributes,
|
|
641
|
-
extensionKey,
|
|
642
|
-
definitionId,
|
|
643
|
-
resourceType,
|
|
644
|
-
destinationProduct,
|
|
645
|
-
destinationSubproduct,
|
|
646
|
-
location
|
|
647
|
-
}), commonAttributes)),
|
|
648
|
-
/**
|
|
649
|
-
* This fires an event which represents a user starting the Smart Link connect account process.
|
|
650
|
-
* @param location a location where the Smart Link auth action was initiated.
|
|
651
|
-
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
652
|
-
* @returns
|
|
653
|
-
* @deprecated
|
|
654
|
-
*/
|
|
655
|
-
appAccountAuthStarted: ({
|
|
656
|
-
extensionKey,
|
|
657
|
-
location
|
|
658
|
-
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountAuthStarted({
|
|
659
|
-
...commonAttributes,
|
|
660
|
-
extensionKey,
|
|
661
|
-
location
|
|
662
|
-
}), commonAttributes)),
|
|
663
|
-
/**
|
|
664
|
-
* This fires a tracking event before an action invoke api call is made
|
|
665
|
-
* @deprecated
|
|
666
|
-
*/
|
|
667
|
-
smartLinkQuickActionStarted: props => dispatchAnalytics(applyCommonAttributes(trackSmartLinkQuickActionStarted({
|
|
668
|
-
...commonAttributes,
|
|
669
|
-
...props
|
|
670
|
-
}), commonAttributes)),
|
|
671
|
-
/**
|
|
672
|
-
* This fires a tracking event after an action invoke api call is successful
|
|
673
|
-
* @deprecated
|
|
674
|
-
*/
|
|
675
|
-
smartLinkQuickActionSuccess: props => dispatchAnalytics(applyCommonAttributes(trackSmartLinkQuickActionSuccess({
|
|
676
|
-
...commonAttributes,
|
|
677
|
-
...props
|
|
678
|
-
}), commonAttributes)),
|
|
679
|
-
/**
|
|
680
|
-
* This fires a tracking event after an action invoke api call has failed
|
|
681
|
-
* @deprecated
|
|
682
|
-
*/
|
|
683
|
-
smartLinkQuickActionFailed: props => dispatchAnalytics(applyCommonAttributes(trackSmartLinkQuickActionFailed({
|
|
684
|
-
...commonAttributes,
|
|
685
|
-
...props
|
|
686
|
-
}), commonAttributes)),
|
|
687
|
-
/**
|
|
688
|
-
* Fires a track event when we call loadMetadata() to get information for a hover card
|
|
689
|
-
* @deprecated
|
|
690
|
-
*/
|
|
691
|
-
hoverCardResolutionStarted: () => dispatchAnalytics(applyCommonAttributes(trackHoverCardResolutionStarted({
|
|
692
|
-
display: 'hoverCardPreview',
|
|
693
|
-
...commonAttributes
|
|
694
|
-
}), commonAttributes))
|
|
695
|
-
}), [commonAttributes, dispatchAnalytics]);
|
|
696
|
-
|
|
697
623
|
/** Contains all screen analytics events */
|
|
698
624
|
const screen = useMemo(() => ({
|
|
699
625
|
/**
|
|
@@ -737,7 +663,6 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
|
|
|
737
663
|
return useMemo(() => ({
|
|
738
664
|
ui,
|
|
739
665
|
operational,
|
|
740
|
-
track,
|
|
741
666
|
screen
|
|
742
|
-
}), [ui, operational,
|
|
667
|
+
}), [ui, operational, screen]);
|
|
743
668
|
};
|
|
@@ -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: "30.4.
|
|
7
|
+
packageVersion: "30.4.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -204,123 +204,6 @@ export const connectFailedEvent = ({
|
|
|
204
204
|
location
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* @deprecated
|
|
210
|
-
*/
|
|
211
|
-
export const trackAppAccountConnected = ({
|
|
212
|
-
definitionId,
|
|
213
|
-
extensionKey,
|
|
214
|
-
destinationProduct,
|
|
215
|
-
destinationSubproduct,
|
|
216
|
-
location
|
|
217
|
-
}) => ({
|
|
218
|
-
action: 'connected',
|
|
219
|
-
actionSubject: 'applicationAccount',
|
|
220
|
-
eventType: 'track',
|
|
221
|
-
attributes: {
|
|
222
|
-
...context,
|
|
223
|
-
definitionId,
|
|
224
|
-
extensionKey,
|
|
225
|
-
destinationProduct,
|
|
226
|
-
destinationSubproduct,
|
|
227
|
-
location
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @deprecated
|
|
233
|
-
*/
|
|
234
|
-
export const trackAppAccountAuthStarted = ({
|
|
235
|
-
extensionKey,
|
|
236
|
-
location
|
|
237
|
-
}) => ({
|
|
238
|
-
action: 'authStarted',
|
|
239
|
-
actionSubject: 'applicationAccount',
|
|
240
|
-
eventType: 'track',
|
|
241
|
-
attributes: {
|
|
242
|
-
...context,
|
|
243
|
-
extensionKey,
|
|
244
|
-
location
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* @deprecated
|
|
250
|
-
*/
|
|
251
|
-
export const trackSmartLinkQuickActionStarted = ({
|
|
252
|
-
smartLinkActionType,
|
|
253
|
-
...attributes
|
|
254
|
-
}) => {
|
|
255
|
-
var _SmartLinkActionTypeT;
|
|
256
|
-
return {
|
|
257
|
-
action: 'started',
|
|
258
|
-
actionSubject: 'smartLinkQuickAction',
|
|
259
|
-
eventType: 'track',
|
|
260
|
-
attributes: {
|
|
261
|
-
...context,
|
|
262
|
-
...attributes,
|
|
263
|
-
smartLinkActionType: (_SmartLinkActionTypeT = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT !== void 0 ? _SmartLinkActionTypeT : smartLinkActionType
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @deprecated
|
|
270
|
-
*/
|
|
271
|
-
export const trackSmartLinkQuickActionSuccess = ({
|
|
272
|
-
smartLinkActionType,
|
|
273
|
-
...attributes
|
|
274
|
-
}) => {
|
|
275
|
-
var _SmartLinkActionTypeT2;
|
|
276
|
-
return {
|
|
277
|
-
action: 'success',
|
|
278
|
-
actionSubject: 'smartLinkQuickAction',
|
|
279
|
-
eventType: 'track',
|
|
280
|
-
attributes: {
|
|
281
|
-
...context,
|
|
282
|
-
...attributes,
|
|
283
|
-
smartLinkActionType: (_SmartLinkActionTypeT2 = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT2 !== void 0 ? _SmartLinkActionTypeT2 : smartLinkActionType
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @deprecated
|
|
290
|
-
*/
|
|
291
|
-
export const trackSmartLinkQuickActionFailed = ({
|
|
292
|
-
smartLinkActionType,
|
|
293
|
-
...attributes
|
|
294
|
-
}) => {
|
|
295
|
-
var _SmartLinkActionTypeT3;
|
|
296
|
-
return {
|
|
297
|
-
action: 'failed',
|
|
298
|
-
actionSubject: 'smartLinkQuickAction',
|
|
299
|
-
eventType: 'track',
|
|
300
|
-
attributes: {
|
|
301
|
-
...context,
|
|
302
|
-
...attributes,
|
|
303
|
-
smartLinkActionType: (_SmartLinkActionTypeT3 = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT3 !== void 0 ? _SmartLinkActionTypeT3 : smartLinkActionType
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* @deprecated
|
|
310
|
-
*/
|
|
311
|
-
export const trackHoverCardResolutionStarted = ({
|
|
312
|
-
display,
|
|
313
|
-
...attributes
|
|
314
|
-
}) => ({
|
|
315
|
-
action: 'resolved',
|
|
316
|
-
actionSubject: 'hoverCard',
|
|
317
|
-
eventType: 'track',
|
|
318
|
-
attributes: {
|
|
319
|
-
...context,
|
|
320
|
-
...attributes,
|
|
321
|
-
display
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
207
|
export const uiAuthEvent = ({
|
|
325
208
|
definitionId,
|
|
326
209
|
extensionKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMeasure } from '../performance';
|
|
2
2
|
import { resolvedEvent, unresolvedEvent } from './analytics';
|
|
3
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, chunkloadFailedEvent, connectSucceededEvent, connectFailedEvent,
|
|
3
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, chunkloadFailedEvent, connectSucceededEvent, connectFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from './analytics';
|
|
4
4
|
export const instrumentEvent = ({
|
|
5
5
|
id,
|
|
6
6
|
status,
|