Skip to content

Commit

Permalink
make fields read only by default
Browse files Browse the repository at this point in the history
  • Loading branch information
r-mettler committed Oct 30, 2024
1 parent ca8b0e3 commit 2c8181c
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const BackupAddressForm = ({ formFieldsName, initialValues, onSubmit, onBack })
<AddressFields
labelHint="Required"
name={formFieldsName}
zipCityEnabled
zipCityError={isLookupErrorVisible}
handleZipCityChange={handleZipCityChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const EditContactInfoForm = ({ initialValues, onSubmit, onCancel }) => {
<AddressFields
name={residentialAddressName}
labelHint="Required"
zipCityEnabled
zipCityError={isCurrentLookupErrorVisible}
handleZipCityChange={handleCurrentZipCityChange}
/>
Expand All @@ -117,7 +116,6 @@ const EditContactInfoForm = ({ initialValues, onSubmit, onCancel }) => {
<AddressFields
name={backupAddressName}
labelHint="Required"
zipCityEnabled
zipCityError={isBackupLookupErrorVisible}
handleZipCityChange={handleBackupZipCityChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const ResidentialAddressForm = ({ formFieldsName, initialValues, onSubmit, onBac
labelHint="Required"
name={formFieldsName}
validators={validators}
zipCityEnabled
zipCityError={isLookupErrorVisible}
handleZipCityChange={handleZipCityChange}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/AddressFields/AddressFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ AddressFields.defaultProps = {
legend: '',
className: '',
render: (fields) => fields,
zipCityEnabled: false,
zipCityEnabled: true,
zipCityError: false,
handleZipCityChange: null,
validators: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const ZipCityAddress = () => (
>
{() => (
<Form className={formStyles.form}>
<AddressFields legend="Zip city address" name="residentialAddress" zipCityEnabled />
<AddressFields legend="Zip city address" name="residentialAddress" />
</Form>
)}
</Formik>
Expand Down
8 changes: 1 addition & 7 deletions src/components/form/AddressFields/AddressFields.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,7 @@ describe('AddressFields component', () => {
const { getByLabelText, getByTestId } = render(
<Provider store={mockStore.store}>
<Formik initialValues={initialValues}>
<AddressFields
legend="Address Form"
name="address"
zipCityEnabled
handleZipCityChange={handleZipCityChange}
/>
<AddressFields legend="Address Form" name="address" handleZipCityChange={handleZipCityChange} />
</Formik>
</Provider>,
);
Expand Down Expand Up @@ -178,7 +173,6 @@ describe('AddressFields component', () => {
<AddressFields
legend="Address Form"
name="address"
zipCityEnabled
zipCityError
handleZipCityChange={handleZipCityChange}
/>
Expand Down

0 comments on commit 2c8181c

Please sign in to comment.