mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 14:51:13 -05:00
Wrap forms with error boundaries
This commit is contained in:
@@ -22,6 +22,7 @@ import { jsonToFormData } from '@/lib/typeConversions';
|
|||||||
import { PropertyOwnerForm } from '@/components/admin/PropertyOwnerForm';
|
import { PropertyOwnerForm } from '@/components/admin/PropertyOwnerForm';
|
||||||
import { RideModelForm } from '@/components/admin/RideModelForm';
|
import { RideModelForm } from '@/components/admin/RideModelForm';
|
||||||
import { Save, X, Edit } from 'lucide-react';
|
import { Save, X, Edit } from 'lucide-react';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
interface ItemEditDialogProps {
|
interface ItemEditDialogProps {
|
||||||
item?: SubmissionItemWithDeps | null;
|
item?: SubmissionItemWithDeps | null;
|
||||||
@@ -131,66 +132,70 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
|||||||
switch (editItem.item_type) {
|
switch (editItem.item_type) {
|
||||||
case 'park':
|
case 'park':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<ParkForm
|
<ParkForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// Convert Json to form-compatible object (null → undefined)
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
isEditing
|
isEditing
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'ride':
|
case 'ride':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// Convert Json to form-compatible object (null → undefined)
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
isEditing
|
isEditing
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'manufacturer':
|
case 'manufacturer':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<ManufacturerForm
|
<ManufacturerForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'designer':
|
case 'designer':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<DesignerForm
|
<DesignerForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'operator':
|
case 'operator':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<OperatorForm
|
<OperatorForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'property_owner':
|
case 'property_owner':
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<PropertyOwnerForm
|
<PropertyOwnerForm
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={jsonToFormData(editItem.item_data) as any}
|
initialData={jsonToFormData(editItem.item_data) as any}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'ride_model':
|
case 'ride_model':
|
||||||
@@ -201,14 +206,15 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
|
|||||||
? itemData.manufacturer_id
|
? itemData.manufacturer_id
|
||||||
: '';
|
: '';
|
||||||
return (
|
return (
|
||||||
|
<SubmissionErrorBoundary submissionId={editItem.id}>
|
||||||
<RideModelForm
|
<RideModelForm
|
||||||
manufacturerName={manufacturerName}
|
manufacturerName={manufacturerName}
|
||||||
manufacturerId={manufacturerId}
|
manufacturerId={manufacturerId}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onCancel={() => onOpenChange(false)}
|
onCancel={() => onOpenChange(false)}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
initialData={itemData as any}
|
initialData={itemData as any}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'photo':
|
case 'photo':
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
import { handleNonCriticalError } from '@/lib/errorHandler';
|
import { handleNonCriticalError } from '@/lib/errorHandler';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function DesignerRides() {
|
export default function DesignerRides() {
|
||||||
const { designerSlug } = useParams<{ designerSlug: string }>();
|
const { designerSlug } = useParams<{ designerSlug: string }>();
|
||||||
@@ -329,10 +330,12 @@ export default function DesignerRides() {
|
|||||||
|
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { getErrorMessage } from '@/lib/errorHandler';
|
import { getErrorMessage } from '@/lib/errorHandler';
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function Designers() {
|
export default function Designers() {
|
||||||
useDocumentTitle('Designers');
|
useDocumentTitle('Designers');
|
||||||
@@ -359,7 +360,9 @@ export default function Designers() {
|
|||||||
</main>
|
</main>
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<DesignerForm onSubmit={handleCreateSubmit} onCancel={() => setIsCreateModalOpen(false)} />
|
<DesignerForm onSubmit={handleCreateSubmit} onCancel={() => setIsCreateModalOpen(false)} />
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
import { handleNonCriticalError } from '@/lib/errorHandler';
|
import { handleNonCriticalError } from '@/lib/errorHandler';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
interface RideModelWithCount extends RideModel {
|
interface RideModelWithCount extends RideModel {
|
||||||
ride_count: number;
|
ride_count: number;
|
||||||
@@ -295,11 +296,13 @@ export default function ManufacturerModels() {
|
|||||||
|
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideModelForm
|
<RideModelForm
|
||||||
manufacturerName={manufacturer.name}
|
manufacturerName={manufacturer.name}
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
import { handleNonCriticalError } from '@/lib/errorHandler';
|
import { handleNonCriticalError } from '@/lib/errorHandler';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function ManufacturerRides() {
|
export default function ManufacturerRides() {
|
||||||
const { manufacturerSlug } = useParams<{ manufacturerSlug: string }>();
|
const { manufacturerSlug } = useParams<{ manufacturerSlug: string }>();
|
||||||
@@ -329,10 +330,12 @@ export default function ManufacturerRides() {
|
|||||||
|
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { getErrorMessage } from '@/lib/errorHandler';
|
import { getErrorMessage } from '@/lib/errorHandler';
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function Manufacturers() {
|
export default function Manufacturers() {
|
||||||
useDocumentTitle('Manufacturers');
|
useDocumentTitle('Manufacturers');
|
||||||
@@ -374,10 +375,12 @@ export default function Manufacturers() {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<ManufacturerForm
|
<ManufacturerForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { getErrorMessage } from '@/lib/errorHandler';
|
import { getErrorMessage } from '@/lib/errorHandler';
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
const Operators = () => {
|
const Operators = () => {
|
||||||
useDocumentTitle('Operators');
|
useDocumentTitle('Operators');
|
||||||
@@ -377,10 +378,12 @@ const Operators = () => {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<OperatorForm
|
<OperatorForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { usePhotoCount } from '@/hooks/photos/usePhotoCount';
|
|||||||
const RideForm = lazy(() => import('@/components/admin/RideForm').then(m => ({ default: m.RideForm })));
|
const RideForm = lazy(() => import('@/components/admin/RideForm').then(m => ({ default: m.RideForm })));
|
||||||
const ParkForm = lazy(() => import('@/components/admin/ParkForm').then(m => ({ default: m.ParkForm })));
|
const ParkForm = lazy(() => import('@/components/admin/ParkForm').then(m => ({ default: m.ParkForm })));
|
||||||
import { getErrorMessage } from '@/lib/errorHandler';
|
import { getErrorMessage } from '@/lib/errorHandler';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
import { useUserRole } from '@/hooks/useUserRole';
|
import { useUserRole } from '@/hooks/useUserRole';
|
||||||
import { Edit } from 'lucide-react';
|
import { Edit } from 'lucide-react';
|
||||||
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
|
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
|
||||||
@@ -610,10 +611,13 @@ export default function ParkDetail() {
|
|||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<Suspense fallback={<AdminFormSkeleton />}>
|
<Suspense fallback={<AdminFormSkeleton />}>
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleRideSubmit}
|
onSubmit={handleRideSubmit}
|
||||||
onCancel={() => setIsAddRideModalOpen(false)}
|
onCancel={() => setIsAddRideModalOpen(false)}
|
||||||
|
initialData={{ park_id: park.id }}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
@@ -628,6 +632,7 @@ export default function ParkDetail() {
|
|||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<Suspense fallback={<AdminFormSkeleton />}>
|
<Suspense fallback={<AdminFormSkeleton />}>
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<ParkForm
|
<ParkForm
|
||||||
onSubmit={handleEditParkSubmit}
|
onSubmit={handleEditParkSubmit}
|
||||||
onCancel={() => setIsEditParkModalOpen(false)}
|
onCancel={() => setIsEditParkModalOpen(false)}
|
||||||
@@ -650,6 +655,7 @@ export default function ParkDetail() {
|
|||||||
}}
|
}}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { useAuthModal } from '@/hooks/useAuthModal';
|
|||||||
import { getErrorMessage } from '@/lib/errorHandler';
|
import { getErrorMessage } from '@/lib/errorHandler';
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
const ParkOwners = () => {
|
const ParkOwners = () => {
|
||||||
useDocumentTitle('Property Owners');
|
useDocumentTitle('Property Owners');
|
||||||
@@ -242,10 +243,12 @@ const ParkOwners = () => {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<PropertyOwnerForm
|
<PropertyOwnerForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { getErrorMessage, handleNonCriticalError } from '@/lib/errorHandler';
|
|||||||
import { useAuthModal } from '@/hooks/useAuthModal';
|
import { useAuthModal } from '@/hooks/useAuthModal';
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function ParkRides() {
|
export default function ParkRides() {
|
||||||
const { parkSlug } = useParams<{ parkSlug: string }>();
|
const { parkSlug } = useParams<{ parkSlug: string }>();
|
||||||
@@ -353,12 +354,14 @@ export default function ParkRides() {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleCreateSubmit as any}
|
onSubmit={handleCreateSubmit as any}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
isEditing={false}
|
isEditing={false}
|
||||||
initialData={{ park_id: park.id }}
|
initialData={{ park_id: park.id }}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import { useAuthModal } from "@/hooks/useAuthModal";
|
|||||||
import { useOpenGraph } from "@/hooks/useOpenGraph";
|
import { useOpenGraph } from "@/hooks/useOpenGraph";
|
||||||
import { useParks } from "@/hooks/parks/useParks";
|
import { useParks } from "@/hooks/parks/useParks";
|
||||||
import { Pagination } from "@/components/common/Pagination";
|
import { Pagination } from "@/components/common/Pagination";
|
||||||
|
import { SubmissionErrorBoundary } from "@/components/error/SubmissionErrorBoundary";
|
||||||
|
|
||||||
export interface FilterState {
|
export interface FilterState {
|
||||||
search: string;
|
search: string;
|
||||||
@@ -583,7 +584,9 @@ export default function Parks() {
|
|||||||
Add a new park to the database. Your submission will be reviewed before being published.
|
Add a new park to the database. Your submission will be reviewed before being published.
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<ParkForm onSubmit={handleParkSubmit} onCancel={() => setIsAddParkModalOpen(false)} isEditing={false} />
|
<ParkForm onSubmit={handleParkSubmit} onCancel={() => setIsAddParkModalOpen(false)} isEditing={false} />
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { toast } from '@/hooks/use-toast';
|
|||||||
import { getErrorMessage, handleNonCriticalError } from '@/lib/errorHandler';
|
import { getErrorMessage, handleNonCriticalError } from '@/lib/errorHandler';
|
||||||
import type { Ride, Company, RideModel } from "@/types/database";
|
import type { Ride, Company, RideModel } from "@/types/database";
|
||||||
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function RideModelRides() {
|
export default function RideModelRides() {
|
||||||
const { manufacturerSlug, modelSlug } = useParams<{ manufacturerSlug: string; modelSlug: string }>();
|
const { manufacturerSlug, modelSlug } = useParams<{ manufacturerSlug: string; modelSlug: string }>();
|
||||||
@@ -293,10 +294,12 @@ export default function RideModelRides() {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
|||||||
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
import { useOpenGraph } from '@/hooks/useOpenGraph';
|
||||||
import { useRides } from '@/hooks/rides/useRides';
|
import { useRides } from '@/hooks/rides/useRides';
|
||||||
import { Pagination } from '@/components/common/Pagination';
|
import { Pagination } from '@/components/common/Pagination';
|
||||||
|
import { SubmissionErrorBoundary } from '@/components/error/SubmissionErrorBoundary';
|
||||||
|
|
||||||
export default function Rides() {
|
export default function Rides() {
|
||||||
useDocumentTitle('Rides & Attractions');
|
useDocumentTitle('Rides & Attractions');
|
||||||
@@ -529,11 +530,13 @@ export default function Rides() {
|
|||||||
{/* Create Modal */}
|
{/* Create Modal */}
|
||||||
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
<Dialog open={isCreateModalOpen} onOpenChange={setIsCreateModalOpen}>
|
||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
|
<SubmissionErrorBoundary>
|
||||||
<RideForm
|
<RideForm
|
||||||
onSubmit={handleCreateSubmit}
|
onSubmit={handleCreateSubmit}
|
||||||
onCancel={() => setIsCreateModalOpen(false)}
|
onCancel={() => setIsCreateModalOpen(false)}
|
||||||
isEditing={false}
|
isEditing={false}
|
||||||
/>
|
/>
|
||||||
|
</SubmissionErrorBoundary>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Reference in New Issue
Block a user