From ede1026a09d42b6fb3a46360fcb7e037aad4436e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dro=C5=84?= Date: Tue, 26 Apr 2022 15:30:51 +0200 Subject: [PATCH] Fix invalid select header in vouchers (#1992) * Fix selected header width in vouchers * Update snapshots * Change number of columns in customer list to correct value * Update snapshots * Same fix in navigation view * Update snapshots * Remove redundant import --- .../components/CustomerList/CustomerList.tsx | 14 +++++++------- .../components/VoucherList/VoucherList.tsx | 5 ++--- src/navigation/components/MenuList/MenuList.tsx | 5 ++--- src/navigation/views/MenuList/MenuList.tsx | 12 +++++++----- src/storybook/__snapshots__/Stories.test.ts.snap | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/customers/components/CustomerList/CustomerList.tsx b/src/customers/components/CustomerList/CustomerList.tsx index 0e4fafefc..8b2f1b22e 100644 --- a/src/customers/components/CustomerList/CustomerList.tsx +++ b/src/customers/components/CustomerList/CustomerList.tsx @@ -48,8 +48,6 @@ export interface CustomerListProps customers: RelayToFlat; } -const numberOfColumns = 3; - const CustomerList: React.FC = props => { const { settings, @@ -71,16 +69,18 @@ const CustomerList: React.FC = props => { const userPermissions = useUserPermissions(); + const numberOfColumns = hasPermissions(userPermissions, [ + PermissionEnum.MANAGE_ORDERS + ]) + ? 4 + : 3; + const classes = useStyles(props); return ( = props => { const { @@ -218,7 +217,7 @@ const VoucherList: React.FC = props => { = props => { const { @@ -125,7 +124,7 @@ const MenuList: React.FC = props => { = ({ params }) => { toggle={toggle} toggleAll={toggleAll} toolbar={ - + + } />
No customers found @@ -100948,7 +100948,7 @@ exports[`Storyshots Views / Discounts / Voucher list no data 1`] = ` >
No vouchers found @@ -105723,7 +105723,7 @@ exports[`Storyshots Views / Navigation / Menu list no data 1`] = ` >
No menus found