-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add "Overcharged" status to orders #5505
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
11f12b8
remove deprecated 'token' from orders
Cloud11PL ba18dfe
order details overcharge warning
Cloud11PL 5138a51
show overcharged status in order list
Cloud11PL 855450a
show overcharged status in customer order list
Cloud11PL fe364f4
i18n
Cloud11PL aa4d01a
changeset
Cloud11PL d430c42
update fixutes
Cloud11PL 6ee7260
tests & improvements
Cloud11PL 7b1e114
Merge branch 'main' into BCK-1407-overcharged-status
Cloud11PL c0e3d5c
add cr fixes
Cloud11PL c8df27b
Merge branch 'main' into BCK-1407-overcharged-status
Cloud11PL d77d87e
i18n
Cloud11PL d6c9284
Merge branch 'main' into BCK-1407-overcharged-status
poulch c3e47f7
Update .changeset/little-pandas-travel.md
Cloud11PL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| The order list and details view now support the overcharged status. This means that you can now see pill with overcharged label when order has charge status overcharged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,18 @@ | ||
| import { PillCell } from "@dashboard/components/Datagrid/customCells/PillCell"; | ||
| import { GetCellContentOpts } from "@dashboard/components/Datagrid/Datagrid"; | ||
| import { AvailableColumn } from "@dashboard/components/Datagrid/types"; | ||
| import { OrderListQuery, OrderStatus, PaymentChargeStatusEnum } from "@dashboard/graphql"; | ||
| import { | ||
| OrderChargeStatusEnum, | ||
| OrderListQuery, | ||
| OrderStatus, | ||
| PaymentChargeStatusEnum, | ||
| } from "@dashboard/graphql"; | ||
| import { RelayToFlat } from "@dashboard/types"; | ||
| import { TextCell } from "@glideapps/glide-data-grid"; | ||
| import { intlMock } from "@test/intl"; | ||
| import { renderHook } from "@testing-library/react-hooks"; | ||
|
|
||
| import { getCustomerCellContent, useGetCellContent } from "./datagrid"; | ||
| import { getCustomerCellContent, getPaymentCellContent, useGetCellContent } from "./datagrid"; | ||
|
|
||
| jest.mock("react-intl", () => ({ | ||
| useIntl: jest.fn(() => ({ | ||
|
|
@@ -205,3 +212,33 @@ describe("useGetCellContent", () => { | |
| expect((getCellContent([0, 1], contentOpts) as TextCell).data).toBe(""); | ||
| }); | ||
| }); | ||
|
|
||
| type RowDataType = RelayToFlat<NonNullable<OrderListQuery["orders"]>>[number]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I meant to keep this in one place |
||
|
|
||
| describe("getPaymentCellContent", () => { | ||
| it("should return Fully Paid when payment status is PAID", () => { | ||
| // Arrange | ||
| const data = { | ||
| paymentStatus: "PAID" as PaymentChargeStatusEnum, | ||
| } as RowDataType; | ||
|
|
||
| // Act | ||
| const result = getPaymentCellContent(intlMock, "defaultLight", data); | ||
|
|
||
| // Assert | ||
| expect((result.data as PillCell["data"]).value).toEqual("PAID"); | ||
| }); | ||
|
|
||
| it("should return Overcharged when charge status is OVERCHARGED", () => { | ||
| // Arrange | ||
| const data = { | ||
| chargeStatus: "OVERCHARGED" as OrderChargeStatusEnum, | ||
| } as RowDataType; | ||
|
|
||
| // Act | ||
| const result = getPaymentCellContent(intlMock, "defaultLight", data); | ||
|
|
||
| // Assert | ||
| expect((result.data as PillCell["data"]).value).toEqual("Overcharged"); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.