Skip to content

fix: update party order in AI votes sorting#618

Merged
ManAnRuck merged 2 commits intomasterfrom
feature/adjust-parties-for-lg-21
Apr 26, 2025
Merged

fix: update party order in AI votes sorting#618
ManAnRuck merged 2 commits intomasterfrom
feature/adjust-parties-for-lg-21

Conversation

@ManAnRuck
Copy link
Member

This pull request includes changes to the bundestag.io/admin/src/components/Procedures directory 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:

@ManAnRuck ManAnRuck requested a review from Copilot March 22, 2025 18:36
@ManAnRuck ManAnRuck self-assigned this Mar 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ManAnRuck ManAnRuck moved this to ⚙️ In Progress in Democracy Mar 22, 2025
@ManAnRuck ManAnRuck force-pushed the feature/adjust-parties-for-lg-21 branch from 83cf97f to ed909f3 Compare March 22, 2025 18:44
@ManAnRuck ManAnRuck force-pushed the feature/adjust-parties-for-lg-21 branch 2 times, most recently from 9a768a6 to 7734e3f Compare April 21, 2025 17:22
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>
@ManAnRuck ManAnRuck force-pushed the feature/adjust-parties-for-lg-21 branch from 7734e3f to d1dbad1 Compare April 21, 2025 18:12
@ManAnRuck ManAnRuck requested a review from Copilot April 26, 2025 11:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@ManAnRuck ManAnRuck force-pushed the feature/adjust-parties-for-lg-21 branch from e0072f1 to 9784525 Compare April 26, 2025 12:20
@ManAnRuck ManAnRuck requested a review from Copilot April 26, 2025 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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} />

@ManAnRuck ManAnRuck merged commit 4b23092 into master Apr 26, 2025
6 checks passed
@ManAnRuck ManAnRuck deleted the feature/adjust-parties-for-lg-21 branch April 26, 2025 15:52
@github-project-automation github-project-automation bot moved this from ⚙️ In Progress to 🚀 Shipped in Democracy Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

2 participants