-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve amendements for deputes * Ajouter la page sur les travaux parlementaire * remove duplicated mandats * fix mandats * reshape depute tabs * use relative path * get update from ORM * Ajout des questions au gouvernements
- Loading branch information
1 parent
b6de5bd
commit 5e9ab21
Showing
34 changed files
with
1,191 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
# .env.local | ||
|
||
## settings to the DB for knext (will be removed) | ||
DB_HOST=51.159.207.103 | ||
DB_PORT=1695 | ||
DB_USER=default_user | ||
DB_PASSWORD=... | ||
DB_DATABASE=tricoteuses | ||
DB_DATABASE=tricoteuses | ||
|
||
## setting to the prisma db | ||
TRICOTEUSES_ASSEMBLEE_API_DB_URL="postgresql://username:password@host:port/dbname?schema=public" | ||
|
||
## Path to tricoteuses-api-assemblee-orm | ||
TRICOTEUSES_ASSEMBLEE_API_REPO="/home/.../tricoteuses-api-assemblee-orm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from "react"; | ||
|
||
import Stack from "@mui/material/Stack"; | ||
|
||
import AmendementCard from "@/components/folders/AmendementCard"; | ||
import { prisma } from "@/prisma"; | ||
|
||
async function getDeputeAmendementUnCached(slug: string) { | ||
try { | ||
return await prisma.acteur.findFirst({ | ||
where: { slug }, | ||
select: { | ||
amendements: { | ||
include: { texteLegislatifRef: { select: { numNotice: true } } }, | ||
}, | ||
}, | ||
}); | ||
} catch (error) { | ||
console.error(`Error fetching amendement from depute ${slug}:`, error); | ||
throw error; | ||
} | ||
} | ||
|
||
const getDeputeAmendement = React.cache(getDeputeAmendementUnCached); | ||
|
||
export default async function Amendements({ | ||
params, | ||
}: { | ||
params: { slug: string }; | ||
}) { | ||
const deputeWithAmendements = await getDeputeAmendement(params.slug); | ||
|
||
const { amendements } = deputeWithAmendements!; | ||
|
||
return ( | ||
<Stack> | ||
<p>Amendements</p> | ||
{amendements && | ||
amendements | ||
.sort((a, b) => | ||
Number.parseInt(a.numeroOrdreDepot || "") < | ||
Number.parseInt(b.numeroOrdreDepot || "") | ||
? -1 | ||
: 1 | ||
) | ||
.map((amendement) => { | ||
const numeroNotice = amendement.texteLegislatifRef?.numNotice; | ||
const section = amendement.divisionArticleDesignationCourte; | ||
// const subSection = amendement.alineaDesignation; | ||
|
||
const article = [ | ||
section, | ||
// subSection | ||
] | ||
.filter((item) => item !== null) | ||
.join(" "); | ||
|
||
const titre = `Amendement N°${amendement.numeroOrdreDepot}${ | ||
numeroNotice == null | ||
? "" | ||
: ` au text N°${numeroNotice}${article ? ` - ${article}` : ""}` | ||
}`; | ||
return ( | ||
<AmendementCard | ||
key={amendement.uid} | ||
amendement={amendement} | ||
depute={null} | ||
titre={titre} | ||
/> | ||
); | ||
})} | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
import React from "react"; | ||
import Activites from "./[tab]/Activites"; | ||
|
||
export default function Page({ | ||
params, | ||
}: { | ||
params: { slug: string; tab: string }; | ||
}) { | ||
return <Activites deputeSlug={params.slug} />; | ||
export default function Page({ params }: { params: { slug: string } }) { | ||
return <p>Activités</p>; | ||
} |
Oops, something went wrong.