Skip to content

Commit

Permalink
Merge pull request #42 from alexfauquette/small-fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
alexfauquette authored Apr 20, 2024
2 parents 66f6dd5 + ea418b7 commit 00a1a86
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
24 changes: 14 additions & 10 deletions components/folders/AmendementTab/AmendementCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,26 @@ export default function AmendementCard(props: Amendement) {
<Typography fontWeight="light" variant="body2">
Date de dépôt:&nbsp;
<Typography component="span" variant="body2">
{dateDepot.toLocaleDateString("fr-FR", {
year: "numeric",
month: "short",
day: "numeric",
})}
{dateDepot
? new Date(dateDepot).toLocaleDateString("fr-FR", {
year: "numeric",
month: "short",
day: "numeric",
})
: "-"}
</Typography>
</Typography>

<Typography fontWeight="light" variant="body2">
Date d&apos;examen:&nbsp;
<Typography component="span" variant="body2">
{dateSort?.toLocaleDateString("fr-FR", {
year: "numeric",
month: "short",
day: "numeric",
})}
{dateSort
? new Date(dateSort).toLocaleDateString("fr-FR", {
year: "numeric",
month: "short",
day: "numeric",
})
: "-"}
</Typography>
</Typography>
</Stack>
Expand Down
4 changes: 3 additions & 1 deletion components/folders/DeputeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type DeputeCardProps<RootComponent extends React.ElementType = "div"> = {
shortName: string;
};
smallGroupColor?: boolean;
showVote?: boolean;
vote?: "pour" | "contre" | "nonVotant" | "abstention";
groupPosition?: "pour" | "contre" | "abstention";
} & BoxProps<RootComponent>;
Expand All @@ -36,6 +37,7 @@ export default function DeputeCard<RootComponent extends React.ElementType>(
group,
smallGroupColor,
vote,
showVote,
groupPosition,
sx,
secondaryText,
Expand Down Expand Up @@ -150,7 +152,7 @@ export default function DeputeCard<RootComponent extends React.ElementType>(
<CompareArrowsSharpIcon />
</Tooltip>
)}
{vote && vote !== "nonVotant" && (
{showVote && vote && vote !== "nonVotant" && (
<CircleDiv
color={
(vote === "pour" && "green") ||
Expand Down
4 changes: 2 additions & 2 deletions components/folders/VotesTab/VotesDeputes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function VotesDeputes({ votes }: { votes: Vote[] }) {
group_libelle,
group_libelle_short,
group_color,
// positionVote,
positionVote,
group_position,
}) => (
<DeputeCard
Expand All @@ -98,7 +98,7 @@ export function VotesDeputes({ votes }: { votes: Vote[] }) {
shortName: group_libelle_short,
color: group_color,
}}
// vote={positionVote}
vote={positionVote}
groupPosition={group_position}
/>
)
Expand Down
1 change: 1 addition & 0 deletions components/folders/VotesTab/VotesGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function VotesGroups({ votes }: { votes: Vote[] }) {
prenom={prenom}
nom={nom}
vote={positionVote}
showVote
groupPosition={group_position}
/>
)
Expand Down
7 changes: 3 additions & 4 deletions repository/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,13 @@ export async function getDossierVotes(
"id as group_id",
"organeRefUid",
"positionMajoritaire as group_position",
"hash",
])
.from("GroupeVotant")
.as("groupeVotant");
},
"Vote.groupeVotantRefId",
"groupeVotant.group_id"
"groupeVotant.hash"
)
.leftJoin(
function () {
Expand All @@ -427,9 +428,7 @@ export async function getDossierVotes(
},
"groupeVotant.organeRefUid",
"organe.organe_uid"
)
.options({ nestTables: true });

);
return { votes, acts };
} catch (error) {
console.error("Error fetching rows from Dossier:", error);
Expand Down

0 comments on commit 00a1a86

Please sign in to comment.