diff --git a/src/attributes/components/AttributeList/AttributeList.tsx b/src/attributes/components/AttributeList/AttributeList.tsx index 715a2badb..17afe3b17 100644 --- a/src/attributes/components/AttributeList/AttributeList.tsx +++ b/src/attributes/components/AttributeList/AttributeList.tsx @@ -13,7 +13,7 @@ import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { translateBoolean } from "@saleor/intl"; -import { renderCollection } from "@saleor/misc"; +import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; import { AttributeList_attributes_edges_node } from "../../types/AttributeList"; @@ -139,6 +139,11 @@ const AttributeList: React.StatelessComponent = ({ key={attribute ? attribute.id : "skeleton"} onClick={attribute && onRowClick(attribute.id)} className={classes.link} + data-tc="id" + data-tc-id={maybe(() => attribute.id)} + data-tc-values={JSON.stringify( + maybe(() => attribute.values, []) + )} > = ({ onChange={() => toggle(attribute.id)} /> - + {attribute ? attribute.slug : } - + {attribute ? attribute.name : } - + attribute.visibleInStorefront)} + > {attribute ? ( translateBoolean(attribute.visibleInStorefront, intl) ) : ( )} - + attribute.filterableInDashboard + )} + > {attribute ? ( translateBoolean(attribute.filterableInDashboard, intl) ) : ( )} - + attribute.filterableInStorefront + )} + > {attribute ? ( translateBoolean(attribute.filterableInStorefront, intl) ) : ( diff --git a/src/attributes/queries.ts b/src/attributes/queries.ts index 66f82d08d..f8850d581 100644 --- a/src/attributes/queries.ts +++ b/src/attributes/queries.ts @@ -72,6 +72,11 @@ const attributeList = gql` edges { node { ...AttributeFragment + values { + id + name + slug + } } } pageInfo { diff --git a/src/attributes/types/AttributeList.ts b/src/attributes/types/AttributeList.ts index d5f296707..ad5050ce5 100644 --- a/src/attributes/types/AttributeList.ts +++ b/src/attributes/types/AttributeList.ts @@ -8,6 +8,13 @@ import { AttributeFilterInput } from "./../../types/globalTypes"; // GraphQL query operation: AttributeList // ==================================================== +export interface AttributeList_attributes_edges_node_values { + __typename: "AttributeValue"; + id: string; + name: string | null; + slug: string | null; +} + export interface AttributeList_attributes_edges_node { __typename: "Attribute"; id: string; @@ -16,6 +23,7 @@ export interface AttributeList_attributes_edges_node { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + values: (AttributeList_attributes_edges_node_values | null)[] | null; } export interface AttributeList_attributes_edges { diff --git a/src/categories/components/CategoryList/CategoryList.tsx b/src/categories/components/CategoryList/CategoryList.tsx index dc18b965a..5ae05489e 100644 --- a/src/categories/components/CategoryList/CategoryList.tsx +++ b/src/categories/components/CategoryList/CategoryList.tsx @@ -17,7 +17,7 @@ import Checkbox from "@saleor/components/Checkbox"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import { renderCollection } from "@saleor/misc"; +import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; const styles = (theme: Theme) => @@ -126,6 +126,8 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })( onClick={category ? onRowClick(category.id) : undefined} key={category ? category.id : "skeleton"} selected={isSelected} + data-tc="id" + data-tc-id={maybe(() => category.id)} > toggle(category.id)} /> - + {category && category.name ? category.name : } diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index 68d7302df..aeca0420e 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -122,6 +122,8 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })( onClick={collection ? onRowClick(collection.id) : undefined} key={collection ? collection.id : "skeleton"} selected={isSelected} + data-tc="id" + data-tc-id={maybe(() => collection.id)} > toggle(collection.id)} /> - + {maybe( () => collection.name, @@ -143,7 +145,11 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })( )} - + collection.isPublished)} + > {maybe( () => ( + attribute.id)} index={attributeIndex || 0} + data-tc="id" + data-tc-id={maybe(() => attribute.id)} > toggle(attribute.id)} /> - + {maybe(() => attribute.name) ? ( attribute.name ) : ( )} - + {maybe(() => attribute.slug) ? ( attribute.slug ) : ( diff --git a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx index 536ec3b90..05cbb2825 100644 --- a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx +++ b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx @@ -124,6 +124,8 @@ const ProductTypeList = withStyles(styles, { name: "ProductTypeList" })( key={productType ? productType.id : "skeleton"} onClick={productType ? onRowClick(productType.id) : undefined} selected={isSelected} + data-tc="id" + data-tc-id={maybe(() => productType.id)} > {productType ? ( <> - {productType.name} + {productType.name} {maybe(() => productType.hasVariants) ? intl.formatMessage({