From 1efcbc0f3b411a464ddc110f9360a5cc7e325edc Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Wed, 16 Oct 2024 14:15:56 +0200 Subject: [PATCH] fix(dashboard): Set correct method value on promotion --- .../src/hooks/table/columns/use-promotion-table-columns.tsx | 6 +++--- packages/admin/dashboard/src/i18n/translations/en.json | 1 + .../promotion-general-section/promotion-general-section.tsx | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/admin/dashboard/src/hooks/table/columns/use-promotion-table-columns.tsx b/packages/admin/dashboard/src/hooks/table/columns/use-promotion-table-columns.tsx index 2f54a4f49d4a8..964dad9a70dd9 100644 --- a/packages/admin/dashboard/src/hooks/table/columns/use-promotion-table-columns.tsx +++ b/packages/admin/dashboard/src/hooks/table/columns/use-promotion-table-columns.tsx @@ -28,11 +28,11 @@ export const usePromotionTableColumns = () => { columnHelper.display({ id: "method", - header: () => , + header: () => , cell: ({ row }) => { const text = row.original.is_automatic - ? "Automatic" - : "Promotion Code" + ? t("promotions.form.method.automatic.title") + : t("promotions.form.method.code.title") return }, diff --git a/packages/admin/dashboard/src/i18n/translations/en.json b/packages/admin/dashboard/src/i18n/translations/en.json index fc38ce5f24b3b..2b77b56901929 100644 --- a/packages/admin/dashboard/src/i18n/translations/en.json +++ b/packages/admin/dashboard/src/i18n/translations/en.json @@ -1716,6 +1716,7 @@ "value_type": "Value Type", "value": "Value", "campaign": "Campaign", + "method": "Method", "allocation": "Allocation", "addCondition": "Add condition", "clearAll": "Clear all", diff --git a/packages/admin/dashboard/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx b/packages/admin/dashboard/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx index 65b4ec51267b3..60f11e1a45eba 100644 --- a/packages/admin/dashboard/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx +++ b/packages/admin/dashboard/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx @@ -85,7 +85,7 @@ export const PromotionGeneralSection = ({ [PromotionStatus.EXPIRED]: ["red", t("statuses.expired")], }[getPromotionStatus(promotion)] as [ "grey" | "orange" | "green" | "red", - string + string, ] const displayValue = getDisplayValue(promotion) @@ -130,7 +130,9 @@ export const PromotionGeneralSection = ({ - {promotion.is_automatic ? "Promotion code" : "Automatic"} + {promotion.is_automatic + ? t("promotions.form.method.automatic.title") + : t("promotions.form.method.code.title")}