From da536aba244e46a81b2237f782be71c8d2d54802 Mon Sep 17 00:00:00 2001
From: Kasper Fabricius Kristensen
<45367945+kasperkristensen@users.noreply.github.com>
Date: Tue, 26 Nov 2024 13:00:25 +0100
Subject: [PATCH] fix(dashboard): Truncate long product organization tags
(#10261)
Resolves CMRC-736
---
.changeset/fresh-birds-grow.md | 5 ++
.../product-tag-product-section.tsx | 2 +-
.../product-organization-section.tsx | 46 ++++++++++++-------
3 files changed, 35 insertions(+), 18 deletions(-)
create mode 100644 .changeset/fresh-birds-grow.md
diff --git a/.changeset/fresh-birds-grow.md b/.changeset/fresh-birds-grow.md
new file mode 100644
index 0000000000000..f490875b339d9
--- /dev/null
+++ b/.changeset/fresh-birds-grow.md
@@ -0,0 +1,5 @@
+---
+"@medusajs/dashboard": patch
+---
+
+fix(dashboard): Truncate long product organization tags
diff --git a/packages/admin/dashboard/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx b/packages/admin/dashboard/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx
index dfb8e5fa4193a..170623a2bb8a0 100644
--- a/packages/admin/dashboard/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx
+++ b/packages/admin/dashboard/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx
@@ -59,7 +59,7 @@ export const ProductTagProductSection = ({
columns={columns}
pageSize={PAGE_SIZE}
count={count}
- navigateTo={(row) => row.original.id}
+ navigateTo={(row) => `/products/${row.original.id}`}
search
pagination
orderBy={[
diff --git a/packages/admin/dashboard/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx b/packages/admin/dashboard/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx
index 8387a66dbea85..c8f722513de60 100644
--- a/packages/admin/dashboard/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx
+++ b/packages/admin/dashboard/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx
@@ -1,6 +1,6 @@
import { PencilSquare } from "@medusajs/icons"
import { HttpTypes } from "@medusajs/types"
-import { Badge, Container, Heading } from "@medusajs/ui"
+import { Badge, Container, Heading, Tooltip } from "@medusajs/ui"
import { useTranslation } from "react-i18next"
import { Link } from "react-router-dom"
import { ActionMenu } from "../../../../../components/common/action-menu"
@@ -41,9 +41,11 @@ export const ProductOrganizationSection = ({
value={
product.tags?.length
? product.tags.map((tag) => (
-
- {tag.value}
-
+
))
: undefined
}
@@ -52,11 +54,10 @@ export const ProductOrganizationSection = ({
title={t("fields.type")}
value={
product.type ? (
-
-
- {product.type.value}
-
-
+
) : undefined
}
/>
@@ -65,11 +66,10 @@ export const ProductOrganizationSection = ({
title={t("fields.collection")}
value={
product.collection ? (
-
-
- {product.collection.title}
-
-
+
) : undefined
}
/>
@@ -79,9 +79,11 @@ export const ProductOrganizationSection = ({
value={
product.categories?.length
? product.categories.map((pcat) => (
-
- {pcat.name}
-
+
))
: undefined
}
@@ -93,3 +95,13 @@ export const ProductOrganizationSection = ({
)
}
+
+const OrganizationTag = ({ label, to }: { label: string; to: string }) => {
+ return (
+
+
+ {label}
+
+
+ )
+}