@atlaskit/smart-card 27.4.1 → 27.4.3
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 +20 -0
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +100 -0
- package/dist/cjs/state/hooks/use-incoming-outgoing-links/query.js +11 -0
- package/dist/cjs/state/hooks/use-resolve/index.js +15 -120
- package/dist/cjs/state/hooks/use-response/index.js +132 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/EmptyState.js +41 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.js +62 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/index.js +22 -0
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/state/hooks/use-incoming-outgoing-links/index.js +44 -0
- package/dist/es2019/state/hooks/use-incoming-outgoing-links/query.js +23 -0
- package/dist/es2019/state/hooks/use-resolve/index.js +9 -112
- package/dist/es2019/state/hooks/use-response/index.js +126 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/EmptyState.js +35 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +54 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/index.js +13 -0
- package/dist/esm/messages.js +10 -0
- package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +93 -0
- package/dist/esm/state/hooks/use-incoming-outgoing-links/query.js +5 -0
- package/dist/esm/state/hooks/use-resolve/index.js +13 -118
- package/dist/esm/state/hooks/use-response/index.js +126 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/EmptyState.js +34 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +54 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/index.js +15 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/hooks/use-incoming-outgoing-links/index.d.ts +9 -0
- package/dist/types/state/hooks/use-incoming-outgoing-links/query.d.ts +5 -0
- package/dist/types/state/hooks/use-response/index.d.ts +7 -0
- package/dist/types/view/RelatedLinksModal/components/EmptyState.d.ts +9 -0
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +3 -0
- package/dist/types/view/RelatedLinksModal/views/errored/index.d.ts +2 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-incoming-outgoing-links/index.d.ts +9 -0
- package/dist/types-ts4.5/state/hooks/use-incoming-outgoing-links/query.d.ts +5 -0
- package/dist/types-ts4.5/state/hooks/use-response/index.d.ts +7 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/EmptyState.d.ts +9 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +3 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/index.d.ts +2 -0
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#102927](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102927)
|
|
8
|
+
[`f4ea3612f795`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f4ea3612f795) -
|
|
9
|
+
created errored view for related-links-modal component in smart cards
|
|
10
|
+
- [#104485](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104485)
|
|
11
|
+
[`7d88a35c15dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d88a35c15dd) -
|
|
12
|
+
Add a custom hook to make call to AGS to get incoming outgoing aris using
|
|
13
|
+
content-referenced-entity relationship
|
|
14
|
+
|
|
15
|
+
## 27.4.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#105240](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105240)
|
|
20
|
+
[`d54017d7086f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d54017d7086f) -
|
|
21
|
+
EDM-9896: separate useResponse hook from useResolveHook.
|
|
22
|
+
|
|
3
23
|
## 27.4.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -730,5 +730,15 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
730
730
|
id: 'fabric.linking.related_links_includes_links_to',
|
|
731
731
|
defaultMessage: 'Includes Links To',
|
|
732
732
|
description: 'Informs the user of the resources the url links to'
|
|
733
|
+
},
|
|
734
|
+
related_links_modal_error_header: {
|
|
735
|
+
id: 'fabric.linking.related_links_modal_error_header',
|
|
736
|
+
defaultMessage: 'Something went wrong',
|
|
737
|
+
description: 'Title for related links error'
|
|
738
|
+
},
|
|
739
|
+
related_links_modal_error_message: {
|
|
740
|
+
id: 'fabric.linking.related_links_modal_error_message',
|
|
741
|
+
defaultMessage: 'We ran into an issue trying to load recent links. Check your connection or refresh to try again.',
|
|
742
|
+
description: 'Informs the user that there was a problem loading related links'
|
|
733
743
|
}
|
|
734
744
|
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useIncomingOutgoingAri = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _linkingCommon = require("@atlaskit/linking-common");
|
|
12
|
+
var _query = require("./query");
|
|
13
|
+
/**
|
|
14
|
+
* @param baseUriWithNoTrailingSlash base url which will then be appended with /gateway/api/graphql to make requests to AGG
|
|
15
|
+
*/
|
|
16
|
+
var useIncomingOutgoingAri = exports.useIncomingOutgoingAri = function useIncomingOutgoingAri() {
|
|
17
|
+
var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
18
|
+
var aggRequestCall = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
19
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(body, headers) {
|
|
20
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
return _context.abrupt("return", (0, _linkingCommon.request)('post', baseUriWithNoTrailingSlash + '/gateway/api/graphql', body, headers, [200]));
|
|
24
|
+
case 1:
|
|
25
|
+
case "end":
|
|
26
|
+
return _context.stop();
|
|
27
|
+
}
|
|
28
|
+
}, _callee);
|
|
29
|
+
}));
|
|
30
|
+
return function (_x, _x2) {
|
|
31
|
+
return _ref.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
}(), [baseUriWithNoTrailingSlash]);
|
|
34
|
+
var getIncomingOutgoingAris = (0, _react.useCallback)(
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
/**
|
|
37
|
+
* Returning aris linking to (outgoing) and from (incoming) a given ari from AGS using
|
|
38
|
+
* https://developer.atlassian.com/cloud/ari-graph-store/relationships/content-referenced-entity/#query
|
|
39
|
+
* @param ari the ari for which the incoming outgoing aris are to be retrieved
|
|
40
|
+
* @param firstIncoming The maximum count of incoming relationships to fetch. Must not exceed 1000. This max limit is handled by AGG itself. Default is 50 (ORS batch max limit)
|
|
41
|
+
* @param firstOutgoing The maximum count of outgoing relationships to fetch. Must not exceed 1000. This max limit is handled by AGG itself. Default is 50 (ORS batch max limit)
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
function () {
|
|
45
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(ari) {
|
|
46
|
+
var _response$data$graphS, _response$data, _response$data$graphS2, _response$data2;
|
|
47
|
+
var firstIncoming,
|
|
48
|
+
firstOutgoing,
|
|
49
|
+
response,
|
|
50
|
+
incomingAris,
|
|
51
|
+
outgoingAris,
|
|
52
|
+
_args2 = arguments;
|
|
53
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
54
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
55
|
+
case 0:
|
|
56
|
+
firstIncoming = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 50;
|
|
57
|
+
firstOutgoing = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : 50;
|
|
58
|
+
_context2.next = 4;
|
|
59
|
+
return aggRequestCall({
|
|
60
|
+
variables: {
|
|
61
|
+
ids: [ari],
|
|
62
|
+
firstIncoming: firstIncoming,
|
|
63
|
+
firstOutgoing: firstOutgoing
|
|
64
|
+
},
|
|
65
|
+
query: _query.queryIncomingOutgoingLinks
|
|
66
|
+
});
|
|
67
|
+
case 4:
|
|
68
|
+
response = _context2.sent;
|
|
69
|
+
incomingAris = (_response$data$graphS = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.graphStore) === null || _response$data === void 0 || (_response$data = _response$data.incoming) === null || _response$data === void 0 || (_response$data = _response$data.nodes) === null || _response$data === void 0 || (_response$data = _response$data.map(function (node) {
|
|
70
|
+
var _node$from;
|
|
71
|
+
return node === null || node === void 0 || (_node$from = node.from) === null || _node$from === void 0 ? void 0 : _node$from.id;
|
|
72
|
+
})) === null || _response$data === void 0 ? void 0 : _response$data.filter(function (id) {
|
|
73
|
+
return !!id;
|
|
74
|
+
})) !== null && _response$data$graphS !== void 0 ? _response$data$graphS : [];
|
|
75
|
+
outgoingAris = (_response$data$graphS2 = response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.graphStore) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.outgoing) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.nodes) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.map(function (node) {
|
|
76
|
+
var _node$to;
|
|
77
|
+
return node === null || node === void 0 || (_node$to = node.to) === null || _node$to === void 0 ? void 0 : _node$to.id;
|
|
78
|
+
})) === null || _response$data2 === void 0 ? void 0 : _response$data2.filter(function (id) {
|
|
79
|
+
return !!id;
|
|
80
|
+
})) !== null && _response$data$graphS2 !== void 0 ? _response$data$graphS2 : [];
|
|
81
|
+
return _context2.abrupt("return", {
|
|
82
|
+
incomingAris: incomingAris,
|
|
83
|
+
outgoingAris: outgoingAris
|
|
84
|
+
});
|
|
85
|
+
case 8:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context2.stop();
|
|
88
|
+
}
|
|
89
|
+
}, _callee2);
|
|
90
|
+
}));
|
|
91
|
+
return function (_x3) {
|
|
92
|
+
return _ref2.apply(this, arguments);
|
|
93
|
+
};
|
|
94
|
+
}(), [aggRequestCall]);
|
|
95
|
+
return (0, _react.useMemo)(function () {
|
|
96
|
+
return {
|
|
97
|
+
getIncomingOutgoingAris: getIncomingOutgoingAris
|
|
98
|
+
};
|
|
99
|
+
}, [getIncomingOutgoingAris]);
|
|
100
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.queryIncomingOutgoingLinks = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* AGG query to retrieve incoming/outgoing links from AGS
|
|
9
|
+
* https://developer.atlassian.com/cloud/ari-graph-store/relationships/content-referenced-entity/#batch-query
|
|
10
|
+
*/
|
|
11
|
+
var queryIncomingOutgoingLinks = exports.queryIncomingOutgoingLinks = "\n query SmartCard_ContentReferencedEntityBatchQuery_V1($ids: [ID!]!, $firstIncoming: Int = 50, $firstOutgoing: Int = 50) {\n graphStore @optIn(to: \"GraphStore\") {\n incoming: contentReferencedEntityInverseBatch(ids: $ids, first: $firstIncoming) @optIn(to: \"GraphStoreContentReferencedEntity\") {\n nodes {\n from {\n id\n }\n }\n }\n outgoing: contentReferencedEntityBatch(ids: $ids, first: $firstOutgoing) @optIn(to: \"GraphStoreContentReferencedEntity\") {\n nodes {\n to {\n id\n }\n }\n }\n }\n }";
|
|
@@ -8,133 +8,28 @@ exports.default = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var _reactDom = require("react-dom");
|
|
12
11
|
var _analytics = require("../../analytics");
|
|
13
|
-
var
|
|
14
|
-
var _constants = require("../../actions/constants");
|
|
15
|
-
var _jsonld = require("../../../utils/jsonld");
|
|
16
|
-
var _constants2 = require("../../../constants");
|
|
12
|
+
var _constants = require("../../../constants");
|
|
17
13
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
|
+
var _useResponse2 = _interopRequireDefault(require("../use-response"));
|
|
18
15
|
var useResolve = function useResolve() {
|
|
19
16
|
// Request JSON-LD data for the card from ORS, if it has extended
|
|
20
17
|
// its cache lifespan OR there is no data for it currently. Once the data
|
|
21
|
-
// has come back asynchronously,
|
|
18
|
+
// has come back asynchronously, call the useResponse callback to
|
|
19
|
+
// dispatch the resolved action for the card.
|
|
22
20
|
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
23
21
|
store = _useSmartLinkContext.store,
|
|
24
|
-
connections = _useSmartLinkContext.connections
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var setMetadataStatus = (0, _react.useCallback)(function (url, metadataStatus) {
|
|
30
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_UPDATE_METADATA_STATUS, {
|
|
31
|
-
url: url
|
|
32
|
-
}, undefined, undefined, metadataStatus));
|
|
33
|
-
}, [dispatch]);
|
|
34
|
-
var handleResolvedLinkError = (0, _react.useCallback)(function (url, error, response, isMetadataRequest) {
|
|
35
|
-
var _ref = getState()[url] || {
|
|
36
|
-
status: _constants2.SmartLinkStatus.Pending,
|
|
37
|
-
details: undefined
|
|
38
|
-
},
|
|
39
|
-
details = _ref.details;
|
|
40
|
-
var hasData = !!(details && details.data);
|
|
41
|
-
|
|
42
|
-
// If metadata request then set metadata status, return and do not alter link status
|
|
43
|
-
if (isMetadataRequest) {
|
|
44
|
-
setMetadataStatus(url, 'errored');
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (error.kind === 'fatal') {
|
|
48
|
-
// If there's no previous data in the store for this URL, then bail
|
|
49
|
-
// out and let the editor handle fallbacks (returns to a blue link).
|
|
50
|
-
if (!hasData && status !== 'resolved') {
|
|
51
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR, {
|
|
52
|
-
url: url
|
|
53
|
-
}, details, error));
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
// If we already have resolved data for this URL in the store, then
|
|
57
|
-
// simply fallback to the previous data.
|
|
58
|
-
if (hasData) {
|
|
59
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
60
|
-
url: url
|
|
61
|
-
}, details));
|
|
62
|
-
}
|
|
63
|
-
// Handle AuthErrors (user did not have access to resource) -
|
|
64
|
-
// Missing AAID in ASAP claims, or missing UserContext, or 403 from downstream
|
|
65
|
-
} else if (error.kind === 'auth') {
|
|
66
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
67
|
-
url: url
|
|
68
|
-
}, (0, _jsonld.getUnauthorizedJsonLd)()));
|
|
69
|
-
} else {
|
|
70
|
-
if (error.kind === 'fallback') {
|
|
71
|
-
// Fallback to blue link with smart link formatting. Not part of reliability.
|
|
72
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR_FALLBACK, {
|
|
73
|
-
url: url
|
|
74
|
-
}, response, error));
|
|
75
|
-
} else {
|
|
76
|
-
// Fallback to blue link with smart link formatting. Part of reliability.
|
|
77
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR, {
|
|
78
|
-
url: url
|
|
79
|
-
}, undefined, error));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, [getState, setMetadataStatus, dispatch]);
|
|
83
|
-
var handleResolvedLinkSuccess = (0, _react.useCallback)(function (resourceUrl, response, isReloading, isMetadataRequest) {
|
|
84
|
-
//if a link resolves normally, metadata will also always be resolved
|
|
85
|
-
setMetadataStatus(resourceUrl, 'resolved');
|
|
86
|
-
// Dispatch Analytics and resolved card action - including unauthorized states.
|
|
87
|
-
if (isReloading) {
|
|
88
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RELOADING, {
|
|
89
|
-
url: resourceUrl
|
|
90
|
-
}, response));
|
|
91
|
-
} else {
|
|
92
|
-
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
93
|
-
url: resourceUrl
|
|
94
|
-
}, response, undefined, undefined, isMetadataRequest));
|
|
95
|
-
}
|
|
96
|
-
}, [setMetadataStatus, dispatch]);
|
|
97
|
-
var handleResolvedLinkResponse = (0, _react.useCallback)(function (resourceUrl, response) {
|
|
98
|
-
var isReloading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
99
|
-
var isMetadataRequest = arguments.length > 3 ? arguments[3] : undefined;
|
|
100
|
-
var hostname = new URL(resourceUrl).hostname;
|
|
101
|
-
var nextStatus = response ? (0, _linkingCommon.getStatus)(response) : 'fatal';
|
|
102
|
-
|
|
103
|
-
// If we require authorization & do not have an authFlow available,
|
|
104
|
-
// throw an error and render as a normal blue link.
|
|
105
|
-
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
106
|
-
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fallback', hostname, _constants.ERROR_MESSAGE_OAUTH), response, isMetadataRequest);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Handle any other errors
|
|
111
|
-
if (nextStatus === 'fatal') {
|
|
112
|
-
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fatal', hostname, _constants.ERROR_MESSAGE_FATAL), undefined, isMetadataRequest);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Handle errors of any other kind in the metadata request response
|
|
117
|
-
if (isMetadataRequest && nextStatus !== 'resolved') {
|
|
118
|
-
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('error', hostname, _constants.ERROR_MESSAGE_METADATA), response, isMetadataRequest);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Using unstable_batchedUpdates because this store update happens async and trigers a rerender
|
|
124
|
-
* more info:
|
|
125
|
-
* https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
|
|
126
|
-
* https://react-redux.js.org/api/batch
|
|
127
|
-
*/
|
|
128
|
-
(0, _reactDom.unstable_batchedUpdates)(function () {
|
|
129
|
-
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
130
|
-
});
|
|
131
|
-
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
22
|
+
connections = _useSmartLinkContext.connections;
|
|
23
|
+
var getState = store.getState;
|
|
24
|
+
var _useResponse = (0, _useResponse2.default)(),
|
|
25
|
+
handleResolvedLinkResponse = _useResponse.handleResolvedLinkResponse,
|
|
26
|
+
handleResolvedLinkError = _useResponse.handleResolvedLinkError;
|
|
132
27
|
return (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
133
|
-
var
|
|
28
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url) {
|
|
134
29
|
var isReloading,
|
|
135
30
|
isMetadataRequest,
|
|
136
31
|
id,
|
|
137
|
-
|
|
32
|
+
_ref2,
|
|
138
33
|
details,
|
|
139
34
|
hasData,
|
|
140
35
|
_args = arguments;
|
|
@@ -144,10 +39,10 @@ var useResolve = function useResolve() {
|
|
|
144
39
|
isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
145
40
|
isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
146
41
|
id = _args.length > 3 && _args[3] !== undefined ? _args[3] : '';
|
|
147
|
-
|
|
148
|
-
status:
|
|
42
|
+
_ref2 = getState()[url] || {
|
|
43
|
+
status: _constants.SmartLinkStatus.Pending,
|
|
149
44
|
details: undefined
|
|
150
|
-
}, details =
|
|
45
|
+
}, details = _ref2.details;
|
|
151
46
|
hasData = !!(details && details.data);
|
|
152
47
|
if (!(isReloading || !hasData || isMetadataRequest)) {
|
|
153
48
|
_context.next = 9;
|
|
@@ -169,7 +64,7 @@ var useResolve = function useResolve() {
|
|
|
169
64
|
}, _callee);
|
|
170
65
|
}));
|
|
171
66
|
return function (_x) {
|
|
172
|
-
return
|
|
67
|
+
return _ref.apply(this, arguments);
|
|
173
68
|
};
|
|
174
69
|
}(), [connections.client, getState, handleResolvedLinkError, handleResolvedLinkResponse]);
|
|
175
70
|
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _linkingCommon = require("@atlaskit/linking-common");
|
|
9
|
+
var _constants = require("../../../constants");
|
|
10
|
+
var _jsonld = require("../../../utils/jsonld");
|
|
11
|
+
var _constants2 = require("../../actions/constants");
|
|
12
|
+
var _reactDom = require("react-dom");
|
|
13
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
|
+
var useResponse = function useResponse() {
|
|
15
|
+
// Takes in the JSON-LD response and dispatch the resolved action for the card.
|
|
16
|
+
// It will dispatch a successful or error action
|
|
17
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
18
|
+
store = _useSmartLinkContext.store,
|
|
19
|
+
config = _useSmartLinkContext.config;
|
|
20
|
+
var getState = store.getState,
|
|
21
|
+
dispatch = store.dispatch;
|
|
22
|
+
var hasAuthFlowSupported = config.authFlow !== 'disabled';
|
|
23
|
+
var setMetadataStatus = (0, _react.useCallback)(function (url, metadataStatus) {
|
|
24
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_UPDATE_METADATA_STATUS, {
|
|
25
|
+
url: url
|
|
26
|
+
}, undefined, undefined, metadataStatus));
|
|
27
|
+
}, [dispatch]);
|
|
28
|
+
var handleResolvedLinkError = (0, _react.useCallback)(function (url, error, response, isMetadataRequest) {
|
|
29
|
+
var _ref = getState()[url] || {
|
|
30
|
+
status: _constants.SmartLinkStatus.Pending,
|
|
31
|
+
details: undefined
|
|
32
|
+
},
|
|
33
|
+
details = _ref.details;
|
|
34
|
+
var hasData = !!(details && details.data);
|
|
35
|
+
// If metadata request then set metadata status, return and do not alter link status
|
|
36
|
+
if (isMetadataRequest) {
|
|
37
|
+
setMetadataStatus(url, 'errored');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (error.kind === 'fatal') {
|
|
41
|
+
// If there's no previous data in the store for this URL, then bail
|
|
42
|
+
// out and let the editor handle fallbacks (returns to a blue link).
|
|
43
|
+
if (!hasData && status !== 'resolved') {
|
|
44
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR, {
|
|
45
|
+
url: url
|
|
46
|
+
}, details, error));
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
// If we already have resolved data for this URL in the store, then
|
|
50
|
+
// simply fallback to the previous data.
|
|
51
|
+
if (hasData) {
|
|
52
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
53
|
+
url: url
|
|
54
|
+
}, details));
|
|
55
|
+
}
|
|
56
|
+
// Handle AuthErrors (user did not have access to resource) -
|
|
57
|
+
// Missing AAID in ASAP claims, or missing UserContext, or 403 from downstream
|
|
58
|
+
} else if (error.kind === 'auth') {
|
|
59
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
60
|
+
url: url
|
|
61
|
+
}, (0, _jsonld.getUnauthorizedJsonLd)()));
|
|
62
|
+
} else {
|
|
63
|
+
if (error.kind === 'fallback') {
|
|
64
|
+
// Fallback to blue link with smart link formatting. Not part of reliability.
|
|
65
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR_FALLBACK, {
|
|
66
|
+
url: url
|
|
67
|
+
}, response, error));
|
|
68
|
+
} else {
|
|
69
|
+
// Fallback to blue link with smart link formatting. Part of reliability.
|
|
70
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR, {
|
|
71
|
+
url: url
|
|
72
|
+
}, undefined, error));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [getState, setMetadataStatus, dispatch]);
|
|
76
|
+
var handleResolvedLinkSuccess = (0, _react.useCallback)(function (resourceUrl, response, isReloading, isMetadataRequest) {
|
|
77
|
+
//if a link resolves normally, metadata will also always be resolved
|
|
78
|
+
setMetadataStatus(resourceUrl, 'resolved');
|
|
79
|
+
// Dispatch Analytics and resolved card action - including unauthorized states.
|
|
80
|
+
if (isReloading) {
|
|
81
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RELOADING, {
|
|
82
|
+
url: resourceUrl
|
|
83
|
+
}, response));
|
|
84
|
+
} else {
|
|
85
|
+
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_RESOLVED, {
|
|
86
|
+
url: resourceUrl
|
|
87
|
+
}, response, undefined, undefined, isMetadataRequest));
|
|
88
|
+
}
|
|
89
|
+
}, [setMetadataStatus, dispatch]);
|
|
90
|
+
var handleResolvedLinkResponse = (0, _react.useCallback)(function (resourceUrl, response) {
|
|
91
|
+
var isReloading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
92
|
+
var isMetadataRequest = arguments.length > 3 ? arguments[3] : undefined;
|
|
93
|
+
var hostname = new URL(resourceUrl).hostname;
|
|
94
|
+
var nextStatus = response ? (0, _linkingCommon.getStatus)(response) : 'fatal';
|
|
95
|
+
|
|
96
|
+
// If we require authorization & do not have an authFlow available,
|
|
97
|
+
// throw an error and render as a normal blue link.
|
|
98
|
+
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
99
|
+
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fallback', hostname, _constants2.ERROR_MESSAGE_OAUTH), response, isMetadataRequest);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Handle any other errors
|
|
104
|
+
if (nextStatus === 'fatal') {
|
|
105
|
+
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fatal', hostname, _constants2.ERROR_MESSAGE_FATAL), undefined, isMetadataRequest);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Handle errors of any other kind in the metadata request response
|
|
110
|
+
if (isMetadataRequest && nextStatus !== 'resolved') {
|
|
111
|
+
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('error', hostname, _constants2.ERROR_MESSAGE_METADATA), response, isMetadataRequest);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Using unstable_batchedUpdates because this store update happens async and triggers a rerender
|
|
117
|
+
* more info:
|
|
118
|
+
* https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
|
|
119
|
+
* https://react-redux.js.org/api/batch
|
|
120
|
+
*/
|
|
121
|
+
(0, _reactDom.unstable_batchedUpdates)(function () {
|
|
122
|
+
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
123
|
+
});
|
|
124
|
+
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
125
|
+
return (0, _react.useMemo)(function () {
|
|
126
|
+
return {
|
|
127
|
+
handleResolvedLinkError: handleResolvedLinkError,
|
|
128
|
+
handleResolvedLinkResponse: handleResolvedLinkResponse
|
|
129
|
+
};
|
|
130
|
+
}, [handleResolvedLinkError, handleResolvedLinkResponse]);
|
|
131
|
+
};
|
|
132
|
+
var _default = exports.default = useResponse;
|
|
@@ -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: "27.4.
|
|
25
|
+
packageVersion: "27.4.3"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -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: "27.4.
|
|
20
|
+
packageVersion: "27.4.3",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.EmptyState = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
10
|
+
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
var emptyStateStyles = (0, _primitives.xcss)({
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
gap: "space.100",
|
|
16
|
+
height: '100%',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
marginLeft: 'space.300',
|
|
19
|
+
marginRight: 'space.300',
|
|
20
|
+
textAlign: 'center'
|
|
21
|
+
});
|
|
22
|
+
var descriptionStyles = (0, _primitives.xcss)({
|
|
23
|
+
marginTop: "var(--ds-space-0, 0px)",
|
|
24
|
+
marginBottom: "var(--ds-space-300, 24px)",
|
|
25
|
+
color: 'color.text'
|
|
26
|
+
});
|
|
27
|
+
var EmptyState = exports.EmptyState = function EmptyState(_ref) {
|
|
28
|
+
var testId = _ref.testId,
|
|
29
|
+
header = _ref.header,
|
|
30
|
+
description = _ref.description,
|
|
31
|
+
renderImage = _ref.renderImage;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
33
|
+
xcss: emptyStateStyles,
|
|
34
|
+
testId: testId
|
|
35
|
+
}, renderImage === null || renderImage === void 0 ? void 0 : renderImage(), /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
36
|
+
size: "small"
|
|
37
|
+
}, header), description && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
38
|
+
as: "p",
|
|
39
|
+
xcss: descriptionStyles
|
|
40
|
+
}, description));
|
|
41
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ErrorSVG = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
12
|
+
var errorStyles = (0, _react.css)({
|
|
13
|
+
width: '80px',
|
|
14
|
+
margin: "0 auto ".concat("var(--ds-space-300, 24px)"),
|
|
15
|
+
display: 'block'
|
|
16
|
+
});
|
|
17
|
+
var ErrorSVG = exports.ErrorSVG = function ErrorSVG(props) {
|
|
18
|
+
var id = 'related-links-error-svg';
|
|
19
|
+
return (0, _react.jsx)("svg", (0, _extends2.default)({
|
|
20
|
+
"data-testid": id,
|
|
21
|
+
viewBox: "0 0 164 212",
|
|
22
|
+
fill: "none",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
css: errorStyles
|
|
25
|
+
}, props), (0, _react.jsx)("path", {
|
|
26
|
+
d: "m95.43 74.16 66.44 115.08c5.84 10.12-1.46 22.76-13.14 22.76H15.85c-11.68 0-18.98-12.65-13.14-22.76L69.15 74.16c5.84-10.12 20.44-10.12 26.28 0Zm-7.56 83.55 2.88-44.35c.34-5.29-3.86-9.78-9.16-9.78-5.31 0-9.51 4.48-9.16 9.78l2.88 44.35a6.3 6.3 0 0 0 6.28 5.89c3.31 0 6.06-2.58 6.28-5.89Zm-15.84 23.54c0 5.66 4.76 10.1 10.39 9.58 4.85-.45 8.73-4.5 8.83-9.37.11-5.45-4.31-9.94-9.73-9.94-5.23-.01-9.49 4.37-9.49 9.73Z",
|
|
27
|
+
fill: "url(#".concat(id, ")")
|
|
28
|
+
}), (0, _react.jsx)("path", {
|
|
29
|
+
opacity: ".6",
|
|
30
|
+
d: "M93.35 27.17 85.94.45c-.17-.62-1.07-.58-1.19.05l-4.66 25.1-5.8-1.08a.612.612 0 0 0-.7.76L81 52c.17.62 1.07.58 1.19-.05l4.66-25.1 5.8 1.08c.45.08.82-.33.7-.76ZM66.77 41.81 55.9 33.26c-.22-.18-.53.07-.41.33l5.53 11.43-2.66 1.29c-.18.09-.2.33-.05.45l10.87 8.55c.22.18.53-.07.41-.33l-5.53-11.43 2.66-1.29c.17-.08.2-.33.05-.45Z",
|
|
31
|
+
fill: "#C1C7D0"
|
|
32
|
+
}), (0, _react.jsx)("path", {
|
|
33
|
+
opacity: ".6",
|
|
34
|
+
d: "M102.78 56.75a.993.993 0 0 1-.92-1.38c-.24-.77-2.29-2.85-3.54-4.11-2.97-3.01-4.93-5-3.84-6.49 1.09-1.48 3.58-.22 7.35 1.7 1.32.67 3.35 1.7 4.45 2.03-.64-.95-2.24-2.58-3.28-3.63-2.97-3.01-4.93-5-3.84-6.49 1.08-1.48 3.58-.22 7.34 1.7 1.32.67 3.34 1.7 4.45 2.03-.64-.95-2.24-2.57-3.28-3.62-2.97-3.01-4.93-5-3.84-6.49 1.08-1.48 3.57-.22 7.34 1.7 1.58.8 4.18 2.13 4.98 2.13a1.005 1.005 0 0 1 1.46 1.36c-1.09 1.48-3.57.22-7.34-1.7-1.32-.67-3.34-1.7-4.44-2.03.64.95 2.24 2.57 3.28 3.62 2.97 3.01 4.93 5 3.84 6.49-1.08 1.48-3.57.22-7.34-1.7-1.32-.67-3.35-1.7-4.45-2.03.64.95 2.24 2.57 3.28 3.63 2.97 3.01 4.93 5 3.84 6.49-1.09 1.48-3.58.22-7.35-1.7-1.32-.67-3.35-1.71-4.45-2.03.64.95 2.24 2.58 3.28 3.63 2.97 3.01 4.93 5 3.84 6.49-.21.26-.51.4-.82.4Zm5.56 14.32c-.35 0-.69-.19-.88-.52-1.04-1.88-2.22-4.02-.91-5.21 1.31-1.2 3.34.18 5.49 1.63.87.59 2.26 1.53 2.93 1.71-.12-.68-.93-2.15-1.45-3.07-1.26-2.27-2.45-4.41-1.14-5.61 1.31-1.2 3.34.18 5.49 1.63.96.65 2.54 1.72 3.1 1.74a1 1 0 0 1 1.27 1.54c-1.31 1.2-3.34-.17-5.49-1.63-.87-.59-2.26-1.53-2.93-1.71.12.68.93 2.15 1.45 3.07 1.26 2.27 2.45 4.41 1.14 5.61-1.31 1.2-3.34-.18-5.49-1.63-.87-.59-2.26-1.53-2.93-1.71.12.68.93 2.14 1.22 2.67.27.48.09 1.09-.39 1.36-.15.09-.32.13-.48.13Zm-54.32-2.89c-.22 0-.44-.04-.67-.14-1.64-.69-1.24-3.11-.81-5.67.17-1.04.45-2.7.33-3.38-.57.39-1.56 1.75-2.18 2.6-1.53 2.09-2.99 4.07-4.62 3.38a.991.991 0 0 1-.53-1.31c.2-.48.73-.72 1.21-.57.52-.21 1.65-1.75 2.34-2.68 1.53-2.09 2.98-4.08 4.62-3.38 1.64.69 1.24 3.11.81 5.67-.17 1.04-.45 2.7-.33 3.38.57-.39 1.56-1.75 2.18-2.6 1.53-2.09 2.98-4.08 4.62-3.38 1.63.69 1.24 3.09.89 5.21-.09.54-.6.91-1.15.83-.54-.09-.92-.6-.83-1.15.1-.59.37-2.24.26-2.92-.57.39-1.56 1.75-2.18 2.6-1.33 1.79-2.59 3.51-3.96 3.51Z",
|
|
35
|
+
fill: "#B3BAC5"
|
|
36
|
+
}), (0, _react.jsx)("defs", null, (0, _react.jsx)("linearGradient", {
|
|
37
|
+
id: id,
|
|
38
|
+
x1: "26.169",
|
|
39
|
+
y1: "228.621",
|
|
40
|
+
x2: "138.408",
|
|
41
|
+
y2: "116.382",
|
|
42
|
+
gradientUnits: "userSpaceOnUse"
|
|
43
|
+
}, (0, _react.jsx)("stop", {
|
|
44
|
+
stopColor: "#C1C7D0"
|
|
45
|
+
}), (0, _react.jsx)("stop", {
|
|
46
|
+
offset: ".297",
|
|
47
|
+
stopColor: "#C6CBD4",
|
|
48
|
+
stopOpacity: ".881"
|
|
49
|
+
}), (0, _react.jsx)("stop", {
|
|
50
|
+
offset: ".63",
|
|
51
|
+
stopColor: "#D3D7DE",
|
|
52
|
+
stopOpacity: ".748"
|
|
53
|
+
}), (0, _react.jsx)("stop", {
|
|
54
|
+
offset: ".98",
|
|
55
|
+
stopColor: "#E9EBEF",
|
|
56
|
+
stopOpacity: ".608"
|
|
57
|
+
}), (0, _react.jsx)("stop", {
|
|
58
|
+
offset: "1",
|
|
59
|
+
stopColor: "#EBECF0",
|
|
60
|
+
stopOpacity: ".6"
|
|
61
|
+
}))));
|
|
62
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RelatedLinksErroredView = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _messages = require("../../../../messages");
|
|
11
|
+
var _errorSvg = require("./error-svg");
|
|
12
|
+
var _EmptyState = require("../../components/EmptyState");
|
|
13
|
+
var RelatedLinksErroredView = exports.RelatedLinksErroredView = function RelatedLinksErroredView() {
|
|
14
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_EmptyState.EmptyState, {
|
|
16
|
+
renderImage: function renderImage() {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_errorSvg.ErrorSVG, null);
|
|
18
|
+
},
|
|
19
|
+
header: intl.formatMessage(_messages.messages.related_links_modal_error_header),
|
|
20
|
+
description: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.related_links_modal_error_message)
|
|
21
|
+
});
|
|
22
|
+
};
|
package/dist/es2019/messages.js
CHANGED
|
@@ -724,5 +724,15 @@ export const messages = defineMessages({
|
|
|
724
724
|
id: 'fabric.linking.related_links_includes_links_to',
|
|
725
725
|
defaultMessage: 'Includes Links To',
|
|
726
726
|
description: 'Informs the user of the resources the url links to'
|
|
727
|
+
},
|
|
728
|
+
related_links_modal_error_header: {
|
|
729
|
+
id: 'fabric.linking.related_links_modal_error_header',
|
|
730
|
+
defaultMessage: 'Something went wrong',
|
|
731
|
+
description: 'Title for related links error'
|
|
732
|
+
},
|
|
733
|
+
related_links_modal_error_message: {
|
|
734
|
+
id: 'fabric.linking.related_links_modal_error_message',
|
|
735
|
+
defaultMessage: 'We ran into an issue trying to load recent links. Check your connection or refresh to try again.',
|
|
736
|
+
description: 'Informs the user that there was a problem loading related links'
|
|
727
737
|
}
|
|
728
738
|
});
|