-
Notifications
You must be signed in to change notification settings - Fork 21
PS-469 - update wallet admin ui to show the onhold admin dropdown #1357
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
Conversation
| if (updateObj.paymentStatus === 'Owed') { | ||
| paymentStatus = 'OWED' | ||
| } else if (updateObj.paymentStatus === 'On Hold') { | ||
| } else if (updateObj.paymentStatus === 'On Hold (Admin)') { |
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.
[❗❗ correctness]
The change from 'On Hold' to 'On Hold (Admin)' in the condition might affect other parts of the code that rely on the previous status. Ensure that all relevant parts of the application are updated to handle this new status correctly.
| } else if (['On Hold (Member)', 'On Hold (Tax Form)', 'On Hold (Payment Provider)'].indexOf(status) !== -1) { | ||
| status = 'Owed' | ||
| } | ||
|
|
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.
[❗❗ correctness]
The removal of the logic that maps 'On Hold (Admin)' back to 'On Hold' could lead to inconsistencies if other parts of the application expect the status to be 'On Hold'. Verify that this change does not introduce any unintended side effects.
|
|
||
| const options = useCallback(() => { | ||
| if (props.payment.status.toUpperCase() !== 'PAID') { | ||
| const isMemberHold = ['On Hold (Member)', 'On Hold (Tax Form)', 'On Hold (Payment Provider)'].indexOf(props.payment.status) !== -1; |
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.
[💡 readability]
Consider using includes instead of indexOf for better readability and to avoid potential off-by-one errors. const isMemberHold = ['On Hold (Member)', 'On Hold (Tax Form)', 'On Hold (Payment Provider)'].includes(props.payment.status);
kkartunov
left a comment
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.
Looks good 👍
|
|
||
| const options = useCallback(() => { | ||
| if (props.payment.status.toUpperCase() !== 'PAID') { | ||
| const isMemberHold = [ |
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.
[correctness]
The change from indexOf to includes is a good improvement for readability and clarity. However, ensure that props.payment.status is always a string to avoid potential runtime errors.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PS-469
What's in this PR?