feat: Optimize SCSS architecture.

This commit is contained in:
a.bouhuolia
2021-01-17 12:17:15 +02:00
parent a747750d88
commit 09db5df686
154 changed files with 2814 additions and 2772 deletions

View File

@@ -14,6 +14,8 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/ManualJournal/MakeJournal.scss'
function MakeJournalEntriesPage({
// #withCustomersActions
requestFetchCustomers,

View File

@@ -1,17 +1,12 @@
import React, { useState, useMemo, useEffect, useCallback } from 'react';
import { Button, Tooltip, Position, Intent } from '@blueprintjs/core';
import { Button } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { omit } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import DataTable from 'components/DataTable';
import {
compose,
formattedAmount,
transformUpdatedRows,
saveInvoke,
} from 'utils';
import { compose, transformUpdatedRows, saveInvoke } from 'utils';
import {
AccountsListFieldCell,
MoneyFieldCell,
@@ -25,6 +20,7 @@ import {
TotalCreditDebitCellRenderer,
NoteCellRenderer,
} from './components';
import { DataTableEditable } from 'components';
import withAccounts from 'containers/Accounts/withAccounts';
import withCustomers from 'containers/Customers/withCustomers';
@@ -130,45 +126,34 @@ function MakeJournalEntriesTable({
};
// Handles update datatable data.
const handleUpdateData = useCallback(
(rowIndex, columnIdOrObj, value) => {
const newRows = transformUpdatedRows(
rows,
rowIndex,
columnIdOrObj,
value,
);
saveInvoke(
onChange,
newRows
.filter((row) => row.rowType === 'editor')
.map((row) => ({
...omit(row, ['rowType']),
})),
);
},
[rows, onChange],
);
const handleUpdateData = (rowIndex, columnIdOrObj, value) => {
const newRows = transformUpdatedRows(rows, rowIndex, columnIdOrObj, value);
saveInvoke(
onChange,
newRows
.filter((row) => row.rowType === 'editor')
.map((row) => ({
...omit(row, ['rowType']),
})),
);
};
// Handle remove datatable row.
const handleRemoveRow = (rowIndex) => {
// Can't continue if there is just one row line or less.
if (rows.length <= 2) {
return;
}
const removeIndex = parseInt(rowIndex, 10);
const newRows = rows.filter((row, index) => index !== removeIndex);
const handleRemoveRow = useCallback(
(rowIndex) => {
// Can't continue if there is just one row line or less.
if (rows.length <= 2) {
return;
}
const removeIndex = parseInt(rowIndex, 10);
const newRows = rows.filter((row, index) => index !== removeIndex);
saveInvoke(
onChange,
newRows
.filter((row) => row.rowType === 'editor')
.map((row) => ({ ...omit(row, ['rowType']) })),
);
saveInvoke(onClickRemoveRow, removeIndex);
},
[rows, onChange, onClickRemoveRow],
);
saveInvoke(
onChange,
newRows
.filter((row) => row.rowType === 'editor')
.map((row) => ({ ...omit(row, ['rowType']) })),
);
saveInvoke(onClickRemoveRow, removeIndex);
};
// Rows class names callback.
const rowClassNames = useCallback(
@@ -183,48 +168,44 @@ function MakeJournalEntriesTable({
};
return (
<div
className={classNames(
CLASSES.DATATABLE_EDITOR,
CLASSES.DATATABLE_EDITOR_HAS_TOTAL_ROW,
)}
>
<DataTable
columns={columns}
data={tableRows}
rowClassNames={rowClassNames}
sticky={true}
payload={{
accounts: accountsList,
errors: error,
updateData: handleUpdateData,
removeRow: handleRemoveRow,
contacts: [
...customers.map((customer) => ({
...customer,
contact_type: 'customer',
})),
],
}}
/>
<div className={classNames(CLASSES.DATATABLE_EDITOR_ACTIONS)}>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<DataTableEditable
columns={columns}
data={tableRows}
rowClassNames={rowClassNames}
sticky={true}
totalRow={true}
payload={{
accounts: accountsList,
errors: error,
updateData: handleUpdateData,
removeRow: handleRemoveRow,
contacts: [
...customers.map((customer) => ({
...customer,
contact_type: 'customer',
})),
],
}}
actions={
<>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</div>
</div>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</>
}
/>
);
}

View File

@@ -6,7 +6,6 @@ import AppToaster from 'components/AppToaster';
import {
FormattedMessage as T,
useIntl,
FormattedHTMLMessage,
} from 'react-intl';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
@@ -25,6 +24,8 @@ import withResourceActions from 'containers/Resources/withResourcesActions';
import { compose } from 'utils';
import 'style/pages/ManualJournal/List.scss';
/**
* Manual journals table.
*/

View File

@@ -25,6 +25,11 @@ import withAccounts from 'containers/Accounts/withAccounts';
import { compose } from 'utils';
import 'style/pages/Accounts/List.scss';
/**
* Accounts chart list.
*/
function AccountsChart({
// #withDashboardActions
changePageTitle,

View File

@@ -27,6 +27,7 @@ import withAccounts from 'containers/Accounts/withAccounts';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withCurrentView from 'containers/Views/withCurrentView';
import { accountNameAccessor } from './utils';
function AccountsDataTable({
// #withDashboardActions
@@ -135,7 +136,7 @@ function AccountsDataTable({
{
id: 'name',
Header: formatMessage({ id: 'account_name' }),
accessor: 'name',
accessor: accountNameAccessor,
className: 'account_name',
width: 220,
},

View File

@@ -0,0 +1,13 @@
import React from 'react';
import { If } from 'components';
export const accountNameAccessor = (account) => {
return (
<span>
<If condition={account.name}>
<span class={'account-name'}>{ account.name }</span>
</If>
<span class={'account-desc'}>{ account.description }</span>
</span>
);
}

View File

@@ -11,6 +11,8 @@ import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
import { compose } from 'utils';
import 'style/pages/Customers/PageForm.scss';
function Customer({
// // #withDashboardActions
// changePageTitle,

View File

@@ -24,6 +24,11 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/Customers/List.scss';
/**
* Customers list.
*/
function CustomersList({
// #withDashboardActions
changePageTitle,

View File

@@ -19,6 +19,8 @@ import {
import { compose, transformToForm } from 'utils';
import { transformApiErrors, transformAccountToForm } from './utils';
import 'style/pages/Accounts/AccountFormDialog.scss';
const defaultInitialValues = {
account_type_id: '',
parent_account_id: '',

View File

@@ -11,9 +11,7 @@ import { useFormik } from 'formik';
import { useQuery, queryCache } from 'react-query';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { pick } from 'lodash';
import classNames from 'classnames';
import {
If,
ErrorMessage,
AppToaster,
FieldRequiredHint,
@@ -26,6 +24,8 @@ import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
import { compose } from 'utils';
import 'style/pages/Currency/CurrencyFormDialog.scss'
function CurencyFormDialogContent({
// #withCurrencyDetail
currency,

View File

@@ -6,7 +6,6 @@ import {
InputGroup,
Intent,
Position,
MenuItem,
} from '@blueprintjs/core';
import { pick } from 'lodash';
import * as Yup from 'yup';
@@ -18,9 +17,7 @@ import { FormattedMessage as T, useIntl } from 'react-intl';
import { momentFormatter, tansformDateValue } from 'utils';
import {
AppToaster,
Dialog,
ErrorMessage,
ListSelect,
DialogContent,
FieldRequiredHint,
CurrencySelectList,
@@ -35,6 +32,11 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
import 'style/pages/ExchangeRate/ExchangeRateDialog.scss';
/**
* Exchange rate form content.
*/
function ExchangeRateFormDialogContent({
// #withDialogActions
closeDialog,

View File

@@ -15,7 +15,11 @@ import UserFormDialogForm from './InviteUserDialogForm';
import { transformApiErrors } from './utils';
//
import 'style/pages/Users/InviteFormDialog.scss'
/**
* Invite user dialog content.
*/
function InviteUserDialogContent({
// #wihtCurrenciesActions
requestFetchUser,

View File

@@ -20,6 +20,8 @@ import {
} from './itemCategoryForm.schema';
import { compose, transformToForm } from 'utils';
import 'style/pages/ItemCategory/ItemCategoryDialog.scss'
const defaultInitialValues = {
name: '',
description: '',

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback, useEffect } from 'react';
import React, { useCallback } from 'react';
import { DialogContent } from 'components';
import { useQuery, queryCache } from 'react-query';
@@ -11,6 +11,8 @@ import withManualJournalsActions from 'containers/Accounting/withManualJournalsA
import { compose, optionsMapToArray } from 'utils';
import 'style/pages/ManualJournal/JournalNumberDialog.scss'
/**
* Journal number dialog's content.
*/

View File

@@ -29,7 +29,6 @@ function JournalNumberDialog({
);
}
export default compose(
withDialogRedux(),
)(JournalNumberDialog);

View File

@@ -5,6 +5,8 @@ import { FormattedMessage as T } from 'react-intl';
import ItemsEntriesTable from './ItemsEntriesTable';
import { orderingLinesIndexes, repeatValue } from 'utils';
import 'style/components/DataTable/DataTableEditable.scss';
export default function EditableItemsEntriesTable({
defaultEntry,
minLinesNumber = 2,

View File

@@ -3,8 +3,7 @@ import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { Hint, Icon } from 'components';
import DataTable from 'components/DataTable';
import { Hint, Icon, DataTableEditable } from 'components';
import {
InputGroupCell,
MoneyFieldCell,
@@ -17,7 +16,6 @@ import withItems from 'containers/Items/withItems';
import {
compose,
formattedAmount,
orderingLinesIndexes,
saveInvoke,
} from 'utils';
@@ -202,7 +200,7 @@ function ItemsEntriesTable({
if (rows.length <= 1) {
return;
}
const removeIndex = parseInt(rowIndex, 10);
const removeIndex = parseInt(rowIndex, 10);
saveInvoke(onClickRemoveRow, removeIndex);
},
[rows, onClickRemoveRow],
@@ -224,43 +222,38 @@ function ItemsEntriesTable({
);
return (
<div
className={classNames(
CLASSES.DATATABLE_EDITOR,
CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES,
CLASSES.DATATABLE_EDITOR_HAS_TOTAL_ROW,
)}
>
<DataTable
columns={columns}
data={rows}
rowClassNames={rowClassNames}
sticky={true}
payload={{
items: itemsCurrentPage,
errors: errors || [],
updateData: handleUpdateData,
removeRow: handleRemoveRow,
}}
/>
<div className={classNames(CLASSES.DATATABLE_EDITOR_ACTIONS)}>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<DataTableEditable
className={classNames(CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES)}
columns={columns}
data={rows}
rowClassNames={rowClassNames}
sticky={true}
payload={{
items: itemsCurrentPage,
errors: errors || [],
updateData: handleUpdateData,
removeRow: handleRemoveRow,
}}
actions={
<>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</div>
</div>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</>
}
/>
);
}

View File

@@ -2,12 +2,8 @@ import React, { useState, useMemo, useEffect, useCallback } from 'react';
import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { omit } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import DataTable from 'components/DataTable';
import Icon from 'components/Icon';
import { DataTableEditable, Icon } from 'components';
import { Hint } from 'components';
import {
compose,
@@ -228,42 +224,38 @@ function ExpenseTable({
);
return (
<div
className={classNames(
CLASSES.DATATABLE_EDITOR,
CLASSES.DATATABLE_EDITOR_HAS_TOTAL_ROW,
)}
>
<DataTable
columns={columns}
data={tableRows}
rowClassNames={rowClassNames}
sticky={true}
payload={{
accounts: accountsList,
errors: error,
updateData: handleUpdateData,
removeRow: handleRemoveRow,
}}
/>
<div className={classNames(CLASSES.DATATABLE_EDITOR_ACTIONS)}>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<DataTableEditable
columns={columns}
data={tableRows}
rowClassNames={rowClassNames}
sticky={true}
payload={{
accounts: accountsList,
errors: error,
updateData: handleUpdateData,
removeRow: handleRemoveRow,
}}
actions={
<>
<Button
small={true}
className={'button--secondary button--new-line'}
onClick={onClickNewRow}
>
<T id={'new_lines'} />
</Button>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</div>
</div>
<Button
small={true}
className={'button--secondary button--clear-lines ml1'}
onClick={handleClickClearAllLines}
>
<T id={'clear_all_lines'} />
</Button>
</>
}
totalRow={true}
/>
);
}

View File

@@ -13,6 +13,11 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/Expense/PageForm.scss';
/**
* Expense page form.
*/
function Expenses({
// #withwithAccountsActions
requestFetchAccounts,

View File

@@ -19,6 +19,8 @@ import withARAgingSummary from './withARAgingSummary';
import { compose } from 'utils';
import { transfromFilterFormToQuery } from './common';
import 'style/pages/FinancialStatements/ARAgingSummary.scss';
/**
* AR aging summary report.
*/

View File

@@ -5,7 +5,7 @@ import FinancialSheet from 'components/FinancialSheet';
import withARAgingSummary from './withARAgingSummary';
import { compose } from 'utils';
import { compose, getColumnWidth } from 'utils';
/**
* AR aging summary table sheet.
@@ -37,28 +37,34 @@ function ReceivableAgingSummaryTable({
accessor: 'name',
className: 'customer_name',
sticky: 'left',
width: 200,
width: 240,
},
{
Header: <T id={'current'} />,
accessor: 'current',
className: 'current',
width: 120,
width: getColumnWidth(receivableAgingRows, `current`, {
minWidth: 120,
}),
},
...agingColumns.map((agingColumn, index) => ({
Header: agingColumn,
accessor: `aging-${index }`,
width: 120,
width: getColumnWidth(receivableAgingRows, `aging-${index }`, {
minWidth: 120,
}),
})),
{
Header: (<T id={'total'} />),
id: 'total',
accessor: 'total',
className: 'total',
width: 140,
width: getColumnWidth(receivableAgingRows, 'total', {
minWidth: 120,
}),
},
],
[agingColumns],
[receivableAgingRows, agingColumns],
);
const rowClassNames = (row) => [`row-type--${row.original.rowType}`];

View File

@@ -21,6 +21,8 @@ import withBalanceSheetDetail from './withBalanceSheetDetail';
import { transformFilterFormToQuery } from 'containers/FinancialStatements/common';
import 'style/pages/FinancialStatements/BalanceSheet.scss';
function BalanceSheet({
// #withDashboardActions
changePageTitle,

View File

@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import React from 'react';
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl';
import moment from 'moment';

View File

@@ -9,6 +9,8 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/FinancialStatements/FinancialSheets.scss';
function FinancialReportsItem({ title, desc, link }) {
return (
<div class="financial-reports__item">

View File

@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react';
import classNames from 'classnames';
import { Position, Drawer } from '@blueprintjs/core';
import 'style/containers/FinancialStatements/DrawerHeader.scss';
export default function FinancialStatementHeader({
children,

View File

@@ -21,6 +21,8 @@ import { compose } from 'utils';
import { transformFilterFormToQuery } from 'containers/FinancialStatements/common';
import withGeneralLedger from './withGeneralLedger';
import 'style/pages/FinancialStatements/GeneralLedger.scss';
/**
* General Ledger (GL) sheet.
*/

View File

@@ -19,6 +19,8 @@ import withJournal from './withJournal';
import { transformFilterFormToQuery } from 'containers/FinancialStatements/common';
import 'style/pages/FinancialStatements/Journal.scss';
function Journal({
// #withJournalActions
requestFetchJournalSheet,

View File

@@ -45,7 +45,7 @@ function JournalSheetTable({
Header: formatMessage({ id: 'transaction_type' }),
accessor: (r) =>
rowTypeFilter(r.rowType, r.transaction_type, ['first_entry']),
className: 'transaction_type',
className: 'reference_type_formatted',
width: 145,
},
{

View File

@@ -19,6 +19,11 @@ import withSettings from 'containers/Settings/withSettings';
import { transformFilterFormToQuery } from 'containers/FinancialStatements/common';
import 'style/pages/FinancialStatements/ProfitLossSheet.scss';
/**
* Profit/Loss financial statement sheet.
*/
function ProfitLossSheet({
// #withDashboardActions
changePageTitle,

View File

@@ -18,6 +18,8 @@ import withTrialBalanceActions from './withTrialBalanceActions';
import withSettings from 'containers/Settings/withSettings';
import withTrialBalance from './withTrialBalance';
import 'style/pages/FinancialStatements/TrialBalanceSheet.scss';
/**
* Trial balance sheet.
*/

View File

@@ -7,11 +7,11 @@ import Money from 'components/Money';
import withTrialBalance from './withTrialBalance';
import { compose } from 'utils';
import { compose, getColumnWidth } from 'utils';
function TrialBalanceSheetTable({
// #withTrialBalanceDetail
trialBalance,
trialBalanceTableRows,
trialBalanceSheetLoading,
// #withTrialBalanceTable
@@ -27,44 +27,57 @@ function TrialBalanceSheetTable({
Header: formatMessage({ id: 'account_name' }),
accessor: (row) => (row.code ? `${row.name} - ${row.code}` : row.name),
className: 'name',
minWidth: 150,
maxWidth: 150,
width: 150,
width: 160,
},
{
Header: formatMessage({ id: 'credit' }),
accessor: 'credit',
Cell: ({ cell }) => {
const { currency_code, credit } = cell.row.original;
return (<Money amount={credit} currency={currency_code} />);
return <Money amount={credit} currency={currency_code} />;
},
className: 'credit',
width: 95,
width: getColumnWidth(trialBalanceTableRows, `credit`, {
minWidth: 95,
}),
},
{
Header: formatMessage({ id: 'debit' }),
accessor: 'debit',
Cell: ({ cell }) => {
const { currency_code, debit } = cell.row.original;
return (<Money amount={debit} currency={currency_code} />);
return <Money amount={debit} currency={currency_code} />;
},
className: 'debit',
width: 95,
width: getColumnWidth(trialBalanceTableRows, `debit`, { minWidth: 95 }),
},
{
Header: formatMessage({ id: 'balance' }),
accessor: 'balance',
Cell: ({ cell }) => {
const { currency_code, balance } = cell.row.original;
return (<Money amount={balance} currency={currency_code} />);
return <Money amount={balance} currency={currency_code} />;
},
className: 'balance',
width: 95,
width: getColumnWidth(trialBalanceTableRows, `balance`, {
minWidth: 95,
}),
},
],
[formatMessage],
[trialBalanceTableRows, formatMessage],
);
const rowClassNames = (row) => {
const { original } = row;
const rowTypes = Array.isArray(original.rowTypes) ? original.rowTypes : [];
return {
...rowTypes.reduce((acc, rowType) => {
acc[`row_type--${rowType}`] = rowType;
return acc;
}, {}),
};
};
return (
<FinancialSheet
companyName={companyName}
@@ -78,24 +91,27 @@ function TrialBalanceSheetTable({
<DataTable
className="bigcapital-datatable--financial-report"
columns={columns}
data={trialBalance.data}
data={trialBalanceTableRows}
expandable={true}
expandToggleColumn={1}
expandColumnSpace={1}
sticky={true}
rowClassNames={rowClassNames}
/>
</FinancialSheet>
);
}
export default compose(
withTrialBalance(({
trialBalance,
trialBalanceSheetLoading,
trialBalanceQuery
}) => ({
trialBalance,
trialBalanceSheetLoading,
trialBalanceQuery
})),
withTrialBalance(
({
trialBalanceTableRows,
trialBalanceSheetLoading,
trialBalanceQuery,
}) => ({
trialBalanceTableRows,
trialBalanceSheetLoading,
trialBalanceQuery,
}),
),
)(TrialBalanceSheetTable);

View File

@@ -2,16 +2,19 @@ import {connect} from 'react-redux';
import {
getFinancialSheetFactory,
getFinancialSheetQueryFactory,
getFinancialSheetTableRowsFactory,
} from 'store/financialStatement/financialStatements.selectors';
export default (mapState) => {
const mapStateToProps = (state, props) => {
const getTrialBalance = getFinancialSheetFactory('trialBalance');
const getBalanceSheetQuery = getFinancialSheetQueryFactory('trialBalance');
const getTrialBalanceRows = getFinancialSheetTableRowsFactory('trialBalance');
const mapped = {
trialBalance: getTrialBalance(state, props),
trialBalanceQuery: getBalanceSheetQuery(state, props),
trialBalanceTableRows: getTrialBalanceRows(state, props),
trialBalanceSheetLoading: state.financialStatements.trialBalance.loading,
trialBalanceSheetFilter: state.financialStatements.trialBalance.filter,
trialBalanceSheetRefresh: state.financialStatements.trialBalance.refresh,

View File

@@ -30,6 +30,8 @@ import {
transformItemFormData,
} from './ItemForm.schema';
import 'style/pages/Items/PageForm.scss';
const defaultInitialValues = {
active: 1,
name: '',

View File

@@ -24,6 +24,11 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withItemsActions from 'containers/Items/withItemsActions';
import withViewsActions from 'containers/Views/withViewsActions';
import 'style/pages/Items/List.scss';
/**
* Items list.
*/
function ItemsList({
// #withDashboardActions
changePageTitle,

View File

@@ -14,6 +14,8 @@ import withAccountsActions from 'containers/Accounts/withAccountsActions';
import { compose } from 'utils';
import 'style/pages/Preferences/Accounting.scss';
// Accountant preferences.
function AccountantPreferences({
changePreferencesPageTitle,

View File

@@ -17,6 +17,11 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withSettings from 'containers/Settings/withSettings';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import 'style/pages/Preferences/GeneralForm.scss';
/**
* Preferences - General form.
*/
function GeneralPreferences({
// #withSettings
organizationSettings,

View File

@@ -3,8 +3,6 @@ import Icon from 'components/Icon';
import {
Button,
Classes,
Menu,
MenuItem,
Popover,
NavbarDivider,
NavbarGroup,
@@ -14,7 +12,7 @@ import {
} from '@blueprintjs/core';
import classNames from 'classnames';
import { useRouteMatch, useHistory } from 'react-router-dom';
import { useHistory } from 'react-router-dom';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { connect } from 'react-redux';

View File

@@ -14,17 +14,19 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/Bills/PageForm.scss';
function Bills({
//#withwithAccountsActions
// #withwithAccountsActions
requestFetchAccounts,
//#withVendorActions
// #withVendorActions
requestFetchVendorsTable,
//#withItemsActions
// #withItemsActions
requestFetchItems,
//# withBilleActions
// #withBilleActions
requestFetchBill,
// #withSettingsActions

View File

@@ -16,6 +16,11 @@ import withSettingsActions from 'containers/Settings/withSettingsActions';
import { compose } from 'utils';
import 'style/pages/PaymentMade/PageForm.scss'
/**
* Payment made - Page form.
*/
function PaymentMade({
//#withAccountsActions
requestFetchAccounts,

View File

@@ -6,7 +6,7 @@ import { sumBy } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { DataTable, Money } from 'components';
import { DataTableEditable, Money } from 'components';
import { transformUpdatedRows } from 'utils';
import {
MoneyFieldCell,
@@ -140,24 +140,18 @@ export default function PaymentMadeItemsTableEditor({
);
return (
<div
className={classNames(
CLASSES.DATATABLE_EDITOR,
CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES,
)}
>
<DataTable
columns={columns}
data={localData}
rowClassNames={rowClassNames}
spinnerProps={false}
payload={{
errors,
updateData: handleUpdateData,
}}
noResults={noResultsMessage}
/>
<div className={classNames(CLASSES.DATATABLE_EDITOR_ACTIONS, 'mt1')}>
<DataTableEditable
className={classNames(CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES)}
columns={columns}
data={localData}
rowClassNames={rowClassNames}
spinnerProps={false}
payload={{
errors,
updateData: handleUpdateData,
}}
noResults={noResultsMessage}
actions={
<Button
small={true}
className={'button--secondary button--clear-lines'}
@@ -165,7 +159,8 @@ export default function PaymentMadeItemsTableEditor({
>
<T id={'clear_all_lines'} />
</Button>
</div>
</div>
}
totalRow={true}
/>
);
}

View File

@@ -13,6 +13,8 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/SaleEstimate/PageForm.scss';
function Estimates({
// #withCustomersActions
requestFetchCustomers,
@@ -85,8 +87,8 @@ function Estimates({
name={'estimate-form'}
>
<EstimateForm
onFormSubmit={handleFormSubmit}
estimateId={id}
onFormSubmit={handleFormSubmit}
onCancelForm={handleCancel}
/>
</DashboardInsider>

View File

@@ -3,7 +3,7 @@ import { Formik, Form } from 'formik';
import moment from 'moment';
import { Intent } from '@blueprintjs/core';
import { useIntl } from 'react-intl';
import { pick, sumBy, omit, values } from 'lodash';
import { pick, sumBy, omit } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';

View File

@@ -8,6 +8,7 @@ import InvoiceFormHeaderFields from './InvoiceFormHeaderFields';
import { PageFormBigNumber } from 'components';
import withSettings from 'containers/Settings/withSettings';
import { compose } from 'redux';
/**

View File

@@ -13,6 +13,8 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
import 'style/pages/SaleInvoice/PageForm.scss';
function Invoices({
// #withCustomersActions
requestFetchCustomers,

View File

@@ -27,6 +27,8 @@ import { AppToaster } from 'components';
import { compose, defaultToTransform } from 'utils';
import 'style/pages/PaymentReceive/PageForm.scss'
/**
* Payment Receive form.
*/

View File

@@ -6,7 +6,7 @@ import { sumBy } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { DataTable, Money } from 'components';
import { DataTableEditable, Money } from 'components';
import { transformUpdatedRows } from 'utils';
import {
MoneyFieldCell,
@@ -146,24 +146,18 @@ export default function PaymentReceiveItemsTableEditor({
);
return (
<div
className={classNames(
CLASSES.DATATABLE_EDITOR,
CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES,
)}
>
<DataTable
columns={columns}
data={localData}
rowClassNames={rowClassNames}
spinnerProps={false}
payload={{
errors,
updateData: handleUpdateData,
}}
noResults={noResultsMessage}
/>
<div className={classNames(CLASSES.DATATABLE_EDITOR_ACTIONS, 'mt1')}>
<DataTableEditable
className={classNames(CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES)}
columns={columns}
data={localData}
rowClassNames={rowClassNames}
spinnerProps={false}
payload={{
errors,
updateData: handleUpdateData,
}}
noResults={noResultsMessage}
actions={
<Button
small={true}
className={'button--secondary button--clear-lines'}
@@ -171,7 +165,8 @@ export default function PaymentReceiveItemsTableEditor({
>
<T id={'clear_all_lines'} />
</Button>
</div>
</div>
}
totalRow={true}
/>
);
}

View File

@@ -29,9 +29,6 @@ import withMediaActions from 'containers/Media/withMediaActions';
import withSettings from 'containers/Settings/withSettings';
import { AppToaster } from 'components';
import Dragzone from 'components/Dragzone';
import useMedia from 'hooks/useMedia';
import {
compose,
repeatValue,
@@ -39,6 +36,8 @@ import {
defaultToTransform,
} from 'utils';
import 'style/pages/SaleReceipt/PageForm.scss'
const MIN_LINES_NUMBER = 4;
const defaultReceipt = {
@@ -66,18 +65,18 @@ const defaultInitialValues = {
* Receipt form.
*/
function ReceiptForm({
//#withMedia
// #withMedia
requestSubmitMedia,
requestDeleteMedia,
//#withReceiptActions
// #withReceiptActions
requestSubmitReceipt,
requestEditReceipt,
//#withReceiptDetail
// #withReceiptDetail
receipt,
//#withDashboard
// #withDashboard
changePageTitle,
changePageSubtitle,

View File

@@ -1,12 +1,16 @@
import React, { useCallback } from 'react';
import { Button, Intent } from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
import { useHistory } from "react-router-dom";
import WorkflowIcon from './WorkflowIcon';
import withOrganizationActions from 'containers/Organization/withOrganizationActions';
import 'style/pages/Setup/Congrats.scss';
import { compose } from 'utils';
/**
* Setup congrats page.
*/
function SetupCongratsPage({
setOrganizationSetupCompleted,
}) {

View File

@@ -3,8 +3,9 @@ import { useQuery } from 'react-query';
import { withWizard } from 'react-albus'
import { ProgressBar, Intent } from '@blueprintjs/core';
import 'style/pages/Setup/Initializing.scss';
import withOrganizationActions from 'containers/Organization/withOrganizationActions';
import withOrganization from 'containers/Organization/withOrganization'
import { compose } from 'utils';

View File

@@ -17,6 +17,9 @@ import { TimezonePicker } from '@blueprintjs/timezone';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { DateInput } from '@blueprintjs/datetime';
import { withWizard } from 'react-albus';
import 'style/pages/Setup/Organization.scss';
import { momentFormatter, tansformDateValue } from 'utils';
import { ListSelect, ErrorMessage, FieldRequiredHint } from 'components';

View File

@@ -4,11 +4,16 @@ import { useFormik } from 'formik';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { Button, Intent } from '@blueprintjs/core';
import { withWizard } from 'react-albus';
import withSubscriptionsActions from 'containers/Subscriptions/withSubscriptionsActions';
import 'style/pages/Setup/Billing.scss';
import BillingPlans from 'containers/Subscriptions/billingPlans';
import BillingPeriods from 'containers/Subscriptions/billingPeriods';
import { BillingPaymentmethod } from 'containers/Subscriptions/billingPaymentmethod';
import withSubscriptionsActions from 'containers/Subscriptions/withSubscriptionsActions';
import withBillingActions from 'containers/Subscriptions/withBillingActions';
import { compose } from 'utils';
/**

View File

@@ -2,6 +2,7 @@ import React from 'react';
import SetupRightSection from './SetupRightSection';
import SetupLeftSection from './SetupLeftSection';
import 'style/pages/Setup/SetupPage.scss';
export default function WizardSetupPage() {
return (