diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f868255..8d11cafec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ All notable, unreleased changes to this project will be documented in this file. - Reset state after closing - #456 by @dominik-zeglen - Password validation errors are not shown - #471 by @gabmartinez - Reset pagination when guest change the sorting of the list - #474 by @gabmartinez +- Filter column ids before send it to GridAttributes operation - #476 by @gabmartinez - Display Is Published column correctly in main Product Listing - #475 by @gabmartinez ## 2.0.0 diff --git a/src/products/views/ProductList/ProductList.tsx b/src/products/views/ProductList/ProductList.tsx index e572e6245..de9ebe432 100644 --- a/src/products/views/ProductList/ProductList.tsx +++ b/src/products/views/ProductList/ProductList.tsx @@ -34,6 +34,10 @@ import createFilterHandlers from "@saleor/utils/handlers/filterHandlers"; import useCategorySearch from "@saleor/searches/useCategorySearch"; import useCollectionSearch from "@saleor/searches/useCollectionSearch"; import useProductTypeSearch from "@saleor/searches/useProductTypeSearch"; +import { + getAttributeIdFromColumnValue, + isAttributeColumnValue +} from "@saleor/products/components/ProductListPage/utils"; import ProductListPage from "../../components/ProductListPage"; import { TypedProductBulkDeleteMutation, @@ -216,9 +220,15 @@ export const ProductList: React.FC = ({ params }) => { } ); + function filterColumnIds(columns: ProductListColumns[]) { + return columns + .filter(isAttributeColumnValue) + .map(getAttributeIdFromColumnValue); + } + return ( {attributes => (