Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop

This commit is contained in:
a.bouhuolia
2021-11-11 17:20:57 +02:00
13 changed files with 43 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import ListSelect from "./ListSelect"; import intl from 'react-intl-universal';
import ListSelect from './ListSelect';
export default function DisplayNameList({ export default function DisplayNameList({
salutation, salutation,
@@ -9,25 +10,32 @@ export default function DisplayNameList({
...restProps ...restProps
}) { }) {
const formats = [ const formats = [
{ format: '{1} {2} {3}', values: [salutation, firstName, lastName], required: [1] }, {
format: '{1} {2} {3}',
values: [salutation, firstName, lastName],
required: [1],
},
{ format: '{1} {2}', values: [firstName, lastName], required: [] }, { format: '{1} {2}', values: [firstName, lastName], required: [] },
{ format: '{1}, {2}', values: [firstName, lastName], required: [1, 2] }, { format: '{1}, {2}', values: [firstName, lastName], required: [1, 2] },
{ format: '{1}', values: [company], required: [1] } { format: '{1}', values: [company], required: [1] },
]; ];
const formatOptions = formats const formatOptions = formats
.filter((format) => !format.values.some((value, index) => { .filter(
return !value && format.required.indexOf(index + 1) !== -1; (format) =>
})) !format.values.some((value, index) => {
return !value && format.required.indexOf(index + 1) !== -1;
}),
)
.map((formatOption) => { .map((formatOption) => {
const { format, values } = formatOption; const { format, values } = formatOption;
let label = format; let label = format;
values.forEach((value, index) => { values.forEach((value, index) => {
const replaceWith = (value || ''); const replaceWith = value || '';
label = label.replace(`{${index + 1}}`, replaceWith).trim(); label = label.replace(`{${index + 1}}`, replaceWith).trim();
}); });
return { label: label.replace(/\s+/g, " ") }; return { label: label.replace(/\s+/g, ' ') };
}); });
return ( return (
@@ -35,9 +43,9 @@ export default function DisplayNameList({
items={formatOptions} items={formatOptions}
selectedItemProp={'label'} selectedItemProp={'label'}
textProp={'label'} textProp={'label'}
defaultText={'Select display name as'} defaultText={intl.get('select_display_name_as')}
filterable={false} filterable={false}
{ ...restProps } {...restProps}
/> />
); );
} }

View File

@@ -25,7 +25,7 @@ export default function CustomersBalanceSummaryTable({
const columns = useCustomersSummaryColumns(); const columns = useCustomersSummaryColumns();
const rowClassNames = (row) => { const rowClassNames = (row) => {
return [`row-type--${row.original.rowTypes}`]; return [`row-type--${row.original.row_types}`];
}; };
return ( return (

View File

@@ -31,7 +31,7 @@ export default function CustomersTransactionsTable({
]); ]);
const rowClassNames = (row) => { const rowClassNames = (row) => {
return [`row-type--${row.original.rowTypes}`]; return [`row-type--${row.original.row_types}`];
}; };
return ( return (

View File

@@ -22,14 +22,14 @@ export const useCustomersTransactionsColumns = () => {
return ( return (
<span <span
className={'force-width'} className={'force-width'}
style={{ minWidth: getForceWidth(cells[0].key) }} style={{ minWidth: getForceWidth(cells[0].value) }}
> >
{cells[0].value} {cells[0].value}
</span> </span>
); );
}, },
className: 'customer_name', className: 'customer_name',
textOverview: true, // textOverview: true,
}, },
{ {
Header: intl.get('account_name'), Header: intl.get('account_name'),

View File

@@ -35,7 +35,7 @@ export function useGeneralLedgerTableColumns() {
return row.date; return row.date;
}, },
className: 'date', className: 'date',
textOverview: true, // textOverview: true,
width: 120, width: 120,
}, },
{ {

View File

@@ -29,7 +29,7 @@ export default function InventoryItemDetailsTable({
); );
const rowClassNames = (row) => { const rowClassNames = (row) => {
return [`row-type--${row.original.rowTypes}`]; return [`row-type--${row.original.row_types}`];
}; };
return ( return (

View File

@@ -9,7 +9,7 @@ const columnsMapper = (data, index, column) => ({
id: column.key, id: column.key,
key: column.key, key: column.key,
Header: column.label, Header: column.label,
// Cell: CellForceWidth, Cell: CellForceWidth,
accessor: `cells[${index}].value`, accessor: `cells[${index}].value`,
forceWidthAccess: `cells[0].value`, forceWidthAccess: `cells[0].value`,
className: column.key, className: column.key,

View File

@@ -25,7 +25,7 @@ export default function VendorsBalanceSummaryTable({
const columns = useVendorsBalanceColumns(); const columns = useVendorsBalanceColumns();
const rowClassNames = (row) => { const rowClassNames = (row) => {
return [`row-type--${row.original.rowTypes}`]; return [`row-type--${row.original.row_types}`];
}; };
return ( return (

View File

@@ -32,7 +32,7 @@ export default function VendorsTransactionsTable({
]); ]);
const rowClassNames = (row) => { const rowClassNames = (row) => {
return [`row-type--${row.original.rowTypes}`]; return [`row-type--${row.original.row_types}`];
}; };
return ( return (

View File

@@ -21,14 +21,14 @@ export const useVendorsTransactionsColumns = () => {
return ( return (
<span <span
className={'force-width'} className={'force-width'}
style={{ minWidth: getForceWidth(cells[0].key) }} style={{ minWidth: getForceWidth(cells[0].value) }}
> >
{cells[0].value} {cells[0].value}
</span> </span>
); );
}, },
className: 'vendor_name', className: 'vendor_name',
textOverview: true, // textOverview: true,
// width: 240, // width: 240,
}, },
{ {

View File

@@ -10,7 +10,11 @@
} }
.tbody { .tbody {
.tr:not(.no-results) { .tr:not(.no-results) {
&.row-type--CASH_END_PERIOD{ // &.row-type--AGGREGATE,
&.row-type--ACCOUNTS {
border-top: 1px solid #bbb;
}
&.row-type--CASH_END_PERIOD {
border-bottom: 3px double #333; border-bottom: 3px double #333;
} }
.td { .td {
@@ -30,7 +34,7 @@
.tr.is-expanded { .tr.is-expanded {
.td.total, .td.total,
.td.date-period{ .td.date-period {
.cell-inner { .cell-inner {
display: none; display: none;
} }

View File

@@ -11,6 +11,10 @@
} }
.tbody { .tbody {
.tr:not(.no-results) { .tr:not(.no-results) {
&.row-type--CUSTOMER,
&.row-type--VENDOR {
border-top: 1px solid #BBB
}
.td { .td {
border-bottom: 0; border-bottom: 0;
padding-top: 0.4rem; padding-top: 0.4rem;

View File

@@ -64,12 +64,11 @@
display: none; display: none;
} }
} }
} &:not(:first-child).is-expanded .td {
&--CUSTOMER:last-child { border-top: 1px solid #ddd;
.td {
border-bottom: 1px solid #ddd;
} }
} }
&--CUSTOMER:last-child,
&--VENDOR:last-child { &--VENDOR:last-child {
.td { .td {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;