diff --git a/app/dashboard/[id]/page.tsx b/app/dashboard/[id]/page.tsx index 2e58e46..99cda0f 100644 --- a/app/dashboard/[id]/page.tsx +++ b/app/dashboard/[id]/page.tsx @@ -147,7 +147,7 @@ export default function AssociationDetailPage() { Torna alle associazioni diff --git a/components/associations/association-table.tsx b/components/associations/association-table.tsx index b348e19..6c8d197 100644 --- a/components/associations/association-table.tsx +++ b/components/associations/association-table.tsx @@ -44,7 +44,12 @@ export function AssociationTable({ associations }: { associations: Association[] className="cursor-pointer" onClick={() => router.push(`/dashboard/${association.id}`)} > - {association.name} + + {association.nasFolderNumber != null && ( + #{association.nasFolderNumber} + )} + {association.name} + {association.address} diff --git a/components/associations/edit-association-dialog.tsx b/components/associations/edit-association-dialog.tsx index cbbe149..dd0a07c 100644 --- a/components/associations/edit-association-dialog.tsx +++ b/components/associations/edit-association-dialog.tsx @@ -31,6 +31,7 @@ export function EditAssociationDialog({ const [vatNumber, setVatNumber] = useState(association.vatNumber ?? ""); const [runtsId, setRuntsId] = useState(association.runtsId ?? ""); const [ratificationCode, setRatificationCode] = useState(association.ratificationCode ?? ""); + const [nasFolderNumber, setNasFolderNumber] = useState(association.nasFolderNumber?.toString() ?? ""); const [isShown, setIsShown] = useState(association.isShown ?? true); useEffect(() => { @@ -40,6 +41,7 @@ export function EditAssociationDialog({ setVatNumber(association.vatNumber ?? ""); setRuntsId(association.runtsId ?? ""); setRatificationCode(association.ratificationCode ?? ""); + setNasFolderNumber(association.nasFolderNumber?.toString() ?? ""); setIsShown(association.isShown ?? true); } }, [open, association]); @@ -55,6 +57,7 @@ export function EditAssociationDialog({ vatNumber, runtsId, ratificationCode, + nasFolderNumber: nasFolderNumber.trim() === "" ? undefined : Number(nasFolderNumber), isShown, }); onSaved(updated); @@ -111,6 +114,17 @@ export function EditAssociationDialog({ /> +
+ + setNasFolderNumber(e.target.value)} + placeholder="Usato per generare il codice di ratifica" + /> +
+
diff --git a/lib/models.ts b/lib/models.ts index 7db35b1..b03b84a 100644 --- a/lib/models.ts +++ b/lib/models.ts @@ -28,6 +28,7 @@ export interface Association { associates?: Associate[]; users?: User[]; ratificationCode?: string; + nasFolderNumber?: number; } export interface LoginResponse {