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

front: fix decimals error for study budget #9598

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

Akctarus
Copy link
Contributor

@Akctarus Akctarus commented Nov 6, 2024

closes #8607

@Akctarus Akctarus requested a review from a team as a code owner November 6, 2024 14:19
@Akctarus Akctarus requested a review from emersion November 6, 2024 14:20
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 42.41%. Comparing base (95c1305) to head (268ae20).
Report is 56 commits behind head on dev.

Files with missing lines Patch % Lines
front/src/modules/study/utils.ts 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #9598      +/-   ##
============================================
- Coverage     42.57%   42.41%   -0.16%     
- Complexity     2271     2272       +1     
============================================
  Files          1311     1314       +3     
  Lines        105246   105821     +575     
  Branches       3296     3305       +9     
============================================
+ Hits          44810    44888      +78     
- Misses        58490    58980     +490     
- Partials       1946     1953       +7     
Flag Coverage Δ
core 74.95% <ø> (-0.11%) ⬇️
editoast 73.22% <ø> (-0.48%) ⬇️
front 18.79% <0.00%> (-0.01%) ⬇️
gateway 2.18% <ø> (-0.32%) ⬇️
osrdyne 3.28% <ø> (+<0.01%) ⬆️
railjson_generator 87.49% <ø> (ø)
tests 86.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Akctarus Akctarus requested a review from emersion November 7, 2024 10:41
@emersion
Copy link
Member

emersion commented Nov 8, 2024

This looks much better! I have one remaining question: we already have some validation logic in checkStudyFields(). I think it would make sense to have a single spot where all of the validation is performed, instead of having half of it in one place and the other somewhere else?

One approach would be to add an extra condition to checkStudyFields() and change the existing error message to "not an integer between 0 and $max". Another approach would be to return an error string (or translation key) from checkStudyFields() instead of a boolean.

@Akctarus Akctarus requested a review from emersion November 8, 2024 17:07
@Akctarus Akctarus changed the title front: force input of the study budget to a numerical value only (no negatives or decimals) front: fix decimals error for study budget Nov 8, 2024
@Akctarus Akctarus force-pushed the tmn/front/fix-study-budget-input branch 3 times, most recently from 659aaf6 to 746ace9 Compare November 8, 2024 17:20
@emersion
Copy link
Member

Seems like there is a duplicate PR? #9663 seems identical.

@Akctarus Akctarus force-pushed the tmn/front/fix-study-budget-input branch from 746ace9 to 268ae20 Compare November 15, 2024 08:45
Copy link
Contributor

@theocrsb theocrsb left a comment

Choose a reason for hiding this comment

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

LGTM and tested :)

@Akctarus
Copy link
Contributor Author

Seems like there is a duplicate PR? #9663 seems identical.

#9663 is for project budget, this one is for study budget :)

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

My bad! LGTM :)

@Akctarus Akctarus enabled auto-merge November 15, 2024 08:56
@Akctarus Akctarus added this pull request to the merge queue Nov 15, 2024
Merged via the queue into dev with commit ca256f7 Nov 15, 2024
27 checks passed
@Akctarus Akctarus deleted the tmn/front/fix-study-budget-input branch November 15, 2024 10:03
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.

Selecting float budget gives unreadable error
4 participants