mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 12:31:14 -05:00
Implement plan to remove public toggle
This commit is contained in:
@@ -41,7 +41,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { DatePicker } from '@/components/ui/date-picker';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
|
||||
import { Loader2, Trash } from 'lucide-react';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
@@ -129,14 +129,12 @@ export function TimelineEventEditorDialog({
|
||||
to_entity_id: existingEvent.to_entity_id || '',
|
||||
from_location_id: existingEvent.from_location_id || '',
|
||||
to_location_id: existingEvent.to_location_id || '',
|
||||
is_public: existingEvent.is_public,
|
||||
} : {
|
||||
event_type: 'milestone',
|
||||
event_date: new Date(),
|
||||
event_date_precision: 'day',
|
||||
title: '',
|
||||
description: '',
|
||||
is_public: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -386,27 +384,6 @@ export function TimelineEventEditorDialog({
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="is_public"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
|
||||
<div className="space-y-0.5">
|
||||
<FormLabel className="text-base">Public Event</FormLabel>
|
||||
<FormDescription>
|
||||
Make this event visible to all users
|
||||
</FormDescription>
|
||||
</div>
|
||||
<FormControl>
|
||||
<Switch
|
||||
checked={field.value}
|
||||
onCheckedChange={field.onChange}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<DialogFooter className="gap-3 sm:gap-0">
|
||||
{isEditing && existingEvent?.approved_by === null && (
|
||||
<AlertDialog open={showDeleteConfirm} onOpenChange={setShowDeleteConfirm}>
|
||||
|
||||
@@ -968,7 +968,7 @@ export async function submitTimelineEvent(
|
||||
to_entity_id: data.to_entity_id,
|
||||
from_location_id: data.from_location_id,
|
||||
to_location_id: data.to_location_id,
|
||||
is_public: data.is_public ?? true,
|
||||
is_public: true, // All timeline events are public
|
||||
};
|
||||
|
||||
const { error: itemError } = await supabase
|
||||
@@ -1057,7 +1057,7 @@ export async function submitTimelineEventUpdate(
|
||||
to_entity_id: data.to_entity_id,
|
||||
from_location_id: data.from_location_id,
|
||||
to_location_id: data.to_location_id,
|
||||
is_public: data.is_public ?? true,
|
||||
is_public: true, // All timeline events are public
|
||||
};
|
||||
|
||||
const { error: itemError } = await supabase
|
||||
|
||||
@@ -46,7 +46,6 @@ export interface TimelineEvent {
|
||||
to_location_id?: string;
|
||||
|
||||
// Metadata
|
||||
is_public: boolean;
|
||||
display_order: number;
|
||||
created_by?: string;
|
||||
approved_by?: string;
|
||||
@@ -73,8 +72,6 @@ export interface TimelineEventFormData {
|
||||
to_entity_id?: string;
|
||||
from_location_id?: string;
|
||||
to_location_id?: string;
|
||||
|
||||
is_public?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user