-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix: skip qty validation when multiqty is disabled #6624
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LinHuiqing
reviewed
Aug 15, 2023
src/app/modules/form/admin-form/__tests__/admin-form.payments.service.spec.ts
Outdated
Show resolved
Hide resolved
2 bugs:
Screen.Recording.2023-08-16.at.1.51.34.PM.mov
Screen.Recording.2023-08-16.at.1.53.44.PM.mov |
…display_amount_keys is undefined
LinHuiqing
approved these changes
Aug 16, 2023
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
This should be fixed such that the quantity check is not performed when the quantity limit toggle is off.
multi_qty
is always treated to be true even if the toggle is disabled, resulting in validation failure when the user is trying to add only 1 single item.Closes FRM-1255
Solution
trigger
is also added so that we can update theuseForm
errors through a validation.multi_qty
is enabled and set the qty modifier to be 1 when disabled during calculations.Breaking Changes
Before & After Screenshots
BEFORE:
Screen.Recording.2023-08-15.at.4.28.32.PM.mov
AFTER:
Untitled.mov
Tests
Quantity below max payment amount (200k)
9
$20000.00
Quantity at max payment amount (200k)
10
$20000.00
Quantity above max payment amount (200k)
11
$20000.00
Regression
Please enter a valid payment amount
Please enter a valid payment amount