From e6f63fbc882e6e58d63c9b84ea6c75b5bb395ae3 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Wed, 13 May 2020 00:02:21 +0200 Subject: [PATCH] WIP feature/breadcrumb/fix_localize --- client/src/components/Authentication.js | 2 +- client/src/components/Breadcrumbs.js | 26 +++ client/src/components/Dashboard/Dashboard.js | 4 +- .../Dashboard/DashboardContentRoute.js | 4 +- .../components/Dashboard/DashboardTopbar.js | 4 +- client/src/components/Dashboard/TopbarUser.js | 11 +- client/src/components/Expenses/ExpenseForm.js | 6 +- .../components/Expenses/ExpensesActionsBar.js | 2 +- .../components/Expenses/ExpensesViewsTabs.js | 2 +- client/src/components/FilterDropdown.js | 16 +- client/src/components/FinancialSheet.js | 55 +++--- .../Preferences/PreferencesContentRoute.js | 6 +- .../Preferences/PreferencesTopbar.js | 6 +- client/src/components/PrivateRoute.js | 2 +- client/src/config/preferencesMenu.js | 23 ++- client/src/config/sidebarMenu.js | 84 ++++----- .../Accounting/MakeJournalEntriesPage.js | 4 +- .../Accounting/ManualJournalActionsBar.js | 2 +- .../Accounting/ManualJournalsList.js | 6 +- .../Accounting/ManualJournalsViewTabs.js | 6 +- .../containers/Accounts/AccountsActionsBar.js | 2 +- .../src/containers/Accounts/AccountsChart.js | 10 +- .../containers/Accounts/AccountsDataTable.js | 4 +- .../containers/Accounts/AccountsViewsTabs.js | 8 +- .../containers/Authentication/InviteAccept.js | 2 +- client/src/containers/Authentication/Login.js | 4 +- .../Authentication/SendResetPassword.js | 5 +- .../containers/Dialogs/AccountFormDialog.js | 2 +- .../containers/Dialogs/ExchangeRateDialog.js | 4 +- .../containers/Dialogs/InviteUserDialog.js | 2 +- .../src/containers/Dialogs/ItemFromDialog.js | 2 +- .../containers/ExchangeRates/ExchangeRate.js | 2 +- .../ExchangeRates/ExchangeRateActionsBar.js | 5 +- .../src/containers/Expenses/ExpensesList.js | 2 +- .../BalanceSheet/BalanceSheet.js | 15 +- .../BalanceSheet/BalanceSheetActionsBar.js | 9 +- .../BalanceSheet/BalanceSheetHeader.js | 26 +-- .../BalanceSheet/BalanceSheetTable.js | 9 +- .../FinancialStatementDateRange.js | 3 +- .../GeneralLedger/GeneralLedger.js | 12 +- .../GeneralLedger/GeneralLedgerActionsBar.js | 11 +- .../GeneralLedger/GeneralLedgerHeader.js | 10 +- .../GeneralLedger/GeneralLedgerTable.js | 46 ++--- .../FinancialStatements/Journal/Journal.js | 5 +- .../Journal/JournalActionsBar.js | 10 +- .../Journal/JournalHeader.js | 16 +- .../Journal/JournalTable.js | 19 +- .../ProfitLossSheet/ProfitLossActionsBar.js | 7 +- .../ProfitLossSheet/ProfitLossSheetHeader.js | 14 +- .../ProfitLossSheet/ProfitLossSheetTable.js | 10 +- .../RadiosAccountingBasis.js | 8 +- .../SelectDisplayColumnsBy.js | 5 +- .../TrialBalanceActionsBar.js | 7 +- .../TrialBalanceSheet/TrialBalanceSheet.js | 5 +- .../TrialBalanceSheetHeader.js | 12 +- .../TrialBalanceSheetTable.js | 14 +- client/src/containers/Items/ItemForm.js | 18 +- .../src/containers/Items/ItemsActionsBar.js | 39 ++-- client/src/containers/Items/ItemsList.js | 6 +- client/src/containers/Items/ItemsViewsTabs.js | 7 +- .../Preferences/Accounts/Accounts.js | 9 +- .../Accounts/AccountsCustomFields.js | 11 +- .../Preferences/Currencies/CurrenciesList.js | 17 +- .../containers/Preferences/General/General.js | 22 +-- .../containers/Preferences/Users/UsersList.js | 39 ++-- client/src/lang/en/index.js | 171 +++++++++++++++--- client/src/routes/dashboard.js | 59 +++--- client/src/routes/preferences.js | 2 +- .../src/store/resources/resources.reducer.js | 6 +- 69 files changed, 610 insertions(+), 394 deletions(-) create mode 100644 client/src/components/Breadcrumbs.js diff --git a/client/src/components/Authentication.js b/client/src/components/Authentication.js index 3c7ed95c5..84c534c8d 100644 --- a/client/src/components/Authentication.js +++ b/client/src/components/Authentication.js @@ -8,7 +8,7 @@ export default function AuthenticationWrapper({ isAuthenticated = false, ...rest }) { - const to = { pathname: '/dashboard/homepage' }; + const to = { pathname: '/homepage' }; return ( diff --git a/client/src/components/Breadcrumbs.js b/client/src/components/Breadcrumbs.js new file mode 100644 index 000000000..e09c30a8f --- /dev/null +++ b/client/src/components/Breadcrumbs.js @@ -0,0 +1,26 @@ +import React from 'react'; +import { NavLink } from 'react-router-dom'; +import routes from 'routes/dashboard'; +import withBreadcrumbs from 'react-router-breadcrumbs-hoc'; + +const PureBreadcrumbs = ({ breadcrumbs }) => ( +
+ {breadcrumbs.map(({ breadcrumb, path, match }) => ( + + {breadcrumb} + / + + ))} +
+ + //
+ // {breadcrumbs.map(({ breadcrumb, match }, index) => ( + //
+ // {breadcrumb} + // {index < breadcrumbs.length - 1 && ">"} + //
+ // ))} + //
+); + +export default withBreadcrumbs(routes)(PureBreadcrumbs); diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js index d4cea68a7..e2d5f189a 100644 --- a/client/src/components/Dashboard/Dashboard.js +++ b/client/src/components/Dashboard/Dashboard.js @@ -11,13 +11,13 @@ export default function Dashboard() { return (
- + - + diff --git a/client/src/components/Dashboard/DashboardContentRoute.js b/client/src/components/Dashboard/DashboardContentRoute.js index be45197a9..28ffcb10a 100644 --- a/client/src/components/Dashboard/DashboardContentRoute.js +++ b/client/src/components/Dashboard/DashboardContentRoute.js @@ -1,11 +1,13 @@ import React from 'react'; import { Route, Switch } from 'react-router-dom'; import routes from 'routes/dashboard' +import Breadcrumbs from 'components/Breadcrumbs'; export default function DashboardContentRoute() { return ( - + + { routes.map((route, index) => ( { - history.push(`/dashboard/custom_views/${editViewId}/edit`); + history.push(`/custom_views/${editViewId}/edit`); }; const maybleRenderPageSubtitle = pageSubtitle &&

{pageSubtitle}

; @@ -48,7 +48,7 @@ function DashboardTopbar({ role='img' focusable='false' > - Menu + <T id={'menu'}/> ( - - - - + } /> + } /> + } shouldDismissPopover={false} /> + } disabled={true} /> - + } onClick={onClickLogout} /> ), [onClickLogout]); diff --git a/client/src/components/Expenses/ExpenseForm.js b/client/src/components/Expenses/ExpenseForm.js index e9fd77bf7..d305c6597 100644 --- a/client/src/components/Expenses/ExpenseForm.js +++ b/client/src/components/Expenses/ExpenseForm.js @@ -52,7 +52,7 @@ export default function ExpenseForm({ submitExpense(values) .then(response => { AppToaster.show({ - message: 'the_expense_has_been_submit' + message: formatMessage({id:'the_expense_has_been_successfully_created'}) }); }) .catch(error => {}); @@ -108,11 +108,11 @@ export default function ExpenseForm({ const paymentAccountLabel = state.selectedPaymentAccount ? state.selectedPaymentAccount.name - : 'Select Payment Account'; + : ; const expenseAccountLabel = state.selectedExpenseAccount ? state.selectedExpenseAccount.name - : 'Select Expense Account'; + : ; const handleClose = () => {}; diff --git a/client/src/components/Expenses/ExpensesActionsBar.js b/client/src/components/Expenses/ExpensesActionsBar.js index 79d02e13a..9386dcfd7 100644 --- a/client/src/components/Expenses/ExpensesActionsBar.js +++ b/client/src/components/Expenses/ExpensesActionsBar.js @@ -50,7 +50,7 @@ export default function ExpensesActionsBar({ } - href='/dashboard/expenses/new' + href='/expenses/new' text={} onClick={onClickNewAccount} /> diff --git a/client/src/components/Expenses/ExpensesViewsTabs.js b/client/src/components/Expenses/ExpensesViewsTabs.js index 400517d65..40e7ac342 100644 --- a/client/src/components/Expenses/ExpensesViewsTabs.js +++ b/client/src/components/Expenses/ExpensesViewsTabs.js @@ -17,7 +17,7 @@ function AccountsViewsTabs({ views }) { const {path} = useRouteMatch(); const handleClickNewView = () => { - history.push('/dashboard/custom_views/new'); + history.push('/custom_views/new'); }; const tabs = views.map((view) => { diff --git a/client/src/components/FilterDropdown.js b/client/src/components/FilterDropdown.js index d04ebab3e..30397f06a 100644 --- a/client/src/components/FilterDropdown.js +++ b/client/src/components/FilterDropdown.js @@ -19,9 +19,11 @@ export default function FilterDropdown({ fields, onFilterChange, }) { + const {formatMessage} =useIntl(); + const conditionalsItems = useMemo(() => [ - { value: 'and', label: 'AND' }, - { value: 'or', label: 'OR' }, + { value: 'and', label:formatMessage({id:'and'}) }, + { value: 'or', label: formatMessage({id:'or'}) }, ], []); const resourceFields = useMemo(() => [ @@ -29,11 +31,11 @@ export default function FilterDropdown({ ], [fields]); const compatatorsItems = useMemo(() => [ - {value: '', label: 'Select a compatator'}, - {value: 'equals', label: 'Equals'}, - {value: 'not_equal', label: 'Not Equal'}, - {value: 'contain', label: 'Contain'}, - {value: 'not_contain', label: 'Not Contain'}, + {value: '', label:formatMessage({id:'select_a_comparator'})}, + {value: 'equals', label: formatMessage({id:'equals'})}, + {value: 'not_equal', label: formatMessage({id:'not_equal'})}, + {value: 'contain', label: formatMessage({id:'contain'})}, + {value: 'not_contain', label: formatMessage({id:'not_contain'})}, ], []); const defaultFilterCondition = useMemo(() => ({ diff --git a/client/src/components/FinancialSheet.js b/client/src/components/FinancialSheet.js index 11fa5b958..aed91dbba 100644 --- a/client/src/components/FinancialSheet.js +++ b/client/src/components/FinancialSheet.js @@ -2,6 +2,7 @@ import React, { useMemo, useCallback } from 'react'; import moment from 'moment'; import classnames from 'classnames'; import LoadingIndicator from 'components/LoadingIndicator'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function FinancialSheet({ companyName, @@ -18,42 +19,44 @@ export default function FinancialSheet({ const formattedFromDate = moment(fromDate).format('DD MMMM YYYY'); const formattedToDate = moment(toDate).format('DD MMMM YYYY'); const nameModifer = name ? `financial-sheet--${name}` : ''; - - const methodsLabels = useMemo(() => ({ - 'cash': 'Cash', - 'accural': 'Accural', - }), []); + const { formatMessage } = useIntl(); + const methodsLabels = useMemo( + () => ({ + cash: formatMessage({id:'cash'}), + accrual: formatMessage({id:'accrual'}), + }), + [] + ); const getBasisLabel = useCallback((b) => methodsLabels[b], [methodsLabels]); - const basisLabel = useMemo(() => getBasisLabel(basis), [getBasisLabel, basis]); + const basisLabel = useMemo(() => getBasisLabel(basis), [ + getBasisLabel, + basis, + ]); return (
-
-

- { companyName } -

-
{ sheetType }
-
- From { formattedFromDate } | To { formattedToDate } +
+

{companyName}

+
{sheetType}
+
+ {formattedFromDate} | {formattedToDate}
-
- { children } -
-
- { accountingBasis } -
+
{children}
+
{accountingBasis}
- { (basisLabel) && ( -
- Accounting Basis: { basisLabel } + {basisLabel && ( +
+ {basisLabel}
- )} + )}
); -} \ No newline at end of file +} diff --git a/client/src/components/Preferences/PreferencesContentRoute.js b/client/src/components/Preferences/PreferencesContentRoute.js index fcf0fa0aa..7981fda09 100644 --- a/client/src/components/Preferences/PreferencesContentRoute.js +++ b/client/src/components/Preferences/PreferencesContentRoute.js @@ -4,11 +4,11 @@ import preferencesRoutes from 'routes/preferences' export default function DashboardContentRoute() { - const defaultTab = '/dashboard/preferences/general'; + const defaultTab = '/preferences/general'; return ( - - + + { preferencesRoutes.map((route, index) => ( diff --git a/client/src/components/Preferences/PreferencesTopbar.js b/client/src/components/Preferences/PreferencesTopbar.js index 605d5577f..212a69324 100644 --- a/client/src/components/Preferences/PreferencesTopbar.js +++ b/client/src/components/Preferences/PreferencesTopbar.js @@ -11,16 +11,16 @@ export default function PreferencesTopbar() {

Accounts

- + diff --git a/client/src/components/PrivateRoute.js b/client/src/components/PrivateRoute.js index 6793eee9d..cfbf55815 100644 --- a/client/src/components/PrivateRoute.js +++ b/client/src/components/PrivateRoute.js @@ -17,7 +17,7 @@ function PrivateRoute({ isAuthenticated ? () : ( diff --git a/client/src/config/preferencesMenu.js b/client/src/config/preferencesMenu.js index 5bad60ee7..f65e307bd 100644 --- a/client/src/config/preferencesMenu.js +++ b/client/src/config/preferencesMenu.js @@ -1,26 +1,29 @@ +import React from 'react' +import { FormattedMessage as T, useIntl } from 'react-intl'; + export default [ { - text: 'General', + text: , disabled: false, - href: '/dashboard/preferences/general', + href: '/preferences/general', }, { - text: 'Users', - href: '/dashboard/preferences/users', + text: , + href: '/preferences/users', }, { - text: 'Currencies', + text: , - href: '/dashboard/preferences/currencies', + href: '/preferences/currencies', }, { - text: 'Accountant', + text: , disabled: false, - href: '/dashboard/preferences/accountant', + href: '/preferences/accountant', }, { - text: 'Accounts', + text: , disabled: false, - href: '/dashboard/preferences/accounts', + href: '/preferences/accounts', }, ]; diff --git a/client/src/config/sidebarMenu.js b/client/src/config/sidebarMenu.js index 8798155f2..f93c29cb1 100644 --- a/client/src/config/sidebarMenu.js +++ b/client/src/config/sidebarMenu.js @@ -1,3 +1,5 @@ +import React from 'react' +import { FormattedMessage as T, useIntl } from 'react-intl'; export default [ { @@ -6,9 +8,9 @@ export default [ { icon: 'homepage', iconSize: 20, - text: 'Homepage', + text: , disabled: false, - href: '/dashboard/homepage', + href: '/homepage', }, { divider: true, @@ -16,19 +18,19 @@ export default [ { icon: 'homepage', iconSize: 20, - text: 'Items', + text: , children: [ { - text: 'Items List', - href: '/dashboard/items', + text: , + href: '/items', }, { - text: 'New Item', - href: '/dashboard/items/new', + text: , + href: '/items/new', }, { - text: 'Category List', - href: '/dashboard/items/categories', + text: , + href: '/items/categories', }, ], }, @@ -38,42 +40,42 @@ export default [ { icon: 'balance-scale', iconSize: 20, - text: 'Financial', + text: , children: [ { - text: 'Accounts Chart', - href: '/dashboard/accounts', + text: , + href: '/accounts', }, { - text: 'Manual Journal', - href: '/dashboard/accounting/manual-journals', + text: , + href: '/manual-journals', }, { - text: 'Make Journal', - href: '/dashboard/accounting/make-journal-entry', + text: , + href: '/make-journal-entry', }, { - text: 'Exchange Rate', - href: '/dashboard/ExchangeRates', + text: , + href: '/ExchangeRates', }, ], }, { icon: 'university', iconSize: 20, - text: 'Banking', + text: , children: [], }, { icon: 'shopping-cart', iconSize: 20, - text: 'Sales', + text: , children: [], }, { icon: 'balance-scale', iconSize: 20, - text: 'Purchases', + text: , children: [ { icon: 'cut', @@ -86,42 +88,42 @@ export default [ { icon: 'analytics', iconSize: 18, - text: 'Financial Reports', + text: , children: [ { - text: 'Balance Sheet', - href: '/dashboard/accounting/balance-sheet', + text: , + href: '/balance-sheet', }, { - text: 'Trial Balance Sheet', - href: '/dashboard/accounting/trial-balance-sheet', + text: , + href: '/trial-balance-sheet', }, { - text: 'Journal', - href: '/dashboard/accounting/journal-sheet', + text: , + href: '/journal-sheet', }, { - text: 'General Ledger', - href: '/dashboard/accounting/general-ledger', + text: , + href: '/general-ledger', }, { - text: 'Profit Loss Sheet', - href: '/dashboard/accounting/profit-loss-sheet', + text: , + href: '/profit-loss-sheet', }, ], }, { - text: 'Expenses', + text: , icon: 'receipt', iconSize: 18, children: [ { - text: 'Expenses List', - href: '/dashboard/expenses', + text: , + href: '/expenses', }, { - text: 'New Expenses', - href: '/dashboard/expenses/new', + text: , + href: '/expenses/new', }, ], }, @@ -129,11 +131,11 @@ export default [ divider: true, }, { - text: 'Preferences', - href: '/dashboard/preferences', + text: , + href: '/preferences', }, { - text: 'Auditing System', - href: '/dashboard/auditing/list', + text: , + href: '/auditing/list', }, ]; diff --git a/client/src/containers/Accounting/MakeJournalEntriesPage.js b/client/src/containers/Accounting/MakeJournalEntriesPage.js index 81edda382..1a7c93085 100644 --- a/client/src/containers/Accounting/MakeJournalEntriesPage.js +++ b/client/src/containers/Accounting/MakeJournalEntriesPage.js @@ -26,11 +26,11 @@ function MakeJournalEntriesPage({ const handleFormSubmit = useCallback((payload) => { payload.redirect && - history.push('/dashboard/accounting/manual-journals'); + history.push('/manual-journals'); }, [history]); const handleCancel = useCallback(() => { - history.push('/dashboard/accounting/manual-journals'); + history.push('/manual-journals'); }, [history]); return ( diff --git a/client/src/containers/Accounting/ManualJournalActionsBar.js b/client/src/containers/Accounting/ManualJournalActionsBar.js index 28423351b..88665152c 100644 --- a/client/src/containers/Accounting/ManualJournalActionsBar.js +++ b/client/src/containers/Accounting/ManualJournalActionsBar.js @@ -53,7 +53,7 @@ function ManualJournalActionsBar({ }); const onClickNewManualJournal = useCallback(() => { - history.push('/dashboard/accounting/make-journal-entry'); + history.push('/make-journal-entry'); }, [history]); const filterDropdown = FilterDropdown({ diff --git a/client/src/containers/Accounting/ManualJournalsList.js b/client/src/containers/Accounting/ManualJournalsList.js index c285ef5f8..da83f420b 100644 --- a/client/src/containers/Accounting/ManualJournalsList.js +++ b/client/src/containers/Accounting/ManualJournalsList.js @@ -97,7 +97,7 @@ function ManualJournalsTable({ const handleEditJournal = useCallback( (journal) => { - history.push(`/dashboard/accounting/manual-journals/${journal.id}/edit`); + history.push(`/manual-journals/${journal.id}/edit`); }, [history] ); @@ -162,8 +162,8 @@ function ManualJournalsTable({ diff --git a/client/src/containers/Accounting/ManualJournalsViewTabs.js b/client/src/containers/Accounting/ManualJournalsViewTabs.js index 8ab8d5fa1..5e7aeab49 100644 --- a/client/src/containers/Accounting/ManualJournalsViewTabs.js +++ b/client/src/containers/Accounting/ManualJournalsViewTabs.js @@ -39,7 +39,7 @@ function ManualJournalsViewTabs({ const handleClickNewView = () => { setTopbarEditView(null); - history.push('/dashboard/custom_views/manual_journals/new'); + history.push('/custom_views/manual_journals/new'); }; const handleViewLinkClick = () => { setTopbarEditView(customViewId); @@ -61,7 +61,7 @@ function ManualJournalsViewTabs({ }, [customViewId]); const tabs = manualJournalsViews.map((view) => { - const baseUrl = '/dashboard/accounting/manual-journals'; + const baseUrl = '/manual-journals'; const link = ( All + All } /> {tabs} diff --git a/client/src/containers/Accounts/AccountsActionsBar.js b/client/src/containers/Accounts/AccountsActionsBar.js index 681369a4f..c8f301a83 100644 --- a/client/src/containers/Accounts/AccountsActionsBar.js +++ b/client/src/containers/Accounts/AccountsActionsBar.js @@ -51,7 +51,7 @@ function AccountsActionsBar({ const onClickNewAccount = () => { openDialog('account-form', {}); }; const onClickViewItem = (view) => { history.push(view - ? `/dashboard/accounts/${view.id}/custom_view` : '/dashboard/accounts'); + ? `/accounts/${view.id}/custom_view` : '/accounts'); }; const viewsMenuItems = accountsViews.map((view) => { diff --git a/client/src/containers/Accounts/AccountsChart.js b/client/src/containers/Accounts/AccountsChart.js index 8f812973d..1c305f3ea 100644 --- a/client/src/containers/Accounts/AccountsChart.js +++ b/client/src/containers/Accounts/AccountsChart.js @@ -96,7 +96,7 @@ function AccountsChart({ } if (errors.find((e) => e.type === 'ACCOUNT.HAS.ASSOCIATED.TRANSACTIONS')) { AppToaster.show({ - message: 'cannot_delete_account_has_associated_transactions' + message: formatMessage({id:'cannot_delete_account_has_associated_transactions'}) }); } } @@ -250,8 +250,8 @@ function AccountsChart({ @@ -310,8 +310,8 @@ function AccountsChart({ } + confirmButtonText={`${formatMessage({id:'delete'})} (${selectedRowsCount})`} icon="trash" intent={Intent.DANGER} isOpen={bulkDelete} diff --git a/client/src/containers/Accounts/AccountsDataTable.js b/client/src/containers/Accounts/AccountsDataTable.js index 915117d83..7ff42622e 100644 --- a/client/src/containers/Accounts/AccountsDataTable.js +++ b/client/src/containers/Accounts/AccountsDataTable.js @@ -72,12 +72,12 @@ function AccountsDataTable({ } onClick={() => onInactiveAccount(account)} /> } onClick={() => onActivateAccount(account)} /> { setTopbarEditView(null); - history.push('/dashboard/custom_views/accounts/new'); + history.push('/custom_views/accounts/new'); }; // Handle view tab link click. @@ -76,7 +76,7 @@ function AccountsViewsTabs({ }; const tabs = accountsViews.map((view) => { - const baseUrl = '/dashboard/accounts'; + const baseUrl = '/accounts'; const link = ( All} + title={} onClick={handleViewLinkClick} /> { tabs } diff --git a/client/src/containers/Authentication/InviteAccept.js b/client/src/containers/Authentication/InviteAccept.js index 753836aeb..f7867965a 100644 --- a/client/src/containers/Authentication/InviteAccept.js +++ b/client/src/containers/Authentication/InviteAccept.js @@ -148,7 +148,7 @@ function Invite({ requestInviteAccept, requestInviteMetaByToken }) {

- {inviteValue.organization_name} Organization. + {inviteValue.organization_name}

diff --git a/client/src/containers/Authentication/Login.js b/client/src/containers/Authentication/Login.js index bc6f1925b..47d33041d 100644 --- a/client/src/containers/Authentication/Login.js +++ b/client/src/containers/Authentication/Login.js @@ -38,7 +38,7 @@ function Login({ const loginValidationSchema = Yup.object().shape({ crediential: Yup.string() .required(formatMessage({ id: 'required' })) - .email(formatMessage({ id: 'invalid_email_or_phone_numner' })), + .email(formatMessage({ id: 'invalid_email_or_phone_number' })), password: Yup.string() .required(formatMessage({ id: 'required' })) .min(4), @@ -63,7 +63,7 @@ function Login({ crediential: values.crediential, password: values.password, }).then(() => { - history.go('/dashboard/homepage'); + history.go('/homepage'); setSubmitting(false); }).catch((errors) => { const toastBuilders = []; diff --git a/client/src/containers/Authentication/SendResetPassword.js b/client/src/containers/Authentication/SendResetPassword.js index ee85ed052..f352760f7 100644 --- a/client/src/containers/Authentication/SendResetPassword.js +++ b/client/src/containers/Authentication/SendResetPassword.js @@ -52,8 +52,7 @@ function SendResetPassword({ requestSendResetPassword }) { requestSendResetPassword(values.crediential) .then((response) => { AppToaster.show({ - message: `Check your email for a link to reset your password. - If it doesn’t appear within a few minutes, check your spam folder.`, + message: formatMessage({id:'check_your_email_for_a_link_to_reset'}), intent: Intent.SUCCESS, }); history.push('/auth/login'); @@ -62,7 +61,7 @@ function SendResetPassword({ requestSendResetPassword }) { .catch((errors) => { if (errors.find((e) => e.type === 'EMAIL.NOT.REGISTERED')) { AppToaster.show({ - message: "We couldn't find your account with that email", + message: formatMessage({id:'we_couldn_t_find_your_account_with_that_email'}), intent: Intent.DANGER, }); } diff --git a/client/src/containers/Dialogs/AccountFormDialog.js b/client/src/containers/Dialogs/AccountFormDialog.js index 1ed18e91f..3e7f8b31b 100644 --- a/client/src/containers/Dialogs/AccountFormDialog.js +++ b/client/src/containers/Dialogs/AccountFormDialog.js @@ -375,7 +375,7 @@ function AccountFormDialog({ text={ selectedSubaccount ? selectedSubaccount.name - : 'Select Parent Account' + : } /> diff --git a/client/src/containers/Dialogs/ExchangeRateDialog.js b/client/src/containers/Dialogs/ExchangeRateDialog.js index 5f89197ad..574e4ed5f 100644 --- a/client/src/containers/Dialogs/ExchangeRateDialog.js +++ b/client/src/containers/Dialogs/ExchangeRateDialog.js @@ -82,7 +82,7 @@ function ExchangeRateDialog({ .then((response) => { closeDialog(name); AppToaster.show({ - message: 'the_exchange_rate_has_been_edited', + message: formatMessage({id:'the_exchange_rate_has_been_successfully_edited'}) }); setSubmitting(false); }) @@ -94,7 +94,7 @@ function ExchangeRateDialog({ .then((response) => { closeDialog(name); AppToaster.show({ - message: 'the_exchangeRate_has_been_submit', + message: formatMessage({id:'the_exchange_rate_has_been_successfully_created'}) }); setSubmitting(false); }) diff --git a/client/src/containers/Dialogs/InviteUserDialog.js b/client/src/containers/Dialogs/InviteUserDialog.js index 01e03b8a6..e6406bae3 100644 --- a/client/src/containers/Dialogs/InviteUserDialog.js +++ b/client/src/containers/Dialogs/InviteUserDialog.js @@ -74,7 +74,7 @@ function InviteUserDialog({ .then((response) => { closeDialog(name); AppToaster.show({ - message: 'the_user_details_has_been_updated', + message: formatMessage({id:'the_user_details_has_been_updated'}), }); setSubmitting(false); }) diff --git a/client/src/containers/Dialogs/ItemFromDialog.js b/client/src/containers/Dialogs/ItemFromDialog.js index d110e1edb..3e50cf87d 100644 --- a/client/src/containers/Dialogs/ItemFromDialog.js +++ b/client/src/containers/Dialogs/ItemFromDialog.js @@ -42,7 +42,7 @@ function ItemFromDialog({ submitItemCategory({ values }) .then((response) => { AppToaster.show({ - message: 'the_category_has_been_submit', + message: formatMessage({id:'the_category_has_been_successfully_created'}), }); }) .catch((error) => { diff --git a/client/src/containers/ExchangeRates/ExchangeRate.js b/client/src/containers/ExchangeRates/ExchangeRate.js index f2e0d5847..8b01add51 100644 --- a/client/src/containers/ExchangeRates/ExchangeRate.js +++ b/client/src/containers/ExchangeRates/ExchangeRate.js @@ -66,7 +66,7 @@ function ExchangeRate({ requestDeleteExchangeRate(deleteExchangeRate.id).then(() => { setDeleteExchangeRate(false); AppToaster.show({ - message: 'the_exchange_rate_has_been_delete', + message: formatMessage({id:'the_exchange_rate_has_been_successfully_deleted'}), }); }); }, [deleteExchangeRate, requestDeleteExchangeRate]); diff --git a/client/src/containers/ExchangeRates/ExchangeRateActionsBar.js b/client/src/containers/ExchangeRates/ExchangeRateActionsBar.js index af432a388..28128c1d5 100644 --- a/client/src/containers/ExchangeRates/ExchangeRateActionsBar.js +++ b/client/src/containers/ExchangeRates/ExchangeRateActionsBar.js @@ -19,7 +19,7 @@ import FilterDropdown from 'components/FilterDropdown'; import withResourceDetail from 'containers/Resources/withResourceDetails'; import { compose } from 'utils'; -import { FormattedMessage as T } from 'react-intl'; +import { FormattedMessage as T ,useIntl } from 'react-intl'; function ExchangeRateActionsBar({ @@ -34,6 +34,7 @@ function ExchangeRateActionsBar({ onFilterChanged, }) { const [filterCount, setFilterCount] = useState(0); +const {formatMessage} =useIntl() const onClickNewExchangeRate = () => { openDialog('exchangeRate-form', {}); @@ -80,7 +81,7 @@ function ExchangeRateActionsBar({ filterCount <= 0 ? ( ) : ( - `${filterCount} filters applied` + `${filterCount} ${formatMessage({id:'filters_applied'})}` ) } icon={} diff --git a/client/src/containers/Expenses/ExpensesList.js b/client/src/containers/Expenses/ExpensesList.js index 06a88cef5..41a8122bb 100644 --- a/client/src/containers/Expenses/ExpensesList.js +++ b/client/src/containers/Expenses/ExpensesList.js @@ -36,7 +36,7 @@ function ExpensesList({ deleteExpense(deleteExpenseState.id).then(() => { setDeleteExpense(false); AppToaster.show({ - message: 'the_expense_has_been_deleted' + message: formatMessage({id:'the_expense_has_been_successfully_deleted'}) }); }); }; diff --git a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js index ad0f3408b..bffab5861 100644 --- a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js +++ b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js @@ -1,8 +1,7 @@ -import React, {useEffect, useMemo, useCallback, useState} from 'react'; +import React, { useEffect, useMemo, useCallback, useState } from 'react'; -import {compose} from 'utils'; +import { compose } from 'utils'; import { useQuery } from 'react-query'; -import { useIntl } from 'react-intl'; import moment from 'moment'; import BalanceSheetHeader from './BalanceSheetHeader'; @@ -17,6 +16,8 @@ import withDashboard from 'containers/Dashboard/withDashboard'; import withBalanceSheetActions from './withBalanceSheetActions'; import withBalanceSheetDetail from './withBalanceSheetDetail'; +import { FormattedMessage as T, useIntl } from 'react-intl'; + function BalanceSheet({ // #withDashboard @@ -24,14 +25,14 @@ function BalanceSheet({ // #withBalanceSheetActions fetchBalanceSheet, - + // #withBalanceSheetDetail balanceSheetLoading, // #withPreferences organizationSettings }) { - const intl = useIntl(); + const { formatMessage } = useIntl(); const [filter, setFilter] = useState({ from_date: moment().startOf('year').format('YYYY-MM-DD'), to_date: moment().endOf('year').format('YYYY-MM-DD'), @@ -40,7 +41,7 @@ function BalanceSheet({ display_columns_by: '', none_zero: false, }); - + const fetchHook = useQuery(['balance-sheet', filter], (key, query) => { fetchBalanceSheet({ ...query }); }); @@ -50,7 +51,7 @@ function BalanceSheet({ }, [fetchHook]); useEffect(() => { - changePageTitle('Balance Sheet'); + changePageTitle(formatMessage({ id: 'balance_sheet' })); }, []); // Handle re-fetch balance sheet after filter change. diff --git a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetActionsBar.js b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetActionsBar.js index 9e792d07d..aa67b45de 100644 --- a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetActionsBar.js +++ b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetActionsBar.js @@ -14,6 +14,7 @@ import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar' import classNames from 'classnames'; import FilterDropdown from 'components/FilterDropdown'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function JournalActionsBar({ @@ -32,7 +33,7 @@ export default function JournalActionsBar({ diff --git a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetTable.js b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetTable.js index 8e82e57c2..2640c6436 100644 --- a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetTable.js +++ b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheetTable.js @@ -12,6 +12,7 @@ import { } from 'store/financialStatement/financialStatements.selectors'; import { compose, defaultExpanderReducer } from 'utils'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function BalanceSheetTable({ @@ -27,6 +28,8 @@ function BalanceSheetTable({ onFetchData, loading, }) { + + const {formatMessage} = useIntl(); const columns = useMemo(() => [ { // Build our expander column @@ -68,18 +71,18 @@ function BalanceSheetTable({ disableResizing: true, }, { - Header: 'Account Name', + Header: formatMessage({id:'account_name'}), accessor: 'name', className: "account_name", }, { - Header: 'Code', + Header: formatMessage({id:'code'}), accessor: 'code', className: "code", }, ...(balanceSheetQuery.display_columns_type === 'total') ? [ { - Header: 'Total', + Header: formatMessage({id:'total'}), accessor: 'balance.formatted_amount', Cell: ({ cell }) => { const row = cell.row.original; diff --git a/client/src/containers/FinancialStatements/FinancialStatementDateRange.js b/client/src/containers/FinancialStatements/FinancialStatementDateRange.js index 34479a3c2..efc264a41 100644 --- a/client/src/containers/FinancialStatements/FinancialStatementDateRange.js +++ b/client/src/containers/FinancialStatements/FinancialStatementDateRange.js @@ -2,7 +2,8 @@ import React, {useState, useCallback, useMemo} from 'react'; import {Row, Col} from 'react-grid-system'; import {momentFormatter} from 'utils'; import {DateInput} from '@blueprintjs/datetime'; -import {useIntl} from 'react-intl'; +import { FormattedMessage as T, useIntl } from 'react-intl'; + import { HTMLSelect, FormGroup, diff --git a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js index 5dae6be1c..33dcccad8 100644 --- a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js +++ b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js @@ -5,12 +5,13 @@ import useAsync from 'hooks/async'; import DashboardConnect from 'connectors/Dashboard.connector'; import GeneralLedgerConnect from 'connectors/GeneralLedgerSheet.connect'; import GeneralLedgerHeader from './GeneralLedgerHeader'; -import {compose} from 'utils'; +import { compose } from 'utils'; import DashboardInsider from 'components/Dashboard/DashboardInsider' import DashboardPageContent from 'components/Dashboard/DashboardPageContent'; import GeneralLedgerActionsBar from './GeneralLedgerActionsBar'; import AccountsConnect from 'connectors/Accounts.connector'; import SettingsConnect from 'connectors/Settings.connect'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function GeneralLedger({ changePageTitle, @@ -21,6 +22,7 @@ function GeneralLedger({ requestFetchAccounts, organizationSettings, }) { + const { formatMessage } = useIntl() const [filter, setFilter] = useState({ from_date: moment().startOf('year').format('YYYY-MM-DD'), to_date: moment().endOf('year').format('YYYY-MM-DD'), @@ -30,7 +32,7 @@ function GeneralLedger({ // Change page title of the dashboard. useEffect(() => { - changePageTitle('General Ledger'); + changePageTitle(formatMessage({id:'general_ledger'})); }, []); const fetchHook = useAsync(() => { @@ -45,7 +47,7 @@ function GeneralLedger({ ]); }, false); - const generalLedgerSheetIndex = useMemo(() => + const generalLedgerSheetIndex = useMemo(() => getGeneralLedgerSheetIndex(filter), [getGeneralLedgerSheetIndex, filter]); @@ -55,7 +57,7 @@ function GeneralLedger({ // Handle fetch data of trial balance table. const handleFetchData = useCallback(() => { fetchSheet.execute() }, [fetchSheet]); - + // Handle financial statement filter change. const handleFilterSubmit = useCallback((filter) => { const parsedFilter = { @@ -67,7 +69,7 @@ function GeneralLedger({ fetchSheet.execute(parsedFilter); }, [setFilter, fetchSheet]); - const handleFilterChanged = () => {}; + const handleFilterChanged = () => { }; return ( diff --git a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerActionsBar.js b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerActionsBar.js index 2c8563677..09c355001 100644 --- a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerActionsBar.js +++ b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerActionsBar.js @@ -14,11 +14,14 @@ import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar' import classNames from 'classnames'; import FilterDropdown from 'components/FilterDropdown'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function GeneralLedgerActionsBar({ }) { + const {formatMessage} =useIntl(); + const filterDropdown = FilterDropdown({ fields: [], onFilterChange: (filterConditions) => { @@ -32,7 +35,7 @@ export default function GeneralLedgerActionsBar({ diff --git a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js index b8ba6caaf..e080cb5ea 100644 --- a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js +++ b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js @@ -1,4 +1,4 @@ -import React, {useEffect, useState, useCallback, useMemo} from 'react'; +import React, { useEffect, useState, useCallback, useMemo } from 'react'; import FinancialSheet from 'components/FinancialSheet'; import DataTable from 'components/DataTable'; import Money from 'components/Money'; @@ -6,6 +6,7 @@ import moment from 'moment'; import { defaultExpanderReducer, } from 'utils'; +import { FormattedMessage as T, useIntl } from 'react-intl'; const ROW_TYPE = { @@ -21,9 +22,10 @@ export default function GeneralLedgerTable({ loading, data, }) { + // Account name column accessor. const accountNameAccessor = useCallback((row) => { - switch(row.rowType) { + switch (row.rowType) { case ROW_TYPE.OPENING_BALANCE: return 'Opening Balance'; case ROW_TYPE.CLOSING_BALANCE: @@ -49,32 +51,32 @@ export default function GeneralLedgerTable({ const transaction = cell.row.original if (transaction.rowType === ROW_TYPE.ACCOUNT) { - return (!cell.row.isExpanded) ? + return (!cell.row.isExpanded) ? () : ''; } return (); }, []); const referenceLink = useCallback((row) => { - return ({ row.referenceId }); + return ({row.referenceId}); }); - + const { formatMessage } = useIntl(); const columns = useMemo(() => [ { // Build our expander column id: 'expander', // Make sure it has an ID - className: 'expander', + className: 'expander', Header: ({ getToggleAllRowsExpandedProps, isAllRowsExpanded }) => ( - - {isAllRowsExpanded ? - () : - () - } - - ), + + {isAllRowsExpanded ? + () : + () + } + + ), Cell: ({ row }) => // Use the row.canExpand and row.getToggleRowExpandedProps prop getter // to build the toggle for expanding a row @@ -100,37 +102,37 @@ export default function GeneralLedgerTable({ disableResizing: true, }, { - Header: 'Account Name', + Header: formatMessage({id:'account_name'}), accessor: accountNameAccessor, className: "name", }, { - Header: 'Date', + Header: formatMessage({id:'date'}), accessor: dateAccessor, className: "date", }, { - Header: 'Transaction Type', + Header: formatMessage({id:'transaction_type'}), accessor: 'referenceType', className: 'transaction_type', }, { - Header: 'Trans. NUM', + Header: formatMessage({id:'trans_num'}), accessor: referenceLink, className: 'transaction_number' }, { - Header: 'Description', + Header: formatMessage({id:'description'}), accessor: 'note', className: 'description', }, { - Header: 'Amount', + Header: formatMessage({id:'amount'}), Cell: amountCell, className: 'amount' }, { - Header: 'Balance', + Header: formatMessage({id:'balance'}), Cell: amountCell, className: 'balance', }, @@ -159,7 +161,7 @@ export default function GeneralLedgerTable({ expanded={expandedRows} virtualizedRows={true} fixedItemSize={37} - fixedSizeHeight={1000} /> + fixedSizeHeight={1000} /> - ); + ); } \ No newline at end of file diff --git a/client/src/containers/FinancialStatements/Journal/Journal.js b/client/src/containers/FinancialStatements/Journal/Journal.js index 58906df36..d13e83369 100644 --- a/client/src/containers/FinancialStatements/Journal/Journal.js +++ b/client/src/containers/FinancialStatements/Journal/Journal.js @@ -14,6 +14,7 @@ import SettingsConnect from 'connectors/Settings.connect'; import withDashboard from 'containers/Dashboard/withDashboard'; import withJournal from './withJournal'; import withJournalActions from './withJournalActions'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function Journal({ @@ -34,9 +35,9 @@ function Journal({ to_date: moment().endOf('year').format('YYYY-MM-DD'), basis: 'accural' }); - +const {formatMessage} =useIntl(); useEffect(() => { - changePageTitle('Journal Sheet'); + changePageTitle(formatMessage({id:'journal_sheet'})); }, []); const fetchHook = useQuery(['journal', filter], diff --git a/client/src/containers/FinancialStatements/Journal/JournalActionsBar.js b/client/src/containers/FinancialStatements/Journal/JournalActionsBar.js index 9e792d07d..c4b2a1896 100644 --- a/client/src/containers/FinancialStatements/Journal/JournalActionsBar.js +++ b/client/src/containers/FinancialStatements/Journal/JournalActionsBar.js @@ -14,7 +14,7 @@ import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar' import classNames from 'classnames'; import FilterDropdown from 'components/FilterDropdown'; - +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function JournalActionsBar({ @@ -32,7 +32,7 @@ export default function JournalActionsBar({ diff --git a/client/src/containers/FinancialStatements/Journal/JournalTable.js b/client/src/containers/FinancialStatements/Journal/JournalTable.js index b9aac4fb7..2f6403233 100644 --- a/client/src/containers/FinancialStatements/Journal/JournalTable.js +++ b/client/src/containers/FinancialStatements/Journal/JournalTable.js @@ -12,6 +12,7 @@ import { } from 'store/financialStatement/financialStatements.selectors'; import withJournal from './withJournal'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function JournalSheetTable({ @@ -30,46 +31,48 @@ function JournalSheetTable({ const exceptRowTypes = (rowType, value, types) => { return (types.indexOf(rowType) !== -1) ? '' : value; }; +const {formatMessage} =useIntl(); + const columns = useMemo(() => [ { - Header: 'Date', + Header: formatMessage({id:'date'}), accessor: r => rowTypeFilter(r.rowType, moment(r.date).format('YYYY/MM/DD'), ['first_entry']), className: 'date', width: 85, }, { - Header: 'Transaction Type', + Header: formatMessage({id:'transaction_type'}), accessor: r => rowTypeFilter(r.rowType, r.transaction_type, ['first_entry']), className: "transaction_type", width: 145, }, { - Header: 'Num.', + Header: formatMessage({id:'num'}), accessor: r => rowTypeFilter(r.rowType, r.reference_id, ['first_entry']), className: 'reference_id', width: 70, }, { - Header: 'Description', + Header: formatMessage({id:'description'}), accessor: 'note', }, { - Header: 'Acc. Code', + Header: formatMessage({id:'acc_code'}), accessor: 'account.code', width: 120, className: 'account_code', }, { - Header: 'Account', + Header: formatMessage({id:'account'}), accessor: 'account.name', }, { - Header: 'Credit', + Header: formatMessage({id:'credit'}), accessor: r => exceptRowTypes( r.rowType, (), ['space_entry']), }, { - Header: 'Debit', + Header: formatMessage({id:'debit'}), accessor: r => exceptRowTypes( r.rowType, (), ['space_entry']), }, diff --git a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossActionsBar.js b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossActionsBar.js index 763b6dda7..c476a1d36 100644 --- a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossActionsBar.js +++ b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossActionsBar.js @@ -9,6 +9,7 @@ import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar' import classNames from 'classnames'; import FilterDropdown from 'components/FilterDropdown'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function ProfitLossActionsBar({ @@ -26,19 +27,19 @@ export default function ProfitLossActionsBar({ diff --git a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheetTable.js b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheetTable.js index 954cfe382..6dede2914 100644 --- a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheetTable.js +++ b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheetTable.js @@ -9,6 +9,7 @@ import { getFinancialSheetIndexByQuery, } from 'store/financialStatement/financialStatements.selectors'; import withProfitLossDetail from './withProfitLoss'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function ProfitLossSheetTable({ @@ -22,6 +23,9 @@ function ProfitLossSheetTable({ onFetchData, companyName, }) { + + const {formatMessage} =useIntl(); + const columns = useMemo(() => [ { // Build our expander column @@ -63,18 +67,18 @@ function ProfitLossSheetTable({ disableResizing: true, }, { - Header: 'Account Name', + Header: formatMessage({id:'account_name'}), accessor: 'name', className: "name", }, { - Header: 'Acc. Code', + Header: formatMessage({id:'acc_code'}), accessor: 'code', className: "account_code", }, ...(profitLossQuery.display_columns_type === 'total') ? [ { - Header: 'Total', + Header: formatMessage({id:'total'}), Cell: ({ cell }) => { const row = cell.row.original; if (row.total) { diff --git a/client/src/containers/FinancialStatements/RadiosAccountingBasis.js b/client/src/containers/FinancialStatements/RadiosAccountingBasis.js index ac3eee2e0..bdcf502f9 100644 --- a/client/src/containers/FinancialStatements/RadiosAccountingBasis.js +++ b/client/src/containers/FinancialStatements/RadiosAccountingBasis.js @@ -9,20 +9,20 @@ import { export default function RadiosAccountingBasis(props) { const { onChange, ...rest } = props; - const intl = useIntl(); + const {formatMessage} = useIntl(); return ( { onChange && onChange(value); })} className={'radio-group---accounting-basis'} {...rest}> - - + + ); } \ No newline at end of file diff --git a/client/src/containers/FinancialStatements/SelectDisplayColumnsBy.js b/client/src/containers/FinancialStatements/SelectDisplayColumnsBy.js index 54ab6aa74..a3989ef3d 100644 --- a/client/src/containers/FinancialStatements/SelectDisplayColumnsBy.js +++ b/client/src/containers/FinancialStatements/SelectDisplayColumnsBy.js @@ -6,6 +6,7 @@ import { FormGroup, MenuItem, } from '@blueprintjs/core'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function SelectsListColumnsBy(props) { const { onItemSelect, formGroupProps, selectListProps } = props; @@ -30,12 +31,12 @@ export default function SelectsListColumnsBy(props) { }, [setItemSelected, onItemSelect]); const buttonLabel = useMemo(() => - itemSelected ? itemSelected.name : 'Select display columns by...', + itemSelected ? itemSelected.name : , [itemSelected]); return ( } className="form-group-display-columns-by form-group--select-list bp3-fill" inline={false} {...formGroupProps}> diff --git a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceActionsBar.js b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceActionsBar.js index 9bcec4b82..b9089c97b 100644 --- a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceActionsBar.js +++ b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceActionsBar.js @@ -14,6 +14,7 @@ import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar' import classNames from 'classnames'; import FilterDropdown from 'components/FilterDropdown'; +import { FormattedMessage as T, useIntl } from 'react-intl'; export default function GeneralLedgerActionsBar({ @@ -31,19 +32,19 @@ export default function GeneralLedgerActionsBar({ diff --git a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js index aaab70c60..b312e0b9b 100644 --- a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js +++ b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js @@ -10,6 +10,7 @@ import { import withTrialBalance from './withTrialBalance'; import { compose } from 'utils'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function TrialBalanceSheetTable({ @@ -23,6 +24,9 @@ function TrialBalanceSheetTable({ loading, companyName, }) { + + const {formatMessage} =useIntl(); + const columns = useMemo(() => [ { // Build our expander column @@ -64,30 +68,30 @@ function TrialBalanceSheetTable({ disableResizing: true, }, { - Header: 'Account Name', + Header: formatMessage({id:'account_name'}), accessor: 'name', className: "name", }, { - Header: 'Code', + Header: formatMessage({id:'code'}), accessor: 'code', className: "code", width: 120, }, { - Header: 'Credit', + Header: formatMessage({id:'credit'}), accessor: r => (), className: 'credit', width: 120, }, { - Header: 'Debit', + Header: formatMessage({id:'debit'}), accessor: r => (), className: 'debit', width: 120, }, { - Header: 'Balance', + Header: formatMessage({id:'balance'}), accessor: r => (), className: 'balance', width: 120, diff --git a/client/src/containers/Items/ItemForm.js b/client/src/containers/Items/ItemForm.js index 41af8c3f5..6fd9362f9 100644 --- a/client/src/containers/Items/ItemForm.js +++ b/client/src/containers/Items/ItemForm.js @@ -57,10 +57,10 @@ const ItemForm = ({ const ItemTypeDisplay = useMemo( () => [ - { value: null, label: 'Select Item Type' }, - { value: 'service', label: 'Service' }, - { value: 'inventory', label: 'Inventory' }, - { value: 'non-inventory', label: 'Non-Inventory' }, + { value: null, label: formatMessage({id:'select_item_type'}) }, + { value: 'service', label: formatMessage({id:'service'}) }, + { value: 'inventory', label: formatMessage({id:'inventory'}) }, + { value: 'non-inventory', label: formatMessage({id:'non_inventory'}) }, ], [] ); @@ -308,7 +308,7 @@ const ItemForm = ({ rightIcon='caret-down' text={getSelectedAccountLabel( 'category_id', - 'Select category' + formatMessage({id:'select_category'}) )} /> @@ -399,7 +399,7 @@ const ItemForm = ({ rightIcon='caret-down' text={getSelectedAccountLabel( 'sell_account_id', - 'Select account' + formatMessage({id:'select_account'}) )} /> @@ -462,7 +462,8 @@ const ItemForm = ({ rightIcon='caret-down' text={getSelectedAccountLabel( 'cost_account_id', - 'Select account' + formatMessage({id:'select_account'}) + )} /> @@ -508,7 +509,8 @@ const ItemForm = ({ rightIcon='caret-down' text={getSelectedAccountLabel( 'inventory_account_id', - 'Select account' + formatMessage({id:'select_account'}) + )} /> diff --git a/client/src/containers/Items/ItemsActionsBar.js b/client/src/containers/Items/ItemsActionsBar.js index 9d4a62a4c..99f647168 100644 --- a/client/src/containers/Items/ItemsActionsBar.js +++ b/client/src/containers/Items/ItemsActionsBar.js @@ -38,23 +38,26 @@ const ItemsActionsBar = ({ const { path } = useRouteMatch(); const history = useHistory(); const [filterCount, setFilterCount] = useState(0); - - const viewsMenuItems = itemsViews.map(view => - ()); + const { formatMessage } = useIntl(); + const viewsMenuItems = itemsViews.map((view) => ( + + )); const onClickNewItem = () => { - history.push('/dashboard/items/new'); + history.push('/items/new'); }; - const hasSelectedRows = useMemo(() => selectedRows.length > 0, [selectedRows]); + const hasSelectedRows = useMemo(() => selectedRows.length > 0, [ + selectedRows, + ]); const filterDropdown = FilterDropdown({ fields: resourceFields, onFilterChange: (filterConditions) => { setFilterCount(filterConditions.length); onFilterChanged && onFilterChanged(filterConditions); - } + }, }); - + const onClickNewCategory = useCallback(() => { openDialog('item-form', {}); }, [openDialog]); @@ -71,7 +74,7 @@ const ItemsActionsBar = ({ - +
diff --git a/client/src/containers/Preferences/Users/UsersList.js b/client/src/containers/Preferences/Users/UsersList.js index 99eddcd57..32d0dba79 100644 --- a/client/src/containers/Preferences/Users/UsersList.js +++ b/client/src/containers/Preferences/Users/UsersList.js @@ -24,6 +24,7 @@ import withUsers from 'containers/Users/withUsers'; import withUsersActions from 'containers/Users/withUsersActions'; import { compose } from 'utils'; +import { FormattedMessage as T, useIntl } from 'react-intl'; function UsersListPreferences({ @@ -33,7 +34,7 @@ function UsersListPreferences({ // #withUsers usersList, - + // #withUsersActions requestDeleteUser, requestInactiveUser, @@ -44,14 +45,14 @@ function UsersListPreferences({ }) { const [deleteUserState, setDeleteUserState] = useState(false); const [inactiveUserState, setInactiveUserState] = useState(false); - - const fetchUsers = useQuery('users-table', + const { formatMessage } = useIntl() + const fetchUsers = useQuery('users-table', () => requestFetchUsers()); const onInactiveUser = (user) => { setInactiveUserState(user); }; - + // Handle cancel inactive user alert const handleCancelInactiveUser = useCallback(() => { setInactiveUserState(false); @@ -61,7 +62,7 @@ function UsersListPreferences({ const handleConfirmUserActive = useCallback(() => { requestInactiveUser(inactiveUserState.id).then(() => { setInactiveUserState(false); - AppToaster.show({ message: 'the_user_has_been_inactivated' }); + AppToaster.show({ message: formatMessage({id:'the_user_has_been_successfully_inactivated'}) }); }); }, [inactiveUserState, requestInactiveUser, requestFetchUsers]); @@ -98,7 +99,7 @@ function UsersListPreferences({ requestDeleteUser(deleteUserState.id).then((response) => { setDeleteUserState(false); AppToaster.show({ - message: 'the_user_has_been_deleted', + message: formatMessage({id:'the_user_has_been_successfully_deleted'}), }); }); }; @@ -106,11 +107,11 @@ function UsersListPreferences({ const actionMenuList = useCallback( (user) => ( - + } onClick={onEditUser(user)} /> - - onInactiveUser(user)} /> - onDeleteUser(user)} /> + } onClick={onEditInviteUser(user)} /> + } onClick={() => onInactiveUser(user)} /> + } onClick={() => onDeleteUser(user)} /> ), [] @@ -119,25 +120,25 @@ function UsersListPreferences({ const columns = useMemo(() => [ { id: 'full_name', - Header: 'Full Name', - accessor: 'full_name', + Header:formatMessage({id:'full_name'}), + accessor: 'full_name', width: 170, }, { id: 'email', - Header: 'Email', + Header: formatMessage({id:'email'}), accessor: 'email', width: 150, }, { id: 'phone_number', - Header: 'Phone Number', + Header: formatMessage({id:'phone_number'}), accessor: 'phone_number', width: 150, }, { id: 'active', - Header: 'Status', + Header: formatMessage({id:'status'}), accessor: (user) => user.active ? Active : Inactivate, width: 50, @@ -174,8 +175,8 @@ function UsersListPreferences({ /> } + confirmButtonText={} icon='trash' intent={Intent.DANGER} isOpen={deleteUserState} @@ -189,8 +190,8 @@ function UsersListPreferences({ } + confirmButtonText={} icon='trash' intent={Intent.WARNING} isOpen={inactiveUserState} diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js index fcff12224..9e1dbf9b5 100644 --- a/client/src/lang/en/index.js +++ b/client/src/lang/en/index.js @@ -3,7 +3,7 @@ export default { email_or_phone_number: 'Email or phone number', password: 'Password', login: 'Login', - invalid_email_or_phone_numner: 'Invalid email or phone number.', + invalid_email_or_phone_number: 'Invalid email or phone number.', required: 'Required', reset_password: 'Reset Password', the_user_has_been_suspended_from_admin: 'The user has been suspended from the administrator.', @@ -67,6 +67,7 @@ export default { edit_account: 'Edit Account', new_account: 'New Account', edit_currency: 'Edit Currency', + delete_currency: 'Delete Currency', new_currency: 'New Currency', currency_name: 'Currency Name', currency_code: 'Currency Code', @@ -134,6 +135,7 @@ export default { inactivate: 'Inactivate', activate: 'Activate', inactivate_account: 'Inactivate Account', + activate_account:'Activate Account', delete_account: 'Delete Account', code: 'Code', type: 'Type', @@ -164,32 +166,143 @@ export default { new_custom_view: 'New Custom View', view_name: 'View Name', new_conditional: 'New Conditional', - 'item': 'Item', - 'account': 'Account', - 'service_has_been_successful_created': '{service} {name} has been successfully created.', - 'service_has_been_successful_edited': '{service} {name} has been successfully edited.', - 'you_are_about_permanently_delete_this_journal': `You're about to permanently delete this journal and all its transactions on accounts and attachments, and all of its data.

If you're not sure, you can archive this journal instead.`, - 'once_delete_these_accounts_you_will_not_able_restore_them': 'Once you delete these accounts, you won\'t be able to retrieve them later. Are you sure you want to delete them?', - 'once_delete_these_service_you_will_not_able_restore_it': 'Once you delete these {service}, you won\'t be able to retrieve them later. Are you sure you want to delete this {service}?', - 'you_could_not_delete_predefined_accounts': 'You could\'t delete predefined accounts.', - 'cannot_delete_account_has_associated_transactions': 'you could\'t not delete account that has associated transactions.', - 'the_account_has_been_successfully_inactivated': 'The account has been successfully inactivated.', - 'the_account_has_been_successfully_activated': 'The account has been successfully activated.', - 'the_account_has_been_successfully_deleted': 'The account has been successfully deleted.', - 'the_accounts_has_been_successfully_deleted': 'The accounts have been successfully deleted.', - 'are_sure_to_inactive_this_account': 'Are you sure you want to inactive this account? You will be able to activate it later', - 'are_sure_to_activate_this_account': 'Are you sure you want to activate this account? You will be able to inactivate it later', - 'once_delete_this_account_you_will_able_to_restore_it': `Once you delete this account, you won\'t be able to restore it later. Are you sure you want to delete this account?

If you're not sure, you can inactivate this account instead.`, - 'the_journal_has_been_successfully_created': 'The journal #{number} has been successfully created.', - 'the_journal_has_been_successfully_edited': 'The journal #{number} has been successfully edited.', - 'credit': 'Credit', - 'debit': 'Debit', - 'once_delete_this_item_you_will_able_to_restore_it': `Once you delete this item, you won\'t be able to restore the item later. Are you sure you want to delete ?

If you're not sure, you can inactivate it instead.`, - 'the_item_has_been_successfully_deleted': 'The item has been successfully deleted.', - 'the_item_category_has_been_successfully_created': 'The item category has been successfully created.', - 'the_item_category_has_been_successfully_edited': 'The item category has been successfully edited.', - 'once_delete_these_views_you_will_not_able_restore_them': 'Once you delete the custom view, you won\'t be able to restore it later. Are you sure you want to delete this view?', - 'the_custom_view_has_been_successfully_deleted': 'The custom view has been successfully deleted.', - 'teammate_invited_to_organization_account': 'Your teammate has been invited to the organization account.', - 'select_account_type': 'Select account type', + item: 'Item', + service_has_been_successful_created: '{service} {name} has been successfully created.', + service_has_been_successful_edited: '{service} {name} has been successfully edited.', + you_are_about_permanently_delete_this_journal: `You're about to permanently delete this journal and all its transactions on accounts and attachments, and all of its data.

If you're not sure, you can archive this journal instead.`, + once_delete_these_accounts_you_will_not_able_restore_them: 'Once you delete these accounts, you won\'t be able to retrieve them later. Are you sure you want to delete them?', + once_delete_these_service_you_will_not_able_restore_it: 'Once you delete these {service}, you won\'t be able to retrieve them later. Are you sure you want to delete this {service}?', + you_could_not_delete_predefined_accounts: 'You could\'t delete predefined accounts.', + cannot_delete_account_has_associated_transactions: 'you could\'t not delete account that has associated transactions.', + the_account_has_been_successfully_inactivated: 'The account has been successfully inactivated.', + the_account_has_been_successfully_activated: 'The account has been successfully activated.', + the_account_has_been_successfully_deleted: 'The account has been successfully deleted.', + the_accounts_has_been_successfully_deleted: 'The accounts have been successfully deleted.', + are_sure_to_inactive_this_account: 'Are you sure you want to inactive this account? You will be able to activate it later', + are_sure_to_activate_this_account: 'Are you sure you want to activate this account? You will be able to inactivate it later', + once_delete_this_account_you_will_able_to_restore_it: `Once you delete this account, you won\'t be able to restore it later. Are you sure you want to delete this account?

If you're not sure, you can inactivate this account instead.`, + the_journal_has_been_successfully_created: 'The journal #{number} has been successfully created.', + the_journal_has_been_successfully_edited: 'The journal #{number} has been successfully edited.', + credit: 'Credit', + debit: 'Debit', + once_delete_this_item_you_will_able_to_restore_it: `Once you delete this item, you won\'t be able to restore the item later. Are you sure you want to delete ?

If you're not sure, you can inactivate it instead.`, + the_item_has_been_successfully_deleted: 'The item has been successfully deleted.', + the_item_category_has_been_successfully_created: 'The item category has been successfully created.', + the_item_category_has_been_successfully_edited: 'The item category has been successfully edited.', + once_delete_these_views_you_will_not_able_restore_them: 'Once you delete the custom view, you won\'t be able to restore it later. Are you sure you want to delete this view?', + the_custom_view_has_been_successfully_deleted: 'The custom view has been successfully deleted.', + teammate_invited_to_organization_account: 'Your teammate has been invited to the organization account.', + select_account_type: 'Select account type', + menu:'Menu', + graph:'Graph', + map:'Map', + table:'Table', + nucleus:'Nucleus', + logout:'Logout', + the_expense_has_been_successfully_created: 'The expense has been successfully created.', + select_payment_account:'Select Payment Account', + select_expense_account:'Select Expense Account', + and:'And', + or:'OR', + select_a_comparator:'Select a comparator', + equals:'Equals', + not_equal:'Not Equal', + contain:'Contain', + not_contain:'Not Contain', + cash:'Cash', + accrual:'Accrual', + from:'From', + to:'To', + accounting_basis:'Accounting Basis:', + general:'General', + users:'Users', + currencies:'Currencies', + accountant:'Accountant', + accounts:'Accounts', + homepage:'Homepage', +items_list:'Items List', +new_item:'New Item', +items:'Items', +category_list:'Category List', +financial:'Financial', +accounts_chart:'Accounts Chart', +manual_journal:'Manual Journal', +make_journal:'Make Journal', +exchange_rate:'Exchange Rate', +banking:'Banking', +sales:'Sales', +purchases:'Purchases', +financial_reports:'Financial Reports', +balance_sheet:'Balance Sheet', +trial_balance_sheet:'Trial Balance Sheet', +journal:'Journal', +general_ledger:'General Ledger', +profit_loss_sheet:'Profit Loss Sheet', +expenses:'Expenses', +expenses_list:'Expenses List', +new_expenses:'New Expenses', +preferences:'Preferences', +auditing_system:'Auditing System', +all:'All', +organization:'Organization.', +check_your_email_for_a_link_to_reset: 'Check your email for a link to reset your password.If it doesn’t appear within a few minutes, check your spam folder.', +we_couldn_t_find_your_account_with_that_email:'We couldn\'t find your account with that email.', +select_parent_account:'Select Parent Account', +the_exchange_rate_has_been_successfully_edited:'The exchange rate has been successfully edited', +the_exchange_rate_has_been_successfully_created:'The exchange rate has been successfully created', +the_exchange_rate_has_been_successfully_deleted: 'The exchange rate has been successfully deleted.', +the_user_details_has_been_updated:'The user details has been updated', +the_category_has_been_successfully_created: 'The category has been successfully created.', +filters_applied:'filters applied', +the_expense_has_been_successfully_deleted: 'The expense has been successfully deleted.', +select_item_type:'Select Item Type', +service:'Service', +inventory:'Inventory', +non_inventory:'Non-Inventory', +select_category:'Select category', +select_account:'Select Account', +custom_fields:'Custom Fields', +the_currency_has_been_successfully_deleted:'The currency has been successfully deleted', +organization_industry:'Organization Industry', +business_location:'Business Location', +base_currency:'Base Currency', +fiscal_year:'Fiscal Year', +language:'Language', +time_zone:'Time Zone', +date_format:'Date Format', +edit_user:'Edit User', +edit_invite:'Edit Invite', +inactivate_user:'Inactivate User', +delete_user:'Delete User', +full_name:'Full Name', +the_user_has_been_successfully_inactivated: 'The user has been successfully inactivated.', +the_user_has_been_successfully_deleted: 'The user has been successfully deleted.', +customize_report:'Customize Report', +print:'Print', +export:'Export', +accounts_with_zero_balance:'Accounts with Zero Balance', +all_transactions:'All Transactions', +filter_accounts:'Filter Accounts', +calculate_report:'Calculate Report', +total:'Total', +specific_accounts:'Specific Accounts', +trans_num:'Trans. NUM', +journal_sheet:'Journal Sheet', +run_report:'Run Report', +num:'Num.', +acc_code:'Acc. Code', +display_report_columns:'Display report columns', +select_display_columns_by:'Select display columns by...' + + + + + + + + + }; + + + diff --git a/client/src/routes/dashboard.js b/client/src/routes/dashboard.js index b558fa2ac..19fdec1fc 100644 --- a/client/src/routes/dashboard.js +++ b/client/src/routes/dashboard.js @@ -1,136 +1,153 @@ import LazyLoader from 'components/LazyLoader'; -const BASE_URL = '/dashboard'; +// const BASE_URL = '/dashboard'; export default [ // Homepage { - path: `${BASE_URL}/homepage`, + path: `/homepage`, component: LazyLoader({ loader: () => import('containers/Homepage/Homepage'), }), + breadcrumb: 'Home', }, // Accounts. { - path: `${BASE_URL}/accounts`, + path: `/accounts`, component: LazyLoader({ loader: () => import('containers/Accounts/AccountsChart'), }), + breadcrumb: 'Accounts Chart', }, // Custom views. { - path: `${BASE_URL}/custom_views/:resource_slug/new`, + path: `/custom_views/:resource_slug/new`, component: LazyLoader({ loader: () => import('containers/Views/ViewFormPage'), }), + breadcrumb: 'New', }, { - path: `${BASE_URL}/custom_views/:view_id/edit`, + path: `/custom_views/:view_id/edit`, component: LazyLoader({ loader: () => import('containers/Views/ViewFormPage'), }), + breadcrumb: 'Edit', }, // Expenses. { - path: `${BASE_URL}/expenses/new`, + path: `/expenses/new`, component: LazyLoader({ loader: () => import('containers/Expenses/ExpenseForm'), }), + breadcrumb: 'New Expense', }, { - path: `${BASE_URL}/expenses`, + path: `/expenses`, component: LazyLoader({ loader: () => import('containers/Expenses/ExpensesList'), }), + breadcrumb: 'Expenses', }, // Accounting { - path: `${BASE_URL}/accounting/make-journal-entry`, + path: `/make-journal-entry`, component: LazyLoader({ loader: () => import('containers/Accounting/MakeJournalEntriesPage'), }), + breadcrumb: 'Make Journal Entry', }, { - path: `${BASE_URL}/accounting/manual-journals/:id/edit`, + path: `/manual-journals/:id/edit`, component: LazyLoader({ loader: () => import('containers/Accounting/MakeJournalEntriesPage'), }), + breadcrumb: 'Edit', }, { - path: `${BASE_URL}/accounting/manual-journals`, + path: `/manual-journals`, component: LazyLoader({ loader: () => import('containers/Accounting/ManualJournalsList'), }), + breadcrumb: 'Manual Journals', }, { - path: `${BASE_URL}/items/categories`, + path: `/items/categories`, component: LazyLoader({ loader: () => import('containers/Items/ItemCategoriesList'), }), + breadcrumb: 'Categories', }, { - path: `${BASE_URL}/items/new`, + path: `/items/new`, component: LazyLoader({ loader: () => import('containers/Items/ItemFormPage'), }), + breadcrumb: 'New Item', }, // Items { - path: `${BASE_URL}/items`, + path: `/items`, component: LazyLoader({ loader: () => import('containers/Items/ItemsList'), }), + breadcrumb: 'Items', }, // Financial Reports. { - path: `${BASE_URL}/accounting/general-ledger`, + path: `/general-ledger`, component: LazyLoader({ loader: () => import('containers/FinancialStatements/GeneralLedger/GeneralLedger'), }), + breadcrumb: 'General Ledger', }, { - path: `${BASE_URL}/accounting/balance-sheet`, + path: `/balance-sheet`, component: LazyLoader({ loader: () => import('containers/FinancialStatements/BalanceSheet/BalanceSheet'), }), + breadcrumb: 'Balance Sheet', }, { - path: `${BASE_URL}/accounting/trial-balance-sheet`, + path: `/trial-balance-sheet`, component: LazyLoader({ loader: () => import( 'containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheet' ), + breadcrumb: 'Trial Balance Sheet', }), }, { - path: `${BASE_URL}/accounting/profit-loss-sheet`, + path: `/profit-loss-sheet`, component: LazyLoader({ loader: () => import( 'containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet' ), + breadcrumb: 'Profit Loss Sheet', }), }, { - path: `${BASE_URL}/accounting/journal-sheet`, + path: `/journal-sheet`, component: LazyLoader({ loader: () => import('containers/FinancialStatements/Journal/Journal'), }), + breadcrumb: 'Journal Sheet', }, { - path: `${BASE_URL}/ExchangeRates`, + path: `/ExchangeRates`, component: LazyLoader({ - loader: () => - import('containers/ExchangeRates/ExchangeRate'), + loader: () => import('containers/ExchangeRates/ExchangeRate'), }), + breadcrumb: 'Exchange Rates', }, ]; diff --git a/client/src/routes/preferences.js b/client/src/routes/preferences.js index 7439409c7..d751c0b40 100644 --- a/client/src/routes/preferences.js +++ b/client/src/routes/preferences.js @@ -4,7 +4,7 @@ import Accountant from 'containers/Preferences/Accountant/Accountant'; import Accounts from 'containers/Preferences/Accounts/Accounts'; import CurrenciesList from 'containers/Preferences/Currencies/CurrenciesList' -const BASE_URL = '/dashboard/preferences'; +const BASE_URL = '/preferences'; export default [ { diff --git a/client/src/store/resources/resources.reducer.js b/client/src/store/resources/resources.reducer.js index 019669e3c..9ba1e37a4 100644 --- a/client/src/store/resources/resources.reducer.js +++ b/client/src/store/resources/resources.reducer.js @@ -11,15 +11,15 @@ const initialState = { metadata: { 'accounts': { label: 'Accounts', - baseRoute: '/dashboard/accounts', + baseRoute: '/accounts', }, 'items': { label: 'Items', - baseRoute: '/dashboard/items', + baseRoute: '/items', }, 'manual_journals': { label: 'Journals', - baseRoute: '/dashboard/accounting/manual-journals', + baseRoute: '/manual-journals', } } };