-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Search for product variants by SKU in quick search, show media #5495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
843351c
a432512
918c881
82b9fd1
faec660
dbe2cd3
a5b17e2
2960555
9e675c9
278f5c5
14aa733
3915fd5
8b3017b
bfa8f1e
9b0d673
4bc2bd1
306ba21
5c82e04
04442d8
bcf8c71
31b75eb
66a60ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| In quick search you can now search for product variants with SKU. This means product variants are a new item added to the search catalogue. Catalogue items now show their media, if available. Category item display message if they don't have parents. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| import { Box, Skeleton } from "@saleor/macaw-ui-next"; | ||||||
| import React, { useState } from "react"; | ||||||
|
|
||||||
| const defaultProps = { | ||||||
| __height: "40px", | ||||||
| __width: "40px", | ||||||
| __minWidth: "40px", | ||||||
| }; | ||||||
|
|
||||||
| export const NavigatorThumbnail = ({ | ||||||
| src, | ||||||
| alt, | ||||||
| }: { | ||||||
| src: string | undefined; | ||||||
| alt: string | undefined; | ||||||
| }) => { | ||||||
| const [loading, setLoading] = useState(true); | ||||||
| const [error, setError] = useState(false || !src); | ||||||
|
|
||||||
| if (error) { | ||||||
| return ( | ||||||
| <Box | ||||||
| {...defaultProps} | ||||||
| backgroundColor="default2" | ||||||
| borderRadius={4} | ||||||
| borderStyle="solid" | ||||||
| borderColor="default1" | ||||||
| borderWidth={1} | ||||||
| marginRight={2} | ||||||
| /> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| return ( | ||||||
| <Box | ||||||
| display="flex" | ||||||
| alignItems="center" | ||||||
| justifyContent="center" | ||||||
| __padding="2px" | ||||||
|
||||||
| __padding="2px" | |
| padding={0.5} |
poulch marked this conversation as resolved.
Show resolved
Hide resolved
poulch marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,90 @@ | ||||||
| import { SearchCatalogQuery } from "@dashboard/graphql"; | ||||||
| import { IntlShape } from "react-intl"; | ||||||
|
|
||||||
| import { searchInCatalog } from "./catalog"; | ||||||
|
|
||||||
| describe("searchInCatalog", () => { | ||||||
|
||||||
| describe("searchInCatalog", () => { | |
| describe("NavigatorSearch / modes / searchInCatalog", () => { |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: use intlMock
Uh oh!
There was an error while loading. Please reload this page.