Skip to content

Commit fb4a498

Browse files
fix(dashboard): add tooltip for full product/variant name in pricing data grids (#15962)
* fix(dashboard): widen title column and add tooltip in pricing data grids * address review: revert width change, use @medusajs/ui Tooltip
1 parent 44353e8 commit fb4a498

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

.changeset/pricing-grid-tooltip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@medusajs/dashboard": patch
3+
---
4+
5+
fix(dashboard): show full product/variant name via tooltip in the price list and variant pricing grids

packages/admin/dashboard/src/routes/price-lists/common/hooks/use-price-list-grid-columns.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { HttpTypes } from "@medusajs/types"
2+
import { Tooltip } from "@medusajs/ui"
23
import { ColumnDef } from "@tanstack/react-table"
34
import { useMemo } from "react"
45
import { useTranslation } from "react-i18next"
@@ -43,7 +44,9 @@ export const usePriceListGridColumns = ({
4344
<DataGrid.ReadonlyCell context={context}>
4445
<div className="flex h-full w-full items-center gap-x-2 overflow-hidden">
4546
<Thumbnail src={entity.thumbnail} size="small" />
46-
<span className="truncate">{entity.title}</span>
47+
<Tooltip content={entity.title}>
48+
<span className="truncate">{entity.title}</span>
49+
</Tooltip>
4750
</div>
4851
</DataGrid.ReadonlyCell>
4952
)
@@ -52,7 +55,9 @@ export const usePriceListGridColumns = ({
5255
return (
5356
<DataGrid.ReadonlyCell context={context} color="normal">
5457
<div className="flex h-full w-full items-center gap-x-2 overflow-hidden">
55-
<span className="truncate">{entity.title}</span>
58+
<Tooltip content={entity.title}>
59+
<span className="truncate">{entity.title}</span>
60+
</Tooltip>
5661
</div>
5762
</DataGrid.ReadonlyCell>
5863
)

packages/admin/dashboard/src/routes/products/common/variant-pricing-form.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { HttpTypes } from "@medusajs/types"
2+
import { Tooltip } from "@medusajs/ui"
23
import { useMemo } from "react"
34
import { UseFormReturn, useWatch } from "react-hook-form"
45
import { useTranslation } from "react-i18next"
@@ -72,7 +73,9 @@ const useVariantPriceGridColumns = ({
7273
return (
7374
<DataGrid.ReadonlyCell context={context}>
7475
<div className="flex h-full w-full items-center gap-x-2 overflow-hidden">
75-
<span className="truncate">{entity.title}</span>
76+
<Tooltip content={entity.title}>
77+
<span className="truncate">{entity.title}</span>
78+
</Tooltip>
7679
</div>
7780
</DataGrid.ReadonlyCell>
7881
)

0 commit comments

Comments
 (0)