@contentful/field-editor-reference 4.3.2 → 4.3.5

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,25 @@
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.3.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.4...@contentful/field-editor-reference@4.3.5) (2022-05-09)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix caching in references entity store ([#1137](https://github.com/contentful/field-editors/issues/1137)) ([1cd8c86](https://github.com/contentful/field-editors/commit/1cd8c861d41d32898ab7bf6b02044462c9f2ca91))
11
+
12
+ ## [4.3.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.3...@contentful/field-editor-reference@4.3.4) (2022-05-06)
13
+
14
+ ### Bug Fixes
15
+
16
+ - add a explanatory comment why we removed useCallback ([4359666](https://github.com/contentful/field-editors/commit/435966687e8e803f7e4fb20f2f7d89101d2fd20a))
17
+ - do not use callback ([811bcfd](https://github.com/contentful/field-editors/commit/811bcfda4a0fadf0701b2d6e712d1871290ebdcb))
18
+
19
+ ## [4.3.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.2...@contentful/field-editor-reference@4.3.3) (2022-05-03)
20
+
21
+ ### Bug Fixes
22
+
23
+ - avoid disabling button if no creatable content type ([#1132](https://github.com/contentful/field-editors/issues/1132)) ([72c7b97](https://github.com/contentful/field-editors/commit/72c7b97019d4a1915fd295592f0724f7be08d424))
24
+
6
25
  ## [4.3.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.1...@contentful/field-editor-reference@4.3.2) (2022-04-29)
7
26
 
8
27
  ### Bug Fixes
@@ -362,7 +362,7 @@ var CreateEntryLinkButton = function CreateEntryLinkButton(_ref) {
362
362
  endIcon: hasDropdown ? React__default.createElement(f36Icons.ChevronDownIcon, null) : undefined,
363
363
  variant: "secondary",
364
364
  className: styles.action,
365
- isDisabled: disabled || isSelecting || contentTypes && contentTypes.length === 0,
365
+ isDisabled: disabled || isSelecting,
366
366
  startIcon: isSelecting ? undefined : plusIcon,
367
367
  size: "small",
368
368
  testId: "create-entry-link-button",
@@ -1607,8 +1607,9 @@ function useLinkActionsProps(props) {
1607
1607
  return function (_x, _x2) {
1608
1608
  return _ref.apply(this, arguments);
1609
1609
  };
1610
- }(), [sdk, entityType, onCreated]);
1611
- var onLinkExisting = React.useCallback( /*#__PURE__*/function () {
1610
+ }(), [sdk, entityType, onCreated]); // Wrapping these two with useCallback caused a bug [ZEND-2154] where CTs were not propagated to the UI at all
1611
+
1612
+ var onLinkExisting = /*#__PURE__*/function () {
1612
1613
  var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(index) {
1613
1614
  var entity;
1614
1615
  return runtime_1.wrap(function _callee2$(_context2) {
@@ -1643,11 +1644,12 @@ function useLinkActionsProps(props) {
1643
1644
  }, _callee2);
1644
1645
  }));
1645
1646
 
1646
- return function (_x3) {
1647
+ return function onLinkExisting(_x3) {
1647
1648
  return _ref2.apply(this, arguments);
1648
1649
  };
1649
- }(), [sdk, entityType, onLinkedExisting]);
1650
- var onLinkSeveralExisting = React.useCallback( /*#__PURE__*/function () {
1650
+ }();
1651
+
1652
+ var onLinkSeveralExisting = /*#__PURE__*/function () {
1651
1653
  var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(index) {
1652
1654
  var entities;
1653
1655
  return runtime_1.wrap(function _callee3$(_context3) {
@@ -1682,10 +1684,12 @@ function useLinkActionsProps(props) {
1682
1684
  }, _callee3);
1683
1685
  }));
1684
1686
 
1685
- return function (_x4) {
1687
+ return function onLinkSeveralExisting(_x4) {
1686
1688
  return _ref3.apply(this, arguments);
1687
1689
  };
1688
- }(), [sdk, entityType, onLinkedExisting]);
1690
+ }(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
1691
+
1692
+
1689
1693
  return React.useMemo(function () {
1690
1694
  return {
1691
1695
  entityType: entityType,
@@ -1796,7 +1800,7 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
1796
1800
  error: e
1797
1801
  });
1798
1802
  });
1799
- }, []);
1803
+ }, [getEntityScheduledActions, entityType, entityId]);
1800
1804
 
1801
1805
  if (status.type === 'loading' || status.type === 'error') {
1802
1806
  return null;
@@ -1829,7 +1833,7 @@ function AssetThumbnail(props) {
1829
1833
  }
1830
1834
 
1831
1835
  function reducer(state, action) {
1832
- var _extends2, _extends3, _extends4, _extends5;
1836
+ var _extends2, _extends3, _extends4, _extends5, _extends6;
1833
1837
 
1834
1838
  switch (action.type) {
1835
1839
  case 'set_entry':
@@ -1852,6 +1856,11 @@ function reducer(state, action) {
1852
1856
  assets: _extends({}, state.assets, (_extends5 = {}, _extends5[action.id] = 'failed', _extends5))
1853
1857
  });
1854
1858
 
1859
+ case 'set_scheduled_actions':
1860
+ return _extends({}, state, {
1861
+ scheduledActions: _extends({}, state.scheduledActions, (_extends6 = {}, _extends6[action.key] = action.actions, _extends6))
1862
+ });
1863
+
1855
1864
  default:
1856
1865
  return state;
1857
1866
  }