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

Migrate Transaction Refund Datagrid to GridTable #4855

Merged

Conversation

Droniu
Copy link
Member

@Droniu Droniu commented May 9, 2024

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes MERX-360

Usage Instructions, Screenshots, Recordings

image

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

Enable this feature with:

localStorage.setItem('FF_improved_refunds', '{"enabled":true,"payload":"default"}')

Go to order with at least one transaction, and create a new refund

Copy link

changeset-bot bot commented May 9, 2024

🦋 Changeset detected

Latest commit: 880a9b5

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 pr-4855 May 9, 2024 18:54 Destroyed
@Droniu Droniu changed the title Migrate Transaction Refund Datagrid to GridTable (WIP) Migrate Transaction Refund Datagrid to GridTable May 9, 2024
@github-actions github-actions bot temporarily deployed to pr-4855 May 13, 2024 22:24 Destroyed
@Droniu Droniu changed the title (WIP) Migrate Transaction Refund Datagrid to GridTable Migrate Transaction Refund Datagrid to GridTable May 14, 2024
@github-actions github-actions bot temporarily deployed to pr-4855 May 14, 2024 08:05 Destroyed
@Droniu Droniu marked this pull request as ready for review May 14, 2024 08:07
@Droniu Droniu requested a review from a team as a code owner May 14, 2024 08:07
@Droniu Droniu requested review from andrzejewsky, poulch and a team May 14, 2024 08:07
Cloud11PL
Cloud11PL previously approved these changes May 15, 2024
Copy link
Member

@Cloud11PL Cloud11PL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, overall LGTM 👌

Comment on lines 86 to 96
const toAdd = linesToRefund.reduce<OrderGrantRefundUpdateLineAddInput[]>((acc, line, ix) => {
if (typeof line.quantity === "number" && line.quantity > 0) {
acc.push({
id: data.order!.lines[ix].id,
quantity: line.quantity,
reason: line.reason,
});
}

return acc;
}, []) ?? [];
return acc;
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: It seems like we can just filter and/or map on linesToRefund here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cloud11PL I needed to change back to reduce here because using filter & map changes the indices I rely upon to get proper line IDs

@Droniu Droniu dismissed stale reviews from andrzejewsky and Cloud11PL via e68c0cb May 16, 2024 13:44
@github-actions github-actions bot temporarily deployed to pr-4855 May 16, 2024 13:46 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4855 May 16, 2024 14:12 Destroyed
@andrzejewsky andrzejewsky self-requested a review May 16, 2024 14:30
@Droniu Droniu dismissed stale reviews from Cloud11PL and andrzejewsky via fb9a1f7 May 16, 2024 19:51
@github-actions github-actions bot temporarily deployed to pr-4855 May 16, 2024 19:53 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4855 May 17, 2024 10:13 Destroyed
Cloud11PL
Cloud11PL previously approved these changes May 17, 2024
@github-actions github-actions bot temporarily deployed to pr-4855 May 17, 2024 12:52 Destroyed
@andrzejewsky andrzejewsky self-requested a review May 17, 2024 12:53
@Droniu Droniu merged commit 6a2c4a0 into main May 20, 2024
13 of 15 checks passed
@Droniu Droniu deleted the merx-360-migrate-transaction-refund-datagrid-to-dashboardtable branch May 20, 2024 07:34
Copy link

cypress bot commented May 21, 2024

5 failed and 4 flaky tests on run #6198 ↗︎

5 209 6 0 Flakiness 4

Details:

Triggered via release - CORE 3.19.42-6dcdc0c,
Project: Saleor Commit: 2c2cabfe37
Status: Failed Duration: 11:28 💡
Started: May 21, 2024 10:38 AM Ended: May 21, 2024 10:49 AM
Failed  discounts/sales/createSalesForProducts.js • 2 failed tests • UI - Electron

View Output

Test Artifacts
As an admin I want to create sale for products > should be able to create fixed price discount. TC: SALEOR_1802 Screenshots
As an admin I want to create sale for products > should not be able to see product discount not assign to channel. TC: SALEOR_1803 Screenshots
Failed  discounts/sales/createSalesForVariants.js • 1 failed test • UI - Electron

View Output

Test Artifacts
Sales discounts for variant > should be able to create fixed price discount. TC: SALEOR_1808 Screenshots
Failed  products/productsList/columnPicker.js • 1 failed test • UI - Electron

View Output

Test Artifacts
As an admin I should be able to use column picker > should be able to remove dynamic column from picker on products list. TC: SALEOR_2611 Screenshots
Failed  products/productsList/deleteProducts.js • 1 failed test • UI - Electron

View Output

Test Artifacts
Test for deleting products > should delete 2 first products on products grid view - SALEOR_2715 Screenshots
Flakiness  discounts/sales/createSalesForProducts.js • 1 flaky test • UI - Electron

View Output

Test Artifacts
As an admin I want to create sale for products > should be able to create percentage discount. TC: SALEOR_1801 Screenshots
Flakiness  products/productsVariants.js • 1 flaky test • UI - Electron

View Output

Test Artifacts
As an admin I should be able to create variant > should be able to create variant visible for the customers in all channels. TC: SALEOR_2901 Screenshots
Flakiness  apps.js • 1 flaky test • UI - Electron

View Output

Test Artifacts
As a staff user I want to manage apps > should be able to create webhook. TC: SALEOR_3002 Screenshots
Flakiness  products/productsList/filteringProducts.js • 1 flaky test • UI - Electron

View Output

Test Artifacts
As an admin I should be able to filter products > should filter products by Category. TC: SALEOR_2601 Screenshots

Review all test suite changes for PR #4855 ↗︎

karola312 pushed a commit that referenced this pull request May 23, 2024
* (wip) Migrate Transaction Refund Datagrid to GridTable

* Add changeset

* UI improvements & reason per line modal

* Fix strict mode

* Refactor

* CR Refactor

* Improve modal UI

* Strict mode fix

* Fix navigation

* CR improvements

* Fix qtyToRefund == maxQtyToRefund

* Split components & handle ellipsis better

* Fix incorrect handling of refund lines

* Fix refs type errors
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.

None yet

4 participants