diff --git a/package-lock.json b/package-lock.json index 6380fd3cf..787f98ca3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10167,7 +10167,7 @@ "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, "buffer-equal-constant-time": { @@ -14989,7 +14989,7 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } } @@ -15470,7 +15470,7 @@ "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { "pend": "~1.2.0" @@ -23666,7 +23666,7 @@ "ospath": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", - "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", + "integrity": "sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs=", "dev": true }, "p-cancelable": { @@ -24219,7 +24219,7 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, "performance-now": { diff --git a/src/apps/components/AppsInProgress/AppsInProgress.tsx b/src/apps/components/AppsInProgress/AppsInProgress.tsx index 0f29fa452..c6e24c1cc 100644 --- a/src/apps/components/AppsInProgress/AppsInProgress.tsx +++ b/src/apps/components/AppsInProgress/AppsInProgress.tsx @@ -3,13 +3,13 @@ import { CircularProgress as Progress, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import { IconButton } from "@saleor/components/IconButton"; import { TableButtonWrapper } from "@saleor/components/TableButtonWrapper/TableButtonWrapper"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AppsInstallationsQuery, JobStatusEnum } from "@saleor/graphql"; import { DeleteIcon, @@ -52,7 +52,7 @@ const AppsInProgress: React.FC = ({ {renderCollection(appsList, ({ status, appName, id, message }) => ( - + {appName} @@ -114,7 +114,7 @@ const AppsInProgress: React.FC = ({ )} - + ))} diff --git a/src/apps/components/AppsSkeleton/AppsSkeleton.tsx b/src/apps/components/AppsSkeleton/AppsSkeleton.tsx index 6799db0da..cc0cda997 100644 --- a/src/apps/components/AppsSkeleton/AppsSkeleton.tsx +++ b/src/apps/components/AppsSkeleton/AppsSkeleton.tsx @@ -1,5 +1,6 @@ -import { TableCell, TableRow } from "@material-ui/core"; +import { TableCell } from "@material-ui/core"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import React from "react"; import { useStyles } from "../../styles"; @@ -8,11 +9,11 @@ export const AppsSkeleton = () => { const classes = useStyles({}); return ( - + - + ); }; diff --git a/src/apps/components/CustomAppTokens/CustomAppTokens.tsx b/src/apps/components/CustomAppTokens/CustomAppTokens.tsx index 6a95ec376..db5577c7f 100644 --- a/src/apps/components/CustomAppTokens/CustomAppTokens.tsx +++ b/src/apps/components/CustomAppTokens/CustomAppTokens.tsx @@ -1,14 +1,9 @@ -import { - Card, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableHead } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AppUpdateMutation } from "@saleor/graphql"; import { DeleteIcon, IconButton } from "@saleor/macaw-ui"; import { renderCollection } from "@saleor/misc"; @@ -54,7 +49,7 @@ const CustomAppTokens: React.FC = props => { /> - + @@ -72,13 +67,13 @@ const CustomAppTokens: React.FC = props => { description="table actions" /> - + {renderCollection( tokens, token => ( - + {token?.name || } @@ -94,17 +89,17 @@ const CustomAppTokens: React.FC = props => { - + ), () => ( - + - + ), )} diff --git a/src/apps/components/CustomApps/CustomApps.tsx b/src/apps/components/CustomApps/CustomApps.tsx index 815116573..ce498710e 100644 --- a/src/apps/components/CustomApps/CustomApps.tsx +++ b/src/apps/components/CustomApps/CustomApps.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableRow, - Typography, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, Typography } from "@material-ui/core"; import { customAppAddUrl } from "@saleor/apps/urls"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; @@ -90,7 +84,7 @@ const CustomApps: React.FC = ({ ), () => ( - + = ({ /> - + ), )} diff --git a/src/apps/components/InstalledApps/InstalledApps.tsx b/src/apps/components/InstalledApps/InstalledApps.tsx index 17735c057..bd71a3e6d 100644 --- a/src/apps/components/InstalledApps/InstalledApps.tsx +++ b/src/apps/components/InstalledApps/InstalledApps.tsx @@ -3,7 +3,6 @@ import { Switch, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import { AppManifestTableDisplay } from "@saleor/apps/components/AppManifestTableDisplay/AppManifestTableDisplay"; @@ -128,7 +127,7 @@ const InstalledApps: React.FC = ({ ), () => ( - + = ({ /> - + ), )} diff --git a/src/attributes/components/AttributeList/AttributeList.tsx b/src/attributes/components/AttributeList/AttributeList.tsx index dfc8ea3d7..9f3fcaabd 100644 --- a/src/attributes/components/AttributeList/AttributeList.tsx +++ b/src/attributes/components/AttributeList/AttributeList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import { AttributeListUrlSortField, attributeUrl, @@ -168,9 +168,9 @@ const AttributeList: React.FC = ({ - + - + {renderCollection( @@ -242,14 +242,14 @@ const AttributeList: React.FC = ({ ); }, () => ( - + - + ), )} diff --git a/src/attributes/components/AttributeValues/AttributeValues.tsx b/src/attributes/components/AttributeValues/AttributeValues.tsx index 959c2d824..fce26a0e4 100644 --- a/src/attributes/components/AttributeValues/AttributeValues.tsx +++ b/src/attributes/components/AttributeValues/AttributeValues.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableCell, - TableFooter, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableCell, TableFooter, TableHead } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -14,6 +8,7 @@ import { SortableTableRow, } from "@saleor/components/SortableTable"; import TablePagination from "@saleor/components/TablePagination"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AttributeInputTypeEnum, AttributeValueFragment, @@ -130,7 +125,7 @@ const AttributeValues: React.FC = ({ /> - + {isSwatch && ( @@ -156,10 +151,10 @@ const AttributeValues: React.FC = ({ /> - + - + = ({ settings={settings} onUpdateListSettings={onUpdateListSettings} /> - + {renderCollection( @@ -211,7 +206,7 @@ const AttributeValues: React.FC = ({ ), () => ( - + = ({ description="No attribute values found" /> - + ), )} diff --git a/src/categories/components/CategoryList/CategoryList.tsx b/src/categories/components/CategoryList/CategoryList.tsx index 76bc109ae..2a7eb6adc 100644 --- a/src/categories/components/CategoryList/CategoryList.tsx +++ b/src/categories/components/CategoryList/CategoryList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import { CategoryListUrlSortField, categoryUrl } from "@saleor/categories/urls"; import Checkbox from "@saleor/components/Checkbox"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -132,13 +132,13 @@ const CategoryList: React.FC = props => { - + - + {renderCollection( @@ -188,7 +188,7 @@ const CategoryList: React.FC = props => { ); }, () => ( - + {isRoot ? ( = props => { /> )} - + ), )} diff --git a/src/categories/components/CategoryProductList/CategoryProductList.tsx b/src/categories/components/CategoryProductList/CategoryProductList.tsx index 5154e2546..716cffa43 100644 --- a/src/categories/components/CategoryProductList/CategoryProductList.tsx +++ b/src/categories/components/CategoryProductList/CategoryProductList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; @@ -96,9 +96,9 @@ export const CategoryProductList: React.FC = props => - + - + {renderCollection( @@ -133,14 +133,14 @@ export const CategoryProductList: React.FC = props => ); }, () => ( - + - + ), )} diff --git a/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx b/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx index 642fd7fc7..18d945f36 100644 --- a/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx +++ b/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableHead } from "@material-ui/core"; import { channelAddUrl, channelUrl } from "@saleor/channels/urls"; import { Backlink } from "@saleor/components/Backlink"; import { Button } from "@saleor/components/Button"; @@ -97,7 +91,7 @@ export const ChannelsListPage: React.FC = ({ - + = ({ description="table actions" /> - + {renderCollection( @@ -149,14 +143,14 @@ export const ChannelsListPage: React.FC = ({ ), () => ( - + - + ), )} diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index e9df2f462..29232e4a8 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import { CollectionListUrlSortField, collectionUrl, @@ -146,13 +146,13 @@ const CollectionList: React.FC = props => { - + - + {renderCollection( @@ -211,14 +211,14 @@ const CollectionList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/collections/components/CollectionProducts/CollectionProducts.tsx b/src/collections/components/CollectionProducts/CollectionProducts.tsx index ed3999e8a..5ee09aef1 100644 --- a/src/collections/components/CollectionProducts/CollectionProducts.tsx +++ b/src/collections/components/CollectionProducts/CollectionProducts.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import { ChannelsAvailabilityDropdown } from "@saleor/components/ChannelsAvailabilityDropdown"; @@ -150,9 +144,9 @@ const CollectionProducts: React.FC = props => { - + - + {renderCollection( @@ -215,14 +209,14 @@ const CollectionProducts: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx index df2948b6c..1aa0662c7 100644 --- a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx +++ b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx @@ -7,13 +7,13 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import ConfirmButton from "@saleor/components/ConfirmButton"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AvailableAttributeFragment } from "@saleor/graphql"; import useElementScroll, { isScrolledToBottom, @@ -170,7 +170,7 @@ const AssignAttributeDialog: React.FC = ({ ); return ( - attribute.id)}> + attribute.id)}> = ({ {attribute.slug} - + ); }, () => !loading && ( - + - + ), )} diff --git a/src/components/AssignContainerDialog/AssignContainerDialog.tsx b/src/components/AssignContainerDialog/AssignContainerDialog.tsx index d98d67d89..4d33c83c4 100644 --- a/src/components/AssignContainerDialog/AssignContainerDialog.tsx +++ b/src/components/AssignContainerDialog/AssignContainerDialog.tsx @@ -6,10 +6,10 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import useSearchQuery from "@saleor/hooks/useSearchQuery"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; import useScrollableDialogStyle from "@saleor/styles/useScrollableDialogStyle"; @@ -131,7 +131,7 @@ const AssignContainerDialog: React.FC = props => { ); return ( - + = props => { {container.name} - + ); })} diff --git a/src/components/AssignProductDialog/AssignProductDialog.tsx b/src/components/AssignProductDialog/AssignProductDialog.tsx index 714a2a851..a853528fa 100644 --- a/src/components/AssignProductDialog/AssignProductDialog.tsx +++ b/src/components/AssignProductDialog/AssignProductDialog.tsx @@ -6,12 +6,12 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, } from "@material-ui/core"; import ConfirmButton from "@saleor/components/ConfirmButton"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { SearchProductsQuery } from "@saleor/graphql"; import useModalDialogOpen from "@saleor/hooks/useModalDialogOpen"; import useSearchQuery from "@saleor/hooks/useSearchQuery"; @@ -148,7 +148,7 @@ const AssignProductDialog: React.FC = props => { const isSelected = productsDict[product.id] || false; return ( - @@ -168,7 +168,7 @@ const AssignProductDialog: React.FC = props => { onChange={() => handleChange(product.id)} /> - + ); })} diff --git a/src/components/AssignVariantDialog/AssignVariantDialog.tsx b/src/components/AssignVariantDialog/AssignVariantDialog.tsx index 1ad54eb52..f8df9ee04 100644 --- a/src/components/AssignVariantDialog/AssignVariantDialog.tsx +++ b/src/components/AssignVariantDialog/AssignVariantDialog.tsx @@ -6,7 +6,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -14,6 +13,7 @@ import ConfirmButton from "@saleor/components/ConfirmButton"; import Money from "@saleor/components/Money"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { SearchProductsQuery } from "@saleor/graphql"; import useSearchQuery from "@saleor/hooks/useSearchQuery"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; @@ -133,7 +133,7 @@ const AssignVariantDialog: React.FC = props => { productChoices, (product, productIndex) => ( - + = props => { {maybe(() => product.name)} - + {maybe(() => product.variants, []).map( (variant, variantIndex) => ( - @@ -206,7 +206,7 @@ const AssignVariantDialog: React.FC = props => { )} - + ), )} diff --git a/src/components/CountryList/CountryList.tsx b/src/components/CountryList/CountryList.tsx index de6d8ce9c..4d41233b1 100644 --- a/src/components/CountryList/CountryList.tsx +++ b/src/components/CountryList/CountryList.tsx @@ -1,9 +1,10 @@ -import { Card, TableBody, TableCell, TableRow } from "@material-ui/core"; +import { Card, TableBody, TableCell } from "@material-ui/core"; import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { CountryFragment } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import classNames from "classnames"; @@ -107,7 +108,7 @@ const CountryList: React.FC = props => { /> - + @@ -132,12 +133,12 @@ const CountryList: React.FC = props => { /> - + {!isCollapsed && renderCollection( sortCountries(countries), (country, countryIndex) => ( - + {maybe( () => ( @@ -167,14 +168,14 @@ const CountryList: React.FC = props => { - + ), () => ( - + {emptyText} - + ), )} diff --git a/src/components/Metadata/MetadataCard.tsx b/src/components/Metadata/MetadataCard.tsx index e27aa1537..6b9af4d5f 100644 --- a/src/components/Metadata/MetadataCard.tsx +++ b/src/components/Metadata/MetadataCard.tsx @@ -6,11 +6,11 @@ import { TableBody, TableCell, TableHead, - TableRow, TextField, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; +import TableRowLink from "@saleor/components/TableRowLink"; import { MetadataInput } from "@saleor/graphql"; import { FormChange } from "@saleor/hooks/useForm"; import { DeleteIcon, ExpandIcon, IconButton } from "@saleor/macaw-ui"; @@ -122,7 +122,7 @@ const MetadataCard: React.FC = ({ ) : ( - + = ({ description="table action" /> - + {data.map((field, fieldIndex) => ( - + = ({ - + ))}
diff --git a/src/components/TableCellHeader/TableCellHeader.stories.tsx b/src/components/TableCellHeader/TableCellHeader.stories.tsx index 63ae23d7e..66cabc945 100644 --- a/src/components/TableCellHeader/TableCellHeader.stories.tsx +++ b/src/components/TableCellHeader/TableCellHeader.stories.tsx @@ -1,11 +1,6 @@ -import { - Card, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableHead } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import { storiesOf } from "@storybook/react"; import React from "react"; @@ -29,7 +24,7 @@ const Story: React.FC = ({ - + = ({ > Type - + - + Apple Juice Juice - + diff --git a/src/components/TableHead/TableHead.tsx b/src/components/TableHead/TableHead.tsx index 2dd5493cb..949f1f7cb 100644 --- a/src/components/TableHead/TableHead.tsx +++ b/src/components/TableHead/TableHead.tsx @@ -1,10 +1,10 @@ import { TableCell, TableHead as MuiTableHead, - TableRow, Typography, } from "@material-ui/core"; import { TableHeadProps as MuiTableHeadProps } from "@material-ui/core/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { makeStyles } from "@saleor/macaw-ui"; import classNames from "classnames"; import React from "react"; @@ -84,7 +84,7 @@ const TableHead: React.FC = props => { return ( - + {dragRows && (items === undefined || items.length > 0) && } {(items === undefined || items.length > 0) && ( = props => { ) : ( children )} - + ); }; diff --git a/src/components/TableRowLink/TableRowLink.tsx b/src/components/TableRowLink/TableRowLink.tsx index 795c02d72..e2715996e 100644 --- a/src/components/TableRowLink/TableRowLink.tsx +++ b/src/components/TableRowLink/TableRowLink.tsx @@ -7,12 +7,12 @@ import { Link } from "react-router-dom"; type MaterialTableRowPropsType = TableRowTypeMap["props"]; -export interface TableRowLinkProps - extends Omit { +export interface TableRowLinkProps extends MaterialTableRowPropsType { children: React.ReactNode; href?: string; className?: string; linkClassName?: string; + onClick?: () => void; } const useStyles = makeStyles( @@ -29,16 +29,21 @@ const TableRowLink = ({ href, children, linkClassName, + onClick, ...props }: TableRowLinkProps) => { const classes = useStyles(); if (!href || isExternalURL(href)) { - return {children}; + return ( + + {children} + + ); } return ( - + {children} diff --git a/src/customers/components/CustomerList/CustomerList.tsx b/src/customers/components/CustomerList/CustomerList.tsx index b7ecebaf1..c109c3780 100644 --- a/src/customers/components/CustomerList/CustomerList.tsx +++ b/src/customers/components/CustomerList/CustomerList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import { useUserPermissions } from "@saleor/auth/hooks/useUserPermissions"; import Checkbox from "@saleor/components/Checkbox"; import RequirePermissions, { @@ -125,13 +125,13 @@ const CustomerList: React.FC = props => { - + - + {renderCollection( @@ -172,14 +172,14 @@ const CustomerList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/customers/components/CustomerOrders/CustomerOrders.tsx b/src/customers/components/CustomerOrders/CustomerOrders.tsx index 6e8db7c11..48cef4daa 100644 --- a/src/customers/components/CustomerOrders/CustomerOrders.tsx +++ b/src/customers/components/CustomerOrders/CustomerOrders.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableHead } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import { DateTime } from "@saleor/components/Date"; @@ -70,7 +64,7 @@ const CustomerOrders: React.FC = props => { /> - + = props => { description="order total amount" /> - + {renderCollection( @@ -147,14 +141,14 @@ const CustomerOrders: React.FC = props => { ), () => ( - + - + ), )} diff --git a/src/discounts/components/DiscountCategories/DiscountCategories.tsx b/src/discounts/components/DiscountCategories/DiscountCategories.tsx index fccb36463..5e160a89f 100644 --- a/src/discounts/components/DiscountCategories/DiscountCategories.tsx +++ b/src/discounts/components/DiscountCategories/DiscountCategories.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { categoryUrl } from "@saleor/categories/urls"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; @@ -90,9 +84,9 @@ const DiscountCategories: React.FC = props => { - + - + {renderCollection( @@ -143,11 +137,11 @@ const DiscountCategories: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/DiscountCollections/DiscountCollections.tsx b/src/discounts/components/DiscountCollections/DiscountCollections.tsx index 98ddef2ed..6edcba115 100644 --- a/src/discounts/components/DiscountCollections/DiscountCollections.tsx +++ b/src/discounts/components/DiscountCollections/DiscountCollections.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { collectionUrl } from "@saleor/collections/urls"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; @@ -88,9 +82,9 @@ const DiscountCollections: React.FC = props => { - + - + {renderCollection( @@ -143,11 +137,11 @@ const DiscountCollections: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx index 2866e3d19..4166941f5 100644 --- a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx +++ b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx @@ -5,7 +5,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -16,6 +15,7 @@ import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import { CountryWithCodeFragment } from "@saleor/graphql"; import { SubmitPromise } from "@saleor/hooks/useForm"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; @@ -130,7 +130,7 @@ const DiscountCountrySelectDialog: React.FC = const isChecked = countrySelectionMap[country.code]; return ( - + {country.country} @@ -163,7 +163,7 @@ const DiscountCountrySelectDialog: React.FC = } /> - + ); })} diff --git a/src/discounts/components/DiscountProducts/DiscountProducts.tsx b/src/discounts/components/DiscountProducts/DiscountProducts.tsx index 4e84e6ca4..f9892f432 100644 --- a/src/discounts/components/DiscountProducts/DiscountProducts.tsx +++ b/src/discounts/components/DiscountProducts/DiscountProducts.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import { ChannelsAvailabilityDropdown } from "@saleor/components/ChannelsAvailabilityDropdown"; @@ -97,9 +91,9 @@ const DiscountProducts: React.FC = props => { - + - + {renderCollection( @@ -164,11 +158,11 @@ const DiscountProducts: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/DiscountVariants/DiscountVariants.tsx b/src/discounts/components/DiscountVariants/DiscountVariants.tsx index a44744736..235e5e7d2 100644 --- a/src/discounts/components/DiscountVariants/DiscountVariants.tsx +++ b/src/discounts/components/DiscountVariants/DiscountVariants.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import Checkbox from "@saleor/components/Checkbox"; @@ -96,9 +90,9 @@ const DiscountVariants: React.FC = props => { - + - + {renderCollection( @@ -161,11 +155,11 @@ const DiscountVariants: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/SaleList/SaleList.tsx b/src/discounts/components/SaleList/SaleList.tsx index c293400e9..752d47b05 100644 --- a/src/discounts/components/SaleList/SaleList.tsx +++ b/src/discounts/components/SaleList/SaleList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import Date from "@saleor/components/Date"; import Money from "@saleor/components/Money"; @@ -170,13 +170,13 @@ const SaleList: React.FC = props => { - + - + {renderCollection( @@ -247,11 +247,11 @@ const SaleList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/SaleValue/SaleValue.tsx b/src/discounts/components/SaleValue/SaleValue.tsx index bce60f6ac..931a0d095 100644 --- a/src/discounts/components/SaleValue/SaleValue.tsx +++ b/src/discounts/components/SaleValue/SaleValue.tsx @@ -4,12 +4,12 @@ import { TableBody, TableCell, TableHead, - TableRow, Typography, } from "@material-ui/core"; import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { DiscountErrorFragment } from "@saleor/graphql"; import { renderCollection } from "@saleor/misc"; import { getFormErrors } from "@saleor/utils/errors"; @@ -94,7 +94,7 @@ const SaleValue: React.FC = ({ ); return ( - @@ -119,18 +119,18 @@ const SaleValue: React.FC = ({ )} - + ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/VoucherList/VoucherList.tsx b/src/discounts/components/VoucherList/VoucherList.tsx index 9923bfca9..84cb230eb 100644 --- a/src/discounts/components/VoucherList/VoucherList.tsx +++ b/src/discounts/components/VoucherList/VoucherList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import Date from "@saleor/components/Date"; import Money from "@saleor/components/Money"; @@ -224,13 +224,13 @@ const VoucherList: React.FC = props => { - + - + {renderCollection( @@ -324,14 +324,14 @@ const VoucherList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx index 273167f7d..e20d4cd11 100644 --- a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx +++ b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx @@ -3,7 +3,6 @@ import { CardContent, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -14,6 +13,7 @@ import RadioGroupField from "@saleor/components/RadioGroupField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ChannelInput } from "@saleor/discounts/handlers"; import { RequirementsPicker } from "@saleor/discounts/types"; import { DiscountErrorFragment } from "@saleor/graphql"; @@ -142,7 +142,7 @@ const VoucherRequirements = ({ id => id === listing.id, ); return ( - + {listing?.name || } @@ -174,18 +174,18 @@ const VoucherRequirements = ({ )} - + ); }, () => ( - + - + ), )} diff --git a/src/discounts/components/VoucherValue/VoucherValue.tsx b/src/discounts/components/VoucherValue/VoucherValue.tsx index 086a9c971..c881269f3 100644 --- a/src/discounts/components/VoucherValue/VoucherValue.tsx +++ b/src/discounts/components/VoucherValue/VoucherValue.tsx @@ -3,7 +3,6 @@ import { CardContent, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import CardTitle from "@saleor/components/CardTitle"; @@ -13,6 +12,7 @@ import RadioGroupField from "@saleor/components/RadioGroupField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import TextFieldWithChoice from "@saleor/components/TextFieldWithChoice"; import { ChannelInput } from "@saleor/discounts/handlers"; import { DiscountTypeEnum } from "@saleor/discounts/types"; @@ -103,7 +103,7 @@ const VoucherValue: React.FC = props => { id => id === listing.id, ); return ( - + {listing?.name || } @@ -150,18 +150,18 @@ const VoucherValue: React.FC = props => { )} - + ); }, () => ( - + - + ), )} diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx index a3dc5d50e..a70db746d 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableRow, - Typography, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, Typography } from "@material-ui/core"; import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer"; import Checkbox from "@saleor/components/Checkbox"; import DeleteIconButton from "@saleor/components/DeleteIconButton"; @@ -180,11 +174,11 @@ const GiftCardsListTable: React.FC = () => { ); }, () => ( - + - + ), )} diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx index 140e776cf..e7b0c3ddb 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx @@ -1,5 +1,6 @@ -import { TableFooter, TableRow } from "@material-ui/core"; +import { TableFooter } from "@material-ui/core"; import TablePagination from "@saleor/components/TablePagination"; +import TableRowLink from "@saleor/components/TableRowLink"; import usePaginator from "@saleor/hooks/usePaginator"; import React from "react"; @@ -23,14 +24,14 @@ const GiftCardsListTableFooter: React.FC = () => { return ( - + - + ); }; diff --git a/src/home/components/HomeProductListCard/HomeProductListCard.tsx b/src/home/components/HomeProductListCard/HomeProductListCard.tsx index cc6ee9537..4803739f3 100644 --- a/src/home/components/HomeProductListCard/HomeProductListCard.tsx +++ b/src/home/components/HomeProductListCard/HomeProductListCard.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableRow, - Typography, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, Typography } from "@material-ui/core"; import CardTitle from "@saleor/components/CardTitle"; import Money from "@saleor/components/Money"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -136,7 +130,7 @@ export const HomeProductList: React.FC = props => { ), () => ( - + = props => { /> - + ), )} diff --git a/src/navigation/components/MenuList/MenuList.tsx b/src/navigation/components/MenuList/MenuList.tsx index 07a009435..2efacd55c 100644 --- a/src/navigation/components/MenuList/MenuList.tsx +++ b/src/navigation/components/MenuList/MenuList.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import IconButtonTableCell from "@saleor/components/IconButtonTableCell"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -117,13 +111,13 @@ const MenuList: React.FC = props => { - + - + {renderCollection( @@ -169,14 +163,14 @@ const MenuList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx b/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx index a023e25f5..b7d20b76c 100644 --- a/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx +++ b/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx @@ -7,12 +7,12 @@ import { Radio, RadioGroup, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; import Debounce from "@saleor/components/Debounce"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderFulfillLineFragment, WarehouseFragment } from "@saleor/graphql"; import { buttonMessages } from "@saleor/intl"; import { @@ -160,7 +160,7 @@ export const OrderChangeWarehouseDialog: React.FC + )} - + ); })} diff --git a/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx b/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx index 5daf4fee4..5c63db3f6 100644 --- a/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx +++ b/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx @@ -1,12 +1,7 @@ -import { - TableBody, - TableCell, - TableHead, - TableRow, - Typography, -} from "@material-ui/core"; +import { TableBody, TableCell, TableHead, Typography } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderDetailsFragment, OrderErrorFragment } from "@saleor/graphql"; import { makeStyles } from "@saleor/macaw-ui"; import { @@ -84,7 +79,7 @@ const OrderDraftDetailsProducts: React.FC = prop {!!lines.length && ( - + @@ -112,7 +107,7 @@ const OrderDraftDetailsProducts: React.FC = prop /> - + )} @@ -136,7 +131,7 @@ const OrderDraftDetailsProducts: React.FC = prop )) ) : ( <> - + = prop )} - + )} diff --git a/src/orders/components/OrderDraftDetailsProducts/TableLine.tsx b/src/orders/components/OrderDraftDetailsProducts/TableLine.tsx index 96de5a1cf..766f74daf 100644 --- a/src/orders/components/OrderDraftDetailsProducts/TableLine.tsx +++ b/src/orders/components/OrderDraftDetailsProducts/TableLine.tsx @@ -1,8 +1,9 @@ -import { TableCell, TableRow, Typography } from "@material-ui/core"; +import { TableCell, Typography } from "@material-ui/core"; import Link from "@saleor/components/Link"; import Money from "@saleor/components/Money"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; import { AVATAR_MARGIN } from "@saleor/components/TableCellAvatar/Avatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderErrorFragment, OrderLineFragment, @@ -103,7 +104,7 @@ const TableLine: React.FC = ({ }; return ( - + = ({ - + ); }; diff --git a/src/orders/components/OrderDraftList/OrderDraftList.tsx b/src/orders/components/OrderDraftList/OrderDraftList.tsx index bcaa6f3ad..0e96114a5 100644 --- a/src/orders/components/OrderDraftList/OrderDraftList.tsx +++ b/src/orders/components/OrderDraftList/OrderDraftList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import { DateTime } from "@saleor/components/Date"; import Money from "@saleor/components/Money"; @@ -144,13 +144,13 @@ export const OrderDraftList: React.FC = props => { - + - + {renderCollection( @@ -213,14 +213,14 @@ export const OrderDraftList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/orders/components/OrderFulfillLine/OrderFulfillLine.tsx b/src/orders/components/OrderFulfillLine/OrderFulfillLine.tsx index e5c7a7184..a30cae278 100644 --- a/src/orders/components/OrderFulfillLine/OrderFulfillLine.tsx +++ b/src/orders/components/OrderFulfillLine/OrderFulfillLine.tsx @@ -1,6 +1,7 @@ -import { TableCell, TableRow, TextField, Typography } from "@material-ui/core"; +import { TableCell, TextField, Typography } from "@material-ui/core"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderFulfillLineFragment } from "@saleor/graphql"; import { FormsetChange, FormsetData } from "@saleor/hooks/useFormset"; import { @@ -60,7 +61,7 @@ export const OrderFulfillLine: React.FC = props => { if (!line) { return ( - + @@ -76,12 +77,12 @@ export const OrderFulfillLine: React.FC = props => { - + ); } return ( - + = props => { - + ); }; OrderFulfillLine.displayName = "OrderFulfillLine"; diff --git a/src/orders/components/OrderFulfillPage/OrderFulfillPage.tsx b/src/orders/components/OrderFulfillPage/OrderFulfillPage.tsx index 7c84c11a5..12db528d8 100644 --- a/src/orders/components/OrderFulfillPage/OrderFulfillPage.tsx +++ b/src/orders/components/OrderFulfillPage/OrderFulfillPage.tsx @@ -4,7 +4,6 @@ import { TableBody, TableCell, TableHead, - TableRow, } from "@material-ui/core"; import { Backlink } from "@saleor/components/Backlink"; import CardSpacer from "@saleor/components/CardSpacer"; @@ -16,6 +15,7 @@ import PageHeader from "@saleor/components/PageHeader"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Savebar from "@saleor/components/Savebar"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { FulfillOrderMutation, OrderErrorCode, @@ -227,7 +227,7 @@ const OrderFulfillPage: React.FC = props => { {order ? ( - + @@ -248,7 +248,7 @@ const OrderFulfillPage: React.FC = props => { - + {renderCollection( diff --git a/src/orders/components/OrderFulfillStockExceededDialog/OrderFulfillStockExceededDialog.tsx b/src/orders/components/OrderFulfillStockExceededDialog/OrderFulfillStockExceededDialog.tsx index 95141e6c4..c8305580a 100644 --- a/src/orders/components/OrderFulfillStockExceededDialog/OrderFulfillStockExceededDialog.tsx +++ b/src/orders/components/OrderFulfillStockExceededDialog/OrderFulfillStockExceededDialog.tsx @@ -1,13 +1,8 @@ -import { - TableBody, - TableCell, - TableHead, - TableRow, - Typography, -} from "@material-ui/core"; +import { TableBody, TableCell, TableHead, Typography } from "@material-ui/core"; import ActionDialog from "@saleor/components/ActionDialog"; import { CardSpacer } from "@saleor/components/CardSpacer"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import { FulfillmentFragment, OrderFulfillLineFragment } from "@saleor/graphql"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; import { renderCollection } from "@saleor/misc"; @@ -76,7 +71,7 @@ const OrderFulfillStockExceededDialog: React.FC {!!lines?.length && ( - + {intl.formatMessage(messages.productLabel)} @@ -86,7 +81,7 @@ const OrderFulfillStockExceededDialog: React.FC {intl.formatMessage(messages.warehouseStockLabel)} - + )} diff --git a/src/orders/components/OrderFulfillStockExceededDialogLine/OrderFulfillStockExceededDialogLine.tsx b/src/orders/components/OrderFulfillStockExceededDialogLine/OrderFulfillStockExceededDialogLine.tsx index 81db91143..921071b9a 100644 --- a/src/orders/components/OrderFulfillStockExceededDialogLine/OrderFulfillStockExceededDialogLine.tsx +++ b/src/orders/components/OrderFulfillStockExceededDialogLine/OrderFulfillStockExceededDialogLine.tsx @@ -1,5 +1,6 @@ -import { TableCell, TableRow, Typography } from "@material-ui/core"; +import { TableCell, Typography } from "@material-ui/core"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { FulfillmentFragment, OrderFulfillLineFragment } from "@saleor/graphql"; import { getAttributesCaption, @@ -33,7 +34,7 @@ const OrderFulfillStockExceededDialogLine: React.FC + {getOrderLineAvailableQuantity(line, stock)} - + ); }; diff --git a/src/orders/components/OrderFulfilledProductsCard/ExtraInfoLines.tsx b/src/orders/components/OrderFulfilledProductsCard/ExtraInfoLines.tsx index 94ebc27a7..c8d81bd18 100644 --- a/src/orders/components/OrderFulfilledProductsCard/ExtraInfoLines.tsx +++ b/src/orders/components/OrderFulfilledProductsCard/ExtraInfoLines.tsx @@ -1,4 +1,5 @@ -import { TableCell, TableRow, Typography } from "@material-ui/core"; +import { TableCell, Typography } from "@material-ui/core"; +import TableRowLink from "@saleor/components/TableRowLink"; import { FulfillmentStatus, OrderDetailsFragment } from "@saleor/graphql"; import { getStringOrPlaceholder } from "@saleor/misc"; import classNames from "classnames"; @@ -25,7 +26,7 @@ const ExtraInfoLines: React.FC = ({ fulfillment }) => { const { warehouse, trackingNumber, status } = fulfillment; return ( - + {warehouse && ( @@ -66,7 +67,7 @@ const ExtraInfoLines: React.FC = ({ fulfillment }) => { )} - + ); }; diff --git a/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx b/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx index 232d3892c..886670136 100644 --- a/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx +++ b/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx @@ -3,7 +3,6 @@ import { CardContent, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; @@ -11,6 +10,7 @@ import CardTitle from "@saleor/components/CardTitle"; import Date from "@saleor/components/Date"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { InvoiceFragment } from "@saleor/graphql"; import { buttonMessages } from "@saleor/intl"; import { makeStyles } from "@saleor/macaw-ui"; @@ -107,7 +107,7 @@ const OrderInvoiceList: React.FC = props => { {generatedInvoices.map(invoice => ( - + = props => { )} - + ))} diff --git a/src/orders/components/OrderList/OrderList.tsx b/src/orders/components/OrderList/OrderList.tsx index 92f1756c2..ec68808a3 100644 --- a/src/orders/components/OrderList/OrderList.tsx +++ b/src/orders/components/OrderList/OrderList.tsx @@ -3,7 +3,6 @@ import { TableCell, TableFooter, TableHead, - TableRow, } from "@material-ui/core"; import { CSSProperties } from "@material-ui/styles"; import { DateTime } from "@saleor/components/Date"; @@ -100,7 +99,7 @@ export const OrderList: React.FC = props => { return ( - + = props => { description="total order price" /> - + - + - + {renderCollection( @@ -256,14 +255,14 @@ export const OrderList: React.FC = props => { ), () => ( - + - + ), )} diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index 8a054b19e..ad03fb3ed 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -7,7 +7,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -17,6 +16,7 @@ import ConfirmButton from "@saleor/components/ConfirmButton"; import FormSpacer from "@saleor/components/FormSpacer"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderErrorFragment, SearchOrderVariantQuery } from "@saleor/graphql"; import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors"; import useModalDialogOpen from "@saleor/hooks/useModalDialogOpen"; @@ -158,7 +158,7 @@ const OrderProductAddDialog: React.FC = props => { productChoicesWithValidVariants, (product, productIndex) => ( - + = props => { {maybe(() => product.name)} - + {maybe(() => product.variants, []) .filter(isValidVariant) .map((variant, variantIndex) => ( - + = props => { - + ))} ), diff --git a/src/orders/components/OrderProductsCardElements/OrderProductsCardHeader.tsx b/src/orders/components/OrderProductsCardElements/OrderProductsCardHeader.tsx index 7d64ba8bb..9abcc4253 100644 --- a/src/orders/components/OrderProductsCardElements/OrderProductsCardHeader.tsx +++ b/src/orders/components/OrderProductsCardElements/OrderProductsCardHeader.tsx @@ -1,4 +1,5 @@ -import { TableCell, TableHead, TableRow } from "@material-ui/core"; +import { TableCell, TableHead } from "@material-ui/core"; +import TableRowLink from "@saleor/components/TableRowLink"; import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -65,7 +66,7 @@ const TableHeader = () => { - + { description="order line total price" /> - + ); diff --git a/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx b/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx index 44e89d850..5d4583f90 100644 --- a/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx +++ b/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx @@ -1,8 +1,9 @@ -import { TableCell, TableRow } from "@material-ui/core"; +import { TableCell } from "@material-ui/core"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; import { AVATAR_MARGIN } from "@saleor/components/TableCellAvatar/Avatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderDetailsFragment, OrderLineFragment } from "@saleor/graphql"; import { makeStyles } from "@saleor/macaw-ui"; import { maybe } from "@saleor/misc"; @@ -73,7 +74,7 @@ const TableLine: React.FC = ({ const quantityToDisplay = isOrderLine ? quantityToFulfill : quantity; return ( - + line.orderLine.thumbnail.url)} @@ -101,7 +102,7 @@ const TableLine: React.FC = ({ }} /> - + ); }; diff --git a/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx b/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx index 2ab0c59b0..55441c7fb 100644 --- a/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx +++ b/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx @@ -5,7 +5,6 @@ import { TableBody, TableCell, TableHead, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -14,6 +13,7 @@ import CardTitle from "@saleor/components/CardTitle"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderRefundDataQuery } from "@saleor/graphql"; import { FormsetChange } from "@saleor/hooks/useFormset"; import { makeStyles } from "@saleor/macaw-ui"; @@ -119,7 +119,7 @@ const OrderRefundFulfilledProducts: React.FC - + description="tabel column header" /> - + {renderCollection( @@ -162,7 +162,7 @@ const OrderRefundFulfilledProducts: React.FC Number(selectedLineQuantity?.value) < 0; return ( - + {line?.orderLine?.productName ? ( line?.orderLine?.productName @@ -230,18 +230,18 @@ const OrderRefundFulfilledProducts: React.FC /> )) || } - + ); }, () => ( - + - + ), )} diff --git a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx index 05e841b0b..0d407bd4b 100644 --- a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx +++ b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx @@ -5,7 +5,6 @@ import { TableBody, TableCell, TableHead, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -14,6 +13,7 @@ import CardTitle from "@saleor/components/CardTitle"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderRefundDataQuery } from "@saleor/graphql"; import { FormsetChange } from "@saleor/hooks/useFormset"; import { makeStyles } from "@saleor/macaw-ui"; @@ -116,7 +116,7 @@ const OrderRefundUnfulfilledProducts: React.FC
- + - + {renderCollection( @@ -160,7 +160,7 @@ const OrderRefundUnfulfilledProducts: React.FC + {line?.productName ? line?.productName : } @@ -224,18 +224,18 @@ const OrderRefundUnfulfilledProducts: React.FC )) || } - + ); }, () => ( - + - + ), )} diff --git a/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx b/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx index 44aabbbb9..c7983dbf0 100644 --- a/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx +++ b/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx @@ -5,12 +5,12 @@ import { TableBody, TableCell, TableHead, - TableRow, TextField, } from "@material-ui/core"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { OrderDetailsFragment, OrderErrorFragment, @@ -138,7 +138,7 @@ const ItemsCard: React.FC = ({ - + = ({ description="table column header" /> - + {renderCollection( @@ -204,7 +204,7 @@ const ItemsCard: React.FC = ({ : "50%"; return ( - + = ({ /> )} - + ); }, () => ( - + - + ), )} diff --git a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx index 6c5fbcd1c..bdec8bce1 100644 --- a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx +++ b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx @@ -1,4 +1,4 @@ -import { Card, TableCell, TableRow } from "@material-ui/core"; +import { Card, TableCell } from "@material-ui/core"; import { attributeUrl } from "@saleor/attributes/urls"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; @@ -11,6 +11,7 @@ import { } from "@saleor/components/SortableTable"; import { TableButtonWrapper } from "@saleor/components/TableButtonWrapper/TableButtonWrapper"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AttributeFragment, AttributeTypeEnum } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { renderCollection } from "@saleor/misc"; @@ -169,14 +170,14 @@ const PageTypeAttributes: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/pageTypes/components/PageTypeList/PageTypeList.tsx b/src/pageTypes/components/PageTypeList/PageTypeList.tsx index 50e4cd865..57fd04f17 100644 --- a/src/pageTypes/components/PageTypeList/PageTypeList.tsx +++ b/src/pageTypes/components/PageTypeList/PageTypeList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; @@ -78,12 +78,12 @@ const PageTypeList: React.FC = props => { - + - + {renderCollection( @@ -118,14 +118,14 @@ const PageTypeList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/pages/components/PageList/PageList.tsx b/src/pages/components/PageList/PageList.tsx index 0a397f143..a258af7cc 100644 --- a/src/pages/components/PageList/PageList.tsx +++ b/src/pages/components/PageList/PageList.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; @@ -132,14 +126,14 @@ const PageList: React.FC = props => { - + - + {renderCollection( @@ -196,14 +190,14 @@ const PageList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx b/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx index 02cd47a26..1206117cd 100644 --- a/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx +++ b/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx @@ -7,7 +7,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -16,6 +15,7 @@ import CardSpacer from "@saleor/components/CardSpacer"; import ConfirmButton from "@saleor/components/ConfirmButton"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { SearchStaffMembersQuery } from "@saleor/graphql"; import useElementScroll, { isScrolledToBottom, @@ -235,7 +235,7 @@ const AssignMembersDialog: React.FC = ({ ); return ( - + = ({ )} - + ); }, () => !loading && ( - + - + ), )} diff --git a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx index e13fd3306..a92832627 100644 --- a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx +++ b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx @@ -3,7 +3,6 @@ import { TableCell, TableFooter, TableHead, - TableRow, } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; @@ -71,7 +70,7 @@ const PermissionGroupList: React.FC = props => { return ( - + = props => { - + - + - + {renderCollection( @@ -158,14 +157,14 @@ const PermissionGroupList: React.FC = props => { ), () => ( - + - + ), )} diff --git a/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx b/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx index 7cf5d0e4f..9e444db5b 100644 --- a/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx +++ b/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx @@ -3,7 +3,6 @@ import { CardContent, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; @@ -13,6 +12,7 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableCellHeader from "@saleor/components/TableCellHeader"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { PermissionGroupMemberFragment } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { @@ -201,7 +201,7 @@ const PermissionGroupMemberList: React.FC = props => { const isSelected = user ? isChecked(user.id) : false; return ( - = props => { )} - + ); }, () => ( - + - + ), )} diff --git a/src/plugins/components/PluginsList/PluginsList.tsx b/src/plugins/components/PluginsList/PluginsList.tsx index a3e088de0..60f820532 100644 --- a/src/plugins/components/PluginsList/PluginsList.tsx +++ b/src/plugins/components/PluginsList/PluginsList.tsx @@ -1,7 +1,8 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import { TablePaginationWithContext } from "@saleor/components/TablePagination"; +import TableRowLink from "@saleor/components/TableRowLink"; import { PluginBaseFragment } from "@saleor/graphql"; import useNavigator from "@saleor/hooks/useNavigator"; import { EditIcon, makeStyles } from "@saleor/macaw-ui"; @@ -49,21 +50,21 @@ const PluginList: React.FC = props => { - + - + {renderCollection( plugins, plugin => plugin ? ( - = props => { - + ) : ( - + - + ), () => ( - + {intl.formatMessage({ id: "Co2U4u", defaultMessage: "No plugins found", })} - + ), )} diff --git a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx index b06a37540..5fca83cc8 100644 --- a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx +++ b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx @@ -1,4 +1,4 @@ -import { Card, TableCell, TableRow } from "@material-ui/core"; +import { Card, TableCell } from "@material-ui/core"; import { attributeUrl } from "@saleor/attributes/urls"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; @@ -11,6 +11,7 @@ import { } from "@saleor/components/SortableTable"; import { TableButtonWrapper } from "@saleor/components/TableButtonWrapper/TableButtonWrapper"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { AttributeFragment, ProductAttributeType } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { maybe, renderCollection } from "@saleor/misc"; @@ -183,14 +184,14 @@ const ProductTypeAttributes: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx index 142923fbd..b179e7f69 100644 --- a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx +++ b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx @@ -2,7 +2,6 @@ import { TableBody, TableCell, TableFooter, - TableRow, Typography, } from "@material-ui/core"; import Checkbox from "@saleor/components/Checkbox"; @@ -123,9 +122,9 @@ const ProductTypeList: React.FC = props => { - + - + {renderCollection( @@ -205,14 +204,14 @@ const ProductTypeList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx b/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx index b376d101a..2f0eebc2a 100644 --- a/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx +++ b/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx @@ -1,4 +1,4 @@ -import { Card, TableCell, TableRow, Tooltip } from "@material-ui/core"; +import { Card, TableCell, Tooltip } from "@material-ui/core"; import HelpOutline from "@material-ui/icons/HelpOutline"; import { attributeUrl } from "@saleor/attributes/urls"; import { Button } from "@saleor/components/Button"; @@ -12,6 +12,7 @@ import { } from "@saleor/components/SortableTable"; import { TableButtonWrapper } from "@saleor/components/TableButtonWrapper/TableButtonWrapper"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ProductAttributeType, ProductTypeDetailsQuery } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { maybe, renderCollection } from "@saleor/misc"; @@ -282,14 +283,14 @@ const ProductTypeVariantAttributes: React.FC ); }, () => ( - + - + ), )} diff --git a/src/products/components/ProductList/ProductList.tsx b/src/products/components/ProductList/ProductList.tsx index f24e3bf8a..c6535edbc 100644 --- a/src/products/components/ProductList/ProductList.tsx +++ b/src/products/components/ProductList/ProductList.tsx @@ -1,4 +1,4 @@ -import { TableBody, TableCell, TableFooter, TableRow } from "@material-ui/core"; +import { TableBody, TableCell, TableFooter } from "@material-ui/core"; import { ChannelsAvailabilityDropdown } from "@saleor/components/ChannelsAvailabilityDropdown"; import { getChannelAvailabilityColor, @@ -313,13 +313,13 @@ export const ProductList: React.FC = props => { - + - + {renderCollection( @@ -442,14 +442,14 @@ export const ProductList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/products/components/ProductStocks/ProductStocks.tsx b/src/products/components/ProductStocks/ProductStocks.tsx index 7c5ad53f8..aace7b7bc 100644 --- a/src/products/components/ProductStocks/ProductStocks.tsx +++ b/src/products/components/ProductStocks/ProductStocks.tsx @@ -10,7 +10,6 @@ import { TableBody, TableCell, TableHead, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -25,6 +24,7 @@ import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import Link from "@saleor/components/Link"; import PreviewPill from "@saleor/components/PreviewPill"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ProductErrorFragment, WarehouseFragment } from "@saleor/graphql"; import { FormChange, FormErrors } from "@saleor/hooks/useForm"; import { FormsetAtomicData, FormsetChange } from "@saleor/hooks/useFormset"; @@ -245,7 +245,7 @@ const ProductStocks: React.FC = ({ - + @@ -256,7 +256,7 @@ const ProductStocks: React.FC = ({ - + {renderCollection(stocks, (stock, index) => { @@ -265,7 +265,7 @@ const ProductStocks: React.FC = ({ ); return ( - + {stock.label} @@ -299,12 +299,12 @@ const ProductStocks: React.FC = ({ - + ); })} {warehousesToAssign.length > 0 && ( setExpansionState(false)}> - setExpansionState(!isExpanded)} > @@ -354,7 +354,7 @@ const ProductStocks: React.FC = ({ - + )} @@ -446,7 +446,7 @@ const ProductStocks: React.FC = ({ - + @@ -456,7 +456,7 @@ const ProductStocks: React.FC = ({ - + {renderCollection(productVariantChannelListings, listing => { @@ -465,7 +465,7 @@ const ProductStocks: React.FC = ({ } return ( - + {listing.name} @@ -498,7 +498,7 @@ const ProductStocks: React.FC = ({ value={listing?.preorderThreshold ?? ""} /> - + ); })} diff --git a/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx b/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx index d412ad497..4da005ad6 100644 --- a/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx +++ b/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx @@ -1,4 +1,4 @@ -import { Card, TableCell, TableRow } from "@material-ui/core"; +import { Card, TableCell } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -8,6 +8,7 @@ import { SortableTableRow, } from "@saleor/components/SortableTable"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ProductVariantCreateDataQuery, ProductVariantDetailsQuery, @@ -94,7 +95,7 @@ const ProductVariantNavigation: React.FC = props ); })} {!isCreate ? ( - + - + ) : ( - + = props - + )} diff --git a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx index 6e7be4e1a..31a7c76a9 100644 --- a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx +++ b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx @@ -4,7 +4,6 @@ import { TableBody, TableCell, TableHead, - TableRow, Typography, } from "@material-ui/core"; import { @@ -16,6 +15,7 @@ import CardTitle from "@saleor/components/CardTitle"; import PriceField from "@saleor/components/PriceField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ProductChannelListingErrorFragment } from "@saleor/graphql"; import { makeStyles } from "@saleor/macaw-ui"; import { renderCollection } from "@saleor/misc"; @@ -130,7 +130,7 @@ const ProductVariantPrice: React.FC = props => { - + = props => { description="tabel column header" /> - + {renderCollection( @@ -168,7 +168,7 @@ const ProductVariantPrice: React.FC = props => { ); return ( - + {listing?.name || } {listing ? ( @@ -230,18 +230,18 @@ const ProductVariantPrice: React.FC = props => { )} - + ); }, () => ( - + - + ), )} diff --git a/src/shipping/components/OrderValue/OrderValue.tsx b/src/shipping/components/OrderValue/OrderValue.tsx index 99c92e815..e2c33fb4c 100644 --- a/src/shipping/components/OrderValue/OrderValue.tsx +++ b/src/shipping/components/OrderValue/OrderValue.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableRow, - Typography, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, Typography } from "@material-ui/core"; import VerticalSpacer from "@saleor/apps/components/VerticalSpacer"; import { ChannelShippingData } from "@saleor/channels/utils"; import CardTitle from "@saleor/components/CardTitle"; @@ -12,6 +6,7 @@ import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import PriceField from "@saleor/components/PriceField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ShippingChannelsErrorFragment } from "@saleor/graphql"; import { ChangeEvent } from "@saleor/hooks/useForm"; import { @@ -138,7 +133,7 @@ export const OrderValue: React.FC = ({ ); return ( - + {channel.name} @@ -187,7 +182,7 @@ export const OrderValue: React.FC = ({ } /> - + ); })} diff --git a/src/shipping/components/PricingCard/PricingCard.tsx b/src/shipping/components/PricingCard/PricingCard.tsx index a0c8fa99e..dd3b3ff22 100644 --- a/src/shipping/components/PricingCard/PricingCard.tsx +++ b/src/shipping/components/PricingCard/PricingCard.tsx @@ -3,7 +3,6 @@ import { CardContent, TableBody, TableCell, - TableRow, Typography, } from "@material-ui/core"; import { ChannelShippingData } from "@saleor/channels/utils"; @@ -11,6 +10,7 @@ import CardTitle from "@saleor/components/CardTitle"; import PriceField from "@saleor/components/PriceField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import TableHead from "@saleor/components/TableHead"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ShippingChannelsErrorFragment } from "@saleor/graphql"; import { getFormChannelError, @@ -91,7 +91,7 @@ export const PricingCard: React.FC = ({ const error = getFormChannelError(formErrors.price, channel.id); return ( - + {channel.name} @@ -117,7 +117,7 @@ export const PricingCard: React.FC = ({ hint={error && getShippingErrorMessage(error, intl)} /> - + ); })} diff --git a/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx b/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx index e4247ded9..c823ecace 100644 --- a/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx +++ b/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx @@ -3,7 +3,6 @@ import { TableBody, TableCell, TableFooter, - TableRow, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; @@ -14,6 +13,7 @@ import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; import TableHead from "@saleor/components/TableHead"; import { TablePaginationWithContext } from "@saleor/components/TablePagination"; +import TableRowLink from "@saleor/components/TableRowLink"; import { ShippingZoneQuery } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { renderCollection } from "@saleor/misc"; @@ -108,27 +108,27 @@ const ShippingMethodProducts: React.FC = props => { - + - + )} {products?.length === 0 ? ( - + - + ) : ( renderCollection(products, product => { const isSelected = product ? isChecked(product.id) : false; return ( - + = props => { - + ); }) )} diff --git a/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx b/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx index bf0fd8575..19b95487f 100644 --- a/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx +++ b/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx @@ -7,7 +7,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, } from "@material-ui/core"; import BackButton from "@saleor/components/BackButton"; @@ -16,6 +15,7 @@ import ConfirmButton from "@saleor/components/ConfirmButton"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableCellAvatar from "@saleor/components/TableCellAvatar"; +import TableRowLink from "@saleor/components/TableRowLink"; import { SearchProductsQuery, ShippingPriceExcludeProductMutation, @@ -184,7 +184,7 @@ const ShippingMethodProductsAddDialog: React.FC - + {product?.name || } - + ); }, () => ( - + - + ), )} diff --git a/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx b/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx index cef106d57..34d721a2c 100644 --- a/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx +++ b/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx @@ -5,7 +5,6 @@ import { DialogTitle, TableBody, TableCell, - TableRow, TextField, Typography, } from "@material-ui/core"; @@ -16,6 +15,7 @@ import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; +import TableRowLink from "@saleor/components/TableRowLink"; import { CountryWithCodeFragment } from "@saleor/graphql"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; import { @@ -127,7 +127,7 @@ const ShippingZoneCountriesAssignDialog: React.FC - handleRestOfTheWorldChange( @@ -154,7 +154,7 @@ const ShippingZoneCountriesAssignDialog: React.FC - + @@ -173,7 +173,7 @@ const ShippingZoneCountriesAssignDialog: React.FC handleCountryChange(country.code, !isChecked) @@ -189,7 +189,7 @@ const ShippingZoneCountriesAssignDialog: React.FC - + ); })} diff --git a/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx b/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx index 15d939113..b35a0e22b 100644 --- a/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx +++ b/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx @@ -4,7 +4,6 @@ import { TableBody, TableCell, TableHead, - TableRow, Typography, } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; @@ -12,6 +11,7 @@ import CardTitle from "@saleor/components/CardTitle"; import RadioGroupField from "@saleor/components/RadioGroupField"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; +import TableRowLink from "@saleor/components/TableRowLink"; import { PostalCodeRuleInclusionTypeEnum, ShippingMethodTypeFragment, @@ -181,7 +181,7 @@ const ShippingZonePostalCodes: React.FC = ({ - + {postalCodes === undefined ? ( @@ -210,14 +210,14 @@ const ShippingZonePostalCodes: React.FC = ({ /> - + {expanded && ( {renderCollection( postalCodes, postalCodeRange => ( - + {getPostalCodeRangeLabel(postalCodeRange)} @@ -231,10 +231,10 @@ const ShippingZonePostalCodes: React.FC = ({ - + ), () => ( - + = ({ /> - + ), )} diff --git a/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx b/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx index 03eead705..8a8b3a025 100644 --- a/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx +++ b/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableHead, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableHead } from "@material-ui/core"; import EditIcon from "@material-ui/icons/Edit"; import CardTitle from "@saleor/components/CardTitle"; import IconButtonTableCell from "@saleor/components/IconButtonTableCell"; @@ -102,7 +96,7 @@ const ShippingZoneRates: React.FC = props => { /> - + = props => { - + {renderCollection( @@ -202,14 +196,14 @@ const ShippingZoneRates: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx b/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx index 79ae08efb..b2d20a352 100644 --- a/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx +++ b/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx @@ -1,10 +1,4 @@ -import { - Card, - TableBody, - TableCell, - TableFooter, - TableRow, -} from "@material-ui/core"; +import { Card, TableBody, TableCell, TableFooter } from "@material-ui/core"; import { Button } from "@saleor/components/Button"; import CardTitle from "@saleor/components/CardTitle"; import Checkbox from "@saleor/components/Checkbox"; @@ -113,14 +107,14 @@ const ShippingZonesList: React.FC = props => { - + - + {renderCollection( @@ -181,14 +175,14 @@ const ShippingZonesList: React.FC = props => { ); }, () => ( - + - + ), )} diff --git a/src/staff/components/StaffList/StaffList.tsx b/src/staff/components/StaffList/StaffList.tsx index 13adfc1b5..9d97b870f 100644 --- a/src/staff/components/StaffList/StaffList.tsx +++ b/src/staff/components/StaffList/StaffList.tsx @@ -3,7 +3,6 @@ import { TableCell, TableFooter, TableHead, - TableRow, Typography, } from "@material-ui/core"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; @@ -98,7 +97,7 @@ const StaffList: React.FC = props => { - + = props => { > - + - + - + {renderCollection( @@ -189,14 +188,14 @@ const StaffList: React.FC = props => { ), () => ( - + - + ), )} diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 08481806f..d79d82153 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -5965,7 +5965,7 @@ exports[`Storyshots Generics / EditableTableCell default 1`] = ` class="MuiTableBody-root-id" >