From acb0a9fd045c8b357d8a68eee8da2c3fb0fc92ca Mon Sep 17 00:00:00 2001 From: federico-tocci-dxc Date: Thu, 21 Nov 2024 10:27:51 +0100 Subject: [PATCH] fix(creazione-utente): fix form valido se user selezionato 20241121 --- .../Headquarters/ManageFacilitator/ManageFacilitator.tsx | 3 ++- .../AdministrativeArea/Entities/modals/manageDelegate.tsx | 3 ++- .../AdministrativeArea/Entities/modals/manageReferal.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fe-piattaforma/src/components/AdministrativeArea/Entities/Headquarters/ManageFacilitator/ManageFacilitator.tsx b/fe-piattaforma/src/components/AdministrativeArea/Entities/Headquarters/ManageFacilitator/ManageFacilitator.tsx index 593a1beaf..bd706e3d8 100644 --- a/fe-piattaforma/src/components/AdministrativeArea/Entities/Headquarters/ManageFacilitator/ManageFacilitator.tsx +++ b/fe-piattaforma/src/components/AdministrativeArea/Entities/Headquarters/ManageFacilitator/ManageFacilitator.tsx @@ -127,6 +127,7 @@ const ManageFacilitator: React.FC = ({ dispatch(GetUserDetails(td.id as string, true)); dispatch(setUsersList(null)); setIsUserSelected(true); + setIsFormValid(true) } }, }; @@ -141,7 +142,7 @@ const ManageFacilitator: React.FC = ({ sendNewValues={(newData?: { [key: string]: formFieldI['value'] }) => setNewFormValues({ ...newData }) } - setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value)} + setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value || isUserSelected)} creation={creation} legend={legend} /> diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageDelegate.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageDelegate.tsx index 94b4f13fa..98d7e219a 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageDelegate.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageDelegate.tsx @@ -157,6 +157,7 @@ const ManageDelegate: React.FC = ({ } setShowForm(true); setIsUserSelected(true); + setIsFormValid(true); }, }; @@ -170,7 +171,7 @@ const ManageDelegate: React.FC = ({ sendNewValues={(newData?: { [key: string]: formFieldI['value'] }) => setNewFormValues({ ...newData }) } - setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value)} + setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value || isUserSelected)} fieldsToHide={['ruolo', 'tipoContratto']} legend={legend} /> diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReferal.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReferal.tsx index f8c90d51b..91f434479 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReferal.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReferal.tsx @@ -179,6 +179,7 @@ const ManageReferal: React.FC = ({ } setShowForm(true); setIsUserSelected(true); + setIsFormValid(true); }, }; @@ -192,7 +193,7 @@ const ManageReferal: React.FC = ({ sendNewValues={(newData?: { [key: string]: formFieldI['value'] }) => setNewFormValues({ ...newData }) } - setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value)} + setIsFormValid={(value: boolean | undefined) => setIsFormValid(!!value || isUserSelected)} fieldsToHide={['ruolo', 'tipoContratto']} legend={legend} />