Skip to content

Commit

Permalink
Merge pull request #41 from alexfauquette/remove-ids
Browse files Browse the repository at this point in the history
remove acts ids and display political parties
  • Loading branch information
alexfauquette authored Apr 20, 2024
2 parents 4fb4f65 + b29f57c commit 66f6dd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 161 deletions.
2 changes: 1 addition & 1 deletion app/depute/[slug]/InfoPersonelles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function InfoPersonelles({
depute: Acteur;
}) {
const sortedMandats = mandats
.filter((mandat) => mandat.legislature === "16")
// .filter((mandat) => mandat.legislature === "16") Partis politique est `null`
.sort((a, b) => (a.dateDebut < b.dateDebut ? 1 : -1));

const dernerMandatDepute = sortedMandats.filter(
Expand Down
165 changes: 5 additions & 160 deletions components/folders/TimelineCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import TimelineContent from "@mui/lab/TimelineContent";
import TimelineOppositeContent, {
timelineOppositeContentClasses,
} from "@mui/lab/TimelineOppositeContent";
import TimelineDot from "@mui/lab/TimelineDot";
import Typography from "@mui/material/Typography";
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";

import { CardLayout } from "@/components/folders/CardLayout";
import StatusChip from "@/components/StatusChip";

import { ActeLegislatif, Document } from "@/repository/types";
import { Box, Link } from "@mui/material";
import { getDocumentURL } from "@/domain/dataTransform";

import { groupActs } from "@/repository/Acts";
import { sortActDate } from "../utils";
import Image from "next/image";
Expand Down Expand Up @@ -284,7 +282,8 @@ export const TimelineCard = ({
key={act.uid}
sx={{ my: 0, ml: 4 }}
>
{title} ({act.uid})
{title}
{/* ({act.uid}) */}
</Typography>
);
})}
Expand All @@ -303,160 +302,6 @@ export const TimelineCard = ({
});
}
)}

{/* {acts
.sort((a, b) => {
if (!a.dateActe || !b.dateActe) {
return 0;
}
return a.dateActe < b.dateActe ? -1 : 1;
})
.map((act) => {
const title = act.nomCanonique || act.codeActe;
return (
<TimelineItem key={act.uid}>
<TimelineOppositeContent>
<Typography variant="body2" fontWeight="light">
{act.dateActe
? act.dateActe.toLocaleDateString("fr-FR", {
year: "numeric",
month: "short",
day: "numeric",
})
: "?"}
</Typography>
</TimelineOppositeContent>
<TimelineSeparator>
<TimelineDot />
<TimelineConnector />
</TimelineSeparator>
<TimelineContent>
<Stack direction="column" spacing={1}>
<Typography variant="body1" fontWeight="bold">
{title}
</Typography>
{act.texteAdopteRefUid && (
<Stack direction="row" spacing={1} alignItems="center">
<Typography
variant="caption"
fontWeight="light"
component={
getDocumentURL(documents[act.texteAdopteRefUid])
? Link
: "p"
}
href={getDocumentURL(
documents[act.texteAdopteRefUid]
)}
>
{documents[act.texteAdopteRefUid]?.titrePrincipal}
</Typography>
<StatusChip
status="validated"
label="Adopté"
size="small"
/>
</Stack>
)}
{act.texteAssocieRefUid && (
<Typography
variant="caption"
fontWeight="light"
component={
getDocumentURL(documents[act.texteAssocieRefUid])
? Link
: "p"
}
href={getDocumentURL(documents[act.texteAssocieRefUid])}
>
{documents[act.texteAssocieRefUid]?.titrePrincipal}
</Typography>
)}
</Stack>
</TimelineContent>
</TimelineItem>
);
})} */}
{/* Next lines are items from the figma.
I keep them to be able to copy past them when needed.
But commented to be sure I don't mix real data and the figma. */}
{/* <TimelineItem>
<TimelineOppositeContent>
<Typography variant="body2" fontWeight="light">
21 Oct 2022
</Typography>
</TimelineOppositeContent>
<TimelineSeparator>
<TimelineDot />
<TimelineConnector />
</TimelineSeparator>
<TimelineContent>
<Stack direction="column" spacing={1}>
<Typography variant="body1" fontWeight="bold">
Avis favorable du conseil constitutionnel
</Typography>
<Typography variant="caption" fontWeight="bold">
Voir séance
</Typography>
<Typography variant="caption" fontWeight="light">
Première partie
</Typography>
<Stack direction="row" spacing={1} alignItems="center">
<Typography variant="caption" fontWeight="light">
Vote sur l&apos;ensemble de la première partie
</Typography>
<StatusChip status="validated" label="Adopté" size="small" />
</Stack>
</Stack>
</TimelineContent>
</TimelineItem>
<TimelineItem>
<TimelineOppositeContent>
<Typography variant="body2" fontWeight="light">
13 Oct 2022
</Typography>
</TimelineOppositeContent>
<TimelineSeparator>
<TimelineDot />
<TimelineConnector />
</TimelineSeparator>
<TimelineContent>
<Stack direction="column" spacing={1}>
<Typography variant="body1" fontWeight="bold">
Séance en hémicycle de 9h
</Typography>
<Typography variant="caption" fontWeight="bold">
Voir séance
</Typography>
<Typography variant="caption" fontWeight="light">
Travaux en commission
</Typography>
<Typography variant="caption" fontWeight="light">
Première partie
</Typography>
<Stack direction="row" spacing={1} alignItems="center">
<Typography variant="caption" fontWeight="light">
Article 1er
</Typography>
<StatusChip status="dropped" label="Rejeté" size="small" />
</Stack>
<Stack direction="row" spacing={1} alignItems="center">
<Typography variant="caption" fontWeight="light">
Article 2 et annexe a
</Typography>
<StatusChip status="validated" label="Adopté" size="small" />
</Stack>
<Stack direction="row" spacing={1} alignItems="center">
<Typography variant="caption" fontWeight="light">
Vote sur l&apos;ensemble de la première partie
</Typography>
<StatusChip status="validated" label="Adopté" size="small" />
</Stack>
</Stack>
</TimelineContent>
</TimelineItem> */}
</Timeline>
</CardLayout>
);
Expand Down

0 comments on commit 66f6dd5

Please sign in to comment.