@atlaskit/smart-card 26.42.0 → 26.42.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 +6 -0
- package/dist/cjs/extractors/common/context/extractAccessContext.js +24 -4
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +6 -2
- package/dist/cjs/view/EmbedCard/index.js +7 -2
- package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +7 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RedesignedInlineCard/index.js +5 -1
- package/dist/es2019/extractors/common/context/extractAccessContext.js +30 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +7 -2
- package/dist/es2019/view/EmbedCard/index.js +8 -2
- package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +8 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RedesignedInlineCard/index.js +6 -1
- package/dist/esm/extractors/common/context/extractAccessContext.js +24 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +6 -2
- package/dist/esm/view/EmbedCard/index.js +7 -2
- package/dist/esm/view/HoverCard/components/views/forbidden/index.js +7 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RedesignedInlineCard/index.js +5 -1
- package/dist/types/extractors/common/context/extractAccessContext.d.ts +3 -1
- package/dist/types-ts4.5/extractors/common/context/extractAccessContext.d.ts +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.42.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42773](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42773) [`d2ff4012e8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d2ff4012e8d) - [ux] fire additional analytics events within smart-card forbidden views
|
|
8
|
+
|
|
3
9
|
## 26.42.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _messages = require("../../../messages");
|
|
10
10
|
var _ForbiddenAction = require("../../../view/BlockCard/actions/ForbiddenAction");
|
|
11
11
|
var _extractHostname = _interopRequireDefault(require("../hostname/extractHostname"));
|
|
12
|
+
var _analytics = require("../../../utils/analytics");
|
|
12
13
|
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; }
|
|
13
14
|
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; }
|
|
14
15
|
var extractRequestAccessContext = exports.extractRequestAccessContext = function extractRequestAccessContext(_ref) {
|
|
@@ -57,7 +58,8 @@ var extractRequestAccessContextImproved = exports.extractRequestAccessContextImp
|
|
|
57
58
|
var _jsonLd$requestAccess2;
|
|
58
59
|
var jsonLd = _ref2.jsonLd,
|
|
59
60
|
url = _ref2.url,
|
|
60
|
-
product = _ref2.product
|
|
61
|
+
product = _ref2.product,
|
|
62
|
+
createAnalyticsEvent = _ref2.createAnalyticsEvent;
|
|
61
63
|
var requestAccess = jsonLd !== null && jsonLd !== void 0 && jsonLd.requestAccess ? _objectSpread(_objectSpread({}, jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.requestAccess), {}, {
|
|
62
64
|
hostname: (0, _extractHostname.default)(url)
|
|
63
65
|
}) : undefined;
|
|
@@ -68,7 +70,13 @@ var extractRequestAccessContextImproved = exports.extractRequestAccessContextImp
|
|
|
68
70
|
descriptiveMessageKey: 'direct_access_description_crossjoin',
|
|
69
71
|
callToActionMessageKey: 'direct_access_crossjoin',
|
|
70
72
|
action: (0, _ForbiddenAction.ForbiddenAction)(function () {
|
|
71
|
-
|
|
73
|
+
createAnalyticsEvent({
|
|
74
|
+
action: 'clicked',
|
|
75
|
+
actionSubject: 'button',
|
|
76
|
+
actionSubjectId: 'crossJoin',
|
|
77
|
+
eventType: 'ui'
|
|
78
|
+
}).fire(_analytics.ANALYTICS_CHANNEL);
|
|
79
|
+
window.open(url);
|
|
72
80
|
}, 'direct_access', _messages.messages.direct_access_crossjoin, {
|
|
73
81
|
product: product
|
|
74
82
|
})
|
|
@@ -79,7 +87,13 @@ var extractRequestAccessContextImproved = exports.extractRequestAccessContextImp
|
|
|
79
87
|
descriptiveMessageKey: 'request_access_description_crossjoin',
|
|
80
88
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
81
89
|
action: (0, _ForbiddenAction.ForbiddenAction)(function () {
|
|
82
|
-
|
|
90
|
+
createAnalyticsEvent({
|
|
91
|
+
action: 'clicked',
|
|
92
|
+
actionSubject: 'button',
|
|
93
|
+
actionSubjectId: 'requestAccess',
|
|
94
|
+
eventType: 'ui'
|
|
95
|
+
}).fire(_analytics.ANALYTICS_CHANNEL);
|
|
96
|
+
window.open(url);
|
|
83
97
|
}, 'request_access', _messages.messages.request_access_crossjoin)
|
|
84
98
|
});
|
|
85
99
|
case 'PENDING_REQUEST_EXISTS':
|
|
@@ -109,7 +123,13 @@ var extractRequestAccessContextImproved = exports.extractRequestAccessContextImp
|
|
|
109
123
|
descriptiveMessageKey: 'access_exists_description_crossjoin',
|
|
110
124
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
111
125
|
action: (0, _ForbiddenAction.ForbiddenAction)(function () {
|
|
112
|
-
|
|
126
|
+
createAnalyticsEvent({
|
|
127
|
+
action: 'clicked',
|
|
128
|
+
actionSubject: 'button',
|
|
129
|
+
actionSubjectId: 'requestAccess',
|
|
130
|
+
eventType: 'ui'
|
|
131
|
+
}).fire(_analytics.ANALYTICS_CHANNEL);
|
|
132
|
+
window.open(url);
|
|
113
133
|
}, 'access_exists', _messages.messages.request_access_crossjoin)
|
|
114
134
|
});
|
|
115
135
|
case 'FORBIDDEN':
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.42.
|
|
25
|
+
packageVersion: "26.42.1"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -23,6 +23,7 @@ var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyl
|
|
|
23
23
|
var _extractAccessContext = require("../../../../extractors/common/context/extractAccessContext");
|
|
24
24
|
var _reactIntlNext = require("react-intl-next");
|
|
25
25
|
var _extractHostname = _interopRequireDefault(require("../../../../extractors/common/hostname/extractHostname"));
|
|
26
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
26
27
|
var _excluded = ["testId"];
|
|
27
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -38,6 +39,8 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
|
38
39
|
var _ref$testId = _ref.testId,
|
|
39
40
|
testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
|
|
40
41
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
42
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
43
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
41
44
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
42
45
|
var cardState = props.cardState,
|
|
43
46
|
onAuthorize = props.onAuthorize,
|
|
@@ -57,9 +60,10 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
|
57
60
|
return (0, _extractAccessContext.extractRequestAccessContextImproved)({
|
|
58
61
|
jsonLd: cardMetadata,
|
|
59
62
|
url: url,
|
|
60
|
-
product: providerName
|
|
63
|
+
product: providerName,
|
|
64
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
61
65
|
});
|
|
62
|
-
}, [cardMetadata, providerName, url]);
|
|
66
|
+
}, [cardMetadata, providerName, url, createAnalyticsEvent]);
|
|
63
67
|
var title = (0, _react.useMemo)(function () {
|
|
64
68
|
var descriptor = (0, _intlUtils.toMessage)(_messages.messages.invalid_permissions, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.titleMessageKey);
|
|
65
69
|
return intl.formatMessage(descriptor, {
|
|
@@ -25,6 +25,7 @@ var _ErroredView = require("./views/ErroredView");
|
|
|
25
25
|
var _forbiddenView = _interopRequireDefault(require("./views/forbidden-view"));
|
|
26
26
|
var _notFoundView = _interopRequireDefault(require("./views/not-found-view"));
|
|
27
27
|
var _unauthorizedView = _interopRequireDefault(require("./views/unauthorized-view"));
|
|
28
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
28
29
|
var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(function (_ref, iframeRef) {
|
|
29
30
|
var _details$meta, _forbiddenViewProps$c3;
|
|
30
31
|
var url = _ref.url,
|
|
@@ -48,6 +49,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
48
49
|
onIframeDwell = _ref.onIframeDwell,
|
|
49
50
|
onIframeFocus = _ref.onIframeFocus,
|
|
50
51
|
iframeUrlType = _ref.iframeUrlType;
|
|
52
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
53
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
51
54
|
var data = details && details.data || (0, _jsonld.getEmptyJsonLd)();
|
|
52
55
|
var meta = details && details.meta;
|
|
53
56
|
var extensionKey = (0, _helpers.getExtensionKey)(details);
|
|
@@ -157,7 +160,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
157
160
|
var accessContext = (0, _extractAccessContext.extractRequestAccessContextImproved)({
|
|
158
161
|
jsonLd: cardMetadata,
|
|
159
162
|
url: url,
|
|
160
|
-
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : ''
|
|
163
|
+
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
164
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
161
165
|
});
|
|
162
166
|
return /*#__PURE__*/_react.default.createElement(_forbiddenView.default, {
|
|
163
167
|
context: forbiddenViewProps.context,
|
|
@@ -194,7 +198,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
194
198
|
var _accessContext = details !== null && details !== void 0 && details.meta ? (0, _extractAccessContext.extractRequestAccessContextImproved)({
|
|
195
199
|
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
196
200
|
url: url,
|
|
197
|
-
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : ''
|
|
201
|
+
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : '',
|
|
202
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
198
203
|
}) : undefined;
|
|
199
204
|
return /*#__PURE__*/_react.default.createElement(_notFoundView.default, {
|
|
200
205
|
context: notFoundViewProps.context,
|
|
@@ -17,11 +17,14 @@ var _styled = require("./styled");
|
|
|
17
17
|
var _styled2 = require("../../../styled");
|
|
18
18
|
var _extractAccessContext = require("../../../../../extractors/common/context/extractAccessContext");
|
|
19
19
|
var _extractHostname = _interopRequireDefault(require("../../../../../extractors/common/hostname/extractHostname"));
|
|
20
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
20
21
|
var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
21
22
|
var _cardState$details, _cardState$details2, _extractProvider$text, _extractProvider, _extractRequestAccess;
|
|
22
23
|
var flexibleCardProps = _ref.flexibleCardProps,
|
|
23
24
|
_ref$testId = _ref.testId,
|
|
24
25
|
testId = _ref$testId === void 0 ? 'hover-card-forbidden-view' : _ref$testId;
|
|
26
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
27
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
25
28
|
var cardState = flexibleCardProps.cardState,
|
|
26
29
|
url = flexibleCardProps.url;
|
|
27
30
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
@@ -31,7 +34,8 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
|
31
34
|
var _ref2 = (_extractRequestAccess = (0, _extractAccessContext.extractRequestAccessContextImproved)({
|
|
32
35
|
jsonLd: meta,
|
|
33
36
|
url: url,
|
|
34
|
-
product: product
|
|
37
|
+
product: product,
|
|
38
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
35
39
|
})) !== null && _extractRequestAccess !== void 0 ? _extractRequestAccess : {},
|
|
36
40
|
action = _ref2.action,
|
|
37
41
|
descriptiveMessageKey = _ref2.descriptiveMessageKey,
|
|
@@ -62,9 +66,9 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
|
62
66
|
hostname: hostname
|
|
63
67
|
}
|
|
64
68
|
}))), action && /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, {
|
|
65
|
-
overrideCss: _styled.connectButtonStyles
|
|
66
|
-
testId: "".concat(testId, "-button")
|
|
69
|
+
overrideCss: _styled.connectButtonStyles
|
|
67
70
|
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
71
|
+
testId: "".concat(testId, "-button"),
|
|
68
72
|
onClick: action === null || action === void 0 ? void 0 : action.promise,
|
|
69
73
|
appearance: "primary",
|
|
70
74
|
isDisabled: buttonDisabled
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.42.
|
|
21
|
+
packageVersion: "26.42.1",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -51,6 +51,7 @@ var _linkExtractors = require("@atlaskit/link-extractors");
|
|
|
51
51
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
52
52
|
var _helpers = require("../../state/helpers");
|
|
53
53
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
54
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
54
55
|
var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
55
56
|
var _details$meta, _providerForbidden$te;
|
|
56
57
|
var analytics = _ref.analytics,
|
|
@@ -68,6 +69,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
68
69
|
showHoverPreview = _ref.showHoverPreview,
|
|
69
70
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
70
71
|
showServerActions = _ref.showServerActions;
|
|
72
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
73
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
71
74
|
var status = cardState.status,
|
|
72
75
|
details = cardState.details;
|
|
73
76
|
var cardDetails = details && details.data || (0, _jsonld.getEmptyJsonLd)();
|
|
@@ -137,7 +140,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
137
140
|
var requestAccessContext = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.cross-join') ? (0, _extractAccessContext.extractRequestAccessContextImproved)({
|
|
138
141
|
jsonLd: cardMetadata,
|
|
139
142
|
url: url,
|
|
140
|
-
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : ''
|
|
143
|
+
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : '',
|
|
144
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
141
145
|
}) : (0, _context.extractRequestAccessContext)({
|
|
142
146
|
jsonLd: cardMetadata,
|
|
143
147
|
url: url,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { messages } from '../../../messages';
|
|
2
2
|
import { ForbiddenAction } from '../../../view/BlockCard/actions/ForbiddenAction';
|
|
3
3
|
import extractHostname from '../hostname/extractHostname';
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../../utils/analytics';
|
|
4
5
|
export const extractRequestAccessContext = ({
|
|
5
6
|
jsonLd,
|
|
6
7
|
url,
|
|
@@ -48,7 +49,8 @@ export const extractRequestAccessContext = ({
|
|
|
48
49
|
export const extractRequestAccessContextImproved = ({
|
|
49
50
|
jsonLd,
|
|
50
51
|
url,
|
|
51
|
-
product
|
|
52
|
+
product,
|
|
53
|
+
createAnalyticsEvent
|
|
52
54
|
}) => {
|
|
53
55
|
var _jsonLd$requestAccess2;
|
|
54
56
|
const requestAccess = jsonLd !== null && jsonLd !== void 0 && jsonLd.requestAccess ? {
|
|
@@ -62,7 +64,15 @@ export const extractRequestAccessContextImproved = ({
|
|
|
62
64
|
titleMessageKey: 'direct_access_title_crossjoin',
|
|
63
65
|
descriptiveMessageKey: 'direct_access_description_crossjoin',
|
|
64
66
|
callToActionMessageKey: 'direct_access_crossjoin',
|
|
65
|
-
action: ForbiddenAction(() =>
|
|
67
|
+
action: ForbiddenAction(() => {
|
|
68
|
+
createAnalyticsEvent({
|
|
69
|
+
action: 'clicked',
|
|
70
|
+
actionSubject: 'button',
|
|
71
|
+
actionSubjectId: 'crossJoin',
|
|
72
|
+
eventType: 'ui'
|
|
73
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
74
|
+
window.open(url);
|
|
75
|
+
}, 'direct_access', messages.direct_access_crossjoin, {
|
|
66
76
|
product
|
|
67
77
|
})
|
|
68
78
|
};
|
|
@@ -72,7 +82,15 @@ export const extractRequestAccessContextImproved = ({
|
|
|
72
82
|
titleMessageKey: 'default_no_access_title_crossjoin',
|
|
73
83
|
descriptiveMessageKey: 'request_access_description_crossjoin',
|
|
74
84
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
75
|
-
action: ForbiddenAction(() =>
|
|
85
|
+
action: ForbiddenAction(() => {
|
|
86
|
+
createAnalyticsEvent({
|
|
87
|
+
action: 'clicked',
|
|
88
|
+
actionSubject: 'button',
|
|
89
|
+
actionSubjectId: 'requestAccess',
|
|
90
|
+
eventType: 'ui'
|
|
91
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
92
|
+
window.open(url);
|
|
93
|
+
}, 'request_access', messages.request_access_crossjoin)
|
|
76
94
|
};
|
|
77
95
|
case 'PENDING_REQUEST_EXISTS':
|
|
78
96
|
return {
|
|
@@ -102,7 +120,15 @@ export const extractRequestAccessContextImproved = ({
|
|
|
102
120
|
titleMessageKey: 'forbidden_title_crossjoin',
|
|
103
121
|
descriptiveMessageKey: 'access_exists_description_crossjoin',
|
|
104
122
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
105
|
-
action: ForbiddenAction(() =>
|
|
123
|
+
action: ForbiddenAction(() => {
|
|
124
|
+
createAnalyticsEvent({
|
|
125
|
+
action: 'clicked',
|
|
126
|
+
actionSubject: 'button',
|
|
127
|
+
actionSubjectId: 'requestAccess',
|
|
128
|
+
eventType: 'ui'
|
|
129
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
130
|
+
window.open(url);
|
|
131
|
+
}, 'access_exists', messages.request_access_crossjoin)
|
|
106
132
|
};
|
|
107
133
|
case 'FORBIDDEN':
|
|
108
134
|
return {
|
|
@@ -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: "26.42.
|
|
7
|
+
packageVersion: "26.42.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -13,6 +13,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
13
13
|
import { extractRequestAccessContextImproved } from '../../../../extractors/common/context/extractAccessContext';
|
|
14
14
|
import { useIntl } from 'react-intl-next';
|
|
15
15
|
import extractHostname from '../../../../extractors/common/hostname/extractHostname';
|
|
16
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* This view represent a Block Card with the 'Forbidden' status.
|
|
@@ -26,6 +27,9 @@ const FlexibleForbiddenView = ({
|
|
|
26
27
|
...props
|
|
27
28
|
}) => {
|
|
28
29
|
var _details$meta;
|
|
30
|
+
const {
|
|
31
|
+
createAnalyticsEvent
|
|
32
|
+
} = useAnalyticsEvents();
|
|
29
33
|
const intl = useIntl();
|
|
30
34
|
const {
|
|
31
35
|
cardState,
|
|
@@ -47,9 +51,10 @@ const FlexibleForbiddenView = ({
|
|
|
47
51
|
return extractRequestAccessContextImproved({
|
|
48
52
|
jsonLd: cardMetadata,
|
|
49
53
|
url,
|
|
50
|
-
product: providerName
|
|
54
|
+
product: providerName,
|
|
55
|
+
createAnalyticsEvent
|
|
51
56
|
});
|
|
52
|
-
}, [cardMetadata, providerName, url]);
|
|
57
|
+
}, [cardMetadata, providerName, url, createAnalyticsEvent]);
|
|
53
58
|
const title = useMemo(() => {
|
|
54
59
|
const descriptor = toMessage(messages.invalid_permissions, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.titleMessageKey);
|
|
55
60
|
return intl.formatMessage(descriptor, {
|
|
@@ -18,6 +18,7 @@ import { EmbedCardErroredView } from './views/ErroredView';
|
|
|
18
18
|
import ForbiddenView from './views/forbidden-view';
|
|
19
19
|
import NotFoundView from './views/not-found-view';
|
|
20
20
|
import UnauthorizedView from './views/unauthorized-view';
|
|
21
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
21
22
|
export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
22
23
|
url,
|
|
23
24
|
cardState: {
|
|
@@ -43,6 +44,9 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
43
44
|
iframeUrlType
|
|
44
45
|
}, iframeRef) => {
|
|
45
46
|
var _details$meta, _forbiddenViewProps$c3;
|
|
47
|
+
const {
|
|
48
|
+
createAnalyticsEvent
|
|
49
|
+
} = useAnalyticsEvents();
|
|
46
50
|
const data = details && details.data || getEmptyJsonLd();
|
|
47
51
|
const meta = details && details.meta;
|
|
48
52
|
const extensionKey = getExtensionKey(details);
|
|
@@ -152,7 +156,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
152
156
|
const accessContext = extractRequestAccessContextImproved({
|
|
153
157
|
jsonLd: cardMetadata,
|
|
154
158
|
url,
|
|
155
|
-
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : ''
|
|
159
|
+
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
160
|
+
createAnalyticsEvent
|
|
156
161
|
});
|
|
157
162
|
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
158
163
|
context: forbiddenViewProps.context,
|
|
@@ -189,7 +194,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
189
194
|
const accessContext = details !== null && details !== void 0 && details.meta ? extractRequestAccessContextImproved({
|
|
190
195
|
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
191
196
|
url,
|
|
192
|
-
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : ''
|
|
197
|
+
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : '',
|
|
198
|
+
createAnalyticsEvent
|
|
193
199
|
}) : undefined;
|
|
194
200
|
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
195
201
|
context: notFoundViewProps.context,
|
|
@@ -10,11 +10,15 @@ import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled'
|
|
|
10
10
|
import { getPreviewBlockStyles } from '../../../styled';
|
|
11
11
|
import { extractRequestAccessContextImproved } from '../../../../../extractors/common/context/extractAccessContext';
|
|
12
12
|
import extractHostname from '../../../../../extractors/common/hostname/extractHostname';
|
|
13
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
14
|
const HoverCardForbiddenView = ({
|
|
14
15
|
flexibleCardProps,
|
|
15
16
|
testId = 'hover-card-forbidden-view'
|
|
16
17
|
}) => {
|
|
17
18
|
var _cardState$details, _cardState$details2, _extractProvider$text, _extractProvider, _extractRequestAccess;
|
|
19
|
+
const {
|
|
20
|
+
createAnalyticsEvent
|
|
21
|
+
} = useAnalyticsEvents();
|
|
18
22
|
const {
|
|
19
23
|
cardState,
|
|
20
24
|
url
|
|
@@ -31,7 +35,8 @@ const HoverCardForbiddenView = ({
|
|
|
31
35
|
} = (_extractRequestAccess = extractRequestAccessContextImproved({
|
|
32
36
|
jsonLd: meta,
|
|
33
37
|
url,
|
|
34
|
-
product
|
|
38
|
+
product,
|
|
39
|
+
createAnalyticsEvent
|
|
35
40
|
})) !== null && _extractRequestAccess !== void 0 ? _extractRequestAccess : {};
|
|
36
41
|
if (!titleMessageKey || !descriptiveMessageKey) {
|
|
37
42
|
return null;
|
|
@@ -58,9 +63,9 @@ const HoverCardForbiddenView = ({
|
|
|
58
63
|
hostname
|
|
59
64
|
}
|
|
60
65
|
}))), action && /*#__PURE__*/React.createElement(CustomBlock, {
|
|
61
|
-
overrideCss: connectButtonStyles
|
|
62
|
-
testId: `${testId}-button`
|
|
66
|
+
overrideCss: connectButtonStyles
|
|
63
67
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
68
|
+
testId: `${testId}-button`,
|
|
64
69
|
onClick: action === null || action === void 0 ? void 0 : action.promise,
|
|
65
70
|
appearance: "primary",
|
|
66
71
|
isDisabled: buttonDisabled
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.42.
|
|
11
|
+
packageVersion: "26.42.1",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
|
@@ -14,6 +14,7 @@ import { extractProvider } from '@atlaskit/link-extractors';
|
|
|
14
14
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
15
15
|
import { getExtensionKey } from '../../state/helpers';
|
|
16
16
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
18
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
18
19
|
export const InlineCard = ({
|
|
19
20
|
analytics,
|
|
@@ -33,6 +34,9 @@ export const InlineCard = ({
|
|
|
33
34
|
showServerActions
|
|
34
35
|
}) => {
|
|
35
36
|
var _details$meta, _providerForbidden$te;
|
|
37
|
+
const {
|
|
38
|
+
createAnalyticsEvent
|
|
39
|
+
} = useAnalyticsEvents();
|
|
36
40
|
const {
|
|
37
41
|
status,
|
|
38
42
|
details
|
|
@@ -104,7 +108,8 @@ export const InlineCard = ({
|
|
|
104
108
|
const requestAccessContext = getBooleanFF('platform.linking-platform.smart-card.cross-join') ? extractRequestAccessContextImproved({
|
|
105
109
|
jsonLd: cardMetadata,
|
|
106
110
|
url,
|
|
107
|
-
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : ''
|
|
111
|
+
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : '',
|
|
112
|
+
createAnalyticsEvent
|
|
108
113
|
}) : extractRequestAccessContext({
|
|
109
114
|
jsonLd: cardMetadata,
|
|
110
115
|
url,
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { messages } from '../../../messages';
|
|
5
5
|
import { ForbiddenAction } from '../../../view/BlockCard/actions/ForbiddenAction';
|
|
6
6
|
import extractHostname from '../hostname/extractHostname';
|
|
7
|
+
import { ANALYTICS_CHANNEL } from '../../../utils/analytics';
|
|
7
8
|
export var extractRequestAccessContext = function extractRequestAccessContext(_ref) {
|
|
8
9
|
var _jsonLd$requestAccess;
|
|
9
10
|
var jsonLd = _ref.jsonLd,
|
|
@@ -50,7 +51,8 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
50
51
|
var _jsonLd$requestAccess2;
|
|
51
52
|
var jsonLd = _ref2.jsonLd,
|
|
52
53
|
url = _ref2.url,
|
|
53
|
-
product = _ref2.product
|
|
54
|
+
product = _ref2.product,
|
|
55
|
+
createAnalyticsEvent = _ref2.createAnalyticsEvent;
|
|
54
56
|
var requestAccess = jsonLd !== null && jsonLd !== void 0 && jsonLd.requestAccess ? _objectSpread(_objectSpread({}, jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.requestAccess), {}, {
|
|
55
57
|
hostname: extractHostname(url)
|
|
56
58
|
}) : undefined;
|
|
@@ -61,7 +63,13 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
61
63
|
descriptiveMessageKey: 'direct_access_description_crossjoin',
|
|
62
64
|
callToActionMessageKey: 'direct_access_crossjoin',
|
|
63
65
|
action: ForbiddenAction(function () {
|
|
64
|
-
|
|
66
|
+
createAnalyticsEvent({
|
|
67
|
+
action: 'clicked',
|
|
68
|
+
actionSubject: 'button',
|
|
69
|
+
actionSubjectId: 'crossJoin',
|
|
70
|
+
eventType: 'ui'
|
|
71
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
72
|
+
window.open(url);
|
|
65
73
|
}, 'direct_access', messages.direct_access_crossjoin, {
|
|
66
74
|
product: product
|
|
67
75
|
})
|
|
@@ -72,7 +80,13 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
72
80
|
descriptiveMessageKey: 'request_access_description_crossjoin',
|
|
73
81
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
74
82
|
action: ForbiddenAction(function () {
|
|
75
|
-
|
|
83
|
+
createAnalyticsEvent({
|
|
84
|
+
action: 'clicked',
|
|
85
|
+
actionSubject: 'button',
|
|
86
|
+
actionSubjectId: 'requestAccess',
|
|
87
|
+
eventType: 'ui'
|
|
88
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
89
|
+
window.open(url);
|
|
76
90
|
}, 'request_access', messages.request_access_crossjoin)
|
|
77
91
|
});
|
|
78
92
|
case 'PENDING_REQUEST_EXISTS':
|
|
@@ -102,7 +116,13 @@ export var extractRequestAccessContextImproved = function extractRequestAccessCo
|
|
|
102
116
|
descriptiveMessageKey: 'access_exists_description_crossjoin',
|
|
103
117
|
callToActionMessageKey: 'request_access_crossjoin',
|
|
104
118
|
action: ForbiddenAction(function () {
|
|
105
|
-
|
|
119
|
+
createAnalyticsEvent({
|
|
120
|
+
action: 'clicked',
|
|
121
|
+
actionSubject: 'button',
|
|
122
|
+
actionSubjectId: 'requestAccess',
|
|
123
|
+
eventType: 'ui'
|
|
124
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
125
|
+
window.open(url);
|
|
106
126
|
}, 'access_exists', messages.request_access_crossjoin)
|
|
107
127
|
});
|
|
108
128
|
case 'FORBIDDEN':
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.42.
|
|
18
|
+
packageVersion: "26.42.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -16,6 +16,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
16
16
|
import { extractRequestAccessContextImproved } from '../../../../extractors/common/context/extractAccessContext';
|
|
17
17
|
import { useIntl } from 'react-intl-next';
|
|
18
18
|
import extractHostname from '../../../../extractors/common/hostname/extractHostname';
|
|
19
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* This view represent a Block Card with the 'Forbidden' status.
|
|
@@ -29,6 +30,8 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
|
29
30
|
var _ref$testId = _ref.testId,
|
|
30
31
|
testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
|
|
31
32
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
34
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
32
35
|
var intl = useIntl();
|
|
33
36
|
var cardState = props.cardState,
|
|
34
37
|
onAuthorize = props.onAuthorize,
|
|
@@ -48,9 +51,10 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
|
48
51
|
return extractRequestAccessContextImproved({
|
|
49
52
|
jsonLd: cardMetadata,
|
|
50
53
|
url: url,
|
|
51
|
-
product: providerName
|
|
54
|
+
product: providerName,
|
|
55
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
52
56
|
});
|
|
53
|
-
}, [cardMetadata, providerName, url]);
|
|
57
|
+
}, [cardMetadata, providerName, url, createAnalyticsEvent]);
|
|
54
58
|
var title = useMemo(function () {
|
|
55
59
|
var descriptor = toMessage(messages.invalid_permissions, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.titleMessageKey);
|
|
56
60
|
return intl.formatMessage(descriptor, {
|
|
@@ -18,6 +18,7 @@ import { EmbedCardErroredView } from './views/ErroredView';
|
|
|
18
18
|
import ForbiddenView from './views/forbidden-view';
|
|
19
19
|
import NotFoundView from './views/not-found-view';
|
|
20
20
|
import UnauthorizedView from './views/unauthorized-view';
|
|
21
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
21
22
|
export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
22
23
|
var _details$meta, _forbiddenViewProps$c3;
|
|
23
24
|
var url = _ref.url,
|
|
@@ -41,6 +42,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
41
42
|
onIframeDwell = _ref.onIframeDwell,
|
|
42
43
|
onIframeFocus = _ref.onIframeFocus,
|
|
43
44
|
iframeUrlType = _ref.iframeUrlType;
|
|
45
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
46
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
44
47
|
var data = details && details.data || getEmptyJsonLd();
|
|
45
48
|
var meta = details && details.meta;
|
|
46
49
|
var extensionKey = getExtensionKey(details);
|
|
@@ -150,7 +153,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
150
153
|
var accessContext = extractRequestAccessContextImproved({
|
|
151
154
|
jsonLd: cardMetadata,
|
|
152
155
|
url: url,
|
|
153
|
-
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : ''
|
|
156
|
+
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
157
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
154
158
|
});
|
|
155
159
|
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
156
160
|
context: forbiddenViewProps.context,
|
|
@@ -187,7 +191,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
187
191
|
var _accessContext = details !== null && details !== void 0 && details.meta ? extractRequestAccessContextImproved({
|
|
188
192
|
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
189
193
|
url: url,
|
|
190
|
-
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : ''
|
|
194
|
+
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : '',
|
|
195
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
191
196
|
}) : undefined;
|
|
192
197
|
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
193
198
|
context: notFoundViewProps.context,
|
|
@@ -10,11 +10,14 @@ import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled'
|
|
|
10
10
|
import { getPreviewBlockStyles } from '../../../styled';
|
|
11
11
|
import { extractRequestAccessContextImproved } from '../../../../../extractors/common/context/extractAccessContext';
|
|
12
12
|
import extractHostname from '../../../../../extractors/common/hostname/extractHostname';
|
|
13
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
14
|
var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
14
15
|
var _cardState$details, _cardState$details2, _extractProvider$text, _extractProvider, _extractRequestAccess;
|
|
15
16
|
var flexibleCardProps = _ref.flexibleCardProps,
|
|
16
17
|
_ref$testId = _ref.testId,
|
|
17
18
|
testId = _ref$testId === void 0 ? 'hover-card-forbidden-view' : _ref$testId;
|
|
19
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
20
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
18
21
|
var cardState = flexibleCardProps.cardState,
|
|
19
22
|
url = flexibleCardProps.url;
|
|
20
23
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
@@ -24,7 +27,8 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
|
24
27
|
var _ref2 = (_extractRequestAccess = extractRequestAccessContextImproved({
|
|
25
28
|
jsonLd: meta,
|
|
26
29
|
url: url,
|
|
27
|
-
product: product
|
|
30
|
+
product: product,
|
|
31
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
28
32
|
})) !== null && _extractRequestAccess !== void 0 ? _extractRequestAccess : {},
|
|
29
33
|
action = _ref2.action,
|
|
30
34
|
descriptiveMessageKey = _ref2.descriptiveMessageKey,
|
|
@@ -55,9 +59,9 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
|
|
|
55
59
|
hostname: hostname
|
|
56
60
|
}
|
|
57
61
|
}))), action && /*#__PURE__*/React.createElement(CustomBlock, {
|
|
58
|
-
overrideCss: connectButtonStyles
|
|
59
|
-
testId: "".concat(testId, "-button")
|
|
62
|
+
overrideCss: connectButtonStyles
|
|
60
63
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
64
|
+
testId: "".concat(testId, "-button"),
|
|
61
65
|
onClick: action === null || action === void 0 ? void 0 : action.promise,
|
|
62
66
|
appearance: "primary",
|
|
63
67
|
isDisabled: buttonDisabled
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
var PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "26.42.
|
|
14
|
+
packageVersion: "26.42.1",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -14,6 +14,7 @@ import { extractProvider } from '@atlaskit/link-extractors';
|
|
|
14
14
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
15
15
|
import { getExtensionKey } from '../../state/helpers';
|
|
16
16
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
18
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
18
19
|
export var InlineCard = function InlineCard(_ref) {
|
|
19
20
|
var _details$meta, _providerForbidden$te;
|
|
@@ -32,6 +33,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
32
33
|
showHoverPreview = _ref.showHoverPreview,
|
|
33
34
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
34
35
|
showServerActions = _ref.showServerActions;
|
|
36
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
37
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
35
38
|
var status = cardState.status,
|
|
36
39
|
details = cardState.details;
|
|
37
40
|
var cardDetails = details && details.data || getEmptyJsonLd();
|
|
@@ -101,7 +104,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
101
104
|
var requestAccessContext = getBooleanFF('platform.linking-platform.smart-card.cross-join') ? extractRequestAccessContextImproved({
|
|
102
105
|
jsonLd: cardMetadata,
|
|
103
106
|
url: url,
|
|
104
|
-
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : ''
|
|
107
|
+
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : '',
|
|
108
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
105
109
|
}) : extractRequestAccessContext({
|
|
106
110
|
jsonLd: cardMetadata,
|
|
107
111
|
url: url,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
export declare const extractRequestAccessContext: ({ jsonLd, url, context, }: {
|
|
4
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
5
6
|
url: string;
|
|
6
7
|
context?: string | undefined;
|
|
7
8
|
}) => RequestAccessContextProps;
|
|
8
|
-
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, }: {
|
|
9
|
+
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
9
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
10
11
|
url: string;
|
|
11
12
|
product: string;
|
|
13
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
12
14
|
}) => RequestAccessContextProps;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
export declare const extractRequestAccessContext: ({ jsonLd, url, context, }: {
|
|
4
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
5
6
|
url: string;
|
|
6
7
|
context?: string | undefined;
|
|
7
8
|
}) => RequestAccessContextProps;
|
|
8
|
-
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, }: {
|
|
9
|
+
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
9
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
10
11
|
url: string;
|
|
11
12
|
product: string;
|
|
13
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
12
14
|
}) => RequestAccessContextProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.42.
|
|
3
|
+
"version": "26.42.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
39
39
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
40
40
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
41
|
-
"@atlaskit/linking-common": "^4.
|
|
41
|
+
"@atlaskit/linking-common": "^4.17.0",
|
|
42
42
|
"@atlaskit/linking-types": "^8.4.0",
|
|
43
43
|
"@atlaskit/logo": "^13.14.0",
|
|
44
44
|
"@atlaskit/lozenge": "^11.4.0",
|