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

Bug : Values in Forms can be Negative #7272

Closed
Keshav-0907 opened this issue Feb 26, 2024 · 7 comments · Fixed by #7273
Closed

Bug : Values in Forms can be Negative #7272

Keshav-0907 opened this issue Feb 26, 2024 · 7 comments · Fixed by #7273
Assignees

Comments

@Keshav-0907
Copy link
Contributor

Keshav-0907 commented Feb 26, 2024

Describe the bug
Currently in forms users are allowed to input negative values in places where it's should be not allowed.

To Reproduce
(one of the examples)

  1. Navigate to '/facility/a782943c-6db9-4994-880d-2c391b89b955'
  2. Click on "Add Triage"
  3. Fill out the form with a negative value and submit
  4. Observe the bug.

Expected behavior
The form should not allow for negative values, and the minimum value accepted should be 0.

Screenshots

Screen.Recording.2024-02-26.at.12.05.35.PM.mov

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 22

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Keshav-0907
Copy link
Contributor Author

@rithviknishad, there are other forms also where the minimum value is not defined. Should I also fix them in the same PR?

@rithviknishad
Copy link
Member

Yup, go ahead! Update the issue description and title too

@Keshav-0907
Copy link
Contributor Author

Okay :)

@Keshav-0907 Keshav-0907 changed the title Bug : Values in Triage can be Negative Bug : Values in Forms can be Negative Feb 26, 2024
@rithviknishad
Copy link
Member

@Keshav-0907 re-request for review once the changes are done.

@nihal467
Copy link
Member

image

@rithviknishad @Keshav-0907 can we have frontend validation like this rather than the browser validation

@Keshav-0907
Copy link
Contributor Author

Absolutely, @nihal467 ! Having frontend validation instead of relying solely on browser validation is a great idea. It provides a more seamless and user-friendly experience.

@Keshav-0907
Copy link
Contributor Author

@nihal467 @rithviknishad @Ashesh3

Sir I have updated the PR #7273 by implementing frontend validation instead of browser validation.

Screenshot 2024-02-29 at 10 22 04 AM

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

Successfully merging a pull request may close this issue.

3 participants