Skip to content

Commit

Permalink
fix(dashboard): Set correct method value on promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
riqwan committed Oct 16, 2024
1 parent ea5bff9 commit 1efcbc0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export const usePromotionTableColumns = () => {

columnHelper.display({
id: "method",
header: () => <TextHeader text={t("promotions.fields.campaign")} />,
header: () => <TextHeader text={t("promotions.fields.method")} />,
cell: ({ row }) => {
const text = row.original.is_automatic
? "Automatic"
: "Promotion Code"
? t("promotions.form.method.automatic.title")
: t("promotions.form.method.code.title")

return <TextCell text={text} />
},
Expand Down
1 change: 1 addition & 0 deletions packages/admin/dashboard/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@
"value_type": "Value Type",
"value": "Value",
"campaign": "Campaign",
"method": "Method",
"allocation": "Allocation",
"addCondition": "Add condition",
"clearAll": "Clear all",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -130,7 +130,9 @@ export const PromotionGeneralSection = ({
</Text>

<Text size="small" leading="compact" className="text-pretty">
{promotion.is_automatic ? "Promotion code" : "Automatic"}
{promotion.is_automatic
? t("promotions.form.method.automatic.title")
: t("promotions.form.method.code.title")}
</Text>
</div>

Expand Down

0 comments on commit 1efcbc0

Please sign in to comment.