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