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 { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||||
import {
|
import {
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
FileText,
|
|
||||||
Hotel as HotelIcon,
|
Hotel as HotelIcon,
|
||||||
Plane,
|
Plane,
|
||||||
Salad,
|
Salad,
|
||||||
ScrollText,
|
ScrollText,
|
||||||
Settings,
|
|
||||||
Stamp,
|
Stamp,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { ConfirmationsTab } from '@/components/admin/logistics/confirmations-tab'
|
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
|
<Salad className="mr-2 h-4 w-4" /> Lunch
|
||||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||||
</TabsTrigger>
|
</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>
|
<TabsTrigger value="email-templates" disabled>
|
||||||
<ScrollText className="mr-2 h-4 w-4" /> Email Templates
|
<ScrollText className="mr-2 h-4 w-4" /> Email Templates
|
||||||
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
<span className="text-muted-foreground ml-1 text-xs">(soon)</span>
|
||||||
</TabsTrigger>
|
</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>
|
</TabsList>
|
||||||
|
|
||||||
<TabsContent value="confirmations">
|
<TabsContent value="confirmations">
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
|
import Link from 'next/link'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { trpc } from '@/lib/trpc/client'
|
import { trpc } from '@/lib/trpc/client'
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||||
import { Badge } from '@/components/ui/badge'
|
import { Badge } from '@/components/ui/badge'
|
||||||
import { Button } from '@/components/ui/button'
|
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 { Skeleton } from '@/components/ui/skeleton'
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
@@ -16,8 +15,7 @@ import {
|
|||||||
TableHeader,
|
TableHeader,
|
||||||
TableRow,
|
TableRow,
|
||||||
} from '@/components/ui/table'
|
} from '@/components/ui/table'
|
||||||
import { toast } from 'sonner'
|
import { Settings as SettingsIcon, ShieldOff } from 'lucide-react'
|
||||||
import { ShieldOff } from 'lucide-react'
|
|
||||||
import { VisaEditDialog, type VisaEditTarget } from './visa-edit-dialog'
|
import { VisaEditDialog, type VisaEditTarget } from './visa-edit-dialog'
|
||||||
import type { VisaStatus } from '@prisma/client'
|
import type { VisaStatus } from '@prisma/client'
|
||||||
|
|
||||||
@@ -65,16 +63,6 @@ export function VisasTab({ programId }: Props) {
|
|||||||
|
|
||||||
const { data, isLoading } = trpc.logistics.listVisaApplications.useQuery({ programId })
|
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(() => {
|
const filtered = useMemo(() => {
|
||||||
if (!data) return []
|
if (!data) return []
|
||||||
return statusFilter === 'all'
|
return statusFilter === 'all'
|
||||||
@@ -129,19 +117,12 @@ export function VisasTab({ programId }: Props) {
|
|||||||
continue to flow over email and are never stored on this platform.
|
continue to flow over email and are never stored on this platform.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 rounded-md border px-3 py-2">
|
<Button variant="outline" size="sm" asChild>
|
||||||
<Switch
|
<Link href="/admin/settings?tab=edition">
|
||||||
id="visa-visibility"
|
<SettingsIcon className="mr-2 h-3.5 w-3.5" />
|
||||||
checked={visibility?.visible ?? true}
|
Edition settings
|
||||||
onCheckedChange={(v) =>
|
</Link>
|
||||||
setVisibility.mutate({ programId, visible: v })
|
</Button>
|
||||||
}
|
|
||||||
disabled={setVisibility.isPending}
|
|
||||||
/>
|
|
||||||
<Label htmlFor="visa-visibility" className="cursor-pointer text-xs">
|
|
||||||
Visible to teams
|
|
||||||
</Label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-1.5">
|
<div className="flex flex-wrap gap-1.5">
|
||||||
<StatusPill value="all" label="All" count={(data ?? []).length} />
|
<StatusPill value="all" label="All" count={(data ?? []).length} />
|
||||||
|
|||||||
Reference in New Issue
Block a user