@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 CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.2.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.2.2...@contentful/field-editor-reference@4.2.3) (2022-04-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - always show link existing button to account for tag based permissions [ZEND-1864] ([#1107](https://github.com/contentful/field-editors/issues/1107)) ([3b4ca1f](https://github.com/contentful/field-editors/commit/3b4ca1f2acca530cceab659346fe7769757d90f4))
11
+
12
+ ## [4.2.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.2.1...@contentful/field-editor-reference@4.2.2) (2022-03-31)
13
+
14
+ ### Bug Fixes
15
+
16
+ - pass already known entry link id to onAction ([#1089](https://github.com/contentful/field-editors/issues/1089)) ([5b30d2f](https://github.com/contentful/field-editors/commit/5b30d2fade2edce5c99956108167aa5732b9bfbb))
17
+
18
+ ## [4.2.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.2.0...@contentful/field-editor-reference@4.2.1) (2022-03-29)
19
+
20
+ ### Bug Fixes
21
+
22
+ - allow linking assets on permission rule with tags ([#1085](https://github.com/contentful/field-editors/issues/1085)) ([d7465d0](https://github.com/contentful/field-editors/commit/d7465d05ecc2674c3e10c927c6f2f414adb5df04))
23
+
6
24
  # [4.2.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.1.2...@contentful/field-editor-reference@4.2.0) (2022-03-02)
7
25
 
8
26
  ### Features
@@ -2308,13 +2308,14 @@ function useEditorPermissions(props) {
2308
2308
 
2309
2309
  function _checkLinkAccess() {
2310
2310
  _checkLinkAccess = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
2311
- var canRead;
2311
+ var canRead, _canRead;
2312
+
2312
2313
  return runtime_1.wrap(function _callee2$(_context2) {
2313
2314
  while (1) {
2314
2315
  switch (_context2.prev = _context2.next) {
2315
2316
  case 0:
2316
2317
  if (!(entityType === 'Asset')) {
2317
- _context2.next = 5;
2318
+ _context2.next = 8;
2318
2319
  break;
2319
2320
  }
2320
2321
 
@@ -2322,15 +2323,28 @@ function useEditorPermissions(props) {
2322
2323
  return canPerformAction('read', 'Asset');
2323
2324
 
2324
2325
  case 3:
2325
- canRead = _context2.sent;
2326
+ _context2.t0 = _context2.sent;
2327
+
2328
+ if (_context2.t0) {
2329
+ _context2.next = 6;
2330
+ break;
2331
+ }
2332
+
2333
+ _context2.t0 = true;
2334
+
2335
+ case 6:
2336
+ canRead = _context2.t0;
2326
2337
  setCanLinkEntity(canRead);
2327
2338
 
2328
- case 5:
2339
+ case 8:
2329
2340
  if (entityType === 'Entry') {
2330
- setCanLinkEntity(readableContentTypes.length > 0);
2341
+ // Hardcoded `true` value following https://contentful.atlassian.net/browse/DANTE-486
2342
+ // TODO: refine permissions check in order to account for tags in rules
2343
+ _canRead = readableContentTypes.length > 0 || true;
2344
+ setCanLinkEntity(_canRead);
2331
2345
  }
2332
2346
 
2333
- case 6:
2347
+ case 9:
2334
2348
  case "end":
2335
2349
  return _context2.stop();
2336
2350
  }
@@ -2612,7 +2626,7 @@ function FetchingWrappedEntryCard(props) {
2612
2626
  switch (_context.prev = _context.next) {
2613
2627
  case 0:
2614
2628
  _context.next = 2;
2615
- return openEntry(props.sdk, get(entry, 'sys.id'), {
2629
+ return openEntry(props.sdk, props.entryId, {
2616
2630
  bulkEditing: props.parameters.instance.bulkEditing,
2617
2631
  index: props.index
2618
2632
  });
@@ -2622,7 +2636,7 @@ function FetchingWrappedEntryCard(props) {
2622
2636
  props.onAction && props.onAction({
2623
2637
  entity: 'Entry',
2624
2638
  type: 'edit',
2625
- id: get(entry, 'sys.id'),
2639
+ id: props.entryId,
2626
2640
  contentTypeId: get(entry, 'sys.contentType.sys.id'),
2627
2641
  slide: slide
2628
2642
  });
@@ -2645,7 +2659,7 @@ function FetchingWrappedEntryCard(props) {
2645
2659
  props.onAction && props.onAction({
2646
2660
  entity: 'Entry',
2647
2661
  type: 'delete',
2648
- id: get(entry, 'sys.id'),
2662
+ id: props.entryId,
2649
2663
  contentTypeId: get(entry, 'sys.contentType.sys.id')
2650
2664
  });
2651
2665
  };