From b8ab053252f7c8f854b4b549b74c2cf0521bd8d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Frane=20Poli=C4=87?=
<16856471+fPolic@users.noreply.github.com>
Date: Mon, 19 May 2025 15:49:34 +0200
Subject: [PATCH] fix(dashboard): refund payment formatting (#12476)
* fix(dashboard): refund payment formatting
* fix: reduce SC pagination limit
---
.changeset/kind-countries-beg.md | 5 +++++
.../components/create-refund-form/create-refund-form.tsx | 6 ++++--
.../product-create-sales-channel-drawer.tsx | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
create mode 100644 .changeset/kind-countries-beg.md
diff --git a/.changeset/kind-countries-beg.md b/.changeset/kind-countries-beg.md
new file mode 100644
index 0000000000..e49b0e437b
--- /dev/null
+++ b/.changeset/kind-countries-beg.md
@@ -0,0 +1,5 @@
+---
+"@medusajs/dashboard": patch
+---
+
+fix(dashboard): refund payment formatting
diff --git a/packages/admin/dashboard/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx b/packages/admin/dashboard/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx
index 60befe28c4..9be6904b20 100644
--- a/packages/admin/dashboard/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx
+++ b/packages/admin/dashboard/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx
@@ -22,6 +22,7 @@ import { formatCurrency } from "../../../../../lib/format-currency"
import { getLocaleAmount } from "../../../../../lib/money-amount-helpers"
import { getPaymentsFromOrder } from "../../../order-detail/components/order-payment-section"
import { formatValue } from "react-currency-input-field"
+import { formatProvider } from "../../../../../lib/format-provider"
type CreateRefundFormProps = {
order: HttpTypes.AdminOrder
@@ -140,6 +141,7 @@ export const CreateRefundForm = ({
disabled={
!!payment.canceled_at || totalRefunded >= payment.amount
}
+ className="flex items-center justify-center"
>
{getLocaleAmount(
@@ -148,8 +150,8 @@ export const CreateRefundForm = ({
)}
{" - "}
- {payment.provider_id}
- - ({payment.id.replace("pay_", "")})
+ {formatProvider(payment.provider_id)}
+ - (#{payment.id.substring(23)})
)
})}
diff --git a/packages/admin/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx b/packages/admin/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
index 77d4596d0e..c8090aa8e5 100644
--- a/packages/admin/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
+++ b/packages/admin/dashboard/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
@@ -23,7 +23,7 @@ type ProductCreateSalesChannelStackedModalProps = {
form: UseFormReturn
}
-const PAGE_SIZE = 50
+const PAGE_SIZE = 20
export const ProductCreateSalesChannelStackedModal = ({
form,