From d9dd7a8024f1f13e78f475d48b3409cf1c120af0 Mon Sep 17 00:00:00 2001 From: Dragos-Paul Strat Date: Thu, 22 Aug 2024 14:28:48 +0300 Subject: [PATCH] fix: [611] add checks for addresses of create/edit organization general --- .../components/CreateOrganizationGeneral.tsx | 6 ++++++ .../components/OrganizationGeneral/OrganizationGeneral.tsx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/frontend/src/pages/create-organziation/components/CreateOrganizationGeneral.tsx b/frontend/src/pages/create-organziation/components/CreateOrganizationGeneral.tsx index 766e5ad9..5a4f22b1 100644 --- a/frontend/src/pages/create-organziation/components/CreateOrganizationGeneral.tsx +++ b/frontend/src/pages/create-organziation/components/CreateOrganizationGeneral.tsx @@ -92,6 +92,8 @@ const CreateOrganizationGeneral = () => { setValue('organizationAddress', address); setValue('organizationCity', city); setValue('organizationCounty', county); + + setOrganizationCounty(county); } }, [watchHasSameAddress]); @@ -432,6 +434,7 @@ const CreateOrganizationGeneral = () => { selected={value} onChange={onChange} readonly={readonly} + disabled={!county} /> ); }} @@ -644,6 +647,7 @@ const CreateOrganizationGeneral = () => { onChange: onChange, id: 'create-organization-general__org-organization-address', }} + disabled={watchHasSameAddress} readonly={readonly} /> ); @@ -671,6 +675,7 @@ const CreateOrganizationGeneral = () => { handleSetOrganizationCounty(e) }} readonly={readonly} + disabled={watchHasSameAddress} /> ); }} @@ -693,6 +698,7 @@ const CreateOrganizationGeneral = () => { selected={value} onChange={onChange} readonly={readonly} + disabled={watchHasSameAddress || !organizationCounty} /> ); }} diff --git a/frontend/src/pages/organization/components/OrganizationGeneral/OrganizationGeneral.tsx b/frontend/src/pages/organization/components/OrganizationGeneral/OrganizationGeneral.tsx index 26bd1245..62f6909b 100644 --- a/frontend/src/pages/organization/components/OrganizationGeneral/OrganizationGeneral.tsx +++ b/frontend/src/pages/organization/components/OrganizationGeneral/OrganizationGeneral.tsx @@ -478,6 +478,7 @@ const OrganizationGeneral = () => { selected={value} onChange={onChange} readonly={readonly} + disabled={!county} /> ); }} @@ -703,6 +704,7 @@ const OrganizationGeneral = () => { placeholder={OrganizationGeneralConfig.organizationAddress.config.placeholder} onChange={onChange} id="create-organization-general__org-organization-address" + disabled={watchHasSameAddress} /> ); }} @@ -729,6 +731,7 @@ const OrganizationGeneral = () => { handleSetOrganizationCounty(e) }} readonly={readonly} + disabled={watchHasSameAddress} /> ); }} @@ -751,6 +754,7 @@ const OrganizationGeneral = () => { selected={value} onChange={onChange} readonly={readonly} + disabled={watchHasSameAddress || !organizationCounty} /> ); }}