fix(nav): drop dedicated EOI route + alerts sidebar entry, fix paginated-URL bug
Trimmed two surfaces that didn't earn their nav weight:
- The /[port]/documents/eoi route added in the previous commit was
redundant with the per-interest EOI status milestones already on
the interest detail and the existing eoi_queue tab inside the
Documents hub. Removed the route + the "EOI queue" sidebar entry.
- The Alerts sidebar entry was promoting a mostly-empty page that
duplicated the dashboard alert rail. Dropped the entry; the
/[port]/alerts route stays accessible via the dashboard rail's
"View all" link and the topbar bell, which is enough for the
audit-trail use case.
While testing the EOI tab, found and fixed a real bug: usePaginatedQuery
was producing malformed URLs like `…?tab=eoi_queue&signatureOnly=true?page=1&limit=25`
(two `?` separators) when the endpoint string already carried query
params. The API rejected those with 400, so the EOI tab in the
documents hub was silently broken. The hook now uses `&` when the
endpoint already contains a `?`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
import { DocumentsHub } from '@/components/documents/documents-hub';
|
|
||||||
|
|
||||||
interface PageProps {
|
|
||||||
params: Promise<{ portSlug: string }>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function EoiQueuePage({ params }: PageProps) {
|
|
||||||
const { portSlug } = await params;
|
|
||||||
return <DocumentsHub portSlug={portSlug} initialTab="eoi_queue" />;
|
|
||||||
}
|
|
||||||
@@ -12,12 +12,10 @@ import {
|
|||||||
Building2,
|
Building2,
|
||||||
Receipt,
|
Receipt,
|
||||||
FileText,
|
FileText,
|
||||||
FileSignature,
|
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
Mail,
|
Mail,
|
||||||
Bell,
|
Bell,
|
||||||
Camera,
|
Camera,
|
||||||
ShieldAlert,
|
|
||||||
Settings,
|
Settings,
|
||||||
Shield,
|
Shield,
|
||||||
Home,
|
Home,
|
||||||
@@ -69,7 +67,6 @@ function buildNavSections(portSlug: string | undefined): NavSection[] {
|
|||||||
marinaRequired: true,
|
marinaRequired: true,
|
||||||
items: [
|
items: [
|
||||||
{ href: `${base}/dashboard`, label: 'Dashboard', icon: LayoutDashboard },
|
{ href: `${base}/dashboard`, label: 'Dashboard', icon: LayoutDashboard },
|
||||||
{ href: `${base}/alerts`, label: 'Alerts', icon: ShieldAlert },
|
|
||||||
{ href: `${base}/clients`, label: 'Clients', icon: Users },
|
{ href: `${base}/clients`, label: 'Clients', icon: Users },
|
||||||
{ href: `${base}/yachts`, label: 'Yachts', icon: Ship },
|
{ href: `${base}/yachts`, label: 'Yachts', icon: Ship },
|
||||||
{ href: `${base}/companies`, label: 'Companies', icon: Building2 },
|
{ href: `${base}/companies`, label: 'Companies', icon: Building2 },
|
||||||
@@ -98,7 +95,6 @@ function buildNavSections(portSlug: string | undefined): NavSection[] {
|
|||||||
marinaRequired: true,
|
marinaRequired: true,
|
||||||
items: [
|
items: [
|
||||||
{ href: `${base}/documents`, label: 'Documents', icon: FileText },
|
{ href: `${base}/documents`, label: 'Documents', icon: FileText },
|
||||||
{ href: `${base}/documents/eoi`, label: 'EOI queue', icon: FileSignature },
|
|
||||||
{ href: `${base}/documents/files`, label: 'Files', icon: FolderOpen },
|
{ href: `${base}/documents/files`, label: 'Files', icon: FolderOpen },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -125,10 +125,14 @@ export function usePaginatedQuery<T>({
|
|||||||
|
|
||||||
const fullQueryKey = [...queryKey, apiParams];
|
const fullQueryKey = [...queryKey, apiParams];
|
||||||
|
|
||||||
|
// Endpoints that already carry a query string (e.g. `/api/v1/documents?tab=eoi_queue`)
|
||||||
|
// need our pagination params merged with `&`, not a second `?`. Without this guard
|
||||||
|
// the URL becomes `…?tab=foo?page=1` and the API rejects it as 400.
|
||||||
|
const separator = endpoint.includes('?') ? '&' : '?';
|
||||||
|
|
||||||
const { data, isLoading, isFetching } = useQuery<PaginatedResponse<T>>({
|
const { data, isLoading, isFetching } = useQuery<PaginatedResponse<T>>({
|
||||||
queryKey: fullQueryKey,
|
queryKey: fullQueryKey,
|
||||||
queryFn: () =>
|
queryFn: () => apiFetch<PaginatedResponse<T>>(`${endpoint}${separator}${apiParams}`),
|
||||||
apiFetch<PaginatedResponse<T>>(`${endpoint}?${apiParams}`),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagination = data?.pagination
|
const pagination = data?.pagination
|
||||||
|
|||||||
Reference in New Issue
Block a user