mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Disable form fields in edit mode
This commit is contained in:
@@ -1660,6 +1660,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
Boolean(formik.errors.record_date)
|
Boolean(formik.errors.record_date)
|
||||||
}
|
}
|
||||||
errorMessage={formik.errors.record_date as string}
|
errorMessage={formik.errors.record_date as string}
|
||||||
|
disabled={type === 'edit'}
|
||||||
/>
|
/>
|
||||||
<SelectInput
|
<SelectInput
|
||||||
key={`location-select-${selectedLocation?.value || 'default'}`}
|
key={`location-select-${selectedLocation?.value || 'default'}`}
|
||||||
@@ -1674,6 +1675,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
placeholder='Pilih Lokasi'
|
placeholder='Pilih Lokasi'
|
||||||
isClearable
|
isClearable
|
||||||
isSearchable
|
isSearchable
|
||||||
|
isDisabled={type === 'edit'}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SelectInput
|
<SelectInput
|
||||||
@@ -1686,7 +1688,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
onInputChange={setProjectFlockSearchValue}
|
onInputChange={setProjectFlockSearchValue}
|
||||||
isLoading={isLoadingProjectFlocks}
|
isLoading={isLoadingProjectFlocks}
|
||||||
onMenuScrollToBottom={loadMoreProjectFlocks}
|
onMenuScrollToBottom={loadMoreProjectFlocks}
|
||||||
isDisabled={!selectedLocation}
|
isDisabled={!selectedLocation || type === 'edit'}
|
||||||
placeholder={
|
placeholder={
|
||||||
selectedLocation
|
selectedLocation
|
||||||
? 'Pilih Project Flock'
|
? 'Pilih Project Flock'
|
||||||
@@ -1704,7 +1706,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
onChange={kandangChangeHandler}
|
onChange={kandangChangeHandler}
|
||||||
options={kandangOptions}
|
options={kandangOptions}
|
||||||
isLoading={false}
|
isLoading={false}
|
||||||
isDisabled={!selectedProjectFlock}
|
isDisabled={!selectedProjectFlock || type === 'edit'}
|
||||||
placeholder={
|
placeholder={
|
||||||
selectedProjectFlock
|
selectedProjectFlock
|
||||||
? 'Pilih Kandang'
|
? 'Pilih Kandang'
|
||||||
|
|||||||
Reference in New Issue
Block a user