@contentful/field-editor-reference 4.3.0 → 4.3.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 +6 -0
- package/dist/field-editor-reference.cjs.development.js +20 -6
- 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 +20 -6
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.0...@contentful/field-editor-reference@4.3.1) (2022-04-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- always show create asset button to be save in regards of tag-based permissions ([#1124](https://github.com/contentful/field-editors/issues/1124)) ([0aa6db6](https://github.com/contentful/field-editors/commit/0aa6db608201750c03a97c941218ba42a56e9aac))
|
|
11
|
+
|
|
6
12
|
# [4.3.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.2.3...@contentful/field-editor-reference@4.3.0) (2022-04-28)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -2262,13 +2262,14 @@ function useEditorPermissions(props) {
|
|
|
2262
2262
|
|
|
2263
2263
|
function _checkCreateAccess() {
|
|
2264
2264
|
_checkCreateAccess = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
2265
|
-
var canCreate;
|
|
2265
|
+
var canCreate, _canCreate;
|
|
2266
|
+
|
|
2266
2267
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2267
2268
|
while (1) {
|
|
2268
2269
|
switch (_context.prev = _context.next) {
|
|
2269
2270
|
case 0:
|
|
2270
2271
|
if (!(entityType === 'Asset')) {
|
|
2271
|
-
_context.next =
|
|
2272
|
+
_context.next = 8;
|
|
2272
2273
|
break;
|
|
2273
2274
|
}
|
|
2274
2275
|
|
|
@@ -2276,15 +2277,28 @@ function useEditorPermissions(props) {
|
|
|
2276
2277
|
return canPerformAction('create', 'Asset');
|
|
2277
2278
|
|
|
2278
2279
|
case 3:
|
|
2279
|
-
|
|
2280
|
+
_context.t0 = _context.sent;
|
|
2281
|
+
|
|
2282
|
+
if (_context.t0) {
|
|
2283
|
+
_context.next = 6;
|
|
2284
|
+
break;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
_context.t0 = true;
|
|
2288
|
+
|
|
2289
|
+
case 6:
|
|
2290
|
+
canCreate = _context.t0;
|
|
2280
2291
|
setCanCreateEntity(canCreate);
|
|
2281
2292
|
|
|
2282
|
-
case
|
|
2293
|
+
case 8:
|
|
2283
2294
|
if (entityType === 'Entry') {
|
|
2284
|
-
|
|
2295
|
+
// Hardcoded `true` value following https://contentful.atlassian.net/browse/DANTE-486
|
|
2296
|
+
// TODO: refine permissions check in order to account for tags in rules
|
|
2297
|
+
_canCreate = readableContentTypes.length > 0 || true;
|
|
2298
|
+
setCanCreateEntity(_canCreate);
|
|
2285
2299
|
}
|
|
2286
2300
|
|
|
2287
|
-
case
|
|
2301
|
+
case 9:
|
|
2288
2302
|
case "end":
|
|
2289
2303
|
return _context.stop();
|
|
2290
2304
|
}
|