Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Define filters

dominik-zeglenc1035f3aaeff
diff --git a/saleor/static/dashboard-next/components/Filter/Filter.tsx b/saleor/static/dashboard-next/components/Filter/Filter.tsx
index 8de4462d17..794ab477e4 100644
--- a/saleor/static/dashboard-next/components/Filter/Filter.tsx
+++ b/saleor/static/dashboard-next/components/Filter/Filter.tsx
@@ -1,20 +1,146 @@
+import ButtonBase from "@material-ui/core/ButtonBase";
+import Grow from "@material-ui/core/Grow";
+import Paper from "@material-ui/core/Paper";
+import Popper from "@material-ui/core/Popper";
import {
createStyles,
Theme,
withStyles,
WithStyles
} from "@material-ui/core/styles";
+import { fade } from "@material-ui/core/styles/colorManipulator";
+import Typography from "@material-ui/core/Typography";
+import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
+import * as classNames from "classnames";
import * as React from "react";
+import { FilterContent } from ".";
+import i18n from "../../i18n";
+import { IFilter } from "./types";
+
export interface FilterProps {
-
+ currencySymbol: string;
+ menu: IFilter;
+ filterLabel: string;
}
-const styles = (theme: Theme) => createStyles({
-
-});
+const styles = (theme: Theme) =>
+ createStyles({
+ addFilterButton: {
+ "&$filterButton": {
+ "&:hover, &:focus": {
+ backgroundColor: fade(theme.palette.primary.main, 0.1)
+ },
+ backgroundColor: "#ffffff",
+ border: `1px solid ${theme.palette.primary.main}`,
+ cursor: "pointer",
+ marginBottom: 0,
+ marginRight: theme.spacing.unit * 2,
+ marginTop: 0,
+ transition: theme.transitions.duration.short + "ms"
+ }
+ },
+ addFilterButtonActive: {
+ "&$addFilterButton": {
+ backgroundColor: fade(theme.palette.primary.main, 0.1)
+ }
+ },
+ addFilterIcon: {
+ transition: theme.transitions.duration.short + "ms"
+ },
+ addFilterText: {
+ color: theme.palette.primary.main,
+ fontSize: 14,
+ fontWeight: 600 as 600,
+ marginRight: 4,
+ textTransform: "uppercase"
+ },
+ filterButton: {
+ alignItems: "center",
+ backgroundColor: fade(theme.palette.primary.main, 0.6),
+ borderRadius: "19px",
+ display: "flex",
+ height: "38px",
+ justifyContent: "space-around",
+ margin: `0 ${theme.spacing.unit * 2}px ${theme.spacing.unit}px`,
+ marginLeft: 0,
+ padding: "0 16px"
+ },
+ filterLabel: {
+ marginBottom: theme.spacing.unit
+ },
+ paper: {
+ marginTop: theme.spacing.unit * 2,
+ padding: theme.spacing.unit * 2,
+ width: 240
+ },
+ popover: {
+ zIndex: 1
+ },
+ rotate: {
+ transform: "rotate(180deg)"
+ }
+ });
const Filter = withStyles(styles, { name: "Filter" })(
- ({ classes }: FilterProps & WithStyles<typeof styles>) => <div />
+ ({
+ classes,
+ currencySymbol,
+ filterLabel,
+ menu
+ }: FilterProps & WithStyles<typeof styles>) => {
+ const anchor = React.useRef<HTMLDivElement>();
+ const [isFilterMenuOpened, setFilterMenuOpened] = React.useState(false);
+
+ return (
+ <div ref={anchor}>
+ <ButtonBase
+ className={classNames(classes.filterButton, classes.addFilterButton, {
+ [classes.addFilterButtonActive]: isFilterMenuOpened
+ })}
+ onClick={() => setFilterMenuOpened(!isFilterMenuOpened)}
+ >
+ <Typography className={classes.addFilterText}>
+ {i18n.t("Add Filter")}
+ </Typography>
+ <ArrowDropDownIcon
+ color="primary"
+ className={classNames(classes.addFilterIcon, {
+ [classes.rotate]: isFilterMenuOpened
+ })}
+ />
+ </ButtonBase>
+ <Popper
+ className={classes.popover}
+ open={isFilterMenuOpened}
+ anchorEl={anchor.current}
+ transition
+ disablePortal
+ placement="bottom-start"
+ >
+ {({ TransitionProps, placement }) => (
+ <Grow
+ {...TransitionProps}
+ style={{
+ transformOrigin:
+ placement === "bottom" ? "right top" : "right bottom"
+ }}
+ >
+ <Paper className={classes.paper}>
+ <Typography className={classes.filterLabel}>
+ {filterLabel}
+ </Typography>
+ <FilterContent
+ currencySymbol={currencySymbol}
+ filters={menu}
+ onSubmit={() => undefined}
+ />
+ </Paper>
+ </Grow>
+ )}
+ </Popper>
+ </div>
+ );
+ }
);
Filter.displayName = "Filter";
export default Filter;
diff --git a/saleor/static/dashboard-next/components/Filter/FilterContent.tsx b/saleor/static/dashboard-next/components/Filter/FilterContent.tsx
index 3d13ff55de..5dbaa5e046 100644
--- a/saleor/static/dashboard-next/components/Filter/FilterContent.tsx
+++ b/saleor/static/dashboard-next/components/Filter/FilterContent.tsx
@@ -14,6 +14,7 @@ export interface FilterContentSubmitData {
value: string | string[];
}
export interface FilterContentProps {
+ currencySymbol: string;
filters: IFilter;
onSubmit: (data: FilterContentSubmitData) => void;
}
@@ -31,7 +32,11 @@ const useStyles = makeStyles({
}
});
-const FilterContent: React.FC<FilterContentProps> = ({ filters, onSubmit }) => {
+const FilterContent: React.FC<FilterContentProps> = ({
+ currencySymbol,
+ filters,
+ onSubmit
+}) => {
const [menuValue, setMenuValue] = React.useState<string>("");
const [filterValue, setFilterValue] = React.useState<string | string[]>("");
const classes = useStyles();
@@ -95,6 +100,7 @@ const FilterContent: React.FC<FilterContentProps> = ({ filters, onSubmit }) => {
<>
<FormSpacer />
<FilterElement
+ currencySymbol={currencySymbol}
filter={activeMenu}
value={filterValue}
onChange={value => setFilterValue(value)}
diff --git a/saleor/static/dashboard-next/components/Filter/FilterElement.tsx b/saleor/static/dashboard-next/components/Filter/FilterElement.tsx
index 8948444641..0d14ec0d7f 100644
--- a/saleor/static/dashboard-next/components/Filter/FilterElement.tsx
+++ b/saleor/static/dashboard-next/components/Filter/FilterElement.tsx
@@ -6,6 +6,7 @@ import * as React from "react";
import i18n from "../../i18n";
import Calendar from "../../icons/Calendar";
import FormSpacer from "../FormSpacer";
+import PriceField from "../PriceField";
import SingleSelectField from "../SingleSelectField";
import { FieldType, IFilterItem } from "./types";
@@ -27,12 +28,14 @@ const useStyles = makeStyles({
export interface FilterElementProps {
className?: string;
+ currencySymbol: string;
filter: IFilterItem;
value: string | string[];
onChange: (value: string | string[]) => void;
}
const FilterElement: React.FC<FilterElementProps> = ({
+ currencySymbol,
className,
filter,
onChange,
@@ -67,6 +70,9 @@ const FilterElement: React.FC<FilterElementProps> = ({
value={value[0]}
onChange={event => onChange([event.target.value, value[1]])}
InputProps={{
+ classes: {
+ input: classes.input
+ },
startAdornment: <Calendar className={classes.calendar} />
}}
/>
@@ -79,6 +85,9 @@ const FilterElement: React.FC<FilterElementProps> = ({
value={value[1]}
onChange={event => onChange([value[0], event.target.value])}
InputProps={{
+ classes: {
+ input: classes.input
+ },
startAdornment: <Calendar className={classes.calendar} />
}}
/>
@@ -94,6 +103,11 @@ const FilterElement: React.FC<FilterElementProps> = ({
value={value[0]}
onChange={event => onChange([event.target.value, value[1]])}
type="number"
+ InputProps={{
+ classes: {
+ input: classes.input
+ }
+ }}
/>
<FormSpacer />
<Typography>{i18n.t("to")}</Typography>
@@ -103,6 +117,41 @@ const FilterElement: React.FC<FilterElementProps> = ({
value={value[1]}
onChange={event => onChange([value[0], event.target.value])}
type="number"
+ InputProps={{
+ classes: {
+ input: classes.input
+ }
+ }}
+ />
+ </>
+ );
+ } else if (filter.data.type === FieldType.rangePrice) {
+ return (
+ <>
+ <Typography>{i18n.t("from")}</Typography>
+ <PriceField
+ currencySymbol={currencySymbol}
+ className={className}
+ value={value[0]}
+ onChange={event => onChange([event.target.value, value[1]])}
+ InputProps={{
+ classes: {
+ input: classes.input
+ }
+ }}
+ />
+ <FormSpacer />
+ <Typography>{i18n.t("to")}</Typography>
+ <PriceField
+ currencySymbol={currencySymbol}
+ className={className}
+ value={value[1]}
+ onChange={event => onChange([value[0], event.target.value])}
+ InputProps={{
+ classes: {
+ input: classes.input
+ }
+ }}
/>
</>
);
@@ -113,13 +162,47 @@ const FilterElement: React.FC<FilterElementProps> = ({
...option,
value: option.value.toString()
}))}
+ selectProps={{
+ className,
+ inputProps: {
+ className: classes.input
+ }
+ }}
value={value as string}
placeholder={i18n.t("Select Filter...")}
onChange={event => onChange(event.target.value)}
/>
);
+ } else if (filter.data.type === FieldType.price) {
+ return (
+ <PriceField
+ currencySymbol={currencySymbol}
+ className={className}
+ label={filter.data.fieldLabel}
+ onChange={event => onChange(event.target.value)}
+ InputProps={{
+ classes: {
+ input: filter.data.fieldLabel && classes.input
+ }
+ }}
+ />
+ );
}
- return <TextField className={className} fullWidth label={filter.label} />;
+ return (
+ <>
+ <Typography>{i18n.t("is")}</Typography>
+ <TextField
+ className={className}
+ fullWidth
+ label={filter.data.fieldLabel}
+ InputProps={{
+ classes: {
+ input: filter.data.fieldLabel && classes.input
+ }
+ }}
+ />
+ </>
+ );
};
FilterElement.displayName = "FilterElement";
export default FilterElement;
diff --git a/saleor/static/dashboard-next/components/Filter/types.ts b/saleor/static/dashboard-next/components/Filter/types.ts
index b2f21dd84b..56a6b4e9de 100644
--- a/saleor/static/dashboard-next/components/Filter/types.ts
+++ b/saleor/static/dashboard-next/components/Filter/types.ts
@@ -3,6 +3,7 @@ import { IMenu, IMenuItem } from "../../utils/menu";
export enum FieldType {
date,
number,
+ price,
range,
rangeDate,
rangePrice,
@@ -16,6 +17,7 @@ export interface FilterChoice {
}
export interface FilterData {
+ fieldLabel: string;
options?: FilterChoice[];
type: FieldType;
}
diff --git a/saleor/static/dashboard-next/components/PriceField/PriceField.tsx b/saleor/static/dashboard-next/components/PriceField/PriceField.tsx
index b07a2cd7ac..684da90e24 100644
--- a/saleor/static/dashboard-next/components/PriceField/PriceField.tsx
+++ b/saleor/static/dashboard-next/components/PriceField/PriceField.tsx
@@ -1,3 +1,4 @@
+import { InputProps } from "@material-ui/core/Input";
import InputAdornment from "@material-ui/core/InputAdornment";
import {
createStyles,
@@ -31,6 +32,7 @@ const styles = (theme: Theme) =>
});
interface PriceFieldProps extends WithStyles<typeof styles> {
+ className?: string;
currencySymbol?: string;
disabled?: boolean;
error?: boolean;
@@ -38,11 +40,13 @@ interface PriceFieldProps extends WithStyles<typeof styles> {
label?: string;
name?: string;
value?: string | number;
+ InputProps?: InputProps;
onChange(event: any);
}
export const PriceField = withStyles(styles, { name: "PriceField" })(
({
+ className,
disabled,
error,
label,
@@ -51,14 +55,18 @@ export const PriceField = withStyles(styles, { name: "PriceField" })(
name,
classes,
onChange,
- value
+ value,
+ InputProps
}: PriceFieldProps) => (
<TextField
+ className={className}
error={error}
helperText={hint}
label={label}
+ fullWidth
value={value}
InputProps={{
+ ...InputProps,
endAdornment: currencySymbol ? (
<InputAdornment position="end" className={classes.currencySymbol}>
{currencySymbol}
diff --git a/saleor/static/dashboard-next/components/TableFilter/FilterChips.tsx b/saleor/static/dashboard-next/components/TableFilter/FilterChips.tsx
index 42cee20e0f..645c13bc23 100644
--- a/saleor/static/dashboard-next/components/TableFilter/FilterChips.tsx
+++ b/saleor/static/dashboard-next/components/TableFilter/FilterChips.tsx
@@ -3,13 +3,12 @@ import { Theme } from "@material-ui/core/styles";
import { fade } from "@material-ui/core/styles/colorManipulator";
import TextField, { TextFieldProps } from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
-import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
import ClearIcon from "@material-ui/icons/Clear";
import { createStyles, makeStyles, useTheme } from "@material-ui/styles";
-import * as classNames from "classnames";
import * as React from "react";
-import i18n from "../../i18n";
+import Filter from "../Filter";
+import { IFilter } from "../Filter/types";
import Hr from "../Hr";
export interface Filter {
@@ -47,27 +46,6 @@ const useStyles = makeStyles(
flexWrap: "wrap",
padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3}px`
},
- addFilterButton: {
- "&$filterButton": {
- "&:hover, &:focus": {
- backgroundColor: fade(theme.palette.primary.main, 0.1)
- },
- backgroundColor: "#ffffff",
- border: `1px solid ${theme.palette.primary.main}`,
- cursor: "pointer",
- marginBottom: 0,
- marginRight: theme.spacing.unit * 2,
- marginTop: 0,
- transition: theme.transitions.duration.short + "ms"
- }
- },
- addFilterText: {
- color: theme.palette.primary.main,
- fontSize: 14,
- fontWeight: 600 as 600,
- marginRight: 4,
- textTransform: "uppercase"
- },
filterButton: {
alignItems: "center",
backgroundColor: fade(theme.palette.primary.main, 0.6),
@@ -103,6 +81,9 @@ const useStyles = makeStyles(
padding: 8,
width: 32
},
+ filterLabel: {
+ marginBottom: theme.spacing.unit
+ },
filterText: {
color: theme.palette.common.white,
fontSize: 12,
@@ -115,12 +96,18 @@ const useStyles = makeStyles(
);
interface FilterChipProps {
+ currencySymbol: string;
+ menu: IFilter;
filtersList: Filter[];
+ filterLabel: string;
placeholder: string;
}
export const FilterChips: React.FC<FilterChipProps> = ({
+ currencySymbol,
filtersList,
+ menu,
+ filterLabel,
placeholder
}) => {
const theme = useTheme();
@@ -129,14 +116,11 @@ export const FilterChips: React.FC<FilterChipProps> = ({
return (
<>
<div className={classes.actionContainer}>
- <ButtonBase
- className={classNames(classes.filterButton, classes.addFilterButton)}
- >
- <Typography className={classes.addFilterText}>
- {i18n.t("Add Filter")}
- </Typography>
- <ArrowDropDownIcon color="primary" />
- </ButtonBase>
+ <Filter
+ currencySymbol={currencySymbol}
+ menu={menu}
+ filterLabel={filterLabel}
+ />
<Search fullWidth placeholder={placeholder} />
</div>
{filtersList && filtersList.length > 0 ? (
diff --git a/saleor/static/dashboard-next/orders/components/OrderListFilter/OrderListFilter.tsx b/saleor/static/dashboard-next/orders/components/OrderListFilter/OrderListFilter.tsx
index 54e53a95c9..d5e95e4e05 100644
--- a/saleor/static/dashboard-next/orders/components/OrderListFilter/OrderListFilter.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderListFilter/OrderListFilter.tsx
@@ -1,11 +1,6 @@
import * as React from "react";
-import {
- Filter,
- FilterChips,
- FilterTab,
- FilterTabs
-} from "../../../components/TableFilter";
+import { Filter, FilterTab, FilterTabs } from "../../../components/TableFilter";
import i18n from "../../../i18n";
export type OrderListFilterTabs = "all" | "toFulfill" | "toCapture" | "custom";
@@ -44,9 +39,9 @@ const OrderListFilter: React.StatelessComponent<OrderListFilterProps> = ({
/>
)}
</FilterTabs>
- {currentTab === "custom" && filtersList && filtersList.length > 0 && (
+ {/* {currentTab === "custom" && filtersList && filtersList.length > 0 && (
<FilterChips filtersList={filtersList} />
- )}
+ )} */}
</>
);
OrderListFilter.displayName = "OrderListFilter";
diff --git a/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx b/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
index 6b0c5000ba..7854eaafe0 100644
--- a/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
@@ -13,6 +13,7 @@ import { ListActions, PageListProps } from "../../../types";
import ProductListFilter, { ProductListFilterTabs } from "../ProductListFilter";
interface ProductListCardProps extends PageListProps, ListActions {
+ currencySymbol: string;
currentTab: ProductListFilterTabs;
filtersList: Filter[];
products: CategoryDetails_category_products_edges_node[];
@@ -25,6 +26,7 @@ interface ProductListCardProps extends PageListProps, ListActions {
export const ProductListCard: React.StatelessComponent<
ProductListCardProps
> = ({
+ currencySymbol,
currentTab,
disabled,
filtersList,
@@ -52,6 +54,7 @@ export const ProductListCard: React.StatelessComponent<
</PageHeader>
<Card>
<ProductListFilter
+ currencySymbol={currencySymbol}
currentTab={currentTab}
filtersList={filtersList}
onAvailable={onAvailable}
diff --git a/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx b/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
index dfb0b40a3b..af733274be 100644
--- a/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
+import { FieldType, IFilter } from "../../../components/Filter/types";
import {
Filter,
FilterChips,
@@ -15,6 +16,7 @@ export type ProductListFilterTabs =
| "custom";
interface ProductListFilterProps {
+ currencySymbol: string;
currentTab: ProductListFilterTabs;
filtersList: Filter[];
onAllProducts: () => void;
@@ -23,7 +25,74 @@ interface ProductListFilterProps {
onCustomFilter: () => void;
}
+export enum ProductFilterKeys {
+ published,
+ price,
+ priceEqual,
+ priceRange,
+ stock
+}
+const filterMenu: IFilter = [
+ {
+ children: [],
+ data: {
+ fieldLabel: i18n.t("Status"),
+ options: [
+ {
+ label: i18n.t("Published"),
+ value: true
+ },
+ {
+ label: i18n.t("Hidden"),
+ value: false
+ }
+ ],
+ type: FieldType.select
+ },
+ label: i18n.t("Published"),
+ value: ProductFilterKeys.published.toString()
+ },
+ {
+ children: [],
+ data: {
+ fieldLabel: i18n.t("Stock quantity"),
+ type: FieldType.range
+ },
+ label: i18n.t("Stock"),
+ value: ProductFilterKeys.stock.toString()
+ },
+ {
+ children: [
+ {
+ children: [],
+ data: {
+ fieldLabel: i18n.t("Price"),
+ type: FieldType.price
+ },
+ label: i18n.t("Specific Price"),
+ value: ProductFilterKeys.priceEqual.toString()
+ },
+ {
+ children: [],
+ data: {
+ fieldLabel: i18n.t("Range"),
+ type: FieldType.rangePrice
+ },
+ label: i18n.t("Range"),
+ value: ProductFilterKeys.priceRange.toString()
+ }
+ ],
+ data: {
+ fieldLabel: i18n.t("Price"),
+ type: FieldType.range
+ },
+ label: i18n.t("Price"),
+ value: ProductFilterKeys.price.toString()
+ }
+];
+
const ProductListFilter: React.StatelessComponent<ProductListFilterProps> = ({
+ currencySymbol,
filtersList,
currentTab,
onAllProducts,
@@ -49,7 +118,10 @@ const ProductListFilter: React.StatelessComponent<ProductListFilterProps> = ({
)}
</FilterTabs>
<FilterChips
+ currencySymbol={currencySymbol}
+ menu={filterMenu}
filtersList={filtersList}
+ filterLabel={i18n.t("Select all products where:")}
placeholder={i18n.t("Search Products...")}
/>
</>
diff --git a/saleor/static/dashboard-next/products/views/ProductList.tsx b/saleor/static/dashboard-next/products/views/ProductList.tsx
index 3c767cdd90..31750391dd 100644
--- a/saleor/static/dashboard-next/products/views/ProductList.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductList.tsx
@@ -9,6 +9,7 @@ import useBulkActions from "../../hooks/useBulkActions";
import useNavigator from "../../hooks/useNavigator";
import useNotifier from "../../hooks/useNotifier";
import usePaginator, { createPaginationState } from "../../hooks/usePaginator";
+import useShop from "../../hooks/useShop";
import i18n from "../../i18n";
import { getMutationState, maybe } from "../../misc";
import { StockAvailability } from "../../types/globalTypes";
@@ -42,6 +43,7 @@ export const ProductList: React.StatelessComponent<ProductListProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const paginate = usePaginator();
+ const shop = useShop();
const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions(
params.ids
);
@@ -135,6 +137,7 @@ export const ProductList: React.StatelessComponent<ProductListProps> = ({
return (
<>
<ProductListCard
+ currencySymbol={maybe(() => shop.defaultCurrency)}
currentTab={currentTab}
filtersList={[]}
onAdd={() => navigate(productAddUrl)}
diff --git a/saleor/static/dashboard-next/storybook/stories/components/Filter.tsx b/saleor/static/dashboard-next/storybook/stories/components/Filter.tsx
index c40078ff3a..3ace953cdb 100644
--- a/saleor/static/dashboard-next/storybook/stories/components/Filter.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/components/Filter.tsx
@@ -7,10 +7,12 @@ import CardDecorator from "../../CardDecorator";
import Decorator from "../../Decorator";
const props: FilterContentProps = {
+ currencySymbol: "USD",
filters: [
{
children: [],
data: {
+ fieldLabel: "Category Name",
type: FieldType.text
},
label: "Category",
@@ -19,6 +21,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Product Type Name",
type: FieldType.text
},
label: "Product Type",
@@ -27,6 +30,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Status",
options: [
{
label: "Published",
@@ -45,6 +49,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Stock",
type: FieldType.range
},
label: "Stock",
@@ -55,6 +60,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Equal to",
type: FieldType.date
},
label: "Equal to",
@@ -63,6 +69,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Range",
type: FieldType.rangeDate
},
label: "Range",
@@ -70,6 +77,7 @@ const props: FilterContentProps = {
}
],
data: {
+ fieldLabel: "Date",
type: FieldType.select
},
label: "Date",
@@ -80,7 +88,8 @@ const props: FilterContentProps = {
{
children: [],
data: {
- type: FieldType.number
+ fieldLabel: "Exactly",
+ type: FieldType.price
},
label: "Exactly",
value: "price-exactly"
@@ -88,6 +97,7 @@ const props: FilterContentProps = {
{
children: [],
data: {
+ fieldLabel: "Range",
type: FieldType.rangePrice
},
label: "Range",
@@ -95,6 +105,7 @@ const props: FilterContentProps = {
}
],
data: {
+ fieldLabel: "Price",
type: FieldType.select
},
label: "Price",
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
index 3f7ea197c0..6c9a6fae14 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
@@ -88,6 +88,7 @@ storiesOf("Views / Products / Product list", module)
onAvailable={() => undefined}
onOfStock={() => undefined}
onCustomFilter={() => undefined}
+ currencySymbol="USD"
/>
))
.add("with custom filters", () => (
@@ -101,6 +102,7 @@ storiesOf("Views / Products / Product list", module)
onAvailable={() => undefined}
onOfStock={() => undefined}
onCustomFilter={() => undefined}
+ currencySymbol="USD"
/>
))
.add("loading", () => (
@@ -114,6 +116,7 @@ storiesOf("Views / Products / Product list", module)
onAvailable={() => undefined}
onOfStock={() => undefined}
onCustomFilter={() => undefined}
+ currencySymbol="USD"
/>
))
.add("no data", () => (
@@ -127,5 +130,6 @@ storiesOf("Views / Products / Product list", module)
onAvailable={() => undefined}
onOfStock={() => undefined}
onCustomFilter={() => undefined}
+ currencySymbol="USD"
/>
));