@strapi/content-type-builder 5.48.1 → 5.49.0
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/admin/components/AIChat/components/Messages/Message.js +5 -1
- package/dist/admin/components/AIChat/components/Messages/Message.js.map +1 -1
- package/dist/admin/components/AIChat/components/SimpleMenu.js +3 -2
- package/dist/admin/components/AIChat/components/SimpleMenu.js.map +1 -1
- package/dist/admin/components/AIChat/hooks/useCodeUpload.js +7 -2
- package/dist/admin/components/AIChat/hooks/useCodeUpload.js.map +1 -1
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js +11 -5
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js.map +1 -1
- package/dist/admin/components/AllowedTypesSelect.js +5 -1
- package/dist/admin/components/AllowedTypesSelect.js.map +1 -1
- package/dist/admin/components/AttributeOptions/EmptyAttributes.js +3 -2
- package/dist/admin/components/AttributeOptions/EmptyAttributes.js.map +1 -1
- package/dist/admin/components/AttributeRow.js +10 -5
- package/dist/admin/components/AttributeRow.js.map +1 -1
- package/dist/admin/components/AutoReloadOverlayBlocker.js +3 -2
- package/dist/admin/components/AutoReloadOverlayBlocker.js.map +1 -1
- package/dist/admin/components/ComponentCard/ComponentCard.js +5 -1
- package/dist/admin/components/ComponentCard/ComponentCard.js.map +1 -1
- package/dist/admin/components/ComponentList.js +5 -1
- package/dist/admin/components/ComponentList.js.map +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js +5 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js.map +1 -1
- package/dist/admin/components/DataManager/DataManagerProvider.js +12 -6
- package/dist/admin/components/DataManager/DataManagerProvider.js.map +1 -1
- package/dist/admin/components/DataManager/reducer.js +7 -2
- package/dist/admin/components/DataManager/reducer.js.map +1 -1
- package/dist/admin/components/DataManager/utils/cleanData.js +10 -4
- package/dist/admin/components/DataManager/utils/cleanData.js.map +1 -1
- package/dist/admin/components/DataManager/utils/retrieveComponentsThatHaveComponents.js +5 -1
- package/dist/admin/components/DataManager/utils/retrieveComponentsThatHaveComponents.js.map +1 -1
- package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.js +5 -1
- package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.js.map +1 -1
- package/dist/admin/components/FormModal/FormModal.js +30 -22
- package/dist/admin/components/FormModal/FormModal.js.map +1 -1
- package/dist/admin/components/FormModal/attributes/ConditionForm.js +3 -2
- package/dist/admin/components/FormModal/attributes/ConditionForm.js.map +1 -1
- package/dist/admin/components/FormModal/attributes/types.js +7 -3
- package/dist/admin/components/FormModal/attributes/types.js.map +1 -1
- package/dist/admin/components/FormModal/attributes/validation/common.js +8 -4
- package/dist/admin/components/FormModal/attributes/validation/common.js.map +1 -1
- package/dist/admin/components/FormModal/component/createComponentSchema.js +3 -2
- package/dist/admin/components/FormModal/component/createComponentSchema.js.map +1 -1
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js +3 -2
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js.map +1 -1
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.js +5 -1
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.js.map +1 -1
- package/dist/admin/components/FormModal/reducer.js +32 -26
- package/dist/admin/components/FormModal/reducer.js.map +1 -1
- package/dist/admin/components/FormModalHeader.js +6 -2
- package/dist/admin/components/FormModalHeader.js.map +1 -1
- package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.js +3 -2
- package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.js.map +1 -1
- package/dist/admin/components/FormModalSubHeader.js +6 -2
- package/dist/admin/components/FormModalSubHeader.js.map +1 -1
- package/dist/admin/components/GenericInputs.js +9 -4
- package/dist/admin/components/GenericInputs.js.map +1 -1
- package/dist/admin/components/IconPicker/constants.js +4 -3
- package/dist/admin/components/IconPicker/constants.js.map +1 -1
- package/dist/admin/components/PluralName.js +5 -1
- package/dist/admin/components/PluralName.js.map +1 -1
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js +13 -7
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js.map +1 -1
- package/dist/admin/components/TabForm.js +7 -3
- package/dist/admin/components/TabForm.js.map +1 -1
- package/dist/admin/pages/ListView/ListView.js +5 -1
- package/dist/admin/pages/ListView/ListView.js.map +1 -1
- package/dist/admin/utils/formAPI.js +11 -6
- package/dist/admin/utils/formAPI.js.map +1 -1
- package/dist/admin/utils/getMaxDepth.js.map +1 -1
- package/dist/admin/utils/getMaxDepth.mjs.map +1 -1
- package/dist/admin/utils/nameToSlug.js +5 -1
- package/dist/admin/utils/nameToSlug.js.map +1 -1
- package/dist/admin/utils/toRegressedEnumValue.js +5 -1
- package/dist/admin/utils/toRegressedEnumValue.js.map +1 -1
- package/dist/server/controllers/components.js +6 -2
- package/dist/server/controllers/components.js.map +1 -1
- package/dist/server/controllers/content-types.js +8 -4
- package/dist/server/controllers/content-types.js.map +1 -1
- package/dist/server/controllers/validation/common.js +5 -1
- package/dist/server/controllers/validation/common.js.map +1 -1
- package/dist/server/controllers/validation/component.js +9 -5
- package/dist/server/controllers/validation/component.js.map +1 -1
- package/dist/server/controllers/validation/data-transform.js +6 -2
- package/dist/server/controllers/validation/data-transform.js.map +1 -1
- package/dist/server/controllers/validation/model-schema.js +6 -2
- package/dist/server/controllers/validation/model-schema.js.map +1 -1
- package/dist/server/controllers/validation/types.js +8 -4
- package/dist/server/controllers/validation/types.js.map +1 -1
- package/dist/server/routes/content-api.js +3 -2
- package/dist/server/routes/content-api.js.map +1 -1
- package/dist/server/services/api-handler.js +4 -3
- package/dist/server/services/api-handler.js.map +1 -1
- package/dist/server/services/api-handler.mjs.map +1 -1
- package/dist/server/services/components.js.map +1 -1
- package/dist/server/services/components.mjs.map +1 -1
- package/dist/server/services/content-types.js +8 -4
- package/dist/server/services/content-types.js.map +1 -1
- package/dist/server/services/schema-builder/component-builder.js +11 -5
- package/dist/server/services/schema-builder/component-builder.js.map +1 -1
- package/dist/server/services/schema-builder/content-type-builder.js +13 -8
- package/dist/server/services/schema-builder/content-type-builder.js.map +1 -1
- package/dist/server/services/schema-builder/index.js +5 -1
- package/dist/server/services/schema-builder/index.js.map +1 -1
- package/dist/server/services/schema-builder/schema-handler.js +35 -29
- package/dist/server/services/schema-builder/schema-handler.js.map +1 -1
- package/dist/server/services/schema-builder/schema-handler.mjs.map +1 -1
- package/dist/server/services/schema.js +5 -1
- package/dist/server/services/schema.js.map +1 -1
- package/dist/server/src/services/components.d.ts +3 -26
- package/dist/server/src/services/components.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/schema-handler.d.ts +1 -0
- package/dist/server/src/services/schema-builder/schema-handler.d.ts.map +1 -1
- package/dist/server/utils/attributes.js +12 -7
- package/dist/server/utils/attributes.js.map +1 -1
- package/package.json +5 -5
|
@@ -53,7 +53,10 @@ var createUid = require('./utils/createUid.js');
|
|
|
53
53
|
var getAttributesToDisplay = require('./utils/getAttributesToDisplay.js');
|
|
54
54
|
var getFormInputNames = require('./utils/getFormInputNames.js');
|
|
55
55
|
|
|
56
|
-
function
|
|
56
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
57
|
+
|
|
58
|
+
function _interopNamespace(e) {
|
|
59
|
+
if (e && e.__esModule) return e;
|
|
57
60
|
var n = Object.create(null);
|
|
58
61
|
if (e) {
|
|
59
62
|
Object.keys(e).forEach(function (k) {
|
|
@@ -70,8 +73,13 @@ function _interopNamespaceDefault(e) {
|
|
|
70
73
|
return Object.freeze(n);
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
var React__namespace = /*#__PURE__*/
|
|
74
|
-
var
|
|
76
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
77
|
+
var get__default = /*#__PURE__*/_interopDefault(get);
|
|
78
|
+
var has__default = /*#__PURE__*/_interopDefault(has);
|
|
79
|
+
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
80
|
+
var pick__default = /*#__PURE__*/_interopDefault(pick);
|
|
81
|
+
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
82
|
+
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
75
83
|
|
|
76
84
|
const FormComponent = styledComponents.styled.form`
|
|
77
85
|
overflow: auto;
|
|
@@ -140,7 +148,7 @@ const FormModal = ()=>{
|
|
|
140
148
|
// selects dynamic zone => set the field name
|
|
141
149
|
// then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.
|
|
142
150
|
// In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown
|
|
143
|
-
const foundDynamicZoneTarget = findAttribute.findAttribute(
|
|
151
|
+
const foundDynamicZoneTarget = findAttribute.findAttribute(get__default.default(type, 'schema.attributes', []), dynamicZoneTarget) || null;
|
|
144
152
|
// Create content type we need to add the default option draftAndPublish
|
|
145
153
|
if (modalType === 'contentType' && actionType === 'create') {
|
|
146
154
|
dispatch(reducer.actions.setDataToEdit({
|
|
@@ -191,7 +199,7 @@ const FormModal = ()=>{
|
|
|
191
199
|
}
|
|
192
200
|
// Set the predefined data structure to create an attribute
|
|
193
201
|
if (attributeType) {
|
|
194
|
-
const attributeToEditNotFormatted = findAttribute.findAttribute(
|
|
202
|
+
const attributeToEditNotFormatted = findAttribute.findAttribute(get__default.default(type, [
|
|
195
203
|
'attributes'
|
|
196
204
|
], []), attributeName);
|
|
197
205
|
const attributeToEdit = {
|
|
@@ -202,7 +210,7 @@ const FormModal = ()=>{
|
|
|
202
210
|
// The API doesn't send this info
|
|
203
211
|
if (attributeType === 'component' && actionType === 'edit') {
|
|
204
212
|
if (!('repeatable' in attributeToEdit) || !attributeToEdit.repeatable) {
|
|
205
|
-
|
|
213
|
+
set__default.default(attributeToEdit, 'repeatable', false);
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
if (modalType === 'customField') {
|
|
@@ -214,7 +222,7 @@ const FormModal = ()=>{
|
|
|
214
222
|
}));
|
|
215
223
|
} else {
|
|
216
224
|
dispatch(reducer.actions.setCustomFieldDataSchema({
|
|
217
|
-
customField:
|
|
225
|
+
customField: pick__default.default(customField, [
|
|
218
226
|
'type',
|
|
219
227
|
'options'
|
|
220
228
|
]),
|
|
@@ -226,11 +234,11 @@ const FormModal = ()=>{
|
|
|
226
234
|
} else {
|
|
227
235
|
dispatch(reducer.actions.setAttributeDataSchema({
|
|
228
236
|
attributeType,
|
|
229
|
-
nameToSetForRelation:
|
|
237
|
+
nameToSetForRelation: get__default.default(collectionTypesForRelation, [
|
|
230
238
|
'0',
|
|
231
239
|
'title'
|
|
232
240
|
], 'error'),
|
|
233
|
-
targetUid:
|
|
241
|
+
targetUid: get__default.default(collectionTypesForRelation, [
|
|
234
242
|
'0',
|
|
235
243
|
'uid'
|
|
236
244
|
], 'error'),
|
|
@@ -260,16 +268,16 @@ const FormModal = ()=>{
|
|
|
260
268
|
const isCreatingCustomFieldAttribute = modalType === 'customField';
|
|
261
269
|
const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;
|
|
262
270
|
const isCreating = actionType === 'create';
|
|
263
|
-
const isCreatingComponentFromAView =
|
|
271
|
+
const isCreatingComponentFromAView = get__default.default(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;
|
|
264
272
|
const isInFirstComponentStep = step === '1';
|
|
265
273
|
const isPickingAttribute = modalType === 'chooseAttribute';
|
|
266
274
|
const uid = createUid.createUid(modifiedData.singularName || '');
|
|
267
|
-
const attributes =
|
|
275
|
+
const attributes = get__default.default(type, [
|
|
268
276
|
'attributes'
|
|
269
277
|
], null);
|
|
270
278
|
const checkFormValidity = async ()=>{
|
|
271
279
|
let schema;
|
|
272
|
-
const dataToValidate = isCreatingComponentFromAView && step === '1' ?
|
|
280
|
+
const dataToValidate = isCreatingComponentFromAView && step === '1' ? get__default.default(modifiedData, 'componentToCreate', {}) : modifiedData;
|
|
273
281
|
// Check form validity for content type
|
|
274
282
|
if (isCreatingContentType) {
|
|
275
283
|
schema = forms.forms.contentType.schema(Object.keys(contentTypes), actionType === 'edit', // currentUID
|
|
@@ -280,7 +288,7 @@ const FormModal = ()=>{
|
|
|
280
288
|
schema = forms.forms.component.schema(Object.keys(components), modifiedData.category || '', reservedNames, actionType === 'edit', components, modifiedData.displayName || '', type?.uid ?? null);
|
|
281
289
|
} else if (isCreatingCustomFieldAttribute) {
|
|
282
290
|
schema = forms.forms.customField.schema({
|
|
283
|
-
schemaAttributes:
|
|
291
|
+
schemaAttributes: get__default.default(type, [
|
|
284
292
|
'attributes'
|
|
285
293
|
], []),
|
|
286
294
|
attributeType: customField.type,
|
|
@@ -297,17 +305,17 @@ const FormModal = ()=>{
|
|
|
297
305
|
// Since we temporarily store the component info in another object
|
|
298
306
|
// The data is set in the componentToCreate key
|
|
299
307
|
} else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {
|
|
300
|
-
schema = forms.forms.component.schema(Object.keys(components),
|
|
308
|
+
schema = forms.forms.component.schema(Object.keys(components), get__default.default(modifiedData, 'componentToCreate.category', ''), reservedNames, actionType === 'edit', components, modifiedData.componentToCreate.displayName || '');
|
|
301
309
|
// Check form validity for creating a 'common attribute'
|
|
302
310
|
// We need to make sure that it is independent from the step
|
|
303
311
|
} else if (isCreatingAttribute && !isInFirstComponentStep) {
|
|
304
312
|
const computedAttrbiuteType = attributeType === 'relation' ? 'relation' : modifiedData.type;
|
|
305
313
|
let alreadyTakenTargetContentTypeAttributes = [];
|
|
306
314
|
if (computedAttrbiuteType === 'relation') {
|
|
307
|
-
const targetContentTypeUID =
|
|
315
|
+
const targetContentTypeUID = get__default.default(modifiedData, [
|
|
308
316
|
'target'
|
|
309
317
|
], null);
|
|
310
|
-
const targetContentTypeAttributes =
|
|
318
|
+
const targetContentTypeAttributes = get__default.default(contentTypes, [
|
|
311
319
|
targetContentTypeUID,
|
|
312
320
|
'attributes'
|
|
313
321
|
], []);
|
|
@@ -332,7 +340,7 @@ const FormModal = ()=>{
|
|
|
332
340
|
// in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component
|
|
333
341
|
// eslint-disable-next-line no-lonely-if
|
|
334
342
|
if (isInFirstComponentStep && isCreatingComponentFromAView) {
|
|
335
|
-
schema = forms.forms.component.schema(Object.keys(components),
|
|
343
|
+
schema = forms.forms.component.schema(Object.keys(components), get__default.default(modifiedData, 'componentToCreate.category', ''), reservedNames, actionType === 'edit', components, modifiedData.componentToCreate.displayName || '');
|
|
336
344
|
} else {
|
|
337
345
|
// The form is valid
|
|
338
346
|
// The case here is being in the addComponentToDynamicZone modal and not creating a component
|
|
@@ -750,7 +758,7 @@ const FormModal = ()=>{
|
|
|
750
758
|
};
|
|
751
759
|
const handleClosed = ()=>{
|
|
752
760
|
// Close the modal
|
|
753
|
-
if (!
|
|
761
|
+
if (!isEqual__default.default(modifiedData, initialData)) {
|
|
754
762
|
handleConfirmClose();
|
|
755
763
|
} else {
|
|
756
764
|
onCloseModal();
|
|
@@ -779,7 +787,7 @@ const FormModal = ()=>{
|
|
|
779
787
|
if (modalType === 'component') {
|
|
780
788
|
return true;
|
|
781
789
|
}
|
|
782
|
-
if (
|
|
790
|
+
if (has__default.default(modifiedData, 'createComponent')) {
|
|
783
791
|
return true;
|
|
784
792
|
}
|
|
785
793
|
return false;
|
|
@@ -790,7 +798,7 @@ const FormModal = ()=>{
|
|
|
790
798
|
if (!modalType) {
|
|
791
799
|
return null;
|
|
792
800
|
}
|
|
793
|
-
const formToDisplay =
|
|
801
|
+
const formToDisplay = get__default.default(forms.forms, [
|
|
794
802
|
modalType,
|
|
795
803
|
'form'
|
|
796
804
|
], {
|
|
@@ -829,7 +837,7 @@ const FormModal = ()=>{
|
|
|
829
837
|
formErrors,
|
|
830
838
|
isAddingAComponentToAnotherComponent,
|
|
831
839
|
isCreatingComponentWhileAddingAField,
|
|
832
|
-
mainBoxHeader:
|
|
840
|
+
mainBoxHeader: get__default.default(type, [
|
|
833
841
|
'info',
|
|
834
842
|
'displayName'
|
|
835
843
|
], ''),
|
|
@@ -866,7 +874,7 @@ const FormModal = ()=>{
|
|
|
866
874
|
const advancedFormInputNames = getFormInputNames.getFormInputNames(advancedForm);
|
|
867
875
|
const doesBaseFormHasError = Object.keys(formErrors).some((key)=>baseFormInputNames.includes(key));
|
|
868
876
|
const doesAdvancedFormHasError = Object.keys(formErrors).some((key)=>advancedFormInputNames.includes(key));
|
|
869
|
-
const schemaKind =
|
|
877
|
+
const schemaKind = get__default.default(contentTypes, [
|
|
870
878
|
targetUid,
|
|
871
879
|
'kind'
|
|
872
880
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormModal.js","sources":["../../../../admin/src/components/FormModal/FormModal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useState } from 'react';\n\nimport {\n useStrapiApp,\n useNotification,\n ConfirmDialog,\n useGuidedTour,\n GUIDED_TOUR_REQUIRED_ACTIONS,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Modal, Tabs, Box, Typography, Dialog } from '@strapi/design-system';\nimport get from 'lodash/get';\nimport has from 'lodash/has';\nimport isEqual from 'lodash/isEqual';\nimport pick from 'lodash/pick';\nimport set from 'lodash/set';\nimport { useIntl } from 'react-intl';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport * as yup from 'yup';\n\nimport { pluginId } from '../../pluginId';\nimport { getTrad, isAllowedContentTypesForRelations } from '../../utils';\nimport { findAttribute } from '../../utils/findAttribute';\nimport { getYupInnerErrors } from '../../utils/getYupInnerErrors';\n// New compos\nimport { AllowedTypesSelect } from '../AllowedTypesSelect';\nimport { IconByType } from '../AttributeIcon';\nimport { AttributeOptions } from '../AttributeOptions/AttributeOptions';\nimport { BooleanDefaultValueSelect } from '../BooleanDefaultValueSelect';\nimport { BooleanRadioGroup } from '../BooleanRadioGroup';\nimport { CheckboxWithNumberField } from '../CheckboxWithNumberField';\nimport { ContentTypeRadioGroup } from '../ContentTypeRadioGroup';\nimport { useCTBTracking } from '../CTBSession/ctbSession';\nimport { CustomRadioGroup } from '../CustomRadioGroup';\nimport { useDataManager } from '../DataManager/useDataManager';\nimport { DraftAndPublishToggle } from '../DraftAndPublishToggle';\nimport { FormModalEndActions } from '../FormModalEndActions';\nimport { FormModalHeader } from '../FormModalHeader';\nimport { useFormModalNavigation } from '../FormModalNavigation/useFormModalNavigation';\nimport { FormModalSubHeader } from '../FormModalSubHeader';\nimport { IconPicker } from '../IconPicker/IconPicker';\nimport { PluralName } from '../PluralName';\nimport { Relation } from '../Relation/Relation';\nimport { SelectCategory } from '../SelectCategory';\nimport { SelectComponent } from '../SelectComponent';\nimport { SelectComponents } from '../SelectComponents';\nimport { SelectDateType } from '../SelectDateType';\nimport { SelectNumber } from '../SelectNumber';\nimport { SingularName } from '../SingularName';\nimport { TabForm } from '../TabForm';\nimport { TextareaEnum } from '../TextareaEnum';\n\nimport { ConditionForm } from './attributes/ConditionForm';\nimport { forms } from './forms/forms';\nimport { actions, initialState, type State as FormModalState } from './reducer';\nimport { canEditContentType } from './utils/canEditContentType';\nimport { createComponentUid, createUid } from './utils/createUid';\nimport { getAttributesToDisplay } from './utils/getAttributesToDisplay';\nimport { getFormInputNames } from './utils/getFormInputNames';\n\nimport type { ContentType } from '../../types';\nimport type { Internal } from '@strapi/types';\n\nconst FormComponent = styled.form`\n overflow: auto;\n`;\n\nconst selectState = (state: Record<string, unknown>) =>\n (state['content-type-builder_formModal'] || initialState) as FormModalState;\n\nexport const FormModal = () => {\n const {\n onCloseModal,\n onNavigateToChooseAttributeModal,\n onNavigateToAddCompoToDZModal,\n onNavigateToCreateComponentStep2,\n actionType,\n attributeName,\n attributeType,\n customFieldUid,\n dynamicZoneTarget,\n forTarget,\n modalType,\n isOpen,\n kind,\n step,\n targetUid,\n showBackLink,\n activeTab,\n setActiveTab,\n } = useFormModalNavigation();\n\n const getPlugin = useStrapiApp('FormModal', (state) => state.getPlugin);\n const getCustomField = useStrapiApp('FormModal', (state) => state.customFields.get);\n const customField = getCustomField(customFieldUid);\n\n const dispatch = useDispatch();\n const { toggleNotification } = useNotification();\n const reducerState = useSelector(selectState, shallowEqual);\n\n const navigate = useNavigate();\n const { trackUsage } = useCTBTracking();\n const { formatMessage } = useIntl();\n const ctbPlugin = getPlugin(pluginId);\n const ctbFormsAPI: any = ctbPlugin?.apis.forms;\n const inputsFromPlugins = ctbFormsAPI.components.inputs;\n\n const dispatchGuidedTour = useGuidedTour('FormModal', (s) => s.dispatch);\n\n const {\n addAttribute,\n editAttribute,\n addCustomFieldAttribute,\n addCreatedComponentToDynamicZone,\n changeDynamicZoneComponents,\n contentTypes,\n components,\n createSchema,\n createComponentSchema,\n deleteComponent,\n deleteContentType,\n editCustomFieldAttribute,\n updateSchema,\n nestedComponents,\n sortedContentTypesList,\n updateComponentSchema,\n updateComponentUid,\n reservedNames,\n } = useDataManager();\n\n const {\n componentToCreate,\n formErrors,\n initialData,\n isCreatingComponentWhileAddingAField,\n modifiedData,\n } = reducerState;\n\n const type = forTarget === 'component' ? components[targetUid] : contentTypes[targetUid];\n\n const [showWarningDialog, setShowWarningDialog] = useState(false);\n const [pendingSubmit, setPendingSubmit] = useState<any>(null);\n\n const checkFieldNameChanges = () => {\n // Only check when editing an attribute\n if (actionType !== 'edit' || modalType !== 'attribute') {\n return false;\n }\n\n const oldName = initialData.name;\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n\n // Get all attributes from the content type schema\n const contentTypeAttributes = type?.attributes || [];\n\n // Find all fields that reference this field in their conditions\n const referencedFields = contentTypeAttributes.filter((attr: any) => {\n if (!attr.conditions) return false;\n\n const condition = attr.conditions.visible;\n if (!condition) return false;\n\n const [[, conditions]] = Object.entries(condition);\n const [fieldVar, value] = conditions as [{ var: string }, any];\n\n // Check if this condition references our field\n if (fieldVar.var !== oldName) return false;\n\n // If it's an enum field, also check if the value is being deleted/changed\n if (oldEnum && newEnum) {\n const deletedOrChangedValues = oldEnum.filter(\n (oldValue: string) => !newEnum.includes(oldValue)\n );\n return deletedOrChangedValues.includes(value);\n }\n\n return true;\n });\n\n // If any fields reference this field, return them\n if (referencedFields.length > 0) {\n return referencedFields;\n }\n\n return false;\n };\n\n React.useEffect(() => {\n if (isOpen) {\n const collectionTypesForRelation = sortedContentTypesList.filter(\n isAllowedContentTypesForRelations\n );\n\n if (actionType === 'edit' && modalType === 'attribute' && forTarget === 'contentType') {\n trackUsage('willEditFieldOfContentType');\n }\n\n // Case:\n // the user opens the modal chooseAttributes\n // selects dynamic zone => set the field name\n // then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.\n // In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown\n const foundDynamicZoneTarget =\n findAttribute(get(type, 'schema.attributes', []), dynamicZoneTarget) || null;\n\n // Create content type we need to add the default option draftAndPublish\n if (modalType === 'contentType' && actionType === 'create') {\n dispatch(\n actions.setDataToEdit({\n data: {\n draftAndPublish: true,\n },\n })\n );\n }\n\n // Edit content type\n if (modalType === 'contentType' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n draftAndPublish: type.options?.draftAndPublish,\n kind: 'kind' in type && type.kind,\n pluginOptions: type.pluginOptions,\n pluralName: 'pluralName' in type.info && type.info.pluralName,\n singularName: 'singularName' in type.info && type.info.singularName,\n },\n })\n );\n }\n\n // Edit component\n if (modalType === 'component' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n category: 'category' in type && type.category,\n icon: type.info.icon,\n },\n })\n );\n }\n\n // Special case for the dynamic zone\n if (modalType === 'addComponentToDynamicZone' && actionType === 'edit') {\n const attributeToEdit = {\n ...foundDynamicZoneTarget,\n // We filter the available components\n // Because this modal is only used for adding components\n components: [],\n name: dynamicZoneTarget,\n createComponent: false,\n componentToCreate: { type: 'component' },\n };\n\n dispatch(\n actions.setDynamicZoneDataSchema({\n attributeToEdit,\n })\n );\n }\n\n // Set the predefined data structure to create an attribute\n if (attributeType) {\n const attributeToEditNotFormatted = findAttribute(\n get(type, ['attributes'], []),\n attributeName\n );\n const attributeToEdit = {\n ...attributeToEditNotFormatted,\n name: attributeName,\n };\n\n // We need to set the repeatable key to false when editing a component\n // The API doesn't send this info\n if (attributeType === 'component' && actionType === 'edit') {\n if (!('repeatable' in attributeToEdit) || !attributeToEdit.repeatable) {\n set(attributeToEdit, 'repeatable', false);\n }\n }\n\n if (modalType === 'customField') {\n if (actionType === 'edit') {\n dispatch(\n actions.setCustomFieldDataSchema({\n isEditing: true,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n } else {\n dispatch(\n actions.setCustomFieldDataSchema({\n customField: pick(customField, ['type', 'options']),\n isEditing: false,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n }\n } else {\n dispatch(\n actions.setAttributeDataSchema({\n attributeType,\n nameToSetForRelation: get(collectionTypesForRelation, ['0', 'title'], 'error'),\n targetUid: get(collectionTypesForRelation, ['0', 'uid'], 'error'),\n isEditing: actionType === 'edit',\n modifiedDataToSetForEditing: attributeToEdit,\n step,\n uid: type.uid,\n })\n );\n }\n }\n } else {\n dispatch(actions.resetProps());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionType, attributeName, attributeType, dynamicZoneTarget, forTarget, isOpen, modalType]);\n\n const isCreatingContentType = modalType === 'contentType';\n const isCreatingComponent = modalType === 'component';\n const isCreatingAttribute = modalType === 'attribute';\n const isCreatingCustomFieldAttribute = modalType === 'customField';\n const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;\n const isCreating = actionType === 'create';\n const isCreatingComponentFromAView =\n get(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;\n const isInFirstComponentStep = step === '1';\n const isPickingAttribute = modalType === 'chooseAttribute';\n const uid = createUid(modifiedData.singularName || '');\n const attributes = get(type, ['attributes'], null) as {\n name: string;\n }[];\n\n const checkFormValidity = async () => {\n let schema;\n const dataToValidate =\n isCreatingComponentFromAView && step === '1'\n ? get(modifiedData, 'componentToCreate', {})\n : modifiedData;\n // Check form validity for content type\n if (isCreatingContentType) {\n schema = forms.contentType.schema(\n Object.keys(contentTypes),\n actionType === 'edit',\n // currentUID\n (type?.uid ?? null) as Internal.UID.ContentType,\n reservedNames,\n ctbFormsAPI,\n contentTypes\n );\n\n // Check form validity for component\n // This is happening when the user click on the link from the left menu\n } else if (isCreatingComponent) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n modifiedData.category || '',\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.displayName || '',\n (type?.uid ?? null) as Internal.UID.Component\n // ctbFormsAPI\n );\n } else if (isCreatingCustomFieldAttribute) {\n schema = forms.customField.schema({\n schemaAttributes: get(type, ['attributes'], []),\n attributeType: customField!.type,\n reservedNames,\n schemaData: { modifiedData, initialData },\n ctbFormsAPI,\n customFieldValidator: customField!.options?.validator,\n });\n\n // Check for validity for creating a component\n // This is happening when the user creates a component \"on the fly\"\n // Since we temporarily store the component info in another object\n // The data is set in the componentToCreate key\n } else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n\n // Check form validity for creating a 'common attribute'\n // We need to make sure that it is independent from the step\n } else if (isCreatingAttribute && !isInFirstComponentStep) {\n const computedAttrbiuteType = attributeType === 'relation' ? 'relation' : modifiedData.type;\n\n let alreadyTakenTargetContentTypeAttributes: any[] = [];\n\n if (computedAttrbiuteType === 'relation') {\n const targetContentTypeUID = get(modifiedData, ['target'], null);\n\n const targetContentTypeAttributes = get(\n contentTypes,\n [targetContentTypeUID, 'attributes'],\n []\n );\n\n // Create an array with all the targetContentType attributes name\n // in order to prevent the user from creating a relation with a targetAttribute\n // that may exist in the other content type\n alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(\n ({ name: attrName }: { name: string }) => {\n // Keep all the target content type attributes when creating a relation\n if (actionType !== 'edit') {\n return true;\n }\n\n // Remove the already created one when editing\n return attrName !== initialData.targetAttribute;\n }\n );\n }\n schema = forms.attribute.schema(\n type,\n computedAttrbiuteType,\n reservedNames,\n alreadyTakenTargetContentTypeAttributes,\n { modifiedData, initialData },\n ctbFormsAPI\n );\n } else {\n // The user is either in the addComponentToDynamicZone modal or\n // in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep && isCreatingComponentFromAView) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n } else {\n // The form is valid\n // The case here is being in the addComponentToDynamicZone modal and not creating a component\n return;\n }\n }\n\n await schema.validate(dataToValidate, { abortEarly: false });\n };\n\n const handleChange = React.useCallback(\n ({\n target: { name, value, type, ...rest },\n }: {\n target: { name: string; value: string | string[]; type: string };\n }) => {\n const namesThatCanResetToNullValue = [\n 'enumName',\n 'max',\n 'min',\n 'maxLength',\n 'minLength',\n 'regex',\n 'default',\n ];\n\n let val;\n\n if (namesThatCanResetToNullValue.includes(name) && value === '') {\n val = null;\n } else if (name === 'enum') {\n // For enum values, ensure we're working with an array\n val = Array.isArray(value) ? value : [value];\n } else {\n val = value;\n }\n\n const clonedErrors = Object.assign({}, formErrors);\n\n // Reset min error when modifying the max\n if (name === 'max') {\n delete clonedErrors.min;\n }\n\n // Same here\n if (name === 'maxLength') {\n delete clonedErrors.minLength;\n }\n\n // Since the onBlur is deactivated we remove the errors directly when changing an input\n delete clonedErrors[name];\n\n dispatch(\n actions.setErrors({\n errors: clonedErrors,\n })\n );\n\n dispatch(\n actions.onChange({\n keys: name.split('.'),\n value: val,\n })\n );\n },\n [dispatch, formErrors]\n );\n\n const submitForm = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n try {\n await checkFormValidity();\n\n dispatch(\n actions.setErrors({\n errors: {},\n })\n );\n\n sendButtonAddMoreFieldEvent(shouldContinue);\n\n const ctTargetUid = targetUid;\n\n if (isCreatingContentType) {\n // Create the content type schema\n if (isCreating) {\n createSchema({\n data: {\n kind,\n displayName: modifiedData.displayName,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n singularName: modifiedData.singularName,\n pluralName: modifiedData.pluralName,\n },\n uid,\n });\n\n // Redirect the user to the created content type\n navigate({ pathname: `/plugins/${pluginId}/content-types/${uid}` });\n\n onCloseModal();\n } else {\n // NOTE: we have to assume we have a CT here until we refactor more\n const contentType = type as ContentType;\n // We cannot switch from collection type to single when the modal is making relations other than oneWay or manyWay\n if (canEditContentType(contentType, modifiedData)) {\n onCloseModal();\n\n await updateSchema({\n uid: contentType.uid,\n data: {\n displayName: modifiedData.displayName,\n kind: modifiedData.kind,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n },\n });\n } else {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.contentType.relations.conflict' }),\n });\n }\n\n return;\n }\n // We are creating a component using the component modal from the left menu\n } else if (modalType === 'component') {\n if (isCreating) {\n // Create the component schema\n const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);\n const { category, ...rest } = modifiedData;\n\n createComponentSchema({\n data: {\n displayName: rest.displayName,\n icon: rest.icon,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Redirect the user to the created component\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`,\n });\n\n onCloseModal();\n\n return;\n } else {\n updateComponentSchema({\n data: {\n icon: modifiedData.icon,\n displayName: modifiedData.displayName,\n },\n componentUID: targetUid,\n });\n\n if (type.status === 'NEW') {\n const componentUid = createComponentUid(\n modifiedData.displayName,\n modifiedData.category\n );\n\n updateComponentUid({\n componentUID: targetUid,\n newComponentUID: componentUid,\n });\n\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${modifiedData.category}/${componentUid}`,\n });\n }\n\n // Close the modal\n onCloseModal();\n\n return;\n }\n } else if (isCreatingCustomFieldAttribute) {\n const customFieldAttributeUpdate = {\n attributeToSet: { ...modifiedData, customField: customFieldUid },\n forTarget,\n targetUid,\n name: initialData.name,\n };\n\n if (actionType === 'edit') {\n editCustomFieldAttribute(customFieldAttributeUpdate);\n } else {\n addCustomFieldAttribute(customFieldAttributeUpdate);\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n } else if (isCreatingAttribute && !isCreatingComponentFromAView) {\n const isDynamicZoneAttribute = attributeType === 'dynamiczone';\n\n // The user is creating a DZ (he had entered the name of the dz)\n if (isDynamicZoneAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n // Adding a component to a dynamiczone is not the same logic as creating a simple field\n // so the search is different\n if (isCreating) {\n // Step 1 of adding a component to a DZ, the user has the option to create a component\n dispatch(actions.resetPropsAndSetTheFormForAddingACompoToADz());\n\n setActiveTab('basic');\n onNavigateToAddCompoToDZModal({ dynamicZoneTarget: modifiedData.name });\n } else {\n onCloseModal();\n }\n\n return;\n }\n\n // Normal fields like boolean relations or dynamic zone\n if (!isComponentAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n\n // Adding an existing component\n }\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep) {\n // Navigate the user to step 2\n onNavigateToCreateComponentStep2();\n\n // Clear the reducer and prepare the modified data\n // This way we don't have to add some logic to re-run the useEffect\n // The first step is either needed to create a component or just to navigate\n // To the modal for adding a \"common field\"\n dispatch(\n actions.resetPropsAndSetFormForAddingAnExistingCompo({\n uid: type.uid,\n })\n );\n\n // We don't want all the props to be reset\n return;\n\n // Here we are in step 2\n // The step 2 is also use to edit an attribute that is a component\n }\n\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n // Ensure conditions are explicitly set to undefined if they were removed\n // Explicitly set conditions to undefined when they're removed to distinguish between:\n // 1. missing property: \"don't change existing conditions\" (partial update)\n // 2. undefined property: \"delete conditions\" (explicit removal)\n // This allows the backend to detect user intent:\n // { name: \"field\" } vs { name: \"field\", conditions: undefined }\n // without this, deleted conditions would be preserved by the backend's\n // reuseUnsetPreviousProperties function.\n const attributeData = { ...modifiedData };\n if (!('conditions' in modifiedData) || modifiedData.conditions === undefined) {\n // Explicitly add the conditions key with undefined value\n attributeData.conditions = undefined;\n }\n\n editAttribute({\n attributeToSet: attributeData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid,\n });\n } else {\n onCloseModal();\n }\n\n // We don't need to end the loop here we want the reducer to be reinitialized\n\n // Logic for creating a component without clicking on the link in\n // the left menu\n // We need to separate the logic otherwise the component would be created\n // even though the user didn't set any field\n // We need to prevent the component from being created if the user closes the modal at step 2 without any submission\n } else if (isCreatingAttribute && isCreatingComponentFromAView) {\n // Step 1\n if (isInFirstComponentStep) {\n // Here the search could be refactored since it is the same as the case from above\n // Navigate the user to step 2\n\n trackUsage('willCreateComponentFromAttributesModal');\n\n // Here we clear the reducer state but we also keep the created component\n // If we were to create the component before\n dispatch(\n actions.resetPropsAndSaveCurrentData({\n uid: type.uid,\n })\n );\n\n onNavigateToCreateComponentStep2();\n\n // Terminate because we don't want the reducer to be entirely reset\n return;\n\n // Step 2 of creating a component (which is setting the attribute name in the parent's schema)\n }\n // We are destructuring because the modifiedData object doesn't have the appropriate format to create a field\n const { category, ...rest } = componentToCreate;\n // Create a the component temp UID\n // This could be refactored but I think it's more understandable to separate the logic\n const componentUid = createComponentUid(componentToCreate.displayName, category);\n // Create the component first and add it to the components data\n createComponentSchema({\n // Component data\n data: {\n icon: rest.icon,\n displayName: rest.displayName,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Add the field to the schema\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n\n dispatch(actions.resetProps());\n\n // Open modal attribute for adding attr to component\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n onCloseModal();\n }\n\n return;\n } else {\n // The modal is addComponentToDynamicZone\n if (isInFirstComponentStep) {\n if (isCreatingComponentFromAView) {\n const { category, type, ...rest } = modifiedData.componentToCreate;\n const componentUid = createComponentUid(\n modifiedData.componentToCreate.displayName,\n category\n );\n // Create the component first and add it to the components data\n createComponentSchema({\n data: rest,\n uid: componentUid,\n componentCategory: category,\n });\n // Add the created component to the DZ\n // We don't want to remove the old ones\n addCreatedComponentToDynamicZone({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n componentsToAdd: [componentUid],\n });\n\n // The Dynamic Zone and the component is created\n // Open the modal to add fields to the created component\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n // Add the components to the DZ\n changeDynamicZoneComponents({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n newComponents: modifiedData.components,\n });\n\n onCloseModal();\n }\n } else {\n console.error('This case is not handled');\n }\n\n return;\n }\n\n dispatch(actions.resetProps());\n } catch (err: unknown) {\n if (yup.ValidationError.isError(err)) {\n const errors = getYupInnerErrors(err);\n\n dispatch(\n actions.setErrors({\n errors,\n })\n );\n }\n }\n };\n\n const handleSubmit = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n e.preventDefault();\n\n // Check for field name changes when clicking Finish\n const referencedFields = checkFieldNameChanges();\n if (referencedFields) {\n setPendingSubmit({ e, shouldContinue });\n setShowWarningDialog(true);\n return;\n }\n\n await submitForm(e, shouldContinue);\n };\n\n const handleConfirmClose = () => {\n // eslint-disable-next-line no-alert\n const confirm = window.confirm(\n formatMessage({\n id: 'window.confirm.close-modal.file',\n defaultMessage: 'Are you sure? Your changes will be lost.',\n })\n );\n\n if (confirm) {\n onCloseModal();\n dispatch(actions.resetProps());\n }\n };\n\n const handleClosed = () => {\n // Close the modal\n if (!isEqual(modifiedData, initialData)) {\n handleConfirmClose();\n } else {\n onCloseModal();\n // Reset the reducer\n dispatch(actions.resetProps());\n }\n };\n\n const sendAdvancedTabEvent = (tab: string) => {\n if (tab !== 'advanced') {\n return;\n }\n\n if (isCreatingContentType) {\n trackUsage('didSelectContentTypeSettings');\n\n return;\n }\n\n if (forTarget === 'contentType') {\n trackUsage('didSelectContentTypeFieldSettings');\n }\n };\n\n const sendButtonAddMoreFieldEvent = (shouldContinue: boolean) => {\n if (\n modalType === 'attribute' &&\n forTarget === 'contentType' &&\n attributeType !== 'dynamiczone' &&\n shouldContinue\n ) {\n trackUsage('willAddMoreFieldToContentType');\n }\n };\n\n const shouldDisableAdvancedTab = () => {\n if (modalType === 'component') {\n return true;\n }\n\n if (has(modifiedData, 'createComponent')) {\n return true;\n }\n\n return false;\n };\n\n // Display data for the attributes picker modal\n const displayedAttributes = getAttributesToDisplay(\n forTarget,\n targetUid,\n // We need the nested components so we know when to remove the component option\n nestedComponents\n );\n\n if (!modalType) {\n return null;\n }\n\n const formToDisplay = get(forms, [modalType, 'form'], {\n advanced: () => ({\n sections: [],\n }),\n base: () => ({\n sections: [],\n }),\n });\n\n const isAddingAComponentToAnotherComponent = forTarget === 'component';\n\n const genericInputProps = {\n customInputs: {\n 'allowed-types-select': AllowedTypesSelect,\n 'boolean-radio-group': BooleanRadioGroup,\n 'checkbox-with-number-field': CheckboxWithNumberField,\n 'icon-picker': IconPicker,\n 'content-type-radio-group': ContentTypeRadioGroup,\n 'radio-group': CustomRadioGroup,\n relation: Relation,\n 'select-category': SelectCategory,\n 'select-component': SelectComponent,\n 'select-components': SelectComponents,\n 'select-default-boolean': BooleanDefaultValueSelect,\n 'select-number': SelectNumber,\n 'select-date': SelectDateType,\n 'toggle-draft-publish': DraftAndPublishToggle,\n 'text-plural': PluralName,\n 'text-singular': SingularName,\n 'textarea-enum': TextareaEnum,\n 'condition-form': ConditionForm,\n ...inputsFromPlugins,\n },\n componentToCreate,\n dynamicZoneTarget,\n formErrors,\n isAddingAComponentToAnotherComponent,\n isCreatingComponentWhileAddingAField,\n mainBoxHeader: get(type, ['info', 'displayName'], ''),\n modifiedData,\n naturePickerType: forTarget,\n isCreating,\n targetUid,\n forTarget,\n contentTypeSchema: type,\n };\n\n const advancedForm = formToDisplay.advanced({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n const baseForm = formToDisplay.base({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n\n const baseFormInputNames = getFormInputNames(baseForm);\n\n const advancedFormInputNames = getFormInputNames(advancedForm);\n const doesBaseFormHasError = Object.keys(formErrors).some((key) =>\n baseFormInputNames.includes(key)\n );\n\n const doesAdvancedFormHasError = Object.keys(formErrors).some((key) =>\n advancedFormInputNames.includes(key)\n );\n\n const schemaKind = get(contentTypes, [targetUid, 'kind']);\n\n const checkIsEditingFieldName = () =>\n actionType === 'edit' && attributes.every(({ name }) => name !== modifiedData?.name);\n\n const handleClickFinish = () => {\n if (checkIsEditingFieldName()) {\n trackUsage('didEditFieldNameOnContentType');\n }\n dispatchGuidedTour({\n type: 'set_completed_actions',\n payload: [GUIDED_TOUR_REQUIRED_ACTIONS.contentTypeBuilder.addField],\n });\n };\n\n return (\n <Modal.Root open={isOpen} onOpenChange={handleClosed}>\n <Modal.Content>\n <Dialog.Root open={showWarningDialog} onOpenChange={setShowWarningDialog}>\n <Dialog.Trigger />\n <ConfirmDialog\n onConfirm={() => {\n if (pendingSubmit) {\n const { e, shouldContinue } = pendingSubmit;\n setShowWarningDialog(false);\n setPendingSubmit(null);\n submitForm(e, shouldContinue);\n }\n }}\n onCancel={() => {\n setShowWarningDialog(false);\n setPendingSubmit(null);\n }}\n >\n {(() => {\n const referencedFields = checkFieldNameChanges();\n if (!referencedFields) return null;\n\n const fieldNames = referencedFields.map((field: any) => field.name).join(', ');\n const isEnum = initialData.enum && modifiedData.enum;\n\n if (isEnum) {\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n const deletedOrChangedValues = oldEnum.filter(\n (value: string) => !newEnum.includes(value)\n );\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-values',\n defaultMessage: '. Changing or removing the enum values ',\n })}\n <Typography fontWeight=\"bold\">{deletedOrChangedValues.join(', ')}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-end',\n defaultMessage: ' will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning-end',\n defaultMessage:\n '. Renaming it will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n })()}\n </ConfirmDialog>\n </Dialog.Root>\n <FormModalHeader\n actionType={actionType}\n attributeName={attributeName}\n contentTypeKind={kind as IconByType}\n dynamicZoneTarget={dynamicZoneTarget}\n modalType={modalType}\n forTarget={forTarget}\n targetUid={targetUid}\n attributeType={attributeType as IconByType}\n customFieldUid={customFieldUid}\n showBackLink={showBackLink}\n />\n {isPickingAttribute && (\n <AttributeOptions\n attributes={displayedAttributes}\n forTarget={forTarget}\n kind={schemaKind || 'collectionType'}\n />\n )}\n {!isPickingAttribute && (\n <FormComponent onSubmit={handleSubmit}>\n <Modal.Body>\n <Tabs.Root\n variant=\"simple\"\n value={activeTab}\n onValueChange={(value) => {\n setActiveTab(value);\n sendAdvancedTabEvent(value);\n }}\n hasError={\n doesBaseFormHasError ? 'basic' : doesAdvancedFormHasError ? 'advanced' : undefined\n }\n >\n <Flex justifyContent=\"space-between\">\n <FormModalSubHeader\n actionType={actionType}\n forTarget={forTarget}\n kind={kind}\n step={step}\n modalType={modalType}\n attributeType={attributeType}\n attributeName={attributeName}\n customField={customField}\n />\n <Tabs.List>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTrad('popUpForm.navContainer.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\" disabled={shouldDisableAdvancedTab()}>\n {formatMessage({\n id: getTrad('popUpForm.navContainer.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider marginBottom={6} />\n <Tabs.Content value=\"basic\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={baseForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={advancedForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n </Tabs.Root>\n </Modal.Body>\n <Modal.Footer>\n <Button\n type=\"button\"\n variant=\"tertiary\"\n onClick={(e) => {\n e.preventDefault();\n handleClosed();\n }}\n >\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n {/* TODO: refactor this component. Nuf said. */}\n <FormModalEndActions\n deleteContentType={() => deleteContentType(targetUid as Internal.UID.ContentType)}\n deleteComponent={() => deleteComponent(targetUid as Internal.UID.Component)}\n isAttributeModal={modalType === 'attribute'}\n isCustomFieldModal={modalType === 'customField'}\n isComponentToDzModal={modalType === 'addComponentToDynamicZone'}\n isComponentAttribute={attributeType === 'component'}\n isComponentModal={modalType === 'component'}\n isContentTypeModal={modalType === 'contentType'}\n isCreatingComponent={actionType === 'create'}\n isCreatingDz={actionType === 'create'}\n isCreatingComponentAttribute={modifiedData.createComponent || false}\n isCreatingComponentInDz={modifiedData.createComponent || false}\n isCreatingComponentWhileAddingAField={isCreatingComponentWhileAddingAField}\n isCreatingContentType={actionType === 'create'}\n isEditingAttribute={actionType === 'edit'}\n isDzAttribute={attributeType === 'dynamiczone'}\n isInFirstComponentStep={step === '1'}\n onSubmitAddComponentAttribute={handleSubmit}\n onSubmitAddComponentToDz={handleSubmit}\n onSubmitCreateComponent={handleSubmit}\n onSubmitCreateContentType={handleSubmit}\n onSubmitCreateDz={handleSubmit}\n onSubmitEditAttribute={handleSubmit}\n onSubmitEditComponent={handleSubmit}\n onSubmitEditContentType={handleSubmit}\n onSubmitEditCustomFieldAttribute={handleSubmit}\n onSubmitEditDz={handleSubmit}\n onClickFinish={handleClickFinish}\n />\n </Modal.Footer>\n </FormComponent>\n )}\n </Modal.Content>\n </Modal.Root>\n );\n};\n"],"names":["FormComponent","styled","form","selectState","state","initialState","FormModal","onCloseModal","onNavigateToChooseAttributeModal","onNavigateToAddCompoToDZModal","onNavigateToCreateComponentStep2","actionType","attributeName","attributeType","customFieldUid","dynamicZoneTarget","forTarget","modalType","isOpen","kind","step","targetUid","showBackLink","activeTab","setActiveTab","useFormModalNavigation","getPlugin","useStrapiApp","getCustomField","customFields","get","customField","dispatch","useDispatch","toggleNotification","useNotification","reducerState","useSelector","shallowEqual","navigate","useNavigate","trackUsage","useCTBTracking","formatMessage","useIntl","ctbPlugin","pluginId","ctbFormsAPI","apis","forms","inputsFromPlugins","components","inputs","dispatchGuidedTour","useGuidedTour","s","addAttribute","editAttribute","addCustomFieldAttribute","addCreatedComponentToDynamicZone","changeDynamicZoneComponents","contentTypes","createSchema","createComponentSchema","deleteComponent","deleteContentType","editCustomFieldAttribute","updateSchema","nestedComponents","sortedContentTypesList","updateComponentSchema","updateComponentUid","reservedNames","useDataManager","componentToCreate","formErrors","initialData","isCreatingComponentWhileAddingAField","modifiedData","type","showWarningDialog","setShowWarningDialog","useState","pendingSubmit","setPendingSubmit","checkFieldNameChanges","oldName","name","oldEnum","enum","newEnum","contentTypeAttributes","attributes","referencedFields","filter","attr","conditions","condition","visible","Object","entries","fieldVar","value","var","deletedOrChangedValues","oldValue","includes","length","React","useEffect","collectionTypesForRelation","isAllowedContentTypesForRelations","foundDynamicZoneTarget","findAttribute","actions","setDataToEdit","data","draftAndPublish","displayName","info","options","pluginOptions","pluralName","singularName","category","icon","attributeToEdit","createComponent","setDynamicZoneDataSchema","attributeToEditNotFormatted","repeatable","set","setCustomFieldDataSchema","isEditing","modifiedDataToSetForEditing","uid","pick","setAttributeDataSchema","nameToSetForRelation","resetProps","isCreatingContentType","isCreatingComponent","isCreatingAttribute","isCreatingCustomFieldAttribute","isComponentAttribute","isCreating","isCreatingComponentFromAView","isInFirstComponentStep","isPickingAttribute","createUid","checkFormValidity","schema","dataToValidate","contentType","keys","component","schemaAttributes","schemaData","customFieldValidator","validator","computedAttrbiuteType","alreadyTakenTargetContentTypeAttributes","targetContentTypeUID","targetContentTypeAttributes","attrName","targetAttribute","attribute","validate","abortEarly","handleChange","useCallback","target","rest","namesThatCanResetToNullValue","val","Array","isArray","clonedErrors","assign","min","minLength","setErrors","errors","onChange","split","submitForm","e","shouldContinue","sendButtonAddMoreFieldEvent","ctTargetUid","pathname","canEditContentType","message","id","componentUid","createComponentUid","componentCategory","componentUID","status","newComponentUID","customFieldAttributeUpdate","attributeToSet","isDynamicZoneAttribute","resetPropsAndSetTheFormForAddingACompoToADz","resetPropsAndSetFormForAddingAnExistingCompo","attributeData","undefined","resetPropsAndSaveCurrentData","componentsToAdd","newComponents","console","error","err","yup","ValidationError","isError","getYupInnerErrors","handleSubmit","preventDefault","handleConfirmClose","confirm","window","defaultMessage","handleClosed","isEqual","sendAdvancedTabEvent","tab","shouldDisableAdvancedTab","has","displayedAttributes","getAttributesToDisplay","formToDisplay","advanced","sections","base","isAddingAComponentToAnotherComponent","genericInputProps","customInputs","AllowedTypesSelect","BooleanRadioGroup","CheckboxWithNumberField","IconPicker","ContentTypeRadioGroup","CustomRadioGroup","relation","Relation","SelectCategory","SelectComponent","SelectComponents","BooleanDefaultValueSelect","SelectNumber","SelectDateType","DraftAndPublishToggle","PluralName","SingularName","TextareaEnum","ConditionForm","mainBoxHeader","naturePickerType","contentTypeSchema","advancedForm","extensions","baseForm","baseFormInputNames","getFormInputNames","advancedFormInputNames","doesBaseFormHasError","some","key","doesAdvancedFormHasError","schemaKind","checkIsEditingFieldName","every","handleClickFinish","payload","GUIDED_TOUR_REQUIRED_ACTIONS","contentTypeBuilder","addField","_jsx","Modal","Root","open","onOpenChange","_jsxs","Content","Dialog","Trigger","ConfirmDialog","onConfirm","onCancel","fieldNames","map","field","join","isEnum","Box","Typography","fontWeight","FormModalHeader","contentTypeKind","AttributeOptions","onSubmit","Body","Tabs","variant","onValueChange","hasError","Flex","justifyContent","FormModalSubHeader","List","getTrad","disabled","Divider","marginBottom","direction","alignItems","gap","TabForm","Footer","Button","onClick","FormModalEndActions","isAttributeModal","isCustomFieldModal","isComponentToDzModal","isComponentModal","isContentTypeModal","isCreatingDz","isCreatingComponentAttribute","isCreatingComponentInDz","isEditingAttribute","isDzAttribute","onSubmitAddComponentAttribute","onSubmitAddComponentToDz","onSubmitCreateComponent","onSubmitCreateContentType","onSubmitCreateDz","onSubmitEditAttribute","onSubmitEditComponent","onSubmitEditContentType","onSubmitEditCustomFieldAttribute","onSubmitEditDz","onClickFinish"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAMA,aAAAA,GAAgBC,uBAAAA,CAAOC,IAAI;;AAEjC,CAAC;AAED,MAAMC,cAAc,CAACC,KAAAA,GAClBA,KAAK,CAAC,iCAAiC,IAAIC,oBAAAA;MAEjCC,SAAAA,GAAY,IAAA;AACvB,IAAA,MAAM,EACJC,YAAY,EACZC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gCAAgC,EAChCC,UAAU,EACVC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,YAAY,EACb,GAAGC,6CAAAA,EAAAA;AAEJ,IAAA,MAAMC,YAAYC,wBAAAA,CAAa,WAAA,EAAa,CAACvB,KAAAA,GAAUA,MAAMsB,SAAS,CAAA;IACtE,MAAME,cAAAA,GAAiBD,yBAAa,WAAA,EAAa,CAACvB,QAAUA,KAAAA,CAAMyB,YAAY,CAACC,GAAG,CAAA;AAClF,IAAA,MAAMC,cAAcH,cAAAA,CAAed,cAAAA,CAAAA;AAEnC,IAAA,MAAMkB,QAAAA,GAAWC,sBAAAA,EAAAA;IACjB,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,2BAAAA,EAAAA;IAC/B,MAAMC,YAAAA,GAAeC,uBAAYlC,WAAAA,EAAamC,uBAAAA,CAAAA;AAE9C,IAAA,MAAMC,QAAAA,GAAWC,0BAAAA,EAAAA;IACjB,MAAM,EAAEC,UAAU,EAAE,GAAGC,6BAAAA,EA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Ae,QAAA;AACpC6T,oCAAAA,YAAAA,EAAc7T,UAAAA,KAAe,QAAA;oCAC7B8T,4BAAAA,EAA8B3P,YAAAA,CAAaiD,eAAe,IAAI,KAAA;oCAC9D2M,uBAAAA,EAAyB5P,YAAAA,CAAaiD,eAAe,IAAI,KAAA;oCACzDlD,oCAAAA,EAAsCA,oCAAAA;AACtC+D,oCAAAA,qBAAAA,EAAuBjI,UAAAA,KAAe,QAAA;AACtCgU,oCAAAA,kBAAAA,EAAoBhU,UAAAA,KAAe,MAAA;AACnCiU,oCAAAA,aAAAA,EAAe/T,aAAAA,KAAkB,aAAA;AACjCsI,oCAAAA,sBAAAA,EAAwB/H,IAAAA,KAAS,GAAA;oCACjCyT,6BAAAA,EAA+BpH,YAAAA;oCAC/BqH,wBAAAA,EAA0BrH,YAAAA;oCAC1BsH,uBAAAA,EAAyBtH,YAAAA;oCACzBuH,yBAAAA,EAA2BvH,YAAAA;oCAC3BwH,gBAAAA,EAAkBxH,YAAAA;oCAClByH,qBAAAA,EAAuBzH,YAAAA;oCACvB0H,qBAAAA,EAAuB1H,YAAAA;oCACvB2H,uBAAAA,EAAyB3H,YAAAA;oCACzB4H,gCAAAA,EAAkC5H,YAAAA;oCAClC6H,cAAAA,EAAgB7H,YAAAA;oCAChB8H,aAAAA,EAAetE;;;;;;;;;AAQ/B;;;;"}
|
|
1
|
+
{"version":3,"file":"FormModal.js","sources":["../../../../admin/src/components/FormModal/FormModal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useState } from 'react';\n\nimport {\n useStrapiApp,\n useNotification,\n ConfirmDialog,\n useGuidedTour,\n GUIDED_TOUR_REQUIRED_ACTIONS,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Modal, Tabs, Box, Typography, Dialog } from '@strapi/design-system';\nimport get from 'lodash/get';\nimport has from 'lodash/has';\nimport isEqual from 'lodash/isEqual';\nimport pick from 'lodash/pick';\nimport set from 'lodash/set';\nimport { useIntl } from 'react-intl';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport * as yup from 'yup';\n\nimport { pluginId } from '../../pluginId';\nimport { getTrad, isAllowedContentTypesForRelations } from '../../utils';\nimport { findAttribute } from '../../utils/findAttribute';\nimport { getYupInnerErrors } from '../../utils/getYupInnerErrors';\n// New compos\nimport { AllowedTypesSelect } from '../AllowedTypesSelect';\nimport { IconByType } from '../AttributeIcon';\nimport { AttributeOptions } from '../AttributeOptions/AttributeOptions';\nimport { BooleanDefaultValueSelect } from '../BooleanDefaultValueSelect';\nimport { BooleanRadioGroup } from '../BooleanRadioGroup';\nimport { CheckboxWithNumberField } from '../CheckboxWithNumberField';\nimport { ContentTypeRadioGroup } from '../ContentTypeRadioGroup';\nimport { useCTBTracking } from '../CTBSession/ctbSession';\nimport { CustomRadioGroup } from '../CustomRadioGroup';\nimport { useDataManager } from '../DataManager/useDataManager';\nimport { DraftAndPublishToggle } from '../DraftAndPublishToggle';\nimport { FormModalEndActions } from '../FormModalEndActions';\nimport { FormModalHeader } from '../FormModalHeader';\nimport { useFormModalNavigation } from '../FormModalNavigation/useFormModalNavigation';\nimport { FormModalSubHeader } from '../FormModalSubHeader';\nimport { IconPicker } from '../IconPicker/IconPicker';\nimport { PluralName } from '../PluralName';\nimport { Relation } from '../Relation/Relation';\nimport { SelectCategory } from '../SelectCategory';\nimport { SelectComponent } from '../SelectComponent';\nimport { SelectComponents } from '../SelectComponents';\nimport { SelectDateType } from '../SelectDateType';\nimport { SelectNumber } from '../SelectNumber';\nimport { SingularName } from '../SingularName';\nimport { TabForm } from '../TabForm';\nimport { TextareaEnum } from '../TextareaEnum';\n\nimport { ConditionForm } from './attributes/ConditionForm';\nimport { forms } from './forms/forms';\nimport { actions, initialState, type State as FormModalState } from './reducer';\nimport { canEditContentType } from './utils/canEditContentType';\nimport { createComponentUid, createUid } from './utils/createUid';\nimport { getAttributesToDisplay } from './utils/getAttributesToDisplay';\nimport { getFormInputNames } from './utils/getFormInputNames';\n\nimport type { ContentType } from '../../types';\nimport type { Internal } from '@strapi/types';\n\nconst FormComponent = styled.form`\n overflow: auto;\n`;\n\nconst selectState = (state: Record<string, unknown>) =>\n (state['content-type-builder_formModal'] || initialState) as FormModalState;\n\nexport const FormModal = () => {\n const {\n onCloseModal,\n onNavigateToChooseAttributeModal,\n onNavigateToAddCompoToDZModal,\n onNavigateToCreateComponentStep2,\n actionType,\n attributeName,\n attributeType,\n customFieldUid,\n dynamicZoneTarget,\n forTarget,\n modalType,\n isOpen,\n kind,\n step,\n targetUid,\n showBackLink,\n activeTab,\n setActiveTab,\n } = useFormModalNavigation();\n\n const getPlugin = useStrapiApp('FormModal', (state) => state.getPlugin);\n const getCustomField = useStrapiApp('FormModal', (state) => state.customFields.get);\n const customField = getCustomField(customFieldUid);\n\n const dispatch = useDispatch();\n const { toggleNotification } = useNotification();\n const reducerState = useSelector(selectState, shallowEqual);\n\n const navigate = useNavigate();\n const { trackUsage } = useCTBTracking();\n const { formatMessage } = useIntl();\n const ctbPlugin = getPlugin(pluginId);\n const ctbFormsAPI: any = ctbPlugin?.apis.forms;\n const inputsFromPlugins = ctbFormsAPI.components.inputs;\n\n const dispatchGuidedTour = useGuidedTour('FormModal', (s) => s.dispatch);\n\n const {\n addAttribute,\n editAttribute,\n addCustomFieldAttribute,\n addCreatedComponentToDynamicZone,\n changeDynamicZoneComponents,\n contentTypes,\n components,\n createSchema,\n createComponentSchema,\n deleteComponent,\n deleteContentType,\n editCustomFieldAttribute,\n updateSchema,\n nestedComponents,\n sortedContentTypesList,\n updateComponentSchema,\n updateComponentUid,\n reservedNames,\n } = useDataManager();\n\n const {\n componentToCreate,\n formErrors,\n initialData,\n isCreatingComponentWhileAddingAField,\n modifiedData,\n } = reducerState;\n\n const type = forTarget === 'component' ? components[targetUid] : contentTypes[targetUid];\n\n const [showWarningDialog, setShowWarningDialog] = useState(false);\n const [pendingSubmit, setPendingSubmit] = useState<any>(null);\n\n const checkFieldNameChanges = () => {\n // Only check when editing an attribute\n if (actionType !== 'edit' || modalType !== 'attribute') {\n return false;\n }\n\n const oldName = initialData.name;\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n\n // Get all attributes from the content type schema\n const contentTypeAttributes = type?.attributes || [];\n\n // Find all fields that reference this field in their conditions\n const referencedFields = contentTypeAttributes.filter((attr: any) => {\n if (!attr.conditions) return false;\n\n const condition = attr.conditions.visible;\n if (!condition) return false;\n\n const [[, conditions]] = Object.entries(condition);\n const [fieldVar, value] = conditions as [{ var: string }, any];\n\n // Check if this condition references our field\n if (fieldVar.var !== oldName) return false;\n\n // If it's an enum field, also check if the value is being deleted/changed\n if (oldEnum && newEnum) {\n const deletedOrChangedValues = oldEnum.filter(\n (oldValue: string) => !newEnum.includes(oldValue)\n );\n return deletedOrChangedValues.includes(value);\n }\n\n return true;\n });\n\n // If any fields reference this field, return them\n if (referencedFields.length > 0) {\n return referencedFields;\n }\n\n return false;\n };\n\n React.useEffect(() => {\n if (isOpen) {\n const collectionTypesForRelation = sortedContentTypesList.filter(\n isAllowedContentTypesForRelations\n );\n\n if (actionType === 'edit' && modalType === 'attribute' && forTarget === 'contentType') {\n trackUsage('willEditFieldOfContentType');\n }\n\n // Case:\n // the user opens the modal chooseAttributes\n // selects dynamic zone => set the field name\n // then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.\n // In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown\n const foundDynamicZoneTarget =\n findAttribute(get(type, 'schema.attributes', []), dynamicZoneTarget) || null;\n\n // Create content type we need to add the default option draftAndPublish\n if (modalType === 'contentType' && actionType === 'create') {\n dispatch(\n actions.setDataToEdit({\n data: {\n draftAndPublish: true,\n },\n })\n );\n }\n\n // Edit content type\n if (modalType === 'contentType' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n draftAndPublish: type.options?.draftAndPublish,\n kind: 'kind' in type && type.kind,\n pluginOptions: type.pluginOptions,\n pluralName: 'pluralName' in type.info && type.info.pluralName,\n singularName: 'singularName' in type.info && type.info.singularName,\n },\n })\n );\n }\n\n // Edit component\n if (modalType === 'component' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n category: 'category' in type && type.category,\n icon: type.info.icon,\n },\n })\n );\n }\n\n // Special case for the dynamic zone\n if (modalType === 'addComponentToDynamicZone' && actionType === 'edit') {\n const attributeToEdit = {\n ...foundDynamicZoneTarget,\n // We filter the available components\n // Because this modal is only used for adding components\n components: [],\n name: dynamicZoneTarget,\n createComponent: false,\n componentToCreate: { type: 'component' },\n };\n\n dispatch(\n actions.setDynamicZoneDataSchema({\n attributeToEdit,\n })\n );\n }\n\n // Set the predefined data structure to create an attribute\n if (attributeType) {\n const attributeToEditNotFormatted = findAttribute(\n get(type, ['attributes'], []),\n attributeName\n );\n const attributeToEdit = {\n ...attributeToEditNotFormatted,\n name: attributeName,\n };\n\n // We need to set the repeatable key to false when editing a component\n // The API doesn't send this info\n if (attributeType === 'component' && actionType === 'edit') {\n if (!('repeatable' in attributeToEdit) || !attributeToEdit.repeatable) {\n set(attributeToEdit, 'repeatable', false);\n }\n }\n\n if (modalType === 'customField') {\n if (actionType === 'edit') {\n dispatch(\n actions.setCustomFieldDataSchema({\n isEditing: true,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n } else {\n dispatch(\n actions.setCustomFieldDataSchema({\n customField: pick(customField, ['type', 'options']),\n isEditing: false,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n }\n } else {\n dispatch(\n actions.setAttributeDataSchema({\n attributeType,\n nameToSetForRelation: get(collectionTypesForRelation, ['0', 'title'], 'error'),\n targetUid: get(collectionTypesForRelation, ['0', 'uid'], 'error'),\n isEditing: actionType === 'edit',\n modifiedDataToSetForEditing: attributeToEdit,\n step,\n uid: type.uid,\n })\n );\n }\n }\n } else {\n dispatch(actions.resetProps());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionType, attributeName, attributeType, dynamicZoneTarget, forTarget, isOpen, modalType]);\n\n const isCreatingContentType = modalType === 'contentType';\n const isCreatingComponent = modalType === 'component';\n const isCreatingAttribute = modalType === 'attribute';\n const isCreatingCustomFieldAttribute = modalType === 'customField';\n const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;\n const isCreating = actionType === 'create';\n const isCreatingComponentFromAView =\n get(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;\n const isInFirstComponentStep = step === '1';\n const isPickingAttribute = modalType === 'chooseAttribute';\n const uid = createUid(modifiedData.singularName || '');\n const attributes = get(type, ['attributes'], null) as {\n name: string;\n }[];\n\n const checkFormValidity = async () => {\n let schema;\n const dataToValidate =\n isCreatingComponentFromAView && step === '1'\n ? get(modifiedData, 'componentToCreate', {})\n : modifiedData;\n // Check form validity for content type\n if (isCreatingContentType) {\n schema = forms.contentType.schema(\n Object.keys(contentTypes),\n actionType === 'edit',\n // currentUID\n (type?.uid ?? null) as Internal.UID.ContentType,\n reservedNames,\n ctbFormsAPI,\n contentTypes\n );\n\n // Check form validity for component\n // This is happening when the user click on the link from the left menu\n } else if (isCreatingComponent) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n modifiedData.category || '',\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.displayName || '',\n (type?.uid ?? null) as Internal.UID.Component\n // ctbFormsAPI\n );\n } else if (isCreatingCustomFieldAttribute) {\n schema = forms.customField.schema({\n schemaAttributes: get(type, ['attributes'], []),\n attributeType: customField!.type,\n reservedNames,\n schemaData: { modifiedData, initialData },\n ctbFormsAPI,\n customFieldValidator: customField!.options?.validator,\n });\n\n // Check for validity for creating a component\n // This is happening when the user creates a component \"on the fly\"\n // Since we temporarily store the component info in another object\n // The data is set in the componentToCreate key\n } else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n\n // Check form validity for creating a 'common attribute'\n // We need to make sure that it is independent from the step\n } else if (isCreatingAttribute && !isInFirstComponentStep) {\n const computedAttrbiuteType = attributeType === 'relation' ? 'relation' : modifiedData.type;\n\n let alreadyTakenTargetContentTypeAttributes: any[] = [];\n\n if (computedAttrbiuteType === 'relation') {\n const targetContentTypeUID = get(modifiedData, ['target'], null);\n\n const targetContentTypeAttributes = get(\n contentTypes,\n [targetContentTypeUID, 'attributes'],\n []\n );\n\n // Create an array with all the targetContentType attributes name\n // in order to prevent the user from creating a relation with a targetAttribute\n // that may exist in the other content type\n alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(\n ({ name: attrName }: { name: string }) => {\n // Keep all the target content type attributes when creating a relation\n if (actionType !== 'edit') {\n return true;\n }\n\n // Remove the already created one when editing\n return attrName !== initialData.targetAttribute;\n }\n );\n }\n schema = forms.attribute.schema(\n type,\n computedAttrbiuteType,\n reservedNames,\n alreadyTakenTargetContentTypeAttributes,\n { modifiedData, initialData },\n ctbFormsAPI\n );\n } else {\n // The user is either in the addComponentToDynamicZone modal or\n // in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep && isCreatingComponentFromAView) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n } else {\n // The form is valid\n // The case here is being in the addComponentToDynamicZone modal and not creating a component\n return;\n }\n }\n\n await schema.validate(dataToValidate, { abortEarly: false });\n };\n\n const handleChange = React.useCallback(\n ({\n target: { name, value, type, ...rest },\n }: {\n target: { name: string; value: string | string[]; type: string };\n }) => {\n const namesThatCanResetToNullValue = [\n 'enumName',\n 'max',\n 'min',\n 'maxLength',\n 'minLength',\n 'regex',\n 'default',\n ];\n\n let val;\n\n if (namesThatCanResetToNullValue.includes(name) && value === '') {\n val = null;\n } else if (name === 'enum') {\n // For enum values, ensure we're working with an array\n val = Array.isArray(value) ? value : [value];\n } else {\n val = value;\n }\n\n const clonedErrors = Object.assign({}, formErrors);\n\n // Reset min error when modifying the max\n if (name === 'max') {\n delete clonedErrors.min;\n }\n\n // Same here\n if (name === 'maxLength') {\n delete clonedErrors.minLength;\n }\n\n // Since the onBlur is deactivated we remove the errors directly when changing an input\n delete clonedErrors[name];\n\n dispatch(\n actions.setErrors({\n errors: clonedErrors,\n })\n );\n\n dispatch(\n actions.onChange({\n keys: name.split('.'),\n value: val,\n })\n );\n },\n [dispatch, formErrors]\n );\n\n const submitForm = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n try {\n await checkFormValidity();\n\n dispatch(\n actions.setErrors({\n errors: {},\n })\n );\n\n sendButtonAddMoreFieldEvent(shouldContinue);\n\n const ctTargetUid = targetUid;\n\n if (isCreatingContentType) {\n // Create the content type schema\n if (isCreating) {\n createSchema({\n data: {\n kind,\n displayName: modifiedData.displayName,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n singularName: modifiedData.singularName,\n pluralName: modifiedData.pluralName,\n },\n uid,\n });\n\n // Redirect the user to the created content type\n navigate({ pathname: `/plugins/${pluginId}/content-types/${uid}` });\n\n onCloseModal();\n } else {\n // NOTE: we have to assume we have a CT here until we refactor more\n const contentType = type as ContentType;\n // We cannot switch from collection type to single when the modal is making relations other than oneWay or manyWay\n if (canEditContentType(contentType, modifiedData)) {\n onCloseModal();\n\n await updateSchema({\n uid: contentType.uid,\n data: {\n displayName: modifiedData.displayName,\n kind: modifiedData.kind,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n },\n });\n } else {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.contentType.relations.conflict' }),\n });\n }\n\n return;\n }\n // We are creating a component using the component modal from the left menu\n } else if (modalType === 'component') {\n if (isCreating) {\n // Create the component schema\n const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);\n const { category, ...rest } = modifiedData;\n\n createComponentSchema({\n data: {\n displayName: rest.displayName,\n icon: rest.icon,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Redirect the user to the created component\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`,\n });\n\n onCloseModal();\n\n return;\n } else {\n updateComponentSchema({\n data: {\n icon: modifiedData.icon,\n displayName: modifiedData.displayName,\n },\n componentUID: targetUid,\n });\n\n if (type.status === 'NEW') {\n const componentUid = createComponentUid(\n modifiedData.displayName,\n modifiedData.category\n );\n\n updateComponentUid({\n componentUID: targetUid,\n newComponentUID: componentUid,\n });\n\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${modifiedData.category}/${componentUid}`,\n });\n }\n\n // Close the modal\n onCloseModal();\n\n return;\n }\n } else if (isCreatingCustomFieldAttribute) {\n const customFieldAttributeUpdate = {\n attributeToSet: { ...modifiedData, customField: customFieldUid },\n forTarget,\n targetUid,\n name: initialData.name,\n };\n\n if (actionType === 'edit') {\n editCustomFieldAttribute(customFieldAttributeUpdate);\n } else {\n addCustomFieldAttribute(customFieldAttributeUpdate);\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n } else if (isCreatingAttribute && !isCreatingComponentFromAView) {\n const isDynamicZoneAttribute = attributeType === 'dynamiczone';\n\n // The user is creating a DZ (he had entered the name of the dz)\n if (isDynamicZoneAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n // Adding a component to a dynamiczone is not the same logic as creating a simple field\n // so the search is different\n if (isCreating) {\n // Step 1 of adding a component to a DZ, the user has the option to create a component\n dispatch(actions.resetPropsAndSetTheFormForAddingACompoToADz());\n\n setActiveTab('basic');\n onNavigateToAddCompoToDZModal({ dynamicZoneTarget: modifiedData.name });\n } else {\n onCloseModal();\n }\n\n return;\n }\n\n // Normal fields like boolean relations or dynamic zone\n if (!isComponentAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n\n // Adding an existing component\n }\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep) {\n // Navigate the user to step 2\n onNavigateToCreateComponentStep2();\n\n // Clear the reducer and prepare the modified data\n // This way we don't have to add some logic to re-run the useEffect\n // The first step is either needed to create a component or just to navigate\n // To the modal for adding a \"common field\"\n dispatch(\n actions.resetPropsAndSetFormForAddingAnExistingCompo({\n uid: type.uid,\n })\n );\n\n // We don't want all the props to be reset\n return;\n\n // Here we are in step 2\n // The step 2 is also use to edit an attribute that is a component\n }\n\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n // Ensure conditions are explicitly set to undefined if they were removed\n // Explicitly set conditions to undefined when they're removed to distinguish between:\n // 1. missing property: \"don't change existing conditions\" (partial update)\n // 2. undefined property: \"delete conditions\" (explicit removal)\n // This allows the backend to detect user intent:\n // { name: \"field\" } vs { name: \"field\", conditions: undefined }\n // without this, deleted conditions would be preserved by the backend's\n // reuseUnsetPreviousProperties function.\n const attributeData = { ...modifiedData };\n if (!('conditions' in modifiedData) || modifiedData.conditions === undefined) {\n // Explicitly add the conditions key with undefined value\n attributeData.conditions = undefined;\n }\n\n editAttribute({\n attributeToSet: attributeData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid,\n });\n } else {\n onCloseModal();\n }\n\n // We don't need to end the loop here we want the reducer to be reinitialized\n\n // Logic for creating a component without clicking on the link in\n // the left menu\n // We need to separate the logic otherwise the component would be created\n // even though the user didn't set any field\n // We need to prevent the component from being created if the user closes the modal at step 2 without any submission\n } else if (isCreatingAttribute && isCreatingComponentFromAView) {\n // Step 1\n if (isInFirstComponentStep) {\n // Here the search could be refactored since it is the same as the case from above\n // Navigate the user to step 2\n\n trackUsage('willCreateComponentFromAttributesModal');\n\n // Here we clear the reducer state but we also keep the created component\n // If we were to create the component before\n dispatch(\n actions.resetPropsAndSaveCurrentData({\n uid: type.uid,\n })\n );\n\n onNavigateToCreateComponentStep2();\n\n // Terminate because we don't want the reducer to be entirely reset\n return;\n\n // Step 2 of creating a component (which is setting the attribute name in the parent's schema)\n }\n // We are destructuring because the modifiedData object doesn't have the appropriate format to create a field\n const { category, ...rest } = componentToCreate;\n // Create a the component temp UID\n // This could be refactored but I think it's more understandable to separate the logic\n const componentUid = createComponentUid(componentToCreate.displayName, category);\n // Create the component first and add it to the components data\n createComponentSchema({\n // Component data\n data: {\n icon: rest.icon,\n displayName: rest.displayName,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Add the field to the schema\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n\n dispatch(actions.resetProps());\n\n // Open modal attribute for adding attr to component\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n onCloseModal();\n }\n\n return;\n } else {\n // The modal is addComponentToDynamicZone\n if (isInFirstComponentStep) {\n if (isCreatingComponentFromAView) {\n const { category, type, ...rest } = modifiedData.componentToCreate;\n const componentUid = createComponentUid(\n modifiedData.componentToCreate.displayName,\n category\n );\n // Create the component first and add it to the components data\n createComponentSchema({\n data: rest,\n uid: componentUid,\n componentCategory: category,\n });\n // Add the created component to the DZ\n // We don't want to remove the old ones\n addCreatedComponentToDynamicZone({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n componentsToAdd: [componentUid],\n });\n\n // The Dynamic Zone and the component is created\n // Open the modal to add fields to the created component\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n // Add the components to the DZ\n changeDynamicZoneComponents({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n newComponents: modifiedData.components,\n });\n\n onCloseModal();\n }\n } else {\n console.error('This case is not handled');\n }\n\n return;\n }\n\n dispatch(actions.resetProps());\n } catch (err: unknown) {\n if (yup.ValidationError.isError(err)) {\n const errors = getYupInnerErrors(err);\n\n dispatch(\n actions.setErrors({\n errors,\n })\n );\n }\n }\n };\n\n const handleSubmit = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n e.preventDefault();\n\n // Check for field name changes when clicking Finish\n const referencedFields = checkFieldNameChanges();\n if (referencedFields) {\n setPendingSubmit({ e, shouldContinue });\n setShowWarningDialog(true);\n return;\n }\n\n await submitForm(e, shouldContinue);\n };\n\n const handleConfirmClose = () => {\n // eslint-disable-next-line no-alert\n const confirm = window.confirm(\n formatMessage({\n id: 'window.confirm.close-modal.file',\n defaultMessage: 'Are you sure? Your changes will be lost.',\n })\n );\n\n if (confirm) {\n onCloseModal();\n dispatch(actions.resetProps());\n }\n };\n\n const handleClosed = () => {\n // Close the modal\n if (!isEqual(modifiedData, initialData)) {\n handleConfirmClose();\n } else {\n onCloseModal();\n // Reset the reducer\n dispatch(actions.resetProps());\n }\n };\n\n const sendAdvancedTabEvent = (tab: string) => {\n if (tab !== 'advanced') {\n return;\n }\n\n if (isCreatingContentType) {\n trackUsage('didSelectContentTypeSettings');\n\n return;\n }\n\n if (forTarget === 'contentType') {\n trackUsage('didSelectContentTypeFieldSettings');\n }\n };\n\n const sendButtonAddMoreFieldEvent = (shouldContinue: boolean) => {\n if (\n modalType === 'attribute' &&\n forTarget === 'contentType' &&\n attributeType !== 'dynamiczone' &&\n shouldContinue\n ) {\n trackUsage('willAddMoreFieldToContentType');\n }\n };\n\n const shouldDisableAdvancedTab = () => {\n if (modalType === 'component') {\n return true;\n }\n\n if (has(modifiedData, 'createComponent')) {\n return true;\n }\n\n return false;\n };\n\n // Display data for the attributes picker modal\n const displayedAttributes = getAttributesToDisplay(\n forTarget,\n targetUid,\n // We need the nested components so we know when to remove the component option\n nestedComponents\n );\n\n if (!modalType) {\n return null;\n }\n\n const formToDisplay = get(forms, [modalType, 'form'], {\n advanced: () => ({\n sections: [],\n }),\n base: () => ({\n sections: [],\n }),\n });\n\n const isAddingAComponentToAnotherComponent = forTarget === 'component';\n\n const genericInputProps = {\n customInputs: {\n 'allowed-types-select': AllowedTypesSelect,\n 'boolean-radio-group': BooleanRadioGroup,\n 'checkbox-with-number-field': CheckboxWithNumberField,\n 'icon-picker': IconPicker,\n 'content-type-radio-group': ContentTypeRadioGroup,\n 'radio-group': CustomRadioGroup,\n relation: Relation,\n 'select-category': SelectCategory,\n 'select-component': SelectComponent,\n 'select-components': SelectComponents,\n 'select-default-boolean': BooleanDefaultValueSelect,\n 'select-number': SelectNumber,\n 'select-date': SelectDateType,\n 'toggle-draft-publish': DraftAndPublishToggle,\n 'text-plural': PluralName,\n 'text-singular': SingularName,\n 'textarea-enum': TextareaEnum,\n 'condition-form': ConditionForm,\n ...inputsFromPlugins,\n },\n componentToCreate,\n dynamicZoneTarget,\n formErrors,\n isAddingAComponentToAnotherComponent,\n isCreatingComponentWhileAddingAField,\n mainBoxHeader: get(type, ['info', 'displayName'], ''),\n modifiedData,\n naturePickerType: forTarget,\n isCreating,\n targetUid,\n forTarget,\n contentTypeSchema: type,\n };\n\n const advancedForm = formToDisplay.advanced({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n const baseForm = formToDisplay.base({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n\n const baseFormInputNames = getFormInputNames(baseForm);\n\n const advancedFormInputNames = getFormInputNames(advancedForm);\n const doesBaseFormHasError = Object.keys(formErrors).some((key) =>\n baseFormInputNames.includes(key)\n );\n\n const doesAdvancedFormHasError = Object.keys(formErrors).some((key) =>\n advancedFormInputNames.includes(key)\n );\n\n const schemaKind = get(contentTypes, [targetUid, 'kind']);\n\n const checkIsEditingFieldName = () =>\n actionType === 'edit' && attributes.every(({ name }) => name !== modifiedData?.name);\n\n const handleClickFinish = () => {\n if (checkIsEditingFieldName()) {\n trackUsage('didEditFieldNameOnContentType');\n }\n dispatchGuidedTour({\n type: 'set_completed_actions',\n payload: [GUIDED_TOUR_REQUIRED_ACTIONS.contentTypeBuilder.addField],\n });\n };\n\n return (\n <Modal.Root open={isOpen} onOpenChange={handleClosed}>\n <Modal.Content>\n <Dialog.Root open={showWarningDialog} onOpenChange={setShowWarningDialog}>\n <Dialog.Trigger />\n <ConfirmDialog\n onConfirm={() => {\n if (pendingSubmit) {\n const { e, shouldContinue } = pendingSubmit;\n setShowWarningDialog(false);\n setPendingSubmit(null);\n submitForm(e, shouldContinue);\n }\n }}\n onCancel={() => {\n setShowWarningDialog(false);\n setPendingSubmit(null);\n }}\n >\n {(() => {\n const referencedFields = checkFieldNameChanges();\n if (!referencedFields) return null;\n\n const fieldNames = referencedFields.map((field: any) => field.name).join(', ');\n const isEnum = initialData.enum && modifiedData.enum;\n\n if (isEnum) {\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n const deletedOrChangedValues = oldEnum.filter(\n (value: string) => !newEnum.includes(value)\n );\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-values',\n defaultMessage: '. Changing or removing the enum values ',\n })}\n <Typography fontWeight=\"bold\">{deletedOrChangedValues.join(', ')}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-end',\n defaultMessage: ' will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning-end',\n defaultMessage:\n '. Renaming it will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n })()}\n </ConfirmDialog>\n </Dialog.Root>\n <FormModalHeader\n actionType={actionType}\n attributeName={attributeName}\n contentTypeKind={kind as IconByType}\n dynamicZoneTarget={dynamicZoneTarget}\n modalType={modalType}\n forTarget={forTarget}\n targetUid={targetUid}\n attributeType={attributeType as IconByType}\n customFieldUid={customFieldUid}\n showBackLink={showBackLink}\n />\n {isPickingAttribute && (\n <AttributeOptions\n attributes={displayedAttributes}\n forTarget={forTarget}\n kind={schemaKind || 'collectionType'}\n />\n )}\n {!isPickingAttribute && (\n <FormComponent onSubmit={handleSubmit}>\n <Modal.Body>\n <Tabs.Root\n variant=\"simple\"\n value={activeTab}\n onValueChange={(value) => {\n setActiveTab(value);\n sendAdvancedTabEvent(value);\n }}\n hasError={\n doesBaseFormHasError ? 'basic' : doesAdvancedFormHasError ? 'advanced' : undefined\n }\n >\n <Flex justifyContent=\"space-between\">\n <FormModalSubHeader\n actionType={actionType}\n forTarget={forTarget}\n kind={kind}\n step={step}\n modalType={modalType}\n attributeType={attributeType}\n attributeName={attributeName}\n customField={customField}\n />\n <Tabs.List>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTrad('popUpForm.navContainer.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\" disabled={shouldDisableAdvancedTab()}>\n {formatMessage({\n id: getTrad('popUpForm.navContainer.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider marginBottom={6} />\n <Tabs.Content value=\"basic\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={baseForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={advancedForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n </Tabs.Root>\n </Modal.Body>\n <Modal.Footer>\n <Button\n type=\"button\"\n variant=\"tertiary\"\n onClick={(e) => {\n e.preventDefault();\n handleClosed();\n }}\n >\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n {/* TODO: refactor this component. Nuf said. */}\n <FormModalEndActions\n deleteContentType={() => deleteContentType(targetUid as Internal.UID.ContentType)}\n deleteComponent={() => deleteComponent(targetUid as Internal.UID.Component)}\n isAttributeModal={modalType === 'attribute'}\n isCustomFieldModal={modalType === 'customField'}\n isComponentToDzModal={modalType === 'addComponentToDynamicZone'}\n isComponentAttribute={attributeType === 'component'}\n isComponentModal={modalType === 'component'}\n isContentTypeModal={modalType === 'contentType'}\n isCreatingComponent={actionType === 'create'}\n isCreatingDz={actionType === 'create'}\n isCreatingComponentAttribute={modifiedData.createComponent || false}\n isCreatingComponentInDz={modifiedData.createComponent || false}\n isCreatingComponentWhileAddingAField={isCreatingComponentWhileAddingAField}\n isCreatingContentType={actionType === 'create'}\n isEditingAttribute={actionType === 'edit'}\n isDzAttribute={attributeType === 'dynamiczone'}\n isInFirstComponentStep={step === '1'}\n onSubmitAddComponentAttribute={handleSubmit}\n onSubmitAddComponentToDz={handleSubmit}\n onSubmitCreateComponent={handleSubmit}\n onSubmitCreateContentType={handleSubmit}\n onSubmitCreateDz={handleSubmit}\n onSubmitEditAttribute={handleSubmit}\n onSubmitEditComponent={handleSubmit}\n onSubmitEditContentType={handleSubmit}\n onSubmitEditCustomFieldAttribute={handleSubmit}\n onSubmitEditDz={handleSubmit}\n onClickFinish={handleClickFinish}\n />\n </Modal.Footer>\n </FormComponent>\n )}\n </Modal.Content>\n </Modal.Root>\n );\n};\n"],"names":["FormComponent","styled","form","selectState","state","initialState","FormModal","onCloseModal","onNavigateToChooseAttributeModal","onNavigateToAddCompoToDZModal","onNavigateToCreateComponentStep2","actionType","attributeName","attributeType","customFieldUid","dynamicZoneTarget","forTarget","modalType","isOpen","kind","step","targetUid","showBackLink","activeTab","setActiveTab","useFormModalNavigation","getPlugin","useStrapiApp","getCustomField","customFields","get","customField","dispatch","useDispatch","toggleNotification","useNotification","reducerState","useSelector","shallowEqual","navigate","useNavigate","trackUsage","useCTBTracking","formatMessage","useIntl","ctbPlugin","pluginId","ctbFormsAPI","apis","forms","inputsFromPlugins","components","inputs","dispatchGuidedTour","useGuidedTour","s","addAttribute","editAttribute","addCustomFieldAttribute","addCreatedComponentToDynamicZone","changeDynamicZoneComponents","contentTypes","createSchema","createComponentSchema","deleteComponent","deleteContentType","editCustomFieldAttribute","updateSchema","nestedComponents","sortedContentTypesList","updateComponentSchema","updateComponentUid","reservedNames","useDataManager","componentToCreate","formErrors","initialData","isCreatingComponentWhileAddingAField","modifiedData","type","showWarningDialog","setShowWarningDialog","useState","pendingSubmit","setPendingSubmit","checkFieldNameChanges","oldName","name","oldEnum","enum","newEnum","contentTypeAttributes","attributes","referencedFields","filter","attr","conditions","condition","visible","Object","entries","fieldVar","value","var","deletedOrChangedValues","oldValue","includes","length","React","useEffect","collectionTypesForRelation","isAllowedContentTypesForRelations","foundDynamicZoneTarget","findAttribute","actions","setDataToEdit","data","draftAndPublish","displayName","info","options","pluginOptions","pluralName","singularName","category","icon","attributeToEdit","createComponent","setDynamicZoneDataSchema","attributeToEditNotFormatted","repeatable","set","setCustomFieldDataSchema","isEditing","modifiedDataToSetForEditing","uid","pick","setAttributeDataSchema","nameToSetForRelation","resetProps","isCreatingContentType","isCreatingComponent","isCreatingAttribute","isCreatingCustomFieldAttribute","isComponentAttribute","isCreating","isCreatingComponentFromAView","isInFirstComponentStep","isPickingAttribute","createUid","checkFormValidity","schema","dataToValidate","contentType","keys","component","schemaAttributes","schemaData","customFieldValidator","validator","computedAttrbiuteType","alreadyTakenTargetContentTypeAttributes","targetContentTypeUID","targetContentTypeAttributes","attrName","targetAttribute","attribute","validate","abortEarly","handleChange","useCallback","target","rest","namesThatCanResetToNullValue","val","Array","isArray","clonedErrors","assign","min","minLength","setErrors","errors","onChange","split","submitForm","e","shouldContinue","sendButtonAddMoreFieldEvent","ctTargetUid","pathname","canEditContentType","message","id","componentUid","createComponentUid","componentCategory","componentUID","status","newComponentUID","customFieldAttributeUpdate","attributeToSet","isDynamicZoneAttribute","resetPropsAndSetTheFormForAddingACompoToADz","resetPropsAndSetFormForAddingAnExistingCompo","attributeData","undefined","resetPropsAndSaveCurrentData","componentsToAdd","newComponents","console","error","err","yup","ValidationError","isError","getYupInnerErrors","handleSubmit","preventDefault","handleConfirmClose","confirm","window","defaultMessage","handleClosed","isEqual","sendAdvancedTabEvent","tab","shouldDisableAdvancedTab","has","displayedAttributes","getAttributesToDisplay","formToDisplay","advanced","sections","base","isAddingAComponentToAnotherComponent","genericInputProps","customInputs","AllowedTypesSelect","BooleanRadioGroup","CheckboxWithNumberField","IconPicker","ContentTypeRadioGroup","CustomRadioGroup","relation","Relation","SelectCategory","SelectComponent","SelectComponents","BooleanDefaultValueSelect","SelectNumber","SelectDateType","DraftAndPublishToggle","PluralName","SingularName","TextareaEnum","ConditionForm","mainBoxHeader","naturePickerType","contentTypeSchema","advancedForm","extensions","baseForm","baseFormInputNames","getFormInputNames","advancedFormInputNames","doesBaseFormHasError","some","key","doesAdvancedFormHasError","schemaKind","checkIsEditingFieldName","every","handleClickFinish","payload","GUIDED_TOUR_REQUIRED_ACTIONS","contentTypeBuilder","addField","_jsx","Modal","Root","open","onOpenChange","_jsxs","Content","Dialog","Trigger","ConfirmDialog","onConfirm","onCancel","fieldNames","map","field","join","isEnum","Box","Typography","fontWeight","FormModalHeader","contentTypeKind","AttributeOptions","onSubmit","Body","Tabs","variant","onValueChange","hasError","Flex","justifyContent","FormModalSubHeader","List","getTrad","disabled","Divider","marginBottom","direction","alignItems","gap","TabForm","Footer","Button","onClick","FormModalEndActions","isAttributeModal","isCustomFieldModal","isComponentToDzModal","isComponentModal","isContentTypeModal","isCreatingDz","isCreatingComponentAttribute","isCreatingComponentInDz","isEditingAttribute","isDzAttribute","onSubmitAddComponentAttribute","onSubmitAddComponentToDz","onSubmitCreateComponent","onSubmitCreateContentType","onSubmitCreateDz","onSubmitEditAttribute","onSubmitEditComponent","onSubmitEditContentType","onSubmitEditCustomFieldAttribute","onSubmitEditDz","onClickFinish"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAMA,aAAAA,GAAgBC,uBAAAA,CAAOC,IAAI;;AAEjC,CAAC;AAED,MAAMC,cAAc,CAACC,KAAAA,GAClBA,KAAK,CAAC,iCAAiC,IAAIC,oBAAAA;MAEjCC,SAAAA,GAAY,IAAA;AACvB,IAAA,MAAM,EACJC,YAAY,EACZC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gCAAgC,EAChCC,UAAU,EACVC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,YAAY,EACb,GAAGC,6CAAAA,EAAAA;AAEJ,IAAA,MAAMC,YAAYC,wBAAAA,CAAa,WAAA,EAAa,CAACvB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C5H,YAAAA;oCAClC6H,cAAAA,EAAgB7H,YAAAA;oCAChB8H,aAAAA,EAAetE;;;;;;;;;AAQ/B;;;;"}
|
|
@@ -11,7 +11,8 @@ var AttributeIcon = require('../../AttributeIcon.js');
|
|
|
11
11
|
var getTrad = require('../../../utils/getTrad.js');
|
|
12
12
|
var ApplyConditionButton = require('../../ApplyConditionButton.js');
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
15
16
|
var n = Object.create(null);
|
|
16
17
|
if (e) {
|
|
17
18
|
Object.keys(e).forEach(function (k) {
|
|
@@ -28,7 +29,7 @@ function _interopNamespaceDefault(e) {
|
|
|
28
29
|
return Object.freeze(n);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
var React__namespace = /*#__PURE__*/
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
33
|
|
|
33
34
|
const SmallAttributeIcon = styledComponents.styled(AttributeIcon.AttributeIcon)`
|
|
34
35
|
width: 16px !important;
|