@contentful/field-editor-reference 4.2.0 → 4.2.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 +18 -0
- package/dist/field-editor-reference.cjs.development.js +23 -9
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +23 -9
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -2301,13 +2301,14 @@ function useEditorPermissions(props) {
|
|
|
2301
2301
|
|
|
2302
2302
|
function _checkLinkAccess() {
|
|
2303
2303
|
_checkLinkAccess = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
2304
|
-
var canRead;
|
|
2304
|
+
var canRead, _canRead;
|
|
2305
|
+
|
|
2305
2306
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2306
2307
|
while (1) {
|
|
2307
2308
|
switch (_context2.prev = _context2.next) {
|
|
2308
2309
|
case 0:
|
|
2309
2310
|
if (!(entityType === 'Asset')) {
|
|
2310
|
-
_context2.next =
|
|
2311
|
+
_context2.next = 8;
|
|
2311
2312
|
break;
|
|
2312
2313
|
}
|
|
2313
2314
|
|
|
@@ -2315,15 +2316,28 @@ function useEditorPermissions(props) {
|
|
|
2315
2316
|
return canPerformAction('read', 'Asset');
|
|
2316
2317
|
|
|
2317
2318
|
case 3:
|
|
2318
|
-
|
|
2319
|
+
_context2.t0 = _context2.sent;
|
|
2320
|
+
|
|
2321
|
+
if (_context2.t0) {
|
|
2322
|
+
_context2.next = 6;
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
_context2.t0 = true;
|
|
2327
|
+
|
|
2328
|
+
case 6:
|
|
2329
|
+
canRead = _context2.t0;
|
|
2319
2330
|
setCanLinkEntity(canRead);
|
|
2320
2331
|
|
|
2321
|
-
case
|
|
2332
|
+
case 8:
|
|
2322
2333
|
if (entityType === 'Entry') {
|
|
2323
|
-
|
|
2334
|
+
// Hardcoded `true` value following https://contentful.atlassian.net/browse/DANTE-486
|
|
2335
|
+
// TODO: refine permissions check in order to account for tags in rules
|
|
2336
|
+
_canRead = readableContentTypes.length > 0 || true;
|
|
2337
|
+
setCanLinkEntity(_canRead);
|
|
2324
2338
|
}
|
|
2325
2339
|
|
|
2326
|
-
case
|
|
2340
|
+
case 9:
|
|
2327
2341
|
case "end":
|
|
2328
2342
|
return _context2.stop();
|
|
2329
2343
|
}
|
|
@@ -2605,7 +2619,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2605
2619
|
switch (_context.prev = _context.next) {
|
|
2606
2620
|
case 0:
|
|
2607
2621
|
_context.next = 2;
|
|
2608
|
-
return openEntry(props.sdk,
|
|
2622
|
+
return openEntry(props.sdk, props.entryId, {
|
|
2609
2623
|
bulkEditing: props.parameters.instance.bulkEditing,
|
|
2610
2624
|
index: props.index
|
|
2611
2625
|
});
|
|
@@ -2615,7 +2629,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2615
2629
|
props.onAction && props.onAction({
|
|
2616
2630
|
entity: 'Entry',
|
|
2617
2631
|
type: 'edit',
|
|
2618
|
-
id:
|
|
2632
|
+
id: props.entryId,
|
|
2619
2633
|
contentTypeId: get(entry, 'sys.contentType.sys.id'),
|
|
2620
2634
|
slide: slide
|
|
2621
2635
|
});
|
|
@@ -2638,7 +2652,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2638
2652
|
props.onAction && props.onAction({
|
|
2639
2653
|
entity: 'Entry',
|
|
2640
2654
|
type: 'delete',
|
|
2641
|
-
id:
|
|
2655
|
+
id: props.entryId,
|
|
2642
2656
|
contentTypeId: get(entry, 'sys.contentType.sys.id')
|
|
2643
2657
|
});
|
|
2644
2658
|
};
|