Skip to content
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

Send order lines in orderGrantRefundCreate mutation #4373

Merged
merged 33 commits into from
Nov 2, 2023

Conversation

poulch
Copy link
Member

@poulch poulch commented Oct 25, 2023

closes #4277

General AC:

  • A user should be able to choose each line quantity, is shipping refunded, refund amount and send those data to API
  • A user can choose shipping refund only when none of the other refunds contains a shipping refund selected
    -A user can only select the quantity that is able to refund, when the user had ordered an item with quantity 3, refund 2 of 3, now can only refund 1
  • A user during the creation of a grant refund should see the calculated refund amount based on the selected quantity and shipping refund. User can also provide own custom refund amount.
  • A user during editing granted refund should always see the refunded amount, changing the quantity and shipping refund does not influence the refund amount. User can manually update refund amount.

Screenshots

Before
Screenshot 2023-10-30 at 10 46 14

After
Screenshot 2023-10-30 at 10 48 18

Pull Request Checklist

  1. This code contains UI changes
  2. All visible strings are translated with proper context including data-formatting
  3. Attributes data-test-id are added for new elements
  4. The changes are tested in Chrome/Firefox/Safari browsers and in light/dark mode
  5. Your code works with the latest stable version of the core
  6. I added changesets file (instructions in contribution guide

Test environment config

API_URI=https://master.staging.saleor.cloud/graphql/
APPS_MARKETPLACE_API_URI=https://apps.staging.saleor.io/api/v2/saleor-apps

Do you want to run more stable tests?

To run all tests, just select the stable checkbox. To speed up tests, increase the number of containers. Tests will be re-run only when the "run e2e" label is added.

  1. stable
  2. app
  3. attribute
  4. category
  5. collection
  6. customer
  7. giftCard
  8. homePage
  9. login
  10. menuNavigation
  11. navigation
  12. orders
  13. pages
  14. payments
  15. permissions
  16. plugins
  17. productType
  18. products
  19. sales
  20. shipping
  21. translations
  22. variants
  23. vouchers

CONTAINERS=6

@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2023

🦋 Changeset detected

Latest commit: a7de592

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 10:13 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 10:13 Destroyed
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 10:13 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 10:13 Destroyed
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 10:38 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 10:38 Destroyed
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 11:23 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 11:23 Destroyed
@poulch poulch force-pushed the 4277-send-refund-line-items branch from 43ca73d to 61fa693 Compare October 25, 2023 12:54
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 12:54 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 12:54 Destroyed
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 25, 2023 14:09 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 25, 2023 14:09 Destroyed
@poulch
Copy link
Member Author

poulch commented Oct 30, 2023

@poulch The OrderGrantRefundCreateLineInput has a reason field as well, aka you can provide a reason for each field separately, like this:

{
  "lines": [{"reason": "..." }],
  "reason": ""
}

Will we support this in the next PR, or am I missing something?

@witoszekdev Currently, the UI does not allow the user to add a reason to each line. However, we can address this issue separately since it requires UI redesign.

Droniu
Droniu previously approved these changes Oct 30, 2023
src/orders/components/OrderGrantRefundPage/reducer.ts Outdated Show resolved Hide resolved
src/orders/components/OrderGrantRefundPage/utils.ts Outdated Show resolved Hide resolved
src/orders/components/OrderGrantRefundPage/utils.ts Outdated Show resolved Hide resolved
witoszekdev
witoszekdev previously approved these changes Oct 30, 2023
@poulch poulch dismissed stale reviews from witoszekdev, Droniu, and andrzejewsky via af65064 October 30, 2023 11:21
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 30, 2023 11:21 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 30, 2023 11:21 Destroyed
@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items October 31, 2023 08:22 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items October 31, 2023 08:22 Destroyed
@wojteknowacki
Copy link
Member

Grant refund button should be disabled when refund amount point 0

@wojteknowacki
Copy link
Member

Adjust currency marks in refund amount input
Zrzut ekranu 2023-10-31 o 14 28 21

@wojteknowacki
Copy link
Member

Switching back the refund toggle should be enough to save the edited refund

Nagranie.z.ekranu.2023-10-31.o.14.48.50.mov

@wojteknowacki
Copy link
Member

Error when refunding only shipping
Zrzut ekranu 2023-10-31 o 14 56 00

@github-actions github-actions bot temporarily deployed to 4277-send-refund-line-items November 1, 2023 18:20 Destroyed
@github-actions github-actions bot temporarily deployed to storybook 4277-send-refund-line-items November 1, 2023 18:20 Destroyed
@poulch poulch merged commit 28dafdc into main Nov 2, 2023
18 of 19 checks passed
@poulch poulch deleted the 4277-send-refund-line-items branch November 2, 2023 11:43
@poulch poulch restored the 4277-send-refund-line-items branch July 1, 2024 11:26
@poulch poulch deleted the 4277-send-refund-line-items branch July 1, 2024 11:32
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.

Add order lines and shipping cost to orderGrantRefundCreate mutation
5 participants