diff --git a/apps/admin/src/app/(shell)/signalements/avis/page.tsx b/apps/admin/src/app/(shell)/signalements/avis/page.tsx new file mode 100644 index 00000000..c0b1ca5c --- /dev/null +++ b/apps/admin/src/app/(shell)/signalements/avis/page.tsx @@ -0,0 +1,15 @@ +import { ReportsTabs } from '@/components/reports/ReportsTabs'; +import { ReportRatingsContainer } from '@/containers/ReportRatingsContainer'; +import { Suspense } from 'react'; + +/** A-03, the ratings with a comment. */ +export default function ReportRatingsPage() { + return ( +
+ + + + +
+ ); +} diff --git a/apps/admin/src/app/(shell)/signalements/lieux/page.tsx b/apps/admin/src/app/(shell)/signalements/lieux/page.tsx new file mode 100644 index 00000000..7e3a11a8 --- /dev/null +++ b/apps/admin/src/app/(shell)/signalements/lieux/page.tsx @@ -0,0 +1,15 @@ +import { ReportsTabs } from '@/components/reports/ReportsTabs'; +import { ReportPlacesContainer } from '@/containers/ReportPlacesContainer'; +import { Suspense } from 'react'; + +/** A-03, the places the community flagged. */ +export default function ReportPlacesPage() { + return ( +
+ + + + +
+ ); +} diff --git a/apps/admin/src/app/(shell)/signalements/page.tsx b/apps/admin/src/app/(shell)/signalements/page.tsx new file mode 100644 index 00000000..7af9f54e --- /dev/null +++ b/apps/admin/src/app/(shell)/signalements/page.tsx @@ -0,0 +1,7 @@ +import { reportsPaths } from '@/components/reports/ReportsTabs'; +import { redirect } from 'next/navigation'; + +/** A-03 opens on the reports of routes, where what waits for the team is counted. */ +export default function ReportsPage() { + redirect(reportsPaths.routes); +} diff --git a/apps/admin/src/app/(shell)/signalements/parcours/page.tsx b/apps/admin/src/app/(shell)/signalements/parcours/page.tsx new file mode 100644 index 00000000..4b056cee --- /dev/null +++ b/apps/admin/src/app/(shell)/signalements/parcours/page.tsx @@ -0,0 +1,15 @@ +import { ReportsTabs } from '@/components/reports/ReportsTabs'; +import { ReportRoutesContainer } from '@/containers/ReportRoutesContainer'; +import { Suspense } from 'react'; + +/** A-03, the open reports of routes. The state of the list is read from the address. */ +export default function ReportRoutesPage() { + return ( +
+ + + + +
+ ); +} diff --git a/apps/admin/src/components/catalog/CatalogTabs.tsx b/apps/admin/src/components/catalog/CatalogTabs.tsx index 79491940..7138cd90 100644 --- a/apps/admin/src/components/catalog/CatalogTabs.tsx +++ b/apps/admin/src/components/catalog/CatalogTabs.tsx @@ -1,7 +1,6 @@ +import { SectionTabs } from '@/components/navigation/SectionTabs'; import { sectionPaths } from '@/config/navigation'; import { messages } from '@/messages/fr'; -import { cn } from '@widoo/ui'; -import Link from 'next/link'; const texts = messages.catalog.tabs; @@ -14,22 +13,13 @@ export const catalogPaths = { /** The two lists of the catalog (A-04), as tabs above them: places, then routes. */ export function CatalogTabs({ current }: { current: keyof typeof catalogPaths }) { return ( - + ); } diff --git a/apps/admin/src/components/navigation/SectionTabs.tsx b/apps/admin/src/components/navigation/SectionTabs.tsx new file mode 100644 index 00000000..6935f57e --- /dev/null +++ b/apps/admin/src/components/navigation/SectionTabs.tsx @@ -0,0 +1,36 @@ +import { cn } from '@widoo/ui'; +import Link from 'next/link'; + +type SectionTabsProps = { + /** Name of the navigation for screen readers. */ + label: string; + tabs: readonly { id: TabId; label: string; href: string }[]; + current: TabId; +}; + +/** The lists of a section as tabs above them, each one its own address. */ +export function SectionTabs({ + label, + tabs, + current, +}: SectionTabsProps) { + return ( + + ); +} diff --git a/apps/admin/src/components/reports/ClosePlaceDialog.tsx b/apps/admin/src/components/reports/ClosePlaceDialog.tsx new file mode 100644 index 00000000..9d242b8e --- /dev/null +++ b/apps/admin/src/components/reports/ClosePlaceDialog.tsx @@ -0,0 +1,51 @@ +import { messages } from '@/messages/fr'; +import { ConfirmDialog, Field, Textarea } from '@widoo/ui'; + +const texts = messages.reports.places.closeDialog; + +type ClosePlaceDialogProps = { + isOpen: boolean; + /** Published routes that go through the place: they become « à corriger ». */ + routeCount: number; + reason: string; + onReasonChange: (reason: string) => void; + onCancel: () => void; + onConfirm: () => void; + isBusy: boolean; +}; + +/** « Fermer le lieu »: the effect on its routes, and a required reason kept in the journal. */ +export function ClosePlaceDialog({ + isOpen, + routeCount, + reason, + onReasonChange, + onCancel, + onConfirm, + isBusy, +}: ClosePlaceDialogProps) { + return ( + + +