You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Card - Entering amount $55666666.52 and tapping next all errors are not displayed to proceed #52033
Version Number: 9.0.57-3 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team
Action Performed:
Launch app
Login with account with expensify card enabled with bank account added, and few members invited in workspace
Go to workspace settings
Tap expensify card
Tap issue card - physical card - monthly - next
Enter an big amount $55666666.52
Tap next
Note error shown - please enter an amount less than $21474836
Delete digits before decimal
Now note error "please enter an whole dollar amount before continuing" shown
Expected Result:
Entering amount $55666666.52 and tapping next, both error please enter an amount less than $21474836 &"please enter an whole dollar amount before continuing" must be shown
Actual Result:
Entering amount $55666666.52 and tapping next all errors are not displayed to proceed. Only one error "please enter an amount less than $21474836" displayed and after correcting this other error displayed "please enter an whole dollar amount before continuing".
What changes do you think we should make in order to solve the problem?
On the cardLimitError, if errors.limit already contains a message, add a newline (\n) before the new message, ensuring each error appears on a separate line
What changes do you think we should make in order to solve the problem?
We can prevent users from entering decimals altogether by setting the prop fixedDecimals={0} here. This will ensure that users cannot input any decimal values.
Please re-state the problem that we are trying to solve in this issue.
The OP expects that both error messages that state to enter a whole dollar amount and enter an amount less than the limit will be shown. I think one error message should be shown at a time, but the "enter a whole dollar amount" should be prioritized.
What is the root cause of that problem?
We started to add the maximum amount validation in this PR. However, the validation error overrides any previous validation error found.
I'm going to be honest, this is a very niche error and the parameters are too specific to consider it an active bug. Because of that, I am going to close this.
Activity
melvin-bot commentedon Nov 5, 2024
Triggered auto assignment to @CortneyOfstad (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nyomanjyotisa commentedon Nov 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Card - Entering amount $55666666.52 and tapping next all errors are not displayed to proceed
What is the root cause of that problem?
We replace the
errors.limitso only one error message displayedApp/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 51 to 59 in b1bffa6
What changes do you think we should make in order to solve the problem?
On the cardLimitError, if errors.limit already contains a message, add a newline (\n) before the new message, ensuring each error appears on a separate line
App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 57 to 59 in b1bffa6
Result

What alternative solutions did you explore? (Optional)
Nodebrute commentedon Nov 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Entering amount $55666666.52 and tapping next all errors are not displayed to proceed
What is the root cause of that problem?
We update the
error.limitvalue each time a new error occurs.App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Line 58 in b1bffa6
What changes do you think we should make in order to solve the problem?
We can prevent users from entering decimals altogether by setting the prop
fixedDecimals={0}here. This will ensure that users cannot input any decimal values.App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Line 88 in e3452de
Optional: we can remove this error the
App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 53 to 54 in e3452de
What alternative solutions did you explore? (Optional)
Instead of using
error.limitwe can useaddErrorMessageApp/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 49 to 59 in b1bffa6
We can do something like this
Alternate 2
We can use the onChangeText prop to replace all non-numeric characters(including digits) and then set the new. The same approach we used here
App/src/pages/workspace/rules/RulesMaxExpenseAgePage.tsx
Line 42 in 4603c82
and then set the new, cleaned value accordingly.
Optional:we can remove these errors
App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 51 to 55 in e3452de
bernhardoj commentedon Nov 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The OP expects that both error messages that state to enter a whole dollar amount and enter an amount less than the limit will be shown. I think one error message should be shown at a time, but the "enter a whole dollar amount" should be prioritized.
What is the root cause of that problem?
We started to add the maximum amount validation in this PR. However, the validation error overrides any previous validation error found.
App/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Lines 50 to 60 in b914945
App/src/pages/workspace/expensifyCard/WorkspaceEditCardLimitPage.tsx
Lines 90 to 100 in b914945
What changes do you think we should make in order to solve the problem?
We need to update the validation logic so it only sets the limit error if both previous validation passes.
CortneyOfstad commentedon Nov 12, 2024
I'm going to be honest, this is a very niche error and the parameters are too specific to consider it an active bug. Because of that, I am going to close this.