diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index d46c53de0..a80b9cd50 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -51,7 +51,7 @@ interface CollectionListProps collections: CollectionList_collections_edges_node[]; } -const numberOfColumns = 5; +const numberOfColumns = 4; const CollectionList: React.FC = props => { const { diff --git a/src/components/AssignProductDialog/AssignProductDialog.tsx b/src/components/AssignProductDialog/AssignProductDialog.tsx index 7c40a65ae..92a2a9a0c 100644 --- a/src/components/AssignProductDialog/AssignProductDialog.tsx +++ b/src/components/AssignProductDialog/AssignProductDialog.tsx @@ -32,11 +32,16 @@ export interface FormData { const useStyles = makeStyles( { avatar: { - "&:first-child": { + "&&:first-child": { paddingLeft: 0 - } + }, + width: 72 }, checkboxCell: { + paddingLeft: 0, + width: 88 + }, + colName: { paddingLeft: 0 }, overflow: { @@ -44,10 +49,6 @@ const useStyles = makeStyles( }, scrollArea: { overflowY: "scroll" - }, - wideCell: { - paddingLeft: 0, - width: "100%" } }, { name: "AssignProductDialog" } @@ -148,7 +149,7 @@ const AssignProductDialog: React.FC = props => { className={classes.avatar} thumbnail={maybe(() => product.thumbnail.url)} /> - + {product.name} ({ + alignRight: { + justifyContent: "flex-end" + }, avatar: { background: "none", border: `1px solid ${theme.palette.divider}`, @@ -39,21 +42,33 @@ const useStyles = makeStyles( { name: "TableCellAvatar" } ); -interface TableCellAvatarProps { +interface TableCellAvatarProps extends TableCellProps { className?: string; thumbnail?: string; + alignRight?: boolean; avatarProps?: string; children?: React.ReactNode | React.ReactNodeArray; } const TableCellAvatar: React.FC = props => { - const { children, className, thumbnail, avatarProps, ...rest } = props; + const { + children, + className, + alignRight, + thumbnail, + avatarProps, + ...rest + } = props; const classes = useStyles(props); return ( -
+
{thumbnail === undefined ? ( @@ -68,7 +83,7 @@ const TableCellAvatar: React.FC = props => { src={thumbnail} /> )} -
{children}
+ {!alignRight &&
{children}
}
); diff --git a/src/components/TableHead/TableHead.tsx b/src/components/TableHead/TableHead.tsx index f382fa1c7..da846e74e 100644 --- a/src/components/TableHead/TableHead.tsx +++ b/src/components/TableHead/TableHead.tsx @@ -63,6 +63,14 @@ const useStyles = makeStyles( { name: "TableHead" } ); +function getColSpan(colSpan: number, dragRows: boolean): number { + if (dragRows) { + return colSpan - 2; + } + + return colSpan - 1; +} + const TableHead: React.FC = props => { const { children, @@ -107,7 +115,7 @@ const TableHead: React.FC = props => { <>
{selected && ( diff --git a/src/discounts/components/DiscountCategories/DiscountCategories.tsx b/src/discounts/components/DiscountCategories/DiscountCategories.tsx index 419d68187..ddf81ad16 100644 --- a/src/discounts/components/DiscountCategories/DiscountCategories.tsx +++ b/src/discounts/components/DiscountCategories/DiscountCategories.tsx @@ -28,23 +28,24 @@ export interface DiscountCategoriesProps extends ListProps, ListActions { } const useStyles = makeStyles( - theme => ({ - iconCell: { + { + colActions: { "&:last-child": { paddingRight: 0 }, - width: 48 + theme.spacing(0.5) + width: 80 + }, + colName: { + width: "auto" + }, + colProducts: { + textAlign: "right", + width: 140 }, tableRow: { cursor: "pointer" - }, - textRight: { - textAlign: "right" - }, - wideColumn: { - width: "60%" } - }), + }, { name: "DiscountCategories" } ); @@ -52,8 +53,7 @@ const numberOfColumns = 4; const DiscountCategories: React.FC = props => { const { - discount: sale, - + discount, disabled, pageInfo, onCategoryAssign, @@ -88,19 +88,25 @@ const DiscountCategories: React.FC = props => { } /> + + + + + + sale.categories.edges.map(edge => edge.node))} + items={maybe(() => discount.categories.edges.map(edge => edge.node))} toggleAll={toggleAll} toolbar={toolbar} > <> - + - + = props => { {renderCollection( - maybe(() => sale.categories.edges.map(edge => edge.node)), + maybe(() => discount.categories.edges.map(edge => edge.node)), category => { const isSelected = category ? isChecked(category.id) : false; @@ -147,13 +153,13 @@ const DiscountCategories: React.FC = props => { {maybe(() => category.name, )} - + {maybe( () => category.products.totalCount, )} - + { diff --git a/src/discounts/components/DiscountCollections/DiscountCollections.tsx b/src/discounts/components/DiscountCollections/DiscountCollections.tsx index 1525ae8e8..4d61dfd7b 100644 --- a/src/discounts/components/DiscountCollections/DiscountCollections.tsx +++ b/src/discounts/components/DiscountCollections/DiscountCollections.tsx @@ -28,23 +28,25 @@ export interface DiscountCollectionsProps extends ListProps, ListActions { } const useStyles = makeStyles( - theme => ({ - iconCell: { + { + colActions: { "&:last-child": { paddingRight: 0 }, - width: 48 + theme.spacing(0.5) + width: 80 + }, + colName: { + width: "auto" + }, + colProducts: { + textAlign: "right", + width: 140 }, tableRow: { cursor: "pointer" }, - textRight: { - textAlign: "right" - }, - wideColumn: { - width: "60%" - } - }), + textRight: {} + }, { name: "DiscountCollections" } ); @@ -88,6 +90,12 @@ const DiscountCollections: React.FC = props => { } /> + + + + + + = props => { toggleAll={toggleAll} toolbar={toolbar} > - + @@ -141,19 +149,19 @@ const DiscountCollections: React.FC = props => { onChange={() => toggle(collection.id)} /> - + {maybe( () => collection.name, )} - + {maybe( () => collection.products.totalCount, )} - + { diff --git a/src/discounts/components/DiscountProducts/DiscountProducts.tsx b/src/discounts/components/DiscountProducts/DiscountProducts.tsx index 8f3d51b38..e4d682400 100644 --- a/src/discounts/components/DiscountProducts/DiscountProducts.tsx +++ b/src/discounts/components/DiscountProducts/DiscountProducts.tsx @@ -44,7 +44,7 @@ const useStyles = makeStyles( width: "auto" }, colNameLabel: { - marginLeft: AVATAR_MARGIN + marginLeft: AVATAR_MARGIN + theme.spacing(3) }, colPublished: { width: 150 @@ -102,6 +102,13 @@ const DiscountProducts: React.FC = props => { } /> + + + + + + + = props => { description="product is published" /> - + diff --git a/src/discounts/components/VoucherList/VoucherList.tsx b/src/discounts/components/VoucherList/VoucherList.tsx index 4733999a7..db0536d7a 100644 --- a/src/discounts/components/VoucherList/VoucherList.tsx +++ b/src/discounts/components/VoucherList/VoucherList.tsx @@ -17,6 +17,7 @@ import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps, SortPage } from "@saleor/types"; import { DiscountValueTypeEnum } from "@saleor/types/globalTypes"; import { getArrowDirection } from "@saleor/utils/sort"; +import { getFooterColSpanWithBulkActions } from "@saleor/utils/tables"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -78,7 +79,7 @@ const useStyles = makeStyles( { name: "VoucherList" } ); -const numberOfColumns = 7; +const numberOfColumns = 6; const VoucherList: React.FC = props => { const { @@ -130,6 +131,7 @@ const VoucherList: React.FC = props => { ? getArrowDirection(sort.asc) : undefined } + textAlign="right" onClick={() => onSort(VoucherListUrlSortField.minSpent)} className={classes.colMinSpent} > @@ -144,6 +146,7 @@ const VoucherList: React.FC = props => { ? getArrowDirection(sort.asc) : undefined } + textAlign="right" onClick={() => onSort(VoucherListUrlSortField.startDate)} className={classes.colStart} > @@ -158,6 +161,7 @@ const VoucherList: React.FC = props => { ? getArrowDirection(sort.asc) : undefined } + textAlign="right" onClick={() => onSort(VoucherListUrlSortField.endDate)} className={classes.colEnd} > @@ -172,6 +176,7 @@ const VoucherList: React.FC = props => { ? getArrowDirection(sort.asc) : undefined } + textAlign="right" onClick={() => onSort(VoucherListUrlSortField.value)} className={classes.colValue} > @@ -186,6 +191,7 @@ const VoucherList: React.FC = props => { ? getArrowDirection(sort.asc) : undefined } + textAlign="right" onClick={() => onSort(VoucherListUrlSortField.limit)} className={classes.colUses} > @@ -195,7 +201,7 @@ const VoucherList: React.FC = props => { = props => { })} /> + + + + + {renderCollection( topProducts, @@ -79,7 +88,7 @@ export const HomeProductList: React.FC = props => { } > variant.product.thumbnail.url)} avatarProps={classes.avatarProps} /> @@ -127,7 +136,7 @@ export const HomeProductList: React.FC = props => { ), () => ( - + = props => { const { @@ -116,12 +120,12 @@ const MenuList: React.FC = props => { id="menuListItems" /> - + = props => { )} onDelete(menu.id)} > diff --git a/src/orders/components/OrderFulfillment/OrderFulfillment.tsx b/src/orders/components/OrderFulfillment/OrderFulfillment.tsx index 52ec5e04b..89b79e46d 100644 --- a/src/orders/components/OrderFulfillment/OrderFulfillment.tsx +++ b/src/orders/components/OrderFulfillment/OrderFulfillment.tsx @@ -82,7 +82,7 @@ interface OrderFulfillmentProps { onTrackingCodeAdd: () => void; } -const numberOfColumns = 4; +const numberOfColumns = 5; const OrderFulfillment: React.FC = props => { const { diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index 0330b72ee..53e588717 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -38,7 +38,8 @@ import { const useStyles = makeStyles( theme => ({ avatar: { - paddingLeft: 0 + paddingLeft: 0, + width: 64 }, colName: { paddingLeft: 0 diff --git a/src/plugins/components/PluginsList/PluginsList.tsx b/src/plugins/components/PluginsList/PluginsList.tsx index 37528e7c2..a6d633ba4 100644 --- a/src/plugins/components/PluginsList/PluginsList.tsx +++ b/src/plugins/components/PluginsList/PluginsList.tsx @@ -28,18 +28,16 @@ export interface PluginListProps const useStyles = makeStyles( theme => ({ - [theme.breakpoints.up("lg")]: { - colAction: { - "& svg": { - color: theme.palette.primary.main - }, - textAlign: "right" as "right" + colAction: { + "& svg": { + color: theme.palette.primary.main }, - colActive: {}, - colName: {} + textAlign: "right", + width: 200 + }, + colActive: { + width: 200 }, - colAction: {}, - colActive: {}, colName: {}, link: { cursor: "pointer" @@ -48,7 +46,7 @@ const useStyles = makeStyles( { name: "PluginsList" } ); -const numberOfColumns = 4; +const numberOfColumns = 3; const PluginList: React.FC = props => { const { diff --git a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx index 0487366bc..defe87b39 100644 --- a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx +++ b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx @@ -26,16 +26,19 @@ import { } from "../../types/ProductTypeDetails"; const useStyles = makeStyles( - theme => ({ - colName: {}, - colSlug: { - width: 300 - }, - iconCell: { + { + colAction: { "&:last-child": { paddingRight: 0 }, - width: 48 + theme.spacing(1.5) + width: 80 + }, + colGrab: { + width: 60 + }, + colName: {}, + colSlug: { + width: 300 }, link: { cursor: "pointer" @@ -43,7 +46,7 @@ const useStyles = makeStyles( textLeft: { textAlign: "left" } - }), + }, { name: "ProductTypeAttributes" } ); @@ -115,6 +118,13 @@ const ProductTypeAttributes: React.FC = props => { } /> + + + + + + + = props => { )} - + onAttributeUnassign(attribute.id) diff --git a/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx b/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx index 39ac8e6b2..1b73f0c4f 100644 --- a/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx +++ b/src/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx @@ -22,13 +22,18 @@ import { ProductVariantDetails_productVariant } from "../../types/ProductVariant const useStyles = makeStyles( theme => ({ + colAvatar: { + width: 64 + }, colName: { - paddingLeft: 0, - textAlign: [["left"], "!important"] as any + paddingLeft: 0 }, link: { cursor: "pointer" }, + noHandle: { + textAlign: "right" + }, tabActive: { "& > td:first-child": { "&:before": { @@ -92,6 +97,7 @@ const ProductVariantNavigation: React.FC = props onClick={variant ? () => onRowClick(variant.id) : undefined} > variant.images[0].url, fallbackThumbnail @@ -115,8 +121,17 @@ const ProductVariantNavigation: React.FC = props ) : ( - - + + = props => { )} {hasVariants && ( + + + + + + + + ({ - [theme.breakpoints.up("lg")]: { - colCountries: {}, - colName: { width: 200 } - }, - alignRight: { + colAction: { "&:last-child": { paddingRight: theme.spacing(1) }, - width: ICONBUTTON_SIZE + theme.spacing(0.5) + width: 80 + }, + colCountries: { + width: 180 }, - colCountries: {}, colName: { paddingLeft: 0 }, @@ -49,7 +47,7 @@ const useStyles = makeStyles( { name: "ShippingZonesList" } ); -const numberOfColumns = 4; +const numberOfColumns = 3; const ShippingZonesList: React.FC = props => { const { @@ -108,12 +106,15 @@ const ShippingZonesList: React.FC = props => { - + = props => { )} - + { staffMembers: StaffList_staffUsers_edges_node[]; } +const numberOfColumns = 2; + const StaffList: React.FC = props => { const { settings, @@ -119,7 +121,7 @@ const StaffList: React.FC = props => {
No collections found @@ -65508,6 +65508,18 @@ exports[`Storyshots Views / Discounts / Sale details collections 1`] = ` + + + + + + @@ -65550,7 +65562,7 @@ exports[`Storyshots Views / Discounts / Sale details collections 1`] = ` + + + + + @@ -66357,13 +66381,13 @@ exports[`Storyshots Views / Discounts / Sale details default 1`] = ` + + + + + @@ -67174,13 +67210,13 @@ exports[`Storyshots Views / Discounts / Sale details form errors 1`] = ` + + + + + @@ -68004,13 +68052,13 @@ exports[`Storyshots Views / Discounts / Sale details loading 1`] = ` + + + + + + @@ -68863,7 +68926,7 @@ exports[`Storyshots Views / Discounts / Sale details products 1`] = ` Published @@ -76528,7 +76591,7 @@ exports[`Storyshots Views / Discounts / Voucher list default 1`] = ` scope="col" >
@@ -78042,6 +78105,15 @@ exports[`Storyshots Views / HomePage default 1`] = `
Collection name @@ -65685,17 +65697,17 @@ exports[`Storyshots Views / Discounts / Sale details collections 1`] = ` Winter Collection 110
Category name Products @@ -66497,12 +66521,12 @@ exports[`Storyshots Views / Discounts / Sale details default 1`] = ` Apparel 18
Category name Products @@ -67314,12 +67350,12 @@ exports[`Storyshots Views / Discounts / Sale details form errors 1`] = ` Apparel 18
Category name Products @@ -68151,7 +68199,7 @@ exports[`Storyshots Views / Discounts / Sale details loading 1`] = `
No vouchers found
+ + + + + @@ -78049,7 +78121,7 @@ exports[`Storyshots Views / HomePage default 1`] = ` class="MuiTableRow-root-id HomeProductListCard-tableRow-id MuiTableRow-hover-id" > + + + + @@ -78750,7 +78831,7 @@ exports[`Storyshots Views / HomePage loading 1`] = ` class="MuiTableRow-root-id" > + + + + @@ -79117,6 +79207,7 @@ exports[`Storyshots Views / HomePage no data 1`] = ` > @@ -82028,7 +82119,7 @@ exports[`Storyshots Views / Navigation / Menu list default 1`] = ` 3 @@ -82449,7 +82540,7 @@ exports[`Storyshots Views / Navigation / Menu list loading 1`] = ` @@ -82594,7 +82685,7 @@ exports[`Storyshots Views / Navigation / Menu list no data 1`] = ` > @@ -87381,7 +87472,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` > @@ -126330,6 +126421,21 @@ exports[`Storyshots Views / Product types / Product type details default 1`] = `
+
+
No menus found
No plugins found
+ + + + + + + @@ -126485,7 +126591,7 @@ exports[`Storyshots Views / Product types / Product type details default 1`] = ` author + + + + + + @@ -127523,7 +127644,7 @@ exports[`Storyshots Views / Product types / Product type details form errors 1`] author + + + + + + @@ -128574,7 +128710,7 @@ exports[`Storyshots Views / Product types / Product type details loading 1`] = ` + + + + + + @@ -140711,10 +140862,11 @@ exports[`Storyshots Views / Products / Create product variant add first variant class="MuiTableRow-root-id" > @@ -141513,7 +141661,7 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = ` @@ -142408,7 +142553,7 @@ exports[`Storyshots Views / Products / Create product variant when loading data @@ -143194,7 +143336,7 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] = @@ -145124,6 +145263,24 @@ Ctrl + K"
-
New Variant
-
New Variant
-
New Variant
-
New Variant
+ + + + + + + + @@ -147425,6 +147582,24 @@ Ctrl + K"
+ + + + + + + + @@ -155128,6 +155303,24 @@ Ctrl + K"
+ + + + + + + + @@ -159057,6 +159250,24 @@ Ctrl + K"
+ + + + + + + + @@ -169818,7 +170029,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors @@ -176406,7 +176617,7 @@ exports[`Storyshots Views / Shipping / Shipping zones list default 1`] = ` 51 @@ -177142,7 +177353,7 @@ exports[`Storyshots Views / Shipping / Shipping zones list loading 1`] = ` @@ -177382,7 +177593,7 @@ exports[`Storyshots Views / Shipping / Shipping zones list no data 1`] = ` > @@ -177737,7 +177948,7 @@ exports[`Storyshots Views / Shipping / Shipping zones list no site settings perm Countries @@ -177906,7 +178117,7 @@ exports[`Storyshots Views / Shipping / Shipping zones list no site settings perm 51
No shipping zones found