From 16536835038b6e1518f37c5dd57292d83bcf1aef Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 13 Jun 2024 09:06:45 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Relier=20l'amendement=20vers=20le=20debat?= =?UTF-8?q?=20associ=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[legislature]/dossier/[id]/[tab]/page.tsx | 1 + .../folders/AmendementTab/AmendementCard.tsx | 21 ++++++++++++++----- .../folders/AmendementTab/AmendementList.tsx | 17 ++++++++++++--- components/folders/AmendementTab/index.tsx | 3 +++ .../folders/DebatTab/SubSectionItem.tsx | 5 +++-- components/folders/DebateTimeline.tsx | 18 ++++++++++++++++ 6 files changed, 55 insertions(+), 10 deletions(-) diff --git a/app/[legislature]/dossier/[id]/[tab]/page.tsx b/app/[legislature]/dossier/[id]/[tab]/page.tsx index 881e147..6abd702 100644 --- a/app/[legislature]/dossier/[id]/[tab]/page.tsx +++ b/app/[legislature]/dossier/[id]/[tab]/page.tsx @@ -51,6 +51,7 @@ export default async function Page({ amendements={amendements} documents={dossier?.documents} amendementCount={dossier?.amendementCount} + dossierRefUid={params.id} /> ); diff --git a/components/folders/AmendementTab/AmendementCard.tsx b/components/folders/AmendementTab/AmendementCard.tsx index 35b0f77..5044aef 100644 --- a/components/folders/AmendementTab/AmendementCard.tsx +++ b/components/folders/AmendementTab/AmendementCard.tsx @@ -1,6 +1,8 @@ "use client"; import * as React from "react"; +import Link from "next/link"; + import { Amendement } from "@/repository/types"; import Typography from "@mui/material/Typography"; import Stack from "@mui/material/Stack"; @@ -44,6 +46,9 @@ export default function AmendementCard(props: Amendement) { uid, group_color, group_libelle, + seanceRefUid, + dossierRefUid, + numeroOrdreDepot, } = props; // TODO: utiliser la base cosignataires amendement pour avoir le nombre et les noms @@ -103,12 +108,18 @@ export default function AmendementCard(props: Amendement) { dangerouslySetInnerHTML={{ __html: dispositif }} /> - - Examiné par:  - - Le nom d'une commission parlementaire + {seanceRefUid && ( + // + // Examiné par:  + + Voire le debat associé - + // + )} Déposé par:  diff --git a/components/folders/AmendementTab/AmendementList.tsx b/components/folders/AmendementTab/AmendementList.tsx index 7a74bf0..b13fcf6 100644 --- a/components/folders/AmendementTab/AmendementList.tsx +++ b/components/folders/AmendementTab/AmendementList.tsx @@ -7,14 +7,21 @@ import AmendementCard from "./AmendementCard"; import { AmendementTabProps } from "."; export default function AmendementsList( - props: Pick & { + props: Pick & { numero: string; selectedDocument: string; depute: string; status: string; } ) { - const { amendements, numero, depute, status, selectedDocument } = props; + const { + amendements, + numero, + depute, + status, + selectedDocument, + dossierRefUid, + } = props; const filteredAmendements = amendements .filter((amendement) => { @@ -50,7 +57,11 @@ export default function AmendementsList( return ( {filteredAmendements.map((amendement) => ( - + ))} ); diff --git a/components/folders/AmendementTab/index.tsx b/components/folders/AmendementTab/index.tsx index a8cd1ad..7b18e55 100644 --- a/components/folders/AmendementTab/index.tsx +++ b/components/folders/AmendementTab/index.tsx @@ -18,12 +18,14 @@ export type AmendementTabProps = Pick< "amendementCount" | "documents" > & { amendements: (Amendement & Acteur)[]; + dossierRefUid: string; }; export const AmendementTab = ({ amendements, documents, amendementCount, + dossierRefUid, }: AmendementTabProps) => { const [numero, handleNumero] = useFilterSearch("numero"); const [document, handleDocument] = useFilterSearch("document"); @@ -65,6 +67,7 @@ export const AmendementTab = ({ + {!withoutConnector && } diff --git a/components/folders/DebateTimeline.tsx b/components/folders/DebateTimeline.tsx index ebfe5be..86dfb16 100644 --- a/components/folders/DebateTimeline.tsx +++ b/components/folders/DebateTimeline.tsx @@ -43,6 +43,7 @@ export const DebateTimeline = ({ paragraphs }: DebateTimelineProps) => ( group_libelle_short, roleDebat, texte, + adt, ...other }) => { switch (codeGrammaire) { @@ -70,6 +71,10 @@ export const DebateTimeline = ({ paragraphs }: DebateTimelineProps) => ( return ; case "TITRE_TEXTE_DISCUSSION": + console.log(codeGrammaire); + console.log(texte); + console.log(other); + return ( ( /> ); case "SOUS_TITRE_TEXTE_DISCUSSION": + console.log(codeGrammaire); + console.log(texte); + console.log(other); + return ( ( /> ); case "ODJ_APPEL_DISCUSSION": + console.log(codeGrammaire); + console.log(texte); + console.log(other); + return ( ( /> ); default: + console.log(codeGrammaire); + console.log(texte); + console.log(other); + return texte ? ( ) : null; From 0921cedaf8758e161d577323a328df587c79d495 Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 13 Jun 2024 09:22:18 +0200 Subject: [PATCH 2/2] same for deputes amendements --- components/folders/AmendementTab/AmendementCard.tsx | 2 +- repository/database.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/folders/AmendementTab/AmendementCard.tsx b/components/folders/AmendementTab/AmendementCard.tsx index 5044aef..10220b9 100644 --- a/components/folders/AmendementTab/AmendementCard.tsx +++ b/components/folders/AmendementTab/AmendementCard.tsx @@ -108,7 +108,7 @@ export default function AmendementCard(props: Amendement) { dangerouslySetInnerHTML={{ __html: dispositif }} /> - {seanceRefUid && ( + {dossierRefUid && seanceRefUid && ( // // Examiné par: