Skip to content

Commit

Permalink
Fix collection product url (#5385)
Browse files Browse the repository at this point in the history
* Fix collection product url

* Fix collection product url

* Fix collection product url
  • Loading branch information
andrzejewsky authored and poulch committed Feb 3, 2025
1 parent 8b93496 commit a4041bb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-bulldogs-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Now product links on the collection points to the correct url.
53 changes: 25 additions & 28 deletions src/collections/components/CollectionProducts/ProductTableItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ChannelsAvailabilityDropdown } from "@dashboard/components/ChannelsAvailabilityDropdown";
import { GridTable } from "@dashboard/components/GridTable";
import Link from "@dashboard/components/Link";
import Drag from "@dashboard/icons/Drag";
import { productUrl } from "@dashboard/products/urls";
import { useSortable } from "@dnd-kit/sortable";
Expand Down Expand Up @@ -70,38 +71,34 @@ export const ProductTableItem = ({
</Box>
</GridTable.Cell>
<GridTable.Cell __height="inherit" padding={0}>
<Box
as="a"
href={href}
padding={2}
display="flex"
alignItems="center"
gap={2}
height="100%"
>
{product?.thumbnail ? (
<Box borderColor="default1" borderWidth={1} borderRadius={2} borderStyle="solid">
<Box
as="img"
src={product?.thumbnail?.url}
alt={product?.name}
__width="31px"
__height="31px"
/>
</Box>
) : (
<EmptyImage />
)}
<Text>{product?.name}</Text>
</Box>
<Link href={href}>
<Box padding={2} display="flex" alignItems="center" gap={2} height="100%">
{product?.thumbnail ? (
<Box borderColor="default1" borderWidth={1} borderRadius={2} borderStyle="solid">
<Box
as="img"
src={product?.thumbnail?.url}
alt={product?.name}
__width="31px"
__height="31px"
/>
</Box>
) : (
<EmptyImage />
)}
<Text>{product?.name}</Text>
</Box>
</Link>
</GridTable.Cell>
<GridTable.Cell __height="inherit" padding={0}>
<Box as="a" href={href} padding={2} display="flex" alignItems="center" height="100%">
<Text>{product?.productType.name || <Skeleton />}</Text>
</Box>
<Link href={href}>
<Box padding={2} display="flex" alignItems="center" height="100%">
<Text>{product?.productType.name || <Skeleton />}</Text>
</Box>
</Link>
</GridTable.Cell>
<GridTable.Cell __height="inherit" padding={0}>
<Box as="a" display="block" height="100%" padding={2}>
<Box display="block" height="100%" padding={2}>
{product && !product?.channelListings?.length ? (
"-"
) : product?.channelListings !== undefined ? (
Expand Down

0 comments on commit a4041bb

Please sign in to comment.