diff --git a/.changeset/giant-lamps-wash.md b/.changeset/giant-lamps-wash.md new file mode 100644 index 00000000000..7afdca69fc8 --- /dev/null +++ b/.changeset/giant-lamps-wash.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Add prices in grant refund view diff --git a/introspection.json b/introspection.json index 832687c9be0..ff1317d63a2 100644 --- a/introspection.json +++ b/introspection.json @@ -95679,6 +95679,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "STOCK_ALREADY_EXISTS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "UNIQUE", "description": null, diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 923f26556b1..4d7c1a96bcb 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -3225,6 +3225,10 @@ "KRqgfo": { "string": "User is out of your permissions scope" }, + "KWXwFo": { + "context": "grant refund table, column header", + "string": "Unit price" + }, "KXkdMH": { "context": "order discount removed title", "string": "Order discount was removed by" diff --git a/schema.graphql b/schema.graphql index 1cbdbf620c9..1a55f04a6e9 100644 --- a/schema.graphql +++ b/schema.graphql @@ -24013,6 +24013,7 @@ enum ProductVariantBulkErrorCode { NOT_PRODUCTS_VARIANT PRODUCT_NOT_ASSIGNED_TO_CHANNEL REQUIRED + STOCK_ALREADY_EXISTS UNIQUE } diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index fd6ec6abee7..ddbbd0d5e93 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -5604,6 +5604,7 @@ export enum ProductVariantBulkErrorCode { NOT_PRODUCTS_VARIANT = 'NOT_PRODUCTS_VARIANT', PRODUCT_NOT_ASSIGNED_TO_CHANNEL = 'PRODUCT_NOT_ASSIGNED_TO_CHANNEL', REQUIRED = 'REQUIRED', + STOCK_ALREADY_EXISTS = 'STOCK_ALREADY_EXISTS', UNIQUE = 'UNIQUE' } diff --git a/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx b/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx index 59677499e9c..49fead0500b 100644 --- a/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx +++ b/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx @@ -1,4 +1,4 @@ -// @ts-strict-ignore +import Money from "@dashboard/components/Money"; import TableCellAvatar from "@dashboard/components/TableCellAvatar"; import TableRowLink from "@dashboard/components/TableRowLink"; import { OrderLineGrantRefundFragment } from "@dashboard/graphql"; @@ -75,6 +75,9 @@ export const ProductsCard: React.FC = ({ + + + @@ -86,19 +89,25 @@ export const ProductsCard: React.FC = ({ {renderCollection( lines, line => { + if (!line) { + return null; + } const stateLine = state.lines.get(line.id); return ( - +
- {line?.productName} + {line.productName} {line.variantName}
+ + + {line.quantity} @@ -109,11 +118,11 @@ export const ProductsCard: React.FC = ({ type="number" max={stateLine?.availableQuantity} min={0} - data-test-id={"quantityInput" + line?.id} + data-test-id={"quantityInput" + line.id} value={stateLine?.selectedQuantity ?? 0} onChange={getHandleAmountChange(line)} endAdornment={ - line?.quantity && ( + line.quantity && (