From 685779ec7d3684841ce2757702efb2731697bc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frane=20Poli=C4=87?= <16856471+fPolic@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:54:44 +0200 Subject: [PATCH] feat(dashboard): Cancel claims and exchanges (#8958) **What** - add "Cancel" functionality for claims and exchanges timeline events --- .../dashboard/src/i18n/translations/en.json | 13 ++- .../claim-create-form/claim-create-form.tsx | 2 +- .../exchange-create-form.tsx | 2 +- .../active-order-claim-section.tsx | 2 +- .../active-order-exchange-section.tsx | 2 +- .../order-activity-section/order-timeline.tsx | 100 ++++++++++++++++-- 6 files changed, 103 insertions(+), 18 deletions(-) diff --git a/packages/admin-next/dashboard/src/i18n/translations/en.json b/packages/admin-next/dashboard/src/i18n/translations/en.json index dd3c06df12..968a8c426f 100644 --- a/packages/admin-next/dashboard/src/i18n/translations/en.json +++ b/packages/admin-next/dashboard/src/i18n/translations/en.json @@ -969,7 +969,6 @@ "create": "Create Claim", "confirm": "Confirm Claim", "confirmText": "You are about to confirm a Claim. This action cannot be undone.", - "cancel": "Cancel Claim", "manage": "Manage Claim", "outbound": "Outbound", "outboundItemAdded": "{{itemsCount}}x added through claim", @@ -983,6 +982,10 @@ "successToast": "Claim was successfully canceled." } }, + "cancel": { + "title": "Cancel Claim", + "description": "Are you sure you want to cancel the claim?" + }, "tooltips": { "onlyReturnShippingOptions": "This list will consist of only return shipping options." }, @@ -1000,7 +1003,6 @@ "manage": "Manage Exchange", "confirm": "Confirm Exchange", "confirmText": "You are about to confirm an Exchange. This action cannot be undone.", - "cancel": "Cancel Exchange", "outbound": "Outbound", "outboundItemAdded": "{{itemsCount}}x added through exchange", "outboundTotal": "Outbound total", @@ -1013,6 +1015,10 @@ "successToast": "Exchange was successfully canceled." } }, + "cancel": { + "title": "Cancel Exchange", + "description": "Are you sure you want to cancel the exchange?" + }, "tooltips": { "onlyReturnShippingOptions": "This list will consist of only return shipping options." }, @@ -1160,16 +1166,17 @@ }, "claim": { "created": "Claim #{{claimId}} requested", + "canceled": "Claim #{{claimId}} canceled", "itemsInbound": "{{count}} item to return", "itemsOutbound": "{{count}} item to send" }, "exchange": { "created": "Exchange #{{exchangeId}} requested", + "canceled": "Exchange #{{exchangeId}} canceled", "itemsInbound": "{{count}} item to return", "itemsOutbound": "{{count}} item to send" }, "edit": { - "requested": "Order edit #{{editId}} requested", "requested": "Order edit #{{editId}} requested", "confirmed": "Order edit #{{editId}} confirmed" } diff --git a/packages/admin-next/dashboard/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx b/packages/admin-next/dashboard/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx index 7ecaed3416..9e39ca656d 100644 --- a/packages/admin-next/dashboard/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx +++ b/packages/admin-next/dashboard/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx @@ -1003,7 +1003,7 @@ export const ClaimCreateForm = ({ variant="secondary" size="small" > - {t("orders.claims.cancel")} + {t("orders.claims.cancel.title")} diff --git a/packages/admin-next/dashboard/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx b/packages/admin-next/dashboard/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx index d48a519afc..ba2f35da1d 100644 --- a/packages/admin-next/dashboard/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx +++ b/packages/admin-next/dashboard/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx @@ -65,7 +65,7 @@ export const ActiveOrderClaimSection = ({