-
-
-
-
-
-
- {variant.title}
-
-
- {variant.options.map((o) => o.value).join(" ⋅ ")}
-
+ {variants.map((variant) => {
+ const link = variant.product
+ ? `/products/${variant.product.id}/variants/${variant.id}`
+ : null
+
+ const Inner = (
+
+
+
+
+
+
+
+ {variant.title}
+
+
+ {variant.options.map((o) => o.value).join(" ⋅ ")}
+
+
+
+
+
-
- navigate(
- `/products/${variant.product.id}/variants/${variant.id}`
- )
- }
- >
-
-
-
- ))}
+ )
+
+ if (!link) {
+ return
{Inner}
+ }
+
+ return (
+
+ {Inner}
+
+ )
+ })}
)
diff --git a/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx b/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx
index 997c2806cbea2..4e9ffd4125f51 100644
--- a/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx
+++ b/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx
@@ -1,10 +1,11 @@
import { HttpTypes } from "@medusajs/types"
-import { PlaceholderCell } from "../../../../../components/table/table-cells/common/placeholder-cell"
-import { ReservationActions } from "./reservation-actions"
import { createColumnHelper } from "@tanstack/react-table"
import { useMemo } from "react"
import { useTranslation } from "react-i18next"
import { CreatedAtCell } from "../../../../../components/table/table-cells/common/created-at-cell"
+import { PlaceholderCell } from "../../../../../components/table/table-cells/common/placeholder-cell"
+import { TextCell, TextHeader } from "../../../../../components/table/table-cells/common/text-cell"
+import { ReservationActions } from "./reservation-actions"
/**
* Adds missing properties to the InventoryItemDTO type.
@@ -22,17 +23,16 @@ export const useReservationTableColumn = ({ sku }: { sku: string }) => {
return useMemo(
() => [
columnHelper.display({
- header: t("fields.sku"),
+ id: "sku",
+ header: () =>
,
cell: () => {
return (
-
- {sku}
-
+
)
},
}),
columnHelper.accessor("line_item.order_id", {
- header: t("inventory.reservation.orderID"),
+ header: () =>
,
cell: ({ getValue }) => {
const orderId = getValue()
@@ -41,14 +41,12 @@ export const useReservationTableColumn = ({ sku }: { sku: string }) => {
}
return (
-
- {orderId}
-
+
)
},
}),
columnHelper.accessor("description", {
- header: t("fields.description"),
+ header: () =>
,
cell: ({ getValue }) => {
const description = getValue()
@@ -57,14 +55,12 @@ export const useReservationTableColumn = ({ sku }: { sku: string }) => {
}
return (
-
- {description}
-
+
)
},
}),
columnHelper.accessor("location.name", {
- header: t("inventory.reservation.location"),
+ header: () =>
,
cell: ({ getValue }) => {
const location = getValue()
@@ -73,16 +69,20 @@ export const useReservationTableColumn = ({ sku }: { sku: string }) => {
}
return (
-
- {location}
-
+
)
},
}),
columnHelper.accessor("created_at", {
- header: t("fields.createdAt"),
+ header: () =>
,
cell: ({ getValue }) =>
,
}),
+ columnHelper.accessor("quantity", {
+ header: () =>
,
+ cell: ({ getValue }) => {
+ return
+ },
+ }),
columnHelper.display({
id: "actions",
cell: ({ row }) =>
,
diff --git a/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/inventory-detail.tsx b/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/inventory-detail.tsx
index 8929e48aaa489..f5d5ea406d1af 100644
--- a/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/inventory-detail.tsx
+++ b/packages/admin-next/dashboard/src/routes/inventory/inventory-detail/inventory-detail.tsx
@@ -1,14 +1,20 @@
-import { Outlet, json, useLoaderData, useParams } from "react-router-dom"
+import { useLoaderData, useParams } from "react-router-dom"
+import { TwoColumnPageSkeleton } from "../../../components/common/skeleton"
+import { TwoColumnPage } from "../../../components/layout/pages"
+import { useInventoryItem } from "../../../hooks/api/inventory"
import { InventoryItemAttributeSection } from "./components/inventory-item-attributes/attributes-section"
import { InventoryItemGeneralSection } from "./components/inventory-item-general-section"
import { InventoryItemLocationLevelsSection } from "./components/inventory-item-location-levels"
import { InventoryItemReservationsSection } from "./components/inventory-item-reservations"
-import { JsonViewSection } from "../../../components/common/json-view-section"
-import { useInventoryItem } from "../../../hooks/api/inventory"
import { InventoryItemVariantsSection } from "./components/inventory-item-variants/variants-section"
import { inventoryItemLoader } from "./loader"
+import after from "virtual:medusa/widgets/inventory_item/details/after"
+import before from "virtual:medusa/widgets/inventory_item/details/before"
+import sideAfter from "virtual:medusa/widgets/inventory_item/details/side/after"
+import sideBefore from "virtual:medusa/widgets/inventory_item/details/side/before"
+
export const InventoryDetail = () => {
const { id } = useParams()
@@ -31,37 +37,45 @@ export const InventoryDetail = () => {
}
)
- if (isLoading) {
- return
Loading...
+ if (isLoading || !inventory_item) {
+ return (
+
+ )
}
- if (isError || !inventory_item) {
- if (error) {
- throw error
- }
- throw json("An unknown error occurred", 500)
+ if (isError) {
+ throw error
}
return (
-
+
+
+
+
+
+
+
+
+
+
+
)
}