diff --git a/src/Survey/AreaCount/Area/NewLocationModal/config.tsx b/src/Survey/AreaCount/Area/NewLocationModal/config.tsx index 41c23f9e..d4e499e9 100644 --- a/src/Survey/AreaCount/Area/NewLocationModal/config.tsx +++ b/src/Survey/AreaCount/Area/NewLocationModal/config.tsx @@ -5,6 +5,8 @@ export const siteNameAttr = { container: 'inline', } as const; +export const OTHER_SITE_SIZE_VALUE = '23733'; + export const siteAreaAttr = { id: 'locAttr:376', type: 'choice_input', @@ -15,7 +17,7 @@ export const siteAreaAttr = { { title: '20 x 25 m', data_name: '23730' }, { title: '10 x 50 m', data_name: '23731' }, { title: '5 x 100 m', data_name: '23732' }, - { title: 'other', data_name: '23733' }, + { title: 'other', data_name: OTHER_SITE_SIZE_VALUE }, ], } as const; @@ -59,6 +61,16 @@ export const grainsNumberAttr = { validations: { min: 0, max: 100 }, } as const; +export const customAreaSizeAttr = { + id: 'locAttr:159', + type: 'number_input', + title: 'Area size', + appearance: 'counter', + placeholder: '0', + suffix: 'm²', + validations: { min: 0 }, +} as const; + export const vegetablesNumberAttr = { id: 'locAttr:342', type: 'number_input', diff --git a/src/Survey/AreaCount/Area/NewLocationModal/index.tsx b/src/Survey/AreaCount/Area/NewLocationModal/index.tsx index be9a6161..df80d024 100644 --- a/src/Survey/AreaCount/Area/NewLocationModal/index.tsx +++ b/src/Survey/AreaCount/Area/NewLocationModal/index.tsx @@ -29,10 +29,12 @@ import Media from 'common/models/media'; import { Group } from 'common/models/sample'; import HeaderButton from 'Survey/common/HeaderButton'; import { + OTHER_SITE_SIZE_VALUE, buildingsNumberAttr, commentAttr, cornNumberAttr, croppingNumberAttr, + customAreaSizeAttr, fallowNumberAttr, fertilizedAttr, forestNumberAttr, @@ -195,6 +197,9 @@ const NewLocationModal = ( }, }); + const isOtherSiteSize = + (newLocation as any)[siteAreaAttr.id] === OTHER_SITE_SIZE_VALUE; + return ( <> + {isOtherSiteSize && ( + + )} Approximate size of your observation site.