fix(dashboard): Remove wrongful import of utils function (#11338)

Resolves SUP-819
This commit is contained in:
Kasper Fabricius Kristensen authored and GitHub committed 2025-02-06 17:14:50 +00:00
1 parent 34e7fdafd2
commit 211997b137
3 files changed
+10 -6

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---
fix(dashboard): Remove wrongful import of utils function
@@ -3,12 +3,12 @@ import { TFunction } from "i18next"
export const getCanceledOrderStatus = ( export const getCanceledOrderStatus = (
t: TFunction<"translation">, t: TFunction<"translation">,
status: string status: string
) => { ): { label: string; color: "red" } | null => {
if (status === "canceled") { if (status === "canceled") {
return { label: t("orders.status.canceled"), color: "red" } return { label: t("orders.status.canceled"), color: "red" }
} }
return return null
} }
export const getOrderPaymentStatus = ( export const getOrderPaymentStatus = (
@@ -35,7 +35,7 @@ export const getOrderPaymentStatus = (
], ],
canceled: [t("orders.payment.status.canceled"), "red"], canceled: [t("orders.payment.status.canceled"), "red"],
requires_action: [t("orders.payment.status.requiresAction"), "orange"], requires_action: [t("orders.payment.status.requiresAction"), "orange"],
}[status] }[status] as [string, "red" | "orange" | "green"]
return { label, color } return { label, color }
} }
@@ -10,7 +10,6 @@ import {
usePrompt, usePrompt,
} from "@medusajs/ui" } from "@medusajs/ui"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import { isPresent } from "../../../../../../../../core/utils/src/common/is-present"
import { ActionMenu } from "../../../../../components/common/action-menu" import { ActionMenu } from "../../../../../components/common/action-menu"
import { useCancelOrder } from "../../../../../hooks/api/orders" import { useCancelOrder } from "../../../../../hooks/api/orders"
import { useDate } from "../../../../../hooks/use-date" import { useDate } from "../../../../../hooks/use-date"
@@ -125,8 +124,8 @@ const OrderBadge = ({ order }: { order: HttpTypes.AdminOrder }) => {
const { t } = useTranslation() const { t } = useTranslation()
const orderStatus = getCanceledOrderStatus(t, order.status) const orderStatus = getCanceledOrderStatus(t, order.status)
if (!isPresent(orderStatus)) { if (!orderStatus) {
return return null
} }
return ( return (