Merge pull request #476 from gabmartinez/fix/sending-invalid-ids-to-grid-attributes-request
Columns dialog clean attribute ids before send it to GridAttributes operation
This commit is contained in:
commit
ffced45d55
2 changed files with 12 additions and 1 deletions
|
@ -41,6 +41,7 @@ All notable, unreleased changes to this project will be documented in this file.
|
|||
- Add "Ready to capture" to the "Status" order filter - #430 by @dominik-zeglen
|
||||
- Reset state after closing - #456 by @dominik-zeglen
|
||||
- Password validation errors are not shown - #471 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
|
||||
|
|
|
@ -33,6 +33,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,
|
||||
|
@ -215,9 +219,15 @@ export const ProductList: React.FC<ProductListProps> = ({ params }) => {
|
|||
}
|
||||
);
|
||||
|
||||
function filterColumnIds(columns: ProductListColumns[]) {
|
||||
return columns
|
||||
.filter(isAttributeColumnValue)
|
||||
.map(getAttributeIdFromColumnValue);
|
||||
}
|
||||
|
||||
return (
|
||||
<AvailableInGridAttributesQuery
|
||||
variables={{ first: 6, ids: settings.columns }}
|
||||
variables={{ first: 6, ids: filterColumnIds(settings.columns) }}
|
||||
>
|
||||
{attributes => (
|
||||
<TypedProductListQuery displayLoader variables={queryVariables}>
|
||||
|
|
Loading…
Reference in a new issue