chore: drop dead Logistics tabs + move visa toggle to settings
- Remove the Documents tab — visa documents are out of scope for this edition and there is no other concrete document need. - Remove the Logistics > Settings disabled tab — every per-edition configuration knob now lives at /admin/settings > Edition. - Replace the inline "Visible to teams" toggle on the Visas tab with a small "Edition settings" button that links straight to the consolidated settings page. The toggle itself moved to that page in the previous commit. - Drop the now-unused getVisaVisibility / setVisaVisibility wiring inside VisasTab. (The procedures still exist server-side; the new Edition tab uses program.updateEditionSettings instead.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,12 +5,10 @@ import { useEdition } from '@/contexts/edition-context'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import {
|
||||
CheckCircle2,
|
||||
FileText,
|
||||
Hotel as HotelIcon,
|
||||
Plane,
|
||||
Salad,
|
||||
ScrollText,
|
||||
Settings,
|
||||
Stamp,
|
||||
} from 'lucide-react'
|
||||
import { ConfirmationsTab } from '@/components/admin/logistics/confirmations-tab'
|
||||
@@ -58,18 +56,10 @@ export default function LogisticsPage() {
|
||||
<Salad className="mr-2 h-4 w-4" /> Lunch
|
||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="documents" disabled>
|
||||
<FileText className="mr-2 h-4 w-4" /> Documents
|
||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="email-templates" disabled>
|
||||
<ScrollText className="mr-2 h-4 w-4" /> Email Templates
|
||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="settings" disabled>
|
||||
<Settings className="mr-2 h-4 w-4" /> Settings
|
||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="confirmations">
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { trpc } from '@/lib/trpc/client'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Switch } from '@/components/ui/switch'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import {
|
||||
Table,
|
||||
@@ -16,8 +15,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table'
|
||||
import { toast } from 'sonner'
|
||||
import { ShieldOff } from 'lucide-react'
|
||||
import { Settings as SettingsIcon, ShieldOff } from 'lucide-react'
|
||||
import { VisaEditDialog, type VisaEditTarget } from './visa-edit-dialog'
|
||||
import type { VisaStatus } from '@prisma/client'
|
||||
|
||||
@@ -65,16 +63,6 @@ export function VisasTab({ programId }: Props) {
|
||||
|
||||
const { data, isLoading } = trpc.logistics.listVisaApplications.useQuery({ programId })
|
||||
|
||||
const utils = trpc.useUtils()
|
||||
const { data: visibility } = trpc.logistics.getVisaVisibility.useQuery({ programId })
|
||||
const setVisibility = trpc.logistics.setVisaVisibility.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.logistics.getVisaVisibility.invalidate({ programId })
|
||||
toast.success('Visibility updated')
|
||||
},
|
||||
onError: (e) => toast.error(e.message),
|
||||
})
|
||||
|
||||
const filtered = useMemo(() => {
|
||||
if (!data) return []
|
||||
return statusFilter === 'all'
|
||||
@@ -129,19 +117,12 @@ export function VisasTab({ programId }: Props) {
|
||||
continue to flow over email and are never stored on this platform.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 rounded-md border px-3 py-2">
|
||||
<Switch
|
||||
id="visa-visibility"
|
||||
checked={visibility?.visible ?? true}
|
||||
onCheckedChange={(v) =>
|
||||
setVisibility.mutate({ programId, visible: v })
|
||||
}
|
||||
disabled={setVisibility.isPending}
|
||||
/>
|
||||
<Label htmlFor="visa-visibility" className="cursor-pointer text-xs">
|
||||
Visible to teams
|
||||
</Label>
|
||||
</div>
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
<Link href="/admin/settings?tab=edition">
|
||||
<SettingsIcon className="mr-2 h-3.5 w-3.5" />
|
||||
Edition settings
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
<StatusPill value="all" label="All" count={(data ?? []).length} />
|
||||
|
||||
Reference in New Issue
Block a user