mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 05:31:14 -05:00
Approve database migration
This commit is contained in:
@@ -13,6 +13,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import { EntityMultiImageUploader, ImageAssignments } from '@/components/upload/EntityMultiImageUploader';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { DatePicker } from '@/components/ui/date-picker';
|
||||
import { FlexibleDateInput, type DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { SlugField } from '@/components/ui/slug-field';
|
||||
@@ -158,7 +159,9 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
? STATUS_DB_TO_DISPLAY[initialData.status] || 'Operating'
|
||||
: 'Operating',
|
||||
opening_date: initialData?.opening_date || '',
|
||||
opening_date_precision: initialData?.opening_date_precision || 'day',
|
||||
closing_date: initialData?.closing_date || '',
|
||||
closing_date_precision: initialData?.closing_date_precision || 'day',
|
||||
// Convert metric values to user's preferred unit for display
|
||||
height_requirement: initialData?.height_requirement
|
||||
? convertValueFromMetric(initialData.height_requirement, getDisplayUnit('cm', measurementSystem), 'cm')
|
||||
@@ -486,27 +489,31 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
|
||||
{/* Dates */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div className="space-y-2">
|
||||
<Label>Opening Date</Label>
|
||||
<DatePicker
|
||||
date={watch('opening_date') ? new Date(watch('opening_date')) : undefined}
|
||||
onSelect={(date) => setValue('opening_date', date ? date.toISOString().split('T')[0] : undefined)}
|
||||
placeholder="Select opening date"
|
||||
disableFuture={true}
|
||||
fromYear={1800}
|
||||
/>
|
||||
</div>
|
||||
<FlexibleDateInput
|
||||
value={watch('opening_date') ? new Date(watch('opening_date')) : undefined}
|
||||
precision={(watch('opening_date_precision') as DatePrecision) || 'day'}
|
||||
onChange={(date, precision) => {
|
||||
setValue('opening_date', date ? date.toISOString().split('T')[0] : undefined);
|
||||
setValue('opening_date_precision', precision);
|
||||
}}
|
||||
label="Opening Date"
|
||||
placeholder="Select opening date"
|
||||
disableFuture={true}
|
||||
fromYear={1800}
|
||||
/>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Closing Date (if applicable)</Label>
|
||||
<DatePicker
|
||||
date={watch('closing_date') ? new Date(watch('closing_date')) : undefined}
|
||||
onSelect={(date) => setValue('closing_date', date ? date.toISOString().split('T')[0] : undefined)}
|
||||
placeholder="Select closing date"
|
||||
disablePast={false}
|
||||
fromYear={1800}
|
||||
/>
|
||||
</div>
|
||||
<FlexibleDateInput
|
||||
value={watch('closing_date') ? new Date(watch('closing_date')) : undefined}
|
||||
precision={(watch('closing_date_precision') as DatePrecision) || 'day'}
|
||||
onChange={(date, precision) => {
|
||||
setValue('closing_date', date ? date.toISOString().split('T')[0] : undefined);
|
||||
setValue('closing_date_precision', precision);
|
||||
}}
|
||||
label="Closing Date (if applicable)"
|
||||
placeholder="Select closing date"
|
||||
disablePast={false}
|
||||
fromYear={1800}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Requirements */}
|
||||
|
||||
Reference in New Issue
Block a user