fix: update party order in AI votes sorting#618
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the party handling logic by introducing dynamic party generation based on the legislative period and updating the party order in AI votes sorting. Key changes include:
- Replacing a static FRACTIONS array with a dynamic getFractions function in VoteResultsForm.tsx.
- Changing the sorting order in AiVotes.tsx by removing 'FDP' from the partiesOrder array.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx | Introduces getFractions to generate party lists dynamically based on the period. |
| bundestag.io/admin/src/components/Procedures/AiVotes.tsx | Updates the partiesOrder array to remove 'FDP' from the AI votes sorting order. |
83cf97f to
ed909f3
Compare
9a768a6 to
7734e3f
Compare
Adjust the sorting order of parties in the AI votes component by removing 'FDP' from the list. This change ensures the correct representation of parties based on the current voting period. Signed-off-by: Manuel Ruck <git@manuelruck.de>
7734e3f to
d1dbad1
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates the party sorting logic in AI votes handling by dynamically generating the party list based on the legislative period.
- In VoteResultsForm.tsx, the static FRACTIONS array is replaced with a dynamic getFractions function.
- In AiVotes.tsx, the party order for sorting and an improved error message are implemented using getFractions.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx | Replaces static party list with dynamically generated fractions based on the legislative period. |
| bundestag.io/admin/src/components/Procedures/AiVotes.tsx | Leverages getFractions for sorting the votes and refines the error logging message. |
Enhance the VoteResultsForm component by adding a detailed Props interface to improve type safety and clarity. Refactor the form handling logic to use the new interface, ensuring better maintainability and readability. Signed-off-by: Manuel Ruck <git@manuelruck.de>
e0072f1 to
9784525
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates the party handling logic for AI votes by modifying the party fractions sorting order and dynamically generating the list of parties based on the legislative period.
- Removed the static "FRACTIONS" array in favor of a dynamic getFractions() helper.
- Updated the VoteResultsForm component with stricter typings and layout adjustments.
- Refactored AiVotes to use the new getFractions() for sorting and applied a reset CSS import in the layout.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx | Introduced getFractions, updated form layout, and refined payload mapping |
| bundestag.io/admin/src/components/Procedures/AiVotes.tsx | Modified party sorting logic to leverage getFractions |
| bundestag.io/admin/src/app/layout.tsx | Added CSS reset import |
Comments suppressed due to low confidence (1)
bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx:186
- The function or variable onAiVoteResult is used here but is not defined in the component's scope, which may lead to runtime errors. Define onAiVoteResult or remove the prop if it's not needed.
<AiVotes decision={getFieldValue('decisionText')} period={period} onResult={onAiVoteResult} />
This pull request includes changes to the
bundestag.io/admin/src/components/Proceduresdirectory to update the handling of party fractions based on the legislative period. The most important changes include modifying the sorting order of parties and dynamically generating the list of parties based on the period.Updates to party handling:
bundestag.io/admin/src/components/Procedures/AiVotes.tsx: Modified thepartiesOrderarray to remove 'FDP' from the sorting order.bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx: Replaced the staticFRACTIONSarray with thegetFractionsfunction to dynamically generate the list of parties based on the legislative period.bundestag.io/admin/src/components/Procedures/VoteResultsForm.tsx: Updated thepartiesvariable to use thegetFractionsfunction instead of the staticFRACTIONSarray.