Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): create percentage breakdown input for III.1.1 etc. #723

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

lemilonkh
Copy link
Contributor

@lemilonkh lemilonkh commented Sep 17, 2024

TL;DR

Added a new percentage breakdown input component for activity forms.

What changed?

  • Introduced a new PercentageBreakdownInput component for handling percentage breakdowns in activity forms.
  • Updated activity-form-modal.tsx and activity-modal-body.tsx to incorporate the new input type.
  • Added new icons for different waste categories.
  • Updated localization strings to include new category labels.
  • Modified useActivityForm hook to reset form values when methodology changes.

How to test?

  1. Navigate to an activity form that includes a percentage breakdown field.
  2. Click on the input to open the popover with category breakdowns.
  3. Enter percentages for different categories and ensure the total updates correctly.
  4. Verify that the input summary displays correctly and updates as you modify values.
  5. Check that form validation works properly for the percentage breakdown.

Why make this change?

This change introduces a more user-friendly and intuitive way to input percentage breakdowns for activities. It provides a clear visual representation of different categories and their respective percentages, making it easier for users to accurately input and understand the data. The new component also includes built-in validation to ensure the total percentage adds up to 100%, improving data accuracy and user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant