From 0dad035b9415ae1146620bbfb49fb76d0c159691 Mon Sep 17 00:00:00 2001 From: soupette Date: Thu, 12 Dec 2019 16:13:19 +0100 Subject: [PATCH] Remove add another field button when editing a dz --- .../admin/src/containers/FormModal/index.js | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js index 239eaca619..e9678c659d 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/index.js @@ -1310,31 +1310,60 @@ const FormModal = () => { {formatMessage({ id: getTrad('button.delete.title') })} )} - handleSubmit(e, true)} + icon={ + (isCreatingAttribute && + !isCreatingComponentFromAView && + state.step !== '1') || (state.modalType === 'addComponentToDynamicZone' && - state.step === '1' && - !isCreatingComponentFromAView)) && - !isCreating - ? 'success' - : 'primary' - } - onClick={e => handleSubmit(e, true)} - icon={ - (isCreatingAttribute && - !isCreatingComponentFromAView && - state.step !== '1') || - (state.modalType === 'addComponentToDynamicZone' && - isCreatingComponentFromAView) || - (isCreatingComponentFromAView && state.step === '2') - } - > - {getButtonSubmitMessage()} - + isCreatingComponentFromAView) || + (isCreatingComponentFromAView && state.step === '2') + } + > + {getButtonSubmitMessage()} + + )} + {state.attributeType !== 'dynamiczone' && ( + handleSubmit(e, true)} + icon={ + (isCreatingAttribute && + !isCreatingComponentFromAView && + state.step !== '1') || + (state.modalType === 'addComponentToDynamicZone' && + isCreatingComponentFromAView) || + (isCreatingComponentFromAView && state.step === '2') + } + > + {getButtonSubmitMessage()} + + )}