@atlaskit/smart-card 26.41.3 → 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 +12 -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/FlexibleCard/components/blocks/related-urls-block/analytics.js +30 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/index.js +19 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +11 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/related-url-item/index.js +9 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/analytics.js +51 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +54 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/types.js +5 -0
- 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/FlexibleCard/components/blocks/related-urls-block/analytics.js +19 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/index.js +14 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +12 -15
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/related-url-item/index.js +11 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/analytics.js +42 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/types.js +1 -0
- 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/FlexibleCard/components/blocks/related-urls-block/analytics.js +23 -0
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/index.js +19 -8
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +12 -17
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/related-url-item/index.js +10 -2
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/analytics.js +44 -0
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +44 -0
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/types.js +1 -0
- 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/utils/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/related-urls-block/analytics.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/analytics.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/types.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/blocks/related-urls-block/types.d.ts +3 -0
- package/dist/types-ts4.5/extractors/common/context/extractAccessContext.d.ts +3 -1
- package/dist/types-ts4.5/utils/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/related-urls-block/analytics.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/analytics.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/types.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/related-urls-block/types.d.ts +3 -0
- package/package.json +2 -2
- package/report.api.md +2 -0
- package/tmp/api-report-tmp.d.ts +2 -2
|
@@ -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,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ANALYTICS_CHANNEL } from '../../../../../utils/analytics';
|
|
2
|
+
const createTrackRelatedLinksLoadedEventPayload = ({
|
|
3
|
+
relatedLinksCount
|
|
4
|
+
}) => ({
|
|
5
|
+
action: 'loaded',
|
|
6
|
+
actionSubject: 'relatedLinks',
|
|
7
|
+
eventType: 'track',
|
|
8
|
+
attributes: {
|
|
9
|
+
relatedLinksCount
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export const fireRelatedLinksLoadedEvent = createAnalyticsEvent => attributes => {
|
|
13
|
+
const payload = createTrackRelatedLinksLoadedEventPayload(attributes);
|
|
14
|
+
if (payload) {
|
|
15
|
+
createAnalyticsEvent({
|
|
16
|
+
...payload
|
|
17
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -2,10 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { di } from 'react-magnetic-di';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
6
|
import useRelatedUrls from '../../../../../state/hooks/use-related-urls';
|
|
6
7
|
import { RelatedUrlsBlockErroredView } from './errored';
|
|
7
8
|
import { RelatedUrlsResolvedView } from './resolved';
|
|
8
9
|
import { RelatedUrlsBlockResolvingView } from './resolving';
|
|
10
|
+
import { fireRelatedLinksLoadedEvent } from './analytics';
|
|
9
11
|
/**
|
|
10
12
|
* Represents a block to display related resources of a url
|
|
11
13
|
*/
|
|
@@ -15,6 +17,9 @@ const RelatedUrlsBlock = ({
|
|
|
15
17
|
renderers,
|
|
16
18
|
...blockProps
|
|
17
19
|
}) => {
|
|
20
|
+
const {
|
|
21
|
+
createAnalyticsEvent
|
|
22
|
+
} = useAnalyticsEvents();
|
|
18
23
|
const [loadingRelatedUrls, setLoadingRelatedUrls] = useState(true);
|
|
19
24
|
const [err, setErr] = useState();
|
|
20
25
|
const [relatedUrls, setRelatedUrls] = useState();
|
|
@@ -22,15 +27,23 @@ const RelatedUrlsBlock = ({
|
|
|
22
27
|
useEffect(() => {
|
|
23
28
|
const fetchRelatedUrls = async () => {
|
|
24
29
|
try {
|
|
30
|
+
var _relUrls$resolvedResu, _relUrls$resolvedResu2;
|
|
25
31
|
const relUrls = await getRelatedUrls(url);
|
|
26
32
|
setRelatedUrls(relUrls);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Fire TrackRelatedLinksLoadedEvent
|
|
36
|
+
*/
|
|
37
|
+
fireRelatedLinksLoadedEvent(createAnalyticsEvent)({
|
|
38
|
+
relatedLinksCount: (_relUrls$resolvedResu = (_relUrls$resolvedResu2 = relUrls.resolvedResults) === null || _relUrls$resolvedResu2 === void 0 ? void 0 : _relUrls$resolvedResu2.length) !== null && _relUrls$resolvedResu !== void 0 ? _relUrls$resolvedResu : 0
|
|
39
|
+
});
|
|
27
40
|
} catch (error) {
|
|
28
41
|
setErr(error);
|
|
29
42
|
}
|
|
30
43
|
setLoadingRelatedUrls(false);
|
|
31
44
|
};
|
|
32
45
|
fetchRelatedUrls();
|
|
33
|
-
}, [getRelatedUrls, url]);
|
|
46
|
+
}, [createAnalyticsEvent, getRelatedUrls, url]);
|
|
34
47
|
if (loadingRelatedUrls) {
|
|
35
48
|
return /*#__PURE__*/React.createElement(RelatedUrlsBlockResolvingView, _extends({
|
|
36
49
|
testId: `${testId}-resolving-view`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
4
4
|
import ChevronUpIcon from '@atlaskit/icon/glyph/chevron-up';
|
|
@@ -7,7 +7,7 @@ import { css } from '@emotion/react';
|
|
|
7
7
|
import { messages } from '../../../../../../../messages';
|
|
8
8
|
import { getFormattedMessageAsString } from '../../../../../components/utils';
|
|
9
9
|
import Text from '../../../../elements/text';
|
|
10
|
-
import
|
|
10
|
+
import ResolvedResultsStack from './resolved-result-stack';
|
|
11
11
|
const RelatedUrlList = ({
|
|
12
12
|
resolvedResults,
|
|
13
13
|
title,
|
|
@@ -19,17 +19,6 @@ const RelatedUrlList = ({
|
|
|
19
19
|
const chevronClickHandler = useCallback(() => setIsOpen(!isOpen), [isOpen]);
|
|
20
20
|
const ChevronComponent = isOpen ? ChevronUpIcon : ChevronDownIcon;
|
|
21
21
|
const intl = useIntl();
|
|
22
|
-
const resolvedResultsStack = useMemo(() => {
|
|
23
|
-
return /*#__PURE__*/React.createElement(Stack, {
|
|
24
|
-
space: "space.050",
|
|
25
|
-
testId: `${testId}-items-wrapper`
|
|
26
|
-
}, resolvedResults.map((resolvedResults, idx) => /*#__PURE__*/React.createElement(RelatedUrlItem, {
|
|
27
|
-
testId: `${testId}-item`,
|
|
28
|
-
key: idx,
|
|
29
|
-
results: resolvedResults,
|
|
30
|
-
renderers: renderers
|
|
31
|
-
})));
|
|
32
|
-
}, [renderers, resolvedResults, testId]);
|
|
33
22
|
return resolvedResults.length > 0 ? /*#__PURE__*/React.createElement(Stack, {
|
|
34
23
|
testId: testId,
|
|
35
24
|
xcss: xcss({
|
|
@@ -37,7 +26,11 @@ const RelatedUrlList = ({
|
|
|
37
26
|
})
|
|
38
27
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
39
28
|
onClick: chevronClickHandler,
|
|
40
|
-
testId: `${testId}-expand-title
|
|
29
|
+
testId: `${testId}-expand-title`,
|
|
30
|
+
as: "button",
|
|
31
|
+
backgroundColor: "color.background.neutral.subtle",
|
|
32
|
+
"aria-expanded": !!isOpen,
|
|
33
|
+
padding: "space.0"
|
|
41
34
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
42
35
|
alignBlock: "center",
|
|
43
36
|
spread: "space-between"
|
|
@@ -51,7 +44,11 @@ const RelatedUrlList = ({
|
|
|
51
44
|
}), /*#__PURE__*/React.createElement(ChevronComponent, {
|
|
52
45
|
label: getFormattedMessageAsString(intl, title),
|
|
53
46
|
size: 'medium'
|
|
54
|
-
}))), isOpen &&
|
|
47
|
+
}))), isOpen && /*#__PURE__*/React.createElement(ResolvedResultsStack, {
|
|
48
|
+
resolvedResults: resolvedResults,
|
|
49
|
+
testId: testId,
|
|
50
|
+
renderers: renderers
|
|
51
|
+
})) : /*#__PURE__*/React.createElement(Text, {
|
|
55
52
|
testId: testId,
|
|
56
53
|
message: {
|
|
57
54
|
descriptor: messages.related_work_items_not_found
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
import { Inline } from '@atlaskit/primitives';
|
|
4
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
5
|
import { SmartLinkSize } from '../../../../../../../../constants';
|
|
5
6
|
import extractFlexibleUiContext from '../../../../../../../../extractors/flexible';
|
|
6
7
|
import Icon from '../../../../../elements/icon';
|
|
7
8
|
import Link from '../../../../../elements/link';
|
|
9
|
+
import { fireLinkClickedEvent } from '../../../../../../../../utils/analytics/click';
|
|
8
10
|
const RelatedUrlItem = ({
|
|
9
11
|
results,
|
|
10
12
|
renderers,
|
|
11
13
|
testId
|
|
12
14
|
}) => {
|
|
15
|
+
const {
|
|
16
|
+
createAnalyticsEvent
|
|
17
|
+
} = useAnalyticsEvents();
|
|
13
18
|
const flexibleDataContext = useMemo(() => extractFlexibleUiContext({
|
|
14
19
|
response: results,
|
|
15
20
|
renderers
|
|
16
21
|
}), [renderers, results]);
|
|
22
|
+
const onClick = useCallback(event => {
|
|
23
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
24
|
+
}, [createAnalyticsEvent]);
|
|
17
25
|
return /*#__PURE__*/React.createElement(Inline, {
|
|
18
26
|
alignBlock: "center",
|
|
19
27
|
space: "space.050",
|
|
@@ -26,7 +34,8 @@ const RelatedUrlItem = ({
|
|
|
26
34
|
text: flexibleDataContext === null || flexibleDataContext === void 0 ? void 0 : flexibleDataContext.title,
|
|
27
35
|
url: flexibleDataContext === null || flexibleDataContext === void 0 ? void 0 : flexibleDataContext.url,
|
|
28
36
|
size: SmartLinkSize.Small,
|
|
29
|
-
maxLines: 1
|
|
37
|
+
maxLines: 1,
|
|
38
|
+
onClick: onClick
|
|
30
39
|
}));
|
|
31
40
|
};
|
|
32
41
|
export default RelatedUrlItem;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { getResolvedAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../../../../../../../utils/analytics';
|
|
5
|
+
const createUiRelatedLinksViewedEventPayload = ({
|
|
6
|
+
relatedLinksCount
|
|
7
|
+
}) => ({
|
|
8
|
+
action: 'viewed',
|
|
9
|
+
actionSubject: 'relatedLinks',
|
|
10
|
+
eventType: 'ui',
|
|
11
|
+
attributes: {
|
|
12
|
+
relatedLinksCount
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export const fireRelatedLinksViewedEvent = createAnalyticsEvent => attributes => {
|
|
16
|
+
const payload = createUiRelatedLinksViewedEventPayload(attributes);
|
|
17
|
+
if (payload) {
|
|
18
|
+
createAnalyticsEvent({
|
|
19
|
+
...payload
|
|
20
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const RelatedUrlItemAnalyticsContext = props => {
|
|
24
|
+
const {
|
|
25
|
+
children,
|
|
26
|
+
details
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* We don't really need the `url` to get the attributes here so set
|
|
31
|
+
* it to an empty string to just make typescript happy
|
|
32
|
+
*/
|
|
33
|
+
const attributes = getResolvedAttributes({
|
|
34
|
+
url: ''
|
|
35
|
+
}, details);
|
|
36
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
37
|
+
data: {
|
|
38
|
+
attributes,
|
|
39
|
+
component: 'relatedLink'
|
|
40
|
+
}
|
|
41
|
+
}, children);
|
|
42
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Stack, xcss } from '@atlaskit/primitives';
|
|
3
|
+
import { AnalyticsContext, useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
+
import RelatedUrlItem from '../related-url-item';
|
|
5
|
+
import { RelatedUrlItemAnalyticsContext, fireRelatedLinksViewedEvent } from './analytics';
|
|
6
|
+
const ResolvedResultsStack = ({
|
|
7
|
+
resolvedResults,
|
|
8
|
+
testId,
|
|
9
|
+
renderers
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
createAnalyticsEvent
|
|
13
|
+
} = useAnalyticsEvents();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
// This event will fire each time the component is loaded
|
|
16
|
+
fireRelatedLinksViewedEvent(createAnalyticsEvent)({
|
|
17
|
+
relatedLinksCount: resolvedResults.length
|
|
18
|
+
});
|
|
19
|
+
}, [resolvedResults.length, createAnalyticsEvent]);
|
|
20
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
21
|
+
space: "space.050",
|
|
22
|
+
testId: `${testId}-items-wrapper`,
|
|
23
|
+
as: "ul",
|
|
24
|
+
xcss: xcss({
|
|
25
|
+
paddingLeft: '0px',
|
|
26
|
+
marginTop: '0px'
|
|
27
|
+
})
|
|
28
|
+
}, resolvedResults.map((resolvedResults, idx) => /*#__PURE__*/React.createElement(RelatedUrlItemAnalyticsContext, {
|
|
29
|
+
details: resolvedResults,
|
|
30
|
+
key: idx
|
|
31
|
+
}, /*#__PURE__*/React.createElement(RelatedUrlItem, {
|
|
32
|
+
testId: `${testId}-item`,
|
|
33
|
+
results: resolvedResults,
|
|
34
|
+
renderers: renderers
|
|
35
|
+
}))));
|
|
36
|
+
};
|
|
37
|
+
const ResolvedResultsStackWithAnalytics = props => {
|
|
38
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
39
|
+
data: {
|
|
40
|
+
component: 'relatedLinksSection'
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(ResolvedResultsStack, props));
|
|
43
|
+
};
|
|
44
|
+
export default ResolvedResultsStackWithAnalytics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.
|
|
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.
|
|
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,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../../../../utils/analytics';
|
|
5
|
+
var createTrackRelatedLinksLoadedEventPayload = function createTrackRelatedLinksLoadedEventPayload(_ref) {
|
|
6
|
+
var relatedLinksCount = _ref.relatedLinksCount;
|
|
7
|
+
return {
|
|
8
|
+
action: 'loaded',
|
|
9
|
+
actionSubject: 'relatedLinks',
|
|
10
|
+
eventType: 'track',
|
|
11
|
+
attributes: {
|
|
12
|
+
relatedLinksCount: relatedLinksCount
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export var fireRelatedLinksLoadedEvent = function fireRelatedLinksLoadedEvent(createAnalyticsEvent) {
|
|
17
|
+
return function (attributes) {
|
|
18
|
+
var payload = createTrackRelatedLinksLoadedEventPayload(attributes);
|
|
19
|
+
if (payload) {
|
|
20
|
+
createAnalyticsEvent(_objectSpread({}, payload)).fire(ANALYTICS_CHANNEL);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -9,10 +9,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
9
9
|
import React, { useEffect, useState } from 'react';
|
|
10
10
|
import { di } from 'react-magnetic-di';
|
|
11
11
|
import { css } from '@emotion/react';
|
|
12
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
13
|
import useRelatedUrls from '../../../../../state/hooks/use-related-urls';
|
|
13
14
|
import { RelatedUrlsBlockErroredView } from './errored';
|
|
14
15
|
import { RelatedUrlsResolvedView } from './resolved';
|
|
15
16
|
import { RelatedUrlsBlockResolvingView } from './resolving';
|
|
17
|
+
import { fireRelatedLinksLoadedEvent } from './analytics';
|
|
16
18
|
/**
|
|
17
19
|
* Represents a block to display related resources of a url
|
|
18
20
|
*/
|
|
@@ -22,6 +24,8 @@ var RelatedUrlsBlock = function RelatedUrlsBlock(_ref) {
|
|
|
22
24
|
url = _ref.url,
|
|
23
25
|
renderers = _ref.renderers,
|
|
24
26
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
28
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
25
29
|
var _useState = useState(true),
|
|
26
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
31
|
loadingRelatedUrls = _useState2[0],
|
|
@@ -38,7 +42,7 @@ var RelatedUrlsBlock = function RelatedUrlsBlock(_ref) {
|
|
|
38
42
|
useEffect(function () {
|
|
39
43
|
var fetchRelatedUrls = /*#__PURE__*/function () {
|
|
40
44
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
41
|
-
var relUrls;
|
|
45
|
+
var _relUrls$resolvedResu, _relUrls$resolvedResu2, relUrls;
|
|
42
46
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
43
47
|
while (1) switch (_context.prev = _context.next) {
|
|
44
48
|
case 0:
|
|
@@ -48,26 +52,33 @@ var RelatedUrlsBlock = function RelatedUrlsBlock(_ref) {
|
|
|
48
52
|
case 3:
|
|
49
53
|
relUrls = _context.sent;
|
|
50
54
|
setRelatedUrls(relUrls);
|
|
51
|
-
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Fire TrackRelatedLinksLoadedEvent
|
|
58
|
+
*/
|
|
59
|
+
fireRelatedLinksLoadedEvent(createAnalyticsEvent)({
|
|
60
|
+
relatedLinksCount: (_relUrls$resolvedResu = (_relUrls$resolvedResu2 = relUrls.resolvedResults) === null || _relUrls$resolvedResu2 === void 0 ? void 0 : _relUrls$resolvedResu2.length) !== null && _relUrls$resolvedResu !== void 0 ? _relUrls$resolvedResu : 0
|
|
61
|
+
});
|
|
62
|
+
_context.next = 11;
|
|
52
63
|
break;
|
|
53
|
-
case
|
|
54
|
-
_context.prev =
|
|
64
|
+
case 8:
|
|
65
|
+
_context.prev = 8;
|
|
55
66
|
_context.t0 = _context["catch"](0);
|
|
56
67
|
setErr(_context.t0);
|
|
57
|
-
case 10:
|
|
58
|
-
setLoadingRelatedUrls(false);
|
|
59
68
|
case 11:
|
|
69
|
+
setLoadingRelatedUrls(false);
|
|
70
|
+
case 12:
|
|
60
71
|
case "end":
|
|
61
72
|
return _context.stop();
|
|
62
73
|
}
|
|
63
|
-
}, _callee, null, [[0,
|
|
74
|
+
}, _callee, null, [[0, 8]]);
|
|
64
75
|
}));
|
|
65
76
|
return function fetchRelatedUrls() {
|
|
66
77
|
return _ref2.apply(this, arguments);
|
|
67
78
|
};
|
|
68
79
|
}();
|
|
69
80
|
fetchRelatedUrls();
|
|
70
|
-
}, [getRelatedUrls, url]);
|
|
81
|
+
}, [createAnalyticsEvent, getRelatedUrls, url]);
|
|
71
82
|
if (loadingRelatedUrls) {
|
|
72
83
|
return /*#__PURE__*/React.createElement(RelatedUrlsBlockResolvingView, _extends({
|
|
73
84
|
testId: "".concat(testId, "-resolving-view")
|