-
Notifications
You must be signed in to change notification settings - Fork 1
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
[MPDX-8192] Do not allow fractional admin percentages #1058
Conversation
Preview branch generated at https://8192-validate-percentage.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 1531998 No significant changes found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -177,7 +177,7 @@ const appealFormSchema = yup.object({ | |||
.test( | |||
i18n.t('Is positive?'), | |||
i18n.t('Must use a positive number for Initial Goal'), | |||
(value) => parseFloat(value as unknown as string) >= 0, | |||
(value) => typeof value === 'number' && value >= 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When testing on https://8192-validate-percentage.d3dytjb8adxkk5.amplifyapp.com/
I was still able to enter a number with a decimal point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying the admin percentage validation is good but there isn't validation yet on the initial goal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that is correct
@dr-bizz It kind of seems weird to me that we're trying to keep users from entering fractional amounts, but the goal still probably won't probably be a whole number (e.g. with the numbers below). It feels like we should be rounding the goal amount too if we want everything to be a whole number. Let me know what you think. Also, the goal amount is editable in Angular but not in React. That needs fixed too. |
This is how the old MPDX was, not saying it's correct. But you can bring this up with Scott and see if he wants to make the change. I'm okay with it if he is. |
I've created a task for the Goal input - MPDX-8208 |
@dr-bizz My bad, you're right 🤦♂️. I'll add the whole number validation to the three fields. |
All good. That got me the first time as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! 🔥💯
Description
Require the admin percentage to be a whole number.
MPDX-8192
Checklist: