Fix types

This commit is contained in:
dominik-zeglen 2020-01-10 12:38:13 +01:00
parent d414729f01
commit 1e559b2feb
2 changed files with 33 additions and 1 deletions

View file

@ -26,6 +26,7 @@ import { getSortParams } from "@saleor/utils/sort";
import createSortHandler from "@saleor/utils/handlers/sortHandler"; import createSortHandler from "@saleor/utils/handlers/sortHandler";
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers"; import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
import createFilterHandlers from "@saleor/utils/handlers/filterHandlers"; import createFilterHandlers from "@saleor/utils/handlers/filterHandlers";
import useShop from "@saleor/hooks/useShop";
import { PAGINATE_BY } from "../../../config"; import { PAGINATE_BY } from "../../../config";
import useBulkActions from "../../../hooks/useBulkActions"; import useBulkActions from "../../../hooks/useBulkActions";
import { maybe } from "../../../misc"; import { maybe } from "../../../misc";
@ -52,6 +53,7 @@ const AttributeList: React.FC<AttributeListProps> = ({ params }) => {
const navigate = useNavigator(); const navigate = useNavigator();
const paginate = usePaginator(); const paginate = usePaginator();
const notify = useNotifier(); const notify = useNotifier();
const shop = useShop();
const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions( const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions(
params.ids params.ids
); );
@ -138,6 +140,7 @@ const AttributeList: React.FC<AttributeListProps> = ({ params }) => {
}; };
const handleSort = createSortHandler(navigate, attributeListUrl, params); const handleSort = createSortHandler(navigate, attributeListUrl, params);
const currencySymbol = maybe(() => shop.defaultCurrency, "USD");
return ( return (
<AttributeBulkDeleteMutation onCompleted={handleBulkDelete}> <AttributeBulkDeleteMutation onCompleted={handleBulkDelete}>
@ -147,6 +150,7 @@ const AttributeList: React.FC<AttributeListProps> = ({ params }) => {
attributes={maybe(() => attributes={maybe(() =>
data.attributes.edges.map(edge => edge.node) data.attributes.edges.map(edge => edge.node)
)} )}
currencySymbol={currencySymbol}
currentTab={currentTab} currentTab={currentTab}
disabled={loading || attributeBulkDeleteOpts.loading} disabled={loading || attributeBulkDeleteOpts.loading}
filterOpts={getFilterOpts(params)} filterOpts={getFilterOpts(params)}

View file

@ -10,7 +10,8 @@ import {
pageListProps, pageListProps,
searchPageProps, searchPageProps,
tabPageProps, tabPageProps,
sortPageProps sortPageProps,
filterPageProps
} from "@saleor/fixtures"; } from "@saleor/fixtures";
import { AttributeListUrlSortField } from "@saleor/attributes/urls"; import { AttributeListUrlSortField } from "@saleor/attributes/urls";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
@ -20,7 +21,34 @@ const props: AttributeListPageProps = {
...listActionsProps, ...listActionsProps,
...tabPageProps, ...tabPageProps,
...searchPageProps, ...searchPageProps,
...filterPageProps,
attributes, attributes,
filterOpts: {
availableInGrid: {
active: false,
value: false
},
filterableInDashboard: {
active: false,
value: false
},
filterableInStorefront: {
active: false,
value: false
},
isVariantOnly: {
active: false,
value: false
},
valueRequired: {
active: false,
value: false
},
visibleInStorefront: {
active: false,
value: false
}
},
onBack: () => undefined, onBack: () => undefined,
onSort: () => undefined, onSort: () => undefined,
sort: { sort: {