diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/tests/__snapshots__/Loader.test.js.snap b/packages/strapi-plugin-content-type-builder/admin/src/containers/App/tests/__snapshots__/Loader.test.js.snap
deleted file mode 100644
index 829555e417..0000000000
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/tests/__snapshots__/Loader.test.js.snap
+++ /dev/null
@@ -1,17 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[` should not crash 1`] = `
-
-`;
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js
index 1af9c0ac3a..853fa4ce96 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js
@@ -122,18 +122,25 @@ const FormModal = () => {
headerId = null;
}
+ console.log({ allDataSchema });
+
const checkFormValidity = async () => {
let schema;
if (state.modalType === 'contentType') {
schema = forms[state.modalType].schema(Object.keys(contentTypes));
} else if (
- state.modalType === 'attribute' &&
- state.forTarget !== 'components' &&
- state.forTarget !== 'component'
+ state.modalType === 'attribute'
+ // && state.forTarget !== 'components' &&
+ // state.forTarget !== 'component'
) {
+ const pathToSchemaAttributes =
+ state.forTarget === 'contentType' || state.forTarget === 'component'
+ ? [state.forTarget]
+ : [state.forTarget, state.targetUid];
+
schema = forms[state.modalType].schema(
- allDataSchema,
+ get(allDataSchema, pathToSchemaAttributes, {}),
modifiedData.type,
modifiedData
);