diff --git a/src/categories/components/CategoryProductList/CategoryProductList.tsx b/src/categories/components/CategoryProductList/CategoryProductList.tsx index 2cd9c53d1..1d7a894a6 100644 --- a/src/categories/components/CategoryProductList/CategoryProductList.tsx +++ b/src/categories/components/CategoryProductList/CategoryProductList.tsx @@ -13,13 +13,13 @@ import Checkbox from "@saleor/components/Checkbox"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import StatusLabel from "@saleor/components/StatusLabel"; +import { FormattedMessage, useIntl } from "react-intl"; import TableCellAvatar, { AVATAR_MARGIN } from "@saleor/components/TableCellAvatar"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "@saleor/i18n"; import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; import React from "react"; @@ -95,6 +95,8 @@ export const CategoryProductList = withStyles(styles, { onPreviousPage, onRowClick }: CategoryProductListProps) => { + const intl = useIntl(); + const numberOfColumns = 5; return ( @@ -117,17 +119,26 @@ export const CategoryProductList = withStyles(styles, { > - {i18n.t("Name", { context: "object" })} + - {i18n.t("Type", { context: "object" })} + - {i18n.t("Published", { context: "object" })} + - {i18n.t("Price", { context: "object" })} + @@ -186,11 +197,14 @@ export const CategoryProductList = withStyles(styles, { ( - {i18n.t("No products found")} + ) diff --git a/src/categories/components/CategoryProductList/index.ts b/src/categories/components/CategoryProductList/index.ts index e69de29bb..5bc658620 100644 --- a/src/categories/components/CategoryProductList/index.ts +++ b/src/categories/components/CategoryProductList/index.ts @@ -0,0 +1,2 @@ +export { default } from "./CategoryProductList"; +export * from "./CategoryProductList"; diff --git a/src/products/components/ProductList/ProductList.tsx b/src/products/components/ProductList/ProductList.tsx index 677576ac9..88508d18a 100644 --- a/src/products/components/ProductList/ProductList.tsx +++ b/src/products/components/ProductList/ProductList.tsx @@ -11,6 +11,7 @@ import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import classNames from "classnames"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Checkbox from "@saleor/components/Checkbox"; import Money from "@saleor/components/Money"; @@ -22,7 +23,6 @@ import TableCellAvatar, { import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { ProductListColumns } from "@saleor/config"; -import i18n from "@saleor/i18n"; import { maybe, renderCollection } from "@saleor/misc"; import { getAttributeIdFromColumnValue, @@ -113,6 +113,8 @@ export const ProductList = withStyles(styles, { name: "ProductList" })( onUpdateListSettings, onRowClick }: ProductListProps) => { + const intl = useIntl(); + const DisplayColumn: React.FC<{ column: ProductListColumns }> = props => ( ); @@ -154,17 +156,23 @@ export const ProductList = withStyles(styles, { name: "ProductList" })( })} > - {i18n.t("Name", { context: "object" })} + - {i18n.t("Type", { context: "object" })} + - {i18n.t("Published", { context: "object" })} + {gridAttributesFromSettings.map(gridAttributeFromSettings => ( @@ -186,7 +194,10 @@ export const ProductList = withStyles(styles, { name: "ProductList" })( ))} - {i18n.t("Price", { context: "object" })} + @@ -251,11 +262,14 @@ export const ProductList = withStyles(styles, { name: "ProductList" })( ( - {i18n.t("No products found")} + ) diff --git a/src/products/components/ProductListPage/ProductListPage.tsx b/src/products/components/ProductListPage/ProductListPage.tsx index d89e8077d..ec18734b2 100644 --- a/src/products/components/ProductListPage/ProductListPage.tsx +++ b/src/products/components/ProductListPage/ProductListPage.tsx @@ -12,6 +12,7 @@ import ColumnPicker, { import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; import { ProductListColumns } from "@saleor/config"; +import { sectionNames } from "@saleor/intl"; import { AvailableInGridAttributes_availableInGrid_edges_node, AvailableInGridAttributes_grid_edges_node diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index e4807b17f..b93bd06f1 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -1116,6 +1116,54 @@ exports[`Storyshots Generics / Column picker default 1`] = ` `; +exports[`Storyshots Generics / Column picker loading 1`] = ` +
+
+
+
+
+ +
+
+
+
+
+`; + exports[`Storyshots Generics / Date default 1`] = `
Name Type Published Price @@ -19704,25 +19752,25 @@ Ctrl + K" class="CardTitle-hr-id" />
0 @@ -21401,11 +21439,11 @@ Ctrl + K" src="placeholder60x60.png" /> - Murray Inc - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91641,7 +92259,7 @@ exports[`Storyshots Views / Products / Product list loading 1`] = ` /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93613,7 +94811,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors src="placeholder60x60.png" /> - @@ -93641,7 +94839,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors src="placeholder60x60.png" /> - @@ -93669,7 +94867,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors src="placeholder60x60.png" /> - @@ -93697,7 +94895,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors src="placeholder60x60.png" /> - @@ -94296,7 +95494,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data src="placeholder60x60.png" /> - @@ -94324,7 +95522,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data src="placeholder60x60.png" /> - @@ -94352,7 +95550,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data src="placeholder60x60.png" /> - @@ -94380,7 +95578,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data src="placeholder60x60.png" /> - @@ -94985,7 +96183,7 @@ exports[`Storyshots Views / Products / Product variant details when loading data /> -
Name Type Published Price @@ -19841,8 +19889,7 @@ Ctrl + K" class="MuiTableBody-root-id" >