fix: UX Bug on maintenance page
All checks were successful
Deploy to Staging / Build Images (push) Successful in 1m18s
Deploy to Staging / Deploy to Staging (push) Successful in 44s
Deploy to Staging / Verify Staging (push) Successful in 4s
Deploy to Staging / Notify Staging Ready (push) Successful in 4s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 1m18s
Deploy to Staging / Deploy to Staging (push) Successful in 44s
Deploy to Staging / Verify Staging (push) Successful in 4s
Deploy to Staging / Notify Staging Ready (push) Successful in 4s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
This commit is contained in:
@@ -111,7 +111,7 @@ export const MaintenanceRecordForm: React.FC<MaintenanceRecordFormProps> = ({ ve
|
||||
mode: 'onChange',
|
||||
defaultValues: {
|
||||
vehicle_id: vehicleId || '',
|
||||
category: undefined as any,
|
||||
category: '' as any,
|
||||
subtypes: [],
|
||||
date: new Date().toISOString().split('T')[0],
|
||||
odometer_reading: '' as any,
|
||||
@@ -132,6 +132,8 @@ export const MaintenanceRecordForm: React.FC<MaintenanceRecordFormProps> = ({ ve
|
||||
if (watchedCategory) {
|
||||
setSelectedCategory(watchedCategory as MaintenanceCategory);
|
||||
setValue('subtypes', []);
|
||||
} else {
|
||||
setSelectedCategory(null);
|
||||
}
|
||||
}, [watchedCategory, setValue]);
|
||||
|
||||
@@ -217,7 +219,7 @@ export const MaintenanceRecordForm: React.FC<MaintenanceRecordFormProps> = ({ ve
|
||||
// Reset form
|
||||
reset({
|
||||
vehicle_id: '',
|
||||
category: undefined as any,
|
||||
category: '' as any,
|
||||
subtypes: [],
|
||||
date: new Date().toISOString().split('T')[0],
|
||||
odometer_reading: '' as any,
|
||||
|
||||
@@ -119,7 +119,7 @@ export const MaintenanceScheduleForm: React.FC<MaintenanceScheduleFormProps> = (
|
||||
mode: 'onChange',
|
||||
defaultValues: {
|
||||
vehicle_id: vehicleId || '',
|
||||
category: undefined as any,
|
||||
category: '' as any,
|
||||
subtypes: [],
|
||||
schedule_type: 'interval' as ScheduleType,
|
||||
interval_months: '' as any,
|
||||
@@ -145,6 +145,8 @@ export const MaintenanceScheduleForm: React.FC<MaintenanceScheduleFormProps> = (
|
||||
if (watchedCategory) {
|
||||
setSelectedCategory(watchedCategory as MaintenanceCategory);
|
||||
setValue('subtypes', []);
|
||||
} else {
|
||||
setSelectedCategory(null);
|
||||
}
|
||||
}, [watchedCategory, setValue]);
|
||||
|
||||
@@ -170,7 +172,7 @@ export const MaintenanceScheduleForm: React.FC<MaintenanceScheduleFormProps> = (
|
||||
// Reset form
|
||||
reset({
|
||||
vehicle_id: '',
|
||||
category: undefined as any,
|
||||
category: '' as any,
|
||||
subtypes: [],
|
||||
schedule_type: 'interval' as ScheduleType,
|
||||
interval_months: '' as any,
|
||||
|
||||
Reference in New Issue
Block a user