Skip to content

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

Remove deprecated sorting field

Marcin Gębala9c32900e5cd5
diff --git a/saleor/graphql/product/sorters.py b/saleor/graphql/product/sorters.py
index b629d82049..c25ac7092c 100644
--- a/saleor/graphql/product/sorters.py
+++ b/saleor/graphql/product/sorters.py
@@ -14,17 +14,6 @@ class AttributeSortField(graphene.Enum):
VISIBLE_IN_STOREFRONT = ["visible_in_storefront", "name", "slug"]
FILTERABLE_IN_STOREFRONT = ["filterable_in_storefront", "name", "slug"]
FILTERABLE_IN_DASHBOARD = ["filterable_in_dashboard", "name", "slug"]
-
- # Deprecated: doesn't work
- DASHBOARD_VARIANT_POSITION = [
- "attributevariant__sort_order",
- "attributevariant__id",
- ]
- # Deprecated: doesn't work
- DASHBOARD_PRODUCT_POSITION = [
- "attributeproduct__sort_order",
- "attributevariant__id",
- ]
STOREFRONT_SEARCH_POSITION = ["storefront_search_position", "name", "pk"]
AVAILABLE_IN_GRID = ["available_in_grid", "name", "pk"]
@@ -52,14 +41,6 @@ class AttributeSortField(graphene.Enum):
AttributeSortField.STOREFRONT_SEARCH_POSITION.name: (
"Sort attributes by their position in storefront"
),
- AttributeSortField.DASHBOARD_VARIANT_POSITION.name: (
- "DEPRECATED: Will be removed in Saleor 2.11. "
- "Sort variant attributes by their position in dashboard."
- ),
- AttributeSortField.DASHBOARD_PRODUCT_POSITION.name: (
- "DEPRECATED: Will be removed in Saleor 2.11. "
- "Sort product attributes by their position in dashboard."
- ),
AttributeSortField.AVAILABLE_IN_GRID.name: (
"Sort attributes based on whether they can be displayed "
"or not in a product grid."
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 0c3db39c3f..499512c1be 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -316,8 +316,6 @@ enum AttributeSortField {
VISIBLE_IN_STOREFRONT
FILTERABLE_IN_STOREFRONT
FILTERABLE_IN_DASHBOARD
- DASHBOARD_VARIANT_POSITION
- DASHBOARD_PRODUCT_POSITION
STOREFRONT_SEARCH_POSITION
AVAILABLE_IN_GRID
}
diff --git a/tests/api/pagination/test_attribute.py b/tests/api/pagination/test_attribute.py
index 2c7d0f6c14..e43ff62a97 100644
--- a/tests/api/pagination/test_attribute.py
+++ b/tests/api/pagination/test_attribute.py
@@ -124,14 +124,6 @@ QUERY_ATTRIBUTES_PAGINATION = """
{"field": "STOREFRONT_SEARCH_POSITION", "direction": "ASC"},
["Attr3", "AttrAttr2", "AttrAttr1"],
),
- (
- {"field": "DASHBOARD_VARIANT_POSITION", "direction": "ASC"},
- ["AttrAttr1", "Attr2", "Attr3"],
- ),
- (
- {"field": "DASHBOARD_PRODUCT_POSITION", "direction": "ASC"},
- ["AttrAttr2", "Attr1", "AttrAttr1"],
- ),
],
)
def test_attributes_pagination_with_sorting(