-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
refactor: payments section of Orders 2.0 #5279
Conversation
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@mikemurray the main new code here is in the components There are a couple files which seem like duplicates, but I've left a comment on the top |
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed @spencern @mikemurray I've run into the following lint warning in a few files that I've converted from Class to functional components: In my two files here that threw that warning, I put a I've done some reading into it, it seems like this is a frequent issue, so much so that they added a flag to only use that eslint rule on Class components. What do you all think about flipping the https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md` |
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
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 when the snyk issue is resolved in this PR. #5299
Fixes the Payments portion of #5157
Impact: major
Type: refactor
Issue
Refactoring the Orders Operator UI to deal with multiple fulfillment groups, graphql, etc, to make it 2.0 ready. This PR splits off the Payments portion of the overall work to make it easier to test in smaller chunks.
Portions of the new UI are already available, but this in particular will update strictly the payments section, and the mutations associated with it:
approvePayments
, andcapturePayments
.Testing
IOU
payment method, and putting in a number less than the overall total into the amount field). When viewing the orders table, click on an order, and then once on the single order page, change the URL from/orders/
to/orders-2.0/
to see the new UI. The payments section, which is all that is being tested here, should look like this:Test the following workflows:
Create a user that has admin permission, but not
reaction-order
permission, and see that the user can see a "read-only" version of the payments, i.e. noCapture
buttons show, but all other data does. If you don't want to create a new user, you can manually go into theOrderCardPayments
andOrderCardPayment
files, and change allhasPermission
consts
to befalse
., instead of doing an actual permissions check.On an order with multiple payment methods, use the
Capture all payments
button to capture all payments. Do the same on an order with a single payment method. See that theCapture
button disappears when a payment has already been captured, and statuses have been updated accordingly.On an order with multiple payment methods, use the
Capture payment
button on each payment to individually capture each payment. Do the same on an order with a single payment method. See that theCapture
button disappears when a payment has already been captured.On an order with 4+ payment methods, in the database, manually change one or more payments to have
riskLevel: highest
. This will cause theCapture
button to open a dialog and confirm you want to capture with a second click. Use theCapture all payments
button and make sure the dialog opens. On another order, do the same thing with theriskLevel
, and capture a single non-risky payment. See that the confirm doesn't pop up, since that particular payment is not risky. Then, us the single capture to capture the risky payment. See that the dialog still comes up. Then, capture the rest of the the non-risky payments using theCapture all payments
button, and see the dialog does not come up, since the risky payment has been captured.On an order, either force an error when capturing the payment (I'm not sure how to do this), or manually add a string field called
captureErrorMessage
to thepayments
object (the data can be any string, like "there was an error oh no". See that the error shows inside the Payment.