@strapi/content-manager 0.0.0-experimental.0faf8967355707d2684ecb8579b03979ad5df042 → 0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be
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/dist/_chunks/{ComponentConfigurationPage-D1l2o3w3.mjs → ComponentConfigurationPage-DfFSZQxe.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-D1l2o3w3.mjs.map → ComponentConfigurationPage-DfFSZQxe.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BX0PmIl_.js → ComponentConfigurationPage-FqfsxQ1j.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BX0PmIl_.js.map → ComponentConfigurationPage-FqfsxQ1j.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Sed22MMc.js → EditConfigurationPage-Cn0e8t3I.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-Sed22MMc.js.map → EditConfigurationPage-Cn0e8t3I.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-uDsDO3-f.mjs → EditConfigurationPage-DdPNAbl3.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-uDsDO3-f.mjs.map → EditConfigurationPage-DdPNAbl3.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-Bg7aQ3vS.mjs → EditViewPage-B82x_x1b.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-Bg7aQ3vS.mjs.map → EditViewPage-B82x_x1b.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CcWIJyJa.js → EditViewPage-DlxEHhUt.js} +3 -3
- package/dist/_chunks/{EditViewPage-CcWIJyJa.js.map → EditViewPage-DlxEHhUt.js.map} +1 -1
- package/dist/_chunks/{Field-BnTZJ0fG.js → Field-COL25JiC.js} +11 -7
- package/dist/_chunks/Field-COL25JiC.js.map +1 -0
- package/dist/_chunks/{Field-Cf1nzyOi.mjs → Field-DufHXW17.mjs} +11 -7
- package/dist/_chunks/Field-DufHXW17.mjs.map +1 -0
- package/dist/_chunks/{Form-BH04zZdW.js → Form-BssUwrTO.js} +3 -3
- package/dist/_chunks/Form-BssUwrTO.js.map +1 -0
- package/dist/_chunks/{Form-CXe7dOCt.mjs → Form-u_kAOhwB.mjs} +3 -3
- package/dist/_chunks/Form-u_kAOhwB.mjs.map +1 -0
- package/dist/_chunks/{History-CAM3gN3h.js → History-C9t9UqpO.js} +23 -10
- package/dist/_chunks/History-C9t9UqpO.js.map +1 -0
- package/dist/_chunks/{History-Cg_rjVg_.mjs → History-DRwA3oMM.mjs} +24 -11
- package/dist/_chunks/History-DRwA3oMM.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DMBKzujx.js → ListConfigurationPage-BXYPohh-.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-DMBKzujx.js.map → ListConfigurationPage-BXYPohh-.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-51n8mFbZ.mjs → ListConfigurationPage-BxfQJzPk.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-51n8mFbZ.mjs.map → ListConfigurationPage-BxfQJzPk.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-RzuT8-b2.mjs → ListViewPage-CELx2ysp.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-RzuT8-b2.mjs.map → ListViewPage-CELx2ysp.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DFzs-3jf.js → ListViewPage-D2VD8Szg.js} +3 -3
- package/dist/_chunks/{ListViewPage-DFzs-3jf.js.map → ListViewPage-D2VD8Szg.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BNfF_UU1.js → NoContentTypePage-BV9IjJSM.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BNfF_UU1.js.map → NoContentTypePage-BV9IjJSM.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CldwfMNH.mjs → NoContentTypePage-DtJ9jcfk.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CldwfMNH.mjs.map → NoContentTypePage-DtJ9jcfk.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DhRIJOX9.mjs → NoPermissionsPage-DWleVYK7.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DhRIJOX9.mjs.map → NoPermissionsPage-DWleVYK7.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DwcEM1UU.js → NoPermissionsPage-Dp8NpF9I.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DwcEM1UU.js.map → NoPermissionsPage-Dp8NpF9I.js.map} +1 -1
- package/dist/_chunks/{Relations-D3LEWajT.mjs → Relations-BTcf5xaw.mjs} +3 -3
- package/dist/_chunks/{Relations-D3LEWajT.mjs.map → Relations-BTcf5xaw.mjs.map} +1 -1
- package/dist/_chunks/{Relations-DnFXuS0x.js → Relations-DR7EUgyC.js} +3 -3
- package/dist/_chunks/{Relations-DnFXuS0x.js.map → Relations-DR7EUgyC.js.map} +1 -1
- package/dist/_chunks/{index-DhdyY1Y8.js → index-BdMf2lfT.js} +35 -25
- package/dist/_chunks/index-BdMf2lfT.js.map +1 -0
- package/dist/_chunks/{index-CtuQXm7x.mjs → index-wnqzm4Q8.mjs} +36 -26
- package/dist/_chunks/index-wnqzm4Q8.mjs.map +1 -0
- package/dist/_chunks/{layout-BQCvMBx_.mjs → layout-2CfjL0T9.mjs} +3 -3
- package/dist/_chunks/{layout-BQCvMBx_.mjs.map → layout-2CfjL0T9.mjs.map} +1 -1
- package/dist/_chunks/{layout-DeADP3ln.js → layout-B2MyZU-_.js} +3 -3
- package/dist/_chunks/{layout-DeADP3ln.js.map → layout-B2MyZU-_.js.map} +1 -1
- package/dist/_chunks/{relations-BVo_S6No.js → relations-BH7JJGGe.js} +2 -2
- package/dist/_chunks/{relations-BVo_S6No.js.map → relations-BH7JJGGe.js.map} +1 -1
- package/dist/_chunks/{relations-tS4X2RK8.mjs → relations-C0w0GcXi.mjs} +2 -2
- package/dist/_chunks/{relations-tS4X2RK8.mjs.map → relations-C0w0GcXi.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +6 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +6 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/_chunks/Field-BnTZJ0fG.js.map +0 -1
- package/dist/_chunks/Field-Cf1nzyOi.mjs.map +0 -1
- package/dist/_chunks/Form-BH04zZdW.js.map +0 -1
- package/dist/_chunks/Form-CXe7dOCt.mjs.map +0 -1
- package/dist/_chunks/History-CAM3gN3h.js.map +0 -1
- package/dist/_chunks/History-Cg_rjVg_.mjs.map +0 -1
- package/dist/_chunks/index-CtuQXm7x.mjs.map +0 -1
- package/dist/_chunks/index-DhdyY1Y8.js.map +0 -1
@@ -121,6 +121,7 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
121
121
|
if (!slug) {
|
122
122
|
throw new Error("Cannot find the slug param in the URL");
|
123
123
|
}
|
124
|
+
const [{ rawQuery }] = strapiAdmin.useQueryParams();
|
124
125
|
const userPermissions = strapiAdmin.useAuth("DocumentRBAC", (state) => state.permissions);
|
125
126
|
const contentTypePermissions = React__namespace.useMemo(() => {
|
126
127
|
const contentTypePermissions2 = userPermissions.filter(
|
@@ -131,7 +132,14 @@ const DocumentRBAC = ({ children, permissions }) => {
|
|
131
132
|
return { ...acc, [action]: [permission] };
|
132
133
|
}, {});
|
133
134
|
}, [slug, userPermissions]);
|
134
|
-
const { isLoading, allowedActions } = strapiAdmin.useRBAC(
|
135
|
+
const { isLoading, allowedActions } = strapiAdmin.useRBAC(
|
136
|
+
contentTypePermissions,
|
137
|
+
permissions ?? void 0,
|
138
|
+
// TODO: useRBAC context should be typed and built differently
|
139
|
+
// We are passing raw query as context to the hook so that it can
|
140
|
+
// rely on the locale provided from DocumentRBAC for its permission calculations.
|
141
|
+
rawQuery
|
142
|
+
);
|
135
143
|
const canCreateFields = !isLoading && allowedActions.canCreate ? extractAndDedupeFields(contentTypePermissions.create) : [];
|
136
144
|
const canReadFields = !isLoading && allowedActions.canRead ? extractAndDedupeFields(contentTypePermissions.read) : [];
|
137
145
|
const canUpdateFields = !isLoading && allowedActions.canUpdate ? extractAndDedupeFields(contentTypePermissions.update) : [];
|
@@ -482,12 +490,15 @@ const buildValidParams = (query) => {
|
|
482
490
|
const isBaseQueryError = (error) => {
|
483
491
|
return error.name !== void 0;
|
484
492
|
};
|
485
|
-
const arrayValidator = (options) => ({
|
493
|
+
const arrayValidator = (attribute, options) => ({
|
486
494
|
message: strapiAdmin.translatedErrors.required,
|
487
495
|
test(value) {
|
488
496
|
if (options.status === "draft") {
|
489
497
|
return true;
|
490
498
|
}
|
499
|
+
if (!attribute.required) {
|
500
|
+
return true;
|
501
|
+
}
|
491
502
|
if (!value) {
|
492
503
|
return false;
|
493
504
|
}
|
@@ -521,7 +532,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
521
532
|
...acc,
|
522
533
|
[name]: transformSchema(
|
523
534
|
yup__namespace.array().of(createModelSchema(attributes3).nullable(false))
|
524
|
-
).test(arrayValidator(options))
|
535
|
+
).test(arrayValidator(attribute, options))
|
525
536
|
};
|
526
537
|
} else {
|
527
538
|
return {
|
@@ -548,7 +559,7 @@ const createYupSchema = (attributes = {}, components = {}, options = { status: n
|
|
548
559
|
}
|
549
560
|
)
|
550
561
|
)
|
551
|
-
).test(arrayValidator(options))
|
562
|
+
).test(arrayValidator(attribute, options))
|
552
563
|
};
|
553
564
|
case "relation":
|
554
565
|
return {
|
@@ -646,10 +657,7 @@ const nullableSchema = (schema) => {
|
|
646
657
|
schema
|
647
658
|
);
|
648
659
|
};
|
649
|
-
const addNullableValidation = (
|
650
|
-
if (attribute.required) {
|
651
|
-
return schema;
|
652
|
-
}
|
660
|
+
const addNullableValidation = () => (schema) => {
|
653
661
|
return nullableSchema(schema);
|
654
662
|
};
|
655
663
|
const addRequiredValidation = (attribute, options) => (schema) => {
|
@@ -1187,16 +1195,18 @@ const useDoc = () => {
|
|
1187
1195
|
if (!slug) {
|
1188
1196
|
throw new Error("Could not find model in url params");
|
1189
1197
|
}
|
1198
|
+
const document = useDocument(
|
1199
|
+
{ documentId: origin || id, model: slug, collectionType, params },
|
1200
|
+
{
|
1201
|
+
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1202
|
+
}
|
1203
|
+
);
|
1204
|
+
const returnId = origin || id === "create" ? void 0 : id;
|
1190
1205
|
return {
|
1191
1206
|
collectionType,
|
1192
1207
|
model: slug,
|
1193
|
-
id:
|
1194
|
-
...
|
1195
|
-
{ documentId: origin || id, model: slug, collectionType, params },
|
1196
|
-
{
|
1197
|
-
skip: id === "create" || !origin && !id && collectionType !== SINGLE_TYPES
|
1198
|
-
}
|
1199
|
-
)
|
1208
|
+
id: returnId,
|
1209
|
+
...document
|
1200
1210
|
};
|
1201
1211
|
};
|
1202
1212
|
const useContentManagerContext = () => {
|
@@ -1676,7 +1686,7 @@ const useDocumentActions = () => {
|
|
1676
1686
|
};
|
1677
1687
|
};
|
1678
1688
|
const ProtectedHistoryPage = React.lazy(
|
1679
|
-
() => Promise.resolve().then(() => require("./History-
|
1689
|
+
() => Promise.resolve().then(() => require("./History-C9t9UqpO.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1680
1690
|
);
|
1681
1691
|
const routes$1 = [
|
1682
1692
|
{
|
@@ -1689,31 +1699,31 @@ const routes$1 = [
|
|
1689
1699
|
}
|
1690
1700
|
];
|
1691
1701
|
const ProtectedEditViewPage = React.lazy(
|
1692
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1702
|
+
() => Promise.resolve().then(() => require("./EditViewPage-DlxEHhUt.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1693
1703
|
);
|
1694
1704
|
const ProtectedListViewPage = React.lazy(
|
1695
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1705
|
+
() => Promise.resolve().then(() => require("./ListViewPage-D2VD8Szg.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1696
1706
|
);
|
1697
1707
|
const ProtectedListConfiguration = React.lazy(
|
1698
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1708
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-BXYPohh-.js")).then((mod) => ({
|
1699
1709
|
default: mod.ProtectedListConfiguration
|
1700
1710
|
}))
|
1701
1711
|
);
|
1702
1712
|
const ProtectedEditConfigurationPage = React.lazy(
|
1703
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1713
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-Cn0e8t3I.js")).then((mod) => ({
|
1704
1714
|
default: mod.ProtectedEditConfigurationPage
|
1705
1715
|
}))
|
1706
1716
|
);
|
1707
1717
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1708
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1718
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-FqfsxQ1j.js")).then((mod) => ({
|
1709
1719
|
default: mod.ProtectedComponentConfigurationPage
|
1710
1720
|
}))
|
1711
1721
|
);
|
1712
1722
|
const NoPermissions = React.lazy(
|
1713
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1723
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-Dp8NpF9I.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1714
1724
|
);
|
1715
1725
|
const NoContentType = React.lazy(
|
1716
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1726
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BV9IjJSM.js")).then((mod) => ({ default: mod.NoContentType }))
|
1717
1727
|
);
|
1718
1728
|
const CollectionTypePages = () => {
|
1719
1729
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -4020,7 +4030,7 @@ const index = {
|
|
4020
4030
|
app.router.addRoute({
|
4021
4031
|
path: "content-manager/*",
|
4022
4032
|
lazy: async () => {
|
4023
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4033
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-B2MyZU-_.js"));
|
4024
4034
|
return {
|
4025
4035
|
Component: Layout
|
4026
4036
|
};
|
@@ -4096,4 +4106,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
|
|
4096
4106
|
exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
|
4097
4107
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4098
4108
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4099
|
-
//# sourceMappingURL=index-
|
4109
|
+
//# sourceMappingURL=index-BdMf2lfT.js.map
|