Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Aug 1, 2019

Addresses the refunds portion of #5157
Impact: minor
Type: refactor

Issue

This PR is part of refactoring the Orders Operator UI to deal with multiple fulfillment groups, graphql, etc, to make it 2.0 ready. The majority of the Orders 2.0 UI has already been tested and merged into Reaction.

This PR splits off the refunds portion of the overall work to make it easier to test in smaller chunks. This PR only addresses at the UI portion of refunds - the entirety of the refunds tab. The GraphQL queries and mutations related to refunds have already been tested and merged (#5352, #5354), and don't need to be addressed in this PR.

Breaking changes

None

Testing

  • Place two orders (six total) of each of the following:

    • Using only the Stripe payment method
    • Using only the example payment method
    • Using multiple payments, a combination of Stripe and Example (two or more payments)
  • Navigate to the Orders Operator UI

  • Click on an order, and then once on the single order page, change the URL from /orders/ to /orders-beta/ to see the new UI.

  • Once an order is open, Capture all payments on the order.

  • Then, navigate to the refunds tab. It should look something like this:

Order_Details_for_order_reference__Y3imj7gnML4JtX29B

At this point, do the following tests:

  1. Refund the maximum amount of the single stripe payment
  2. Refund the maximum amount of the single example payment method
  3. refund the maximum amount of all methods in the multiple payment order (you can
  • After all those are done, confirm the input box disappears, and you can no longer create a refund.
  • Confirm you can see previous refunds in the appropriate section

Then:

  1. Refund a partial amount of a single stripe payment
  2. Refund the partial amount of the single example payment method
  3. refund the partial amount of all methods in the multiple payment order (you can
  • At this point, see that there is a line of text that tells you how much has been refunded, and how much is available to refund on each payment

Then:

  1. attempt to refund more than the remaining amount on all payments
  2. The UI will "let" you, but the server side will only allow the remaining amount and complete the refund

Adding translations for Chips:

Add orderStatusLabels to the Shops collection shop object. This will provide translations for all the Chip style order status badges in the Orders Fulfillment UI.

"orderStatusLabels": {
    "new" : [ 
        {
            "language" : "en",
            "label" : "Order received"
        }, 
        {
            "language" : "es",
            "label" : "Recibido"
        }
    ],
    "coreOrderWorkflow/processing" : [ 
        {
            "language" : "en",
            "label" : "Order received"
        }, 
        {
            "language" : "es",
            "label" : "Recibido"
        }
    ],
    "coreOrderWorkflow/completed" : [ 
        {
            "language" : "en",
            "label" : "Shipped"
        }, 
        {
            "language" : "es",
            "label" : "Enviado"
        }
    ],
    "coreOrderWorkflow/canceled" : [ 
        {
            "language" : "en",
            "label" : "Canceled"
        }, 
        {
            "language" : "es",
            "label" : "Cancelado"
        }
    ],
    "coreOrderWorkflow/picked" : [ 
        {
            "language" : "en",
            "label" : "Picked"
        }
    ],
    "coreOrderWorkflow/packed" : [ 
        {
            "language" : "en",
            "label" : "packed"
        }
    ],
    "coreOrderWorkflow/shipped" : [ 
        {
            "language" : "en",
            "label" : "shipped"
        }
    ]
}

Signed-off-by: Erik Kieckhafer <[email protected]>
…ery' into ref-kieckhafer-ordersUiWithMultipleFulfillmentGroups
Signed-off-by: Erik Kieckhafer <[email protected]>
…ery' into ref-kieckhafer-ordersUiWithMultipleFulfillmentGroups
…utation' into ref-kieckhafer-ordersUiWithMultipleFulfillmentGroups
Signed-off-by: Erik Kieckhafer <[email protected]>
…utation' into ref-kieckhafer-ordersUiWithMultipleFulfillmentGroups
…nto ref-kieckhafer-ordersUiWithMultipleFulfillmentGroups
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]>
@machikoyasuda
Copy link
Contributor

Other small random things:

  1. "Order Details" should be "Order details"
  2. "Order Summary" should be "Order summary"
  3. FULFILLMENT/REFUNDS should be "Fulfillment" "Refunds"
  4. Status Chips, like completed should be capitalized like Completed

@kieckhafer
Copy link
Member Author

kieckhafer commented Aug 5, 2019

@machikoyasuda Thanks!

Fixed 1 & 2.

  1. is based on the default "Tab" component, it automatically capitalizes all letters, so probably something to look at when re-doing that component, because we use it in other places too (Tags I can think of off the top of my head), I think maybe products too?

4 Is a translation issue, and does show capitalized when translations are loaded. I added instructions on how to load translations in the testing part of the PR description. By default it just shows the raw data from the database. We unfortunately do not have a default way of doing this on first load.

Signed-off-by: Erik Kieckhafer <[email protected]>
@machikoyasuda
Copy link
Contributor

This could be a ticket for later but OrderStatusChip should inherit from https://catalyst.reactioncommerce.com/#/Components/Content/Chip not MUI Chip. (Just another layer of importing!) and all necessary type changes to OrderStatusChip should come from https://catalyst.reactioncommerce.com/#/Components/Content/Chip

@kieckhafer
Copy link
Member Author

@machikoyasuda Yeah, this PR unfortunately spanned a three week time where we went from MUI 3.x to MUI 4.x, React 16.4 to React 16.8, and Component Library to Catalyst, so there are new ways to do all these things which weren't implemented until after this PR was basically done.

#5158 is the final "switch from orders 1.0 to 2.0" ticket, so after this is merged, I am going to do any design updates from @reactioncommerce/design in that tickets, and can also do a lot of these switchovers to using Catalyst instead of MUI directly.

@machikoyasuda
Copy link
Contributor

@kieckhafer sounds good! that also.. makes way more sense. this way, we can create individual tickets for all the small tickets and assign them to more people, rather than 1 pr with a zillion little fixes!

@kieckhafer
Copy link
Member Author

@aldeed all comments either addressed and fixed, if deemed necessary for this PR, or a ticket created if not required. Ready for another check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants