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/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/DashboardBreadcrumbs.js b/client/src/components/Dashboard/DashboardBreadcrumbs.js index 82b6faa08..a6d0905b0 100644 --- a/client/src/components/Dashboard/DashboardBreadcrumbs.js +++ b/client/src/components/Dashboard/DashboardBreadcrumbs.js @@ -3,38 +3,33 @@ import { CollapsibleList, MenuItem, Classes, - Boundary + Boundary, } from '@blueprintjs/core'; import classNames from 'classnames'; +import withBreadcrumbs from 'react-router-breadcrumbs-hoc'; +import routes from 'routes/dashboard'; +import { useHistory } from 'react-router-dom'; -export default function DashboardBreadcrumbs() { - function renderBreadcrumb(props) { - if (props.href != null) { - return {props.text}; - } else { - return ( - - {props.text} - - ); - } - } - return ( +function DashboardBreadcrumbs( {breadcrumbs }){ + const history = useHistory(); + + return( } - visibleItemRenderer={renderBreadcrumb} - collapseFrom={Boundary.START} - visibleItemCount={0} - > - - - - - - + className={Classes.BREADCRUMBS} + dropdownTarget={} + collapseFrom={Boundary.START} + visibleItemCount={0}> + { + breadcrumbs.map(({ breadcrumb,match })=>{ + return ( history.push(match.url) } />) + }) + } - ); + ) } + +export default withBreadcrumbs(routes)(DashboardBreadcrumbs) diff --git a/client/src/components/Dashboard/DashboardContentRoute.js b/client/src/components/Dashboard/DashboardContentRoute.js index be45197a9..ad7291ed2 100644 --- a/client/src/components/Dashboard/DashboardContentRoute.js +++ b/client/src/components/Dashboard/DashboardContentRoute.js @@ -5,7 +5,7 @@ import routes from 'routes/dashboard' 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..a902ac1b7 100644 --- a/client/src/components/Expenses/ExpenseForm.js +++ b/client/src/components/Expenses/ExpenseForm.js @@ -32,14 +32,14 @@ export default function ExpenseForm({ selectedPaymentAccount: null }); const validationSchema = Yup.object().shape({ - date: Yup.date().required(), - description: Yup.string().trim(), - expense_account_id: Yup.number().required(), - payment_account_id: Yup.number().required(), - amount: Yup.number().required(), - currency_code: Yup.string().required(), - publish: Yup.boolean(), - exchange_rate: Yup.number() + date: Yup.date().required().label(formatMessage({id:'date'})), + description: Yup.string().trim().label(formatMessage({id:'description'})), + expense_account_id: Yup.number().required().label(formatMessage({id:'expense_account_id'})), + payment_account_id: Yup.number().required().label(formatMessage({id:'payment_account_id'})), + amount: Yup.number().required().label(formatMessage({id:'amount'})), + currency_code: Yup.string().required().label(formatMessage({id:'currency_code_'})), + publish: Yup.boolean().label(formatMessage({id:'publish'})), + exchange_rate: Yup.number().label(formatMessage({id:'exchange_rate_'})) }); const formik = useFormik({ @@ -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/MakeJournalEntriesForm.js b/client/src/containers/Accounting/MakeJournalEntriesForm.js index 2538e460b..4f72313ce 100644 --- a/client/src/containers/Accounting/MakeJournalEntriesForm.js +++ b/client/src/containers/Accounting/MakeJournalEntriesForm.js @@ -63,8 +63,8 @@ function MakeJournalEntriesForm({ }, [changePageTitle, changePageSubtitle, manualJournal]); const validationSchema = Yup.object().shape({ - journal_number: Yup.string().required(), - date: Yup.date().required(), + journal_number: Yup.string().required().label(formatMessage({id:'journal_number_'})), + date: Yup.date().required().label(formatMessage({id:'date'})), reference: Yup.string(), description: Yup.string(), entries: Yup.array().of( @@ -147,7 +147,7 @@ function MakeJournalEntriesForm({ // Validate the total credit should be eqials total debit. if (totalCredit !== totalDebit) { AppToaster.show({ - message: 'credit_and_debit_not_equal', + message: formatMessage({id:'credit_and_debit_not_equal'}), }); setSubmitting(false); return; 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 fc12e0650..8d052611f 100644 --- a/client/src/containers/Accounting/ManualJournalActionsBar.js +++ b/client/src/containers/Accounting/ManualJournalActionsBar.js @@ -54,7 +54,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 5d5de9eae..36ec25621 100644 --- a/client/src/containers/Accounting/ManualJournalsList.js +++ b/client/src/containers/Accounting/ManualJournalsList.js @@ -122,7 +122,7 @@ function ManualJournalsTable({ const handleEditJournal = useCallback( (journal) => { - history.push(`/dashboard/accounting/manual-journals/${journal.id}/edit`); + history.push(`/manual-journals/${journal.id}/edit`); }, [history] ); @@ -182,8 +182,8 @@ function ManualJournalsTable({ diff --git a/client/src/containers/Accounting/ManualJournalsViewTabs.js b/client/src/containers/Accounting/ManualJournalsViewTabs.js index a3bd8c3bc..fe4042945 100644 --- a/client/src/containers/Accounting/ManualJournalsViewTabs.js +++ b/client/src/containers/Accounting/ManualJournalsViewTabs.js @@ -41,7 +41,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); @@ -63,7 +63,7 @@ function ManualJournalsViewTabs({ }, [customViewId]); const tabs = manualJournalsViews.map((view) => { - const baseUrl = '/dashboard/accounting/manual-journals'; + const baseUrl = '/manual-journals'; const link = ( { 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 bf69d8cbb..0b7a368c2 100644 --- a/client/src/containers/Accounts/AccountsChart.js +++ b/client/src/containers/Accounts/AccountsChart.js @@ -98,7 +98,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'}) }); } } @@ -313,8 +313,8 @@ const handleConfirmBulkActivate = useCallback(() => { @@ -373,8 +373,8 @@ const handleConfirmBulkActivate = useCallback(() => { } + 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..cb746408a 100644 --- a/client/src/containers/Authentication/InviteAccept.js +++ b/client/src/containers/Authentication/InviteAccept.js @@ -33,14 +33,14 @@ function Invite({ requestInviteAccept, requestInviteMetaByToken }) { }, [shown]); const ValidationSchema = Yup.object().shape({ - first_name: Yup.string().required(formatMessage({ id: 'required' })), - last_name: Yup.string().required(formatMessage({ id: 'required' })), + first_name: Yup.string().required().label(formatMessage({id:'first_name_'})), + last_name: Yup.string().required().label(formatMessage({id:'last_name_'})), phone_number: Yup.string() .matches() - .required(formatMessage({ id: 'required' })), + .required().label(formatMessage({id:''})), password: Yup.string() - .min(4, 'Password has to be longer than 4 characters!') - .required('Password is required!'), + .min(4) + .required().label(formatMessage({id:'password'})) }); const inviteMeta = useAsync(() => { @@ -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..fe6b47ce8 100644 --- a/client/src/containers/Authentication/Login.js +++ b/client/src/containers/Authentication/Login.js @@ -1,6 +1,8 @@ import React, { useMemo, useState } from 'react'; import { Link, useHistory } from 'react-router-dom'; import * as Yup from 'yup'; + + import { useFormik } from 'formik'; import { FormattedMessage as T, useIntl } from 'react-intl'; import { @@ -34,14 +36,15 @@ function Login({ const [shown, setShown] = useState(false); const passwordRevealer = () => { setShown(!shown); }; + // Validation schema. - const loginValidationSchema = Yup.object().shape({ + const loginValidationSchema = Yup.object().shape({ crediential: Yup.string() - .required(formatMessage({ id: 'required' })) - .email(formatMessage({ id: 'invalid_email_or_phone_numner' })), + .required() + .email().label(formatMessage({id:'email'})), password: Yup.string() - .required(formatMessage({ id: 'required' })) - .min(4), + .required() + .min(4).label(formatMessage({id:'password'})) }); // Formik validation schema and submit handler. @@ -63,13 +66,13 @@ function Login({ crediential: values.crediential, password: values.password, }).then(() => { - history.go('/dashboard/homepage'); + history.go('/homepage'); setSubmitting(false); }).catch((errors) => { const toastBuilders = []; if (errors.find((e) => e.type === ERRORS_TYPES.INVALID_DETAILS)) { toastBuilders.push({ - message: formatMessage({id:'email_and_password_entered_did_not_match'}), + message: formatMessage({ id: 'email_and_password_entered_did_not_match' }), intent: Intent.DANGER, }); } @@ -110,7 +113,7 @@ function Login({ } intent={(errors.crediential && touched.crediential) && Intent.DANGER} - helperText={} + helperText={} className={'form-group--crediential'} > - + } labelInfo={passwordRevealerTmp} intent={(errors.password && touched.password) && Intent.DANGER} - helperText={} - className={'form-group--password has-password-revealer'} + helperText={} + className={'form-group--password has-password-revealer'} > - +
- +
@@ -155,7 +158,7 @@ function Login({
- +
diff --git a/client/src/containers/Preferences/Users/UsersList.js b/client/src/containers/Preferences/Users/UsersList.js index b3f38c844..7d0039ba8 100644 --- a/client/src/containers/Preferences/Users/UsersList.js +++ b/client/src/containers/Preferences/Users/UsersList.js @@ -25,6 +25,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({ @@ -34,7 +35,7 @@ function UsersListPreferences({ // #withUsers usersList, - + // #withUsersActions requestDeleteUser, requestInactiveUser, @@ -45,14 +46,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); @@ -62,7 +63,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]); @@ -99,7 +100,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'}), }); }); }; @@ -107,11 +108,11 @@ function UsersListPreferences({ const actionMenuList = useCallback( (user) => ( - + } onClick={onEditUser(user)} /> - - onInactiveUser(user)} /> - onDeleteUser(user)} /> + } onClick={onEditInviteUser(user)} /> + } onClick={() => onInactiveUser(user)} /> + } onClick={() => onDeleteUser(user)} /> ), [] @@ -120,19 +121,19 @@ 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, }, @@ -140,8 +141,8 @@ function UsersListPreferences({ id: 'active', Header: 'Status', accessor: (user) => user.active ? - Active : - Inactivate, + : + , width: 50, className: 'status', }, @@ -177,8 +178,8 @@ function UsersListPreferences({ /> } + confirmButtonText={} icon='trash' intent={Intent.DANGER} isOpen={deleteUserState} @@ -192,8 +193,8 @@ function UsersListPreferences({ } + confirmButtonText={} icon='trash' intent={Intent.WARNING} isOpen={inactiveUserState} diff --git a/client/src/index.js b/client/src/index.js index f2ae83e6f..4db7f18b1 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -6,7 +6,12 @@ import App from 'components/App'; import * as serviceWorker from 'serviceWorker'; import createStore from 'store/createStore'; import AppProgress from 'components/NProgress/AppProgress'; +import { setLocale } from 'yup'; +import {locale} from 'lang/en/locale'; + + +setLocale(locale) ReactDOM.render( diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js index d882c7fed..b32e523f8 100644 --- a/client/src/lang/en/index.js +++ b/client/src/lang/en/index.js @@ -1,10 +1,10 @@ export default { hello_world: 'Hello World', - email_or_phone_number: 'Email or phone number', + 'email_or_phone_number': 'Email or phone number', password: 'Password', login: 'Login', - invalid_email_or_phone_numner: 'Invalid email or phone number.', - required: 'Required', + 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.', email_and_password_entered_did_not_match: @@ -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', @@ -74,7 +75,6 @@ export default { new_exchange_rate: 'New Exchange Rate', delete_exchange_rate: 'Delete Exchange Rate', exchange_rate: 'Exchange Rate', - currency_code: 'Currency Code', edit_invite: 'Edit invite', edit_category: 'Edit Category', delete_category: 'Delete Category', @@ -118,7 +118,7 @@ export default { cancel: 'Cancel', move_to_trash: 'Move to Trash', save_new: 'Save & New', - journal_number: 'Journal number', + journal_number: 'Journal Number', credit_currency: 'Credit ({currency})', debit_currency: 'Debit ({currency})', note: 'Note', @@ -137,6 +137,7 @@ export default { inactivate: 'Inactivate', activate: 'Activate', inactivate_account: 'Inactivate Account', + activate_account:'Activate Account', delete_account: 'Delete Account', code: 'Code', type: 'Type', @@ -167,51 +168,162 @@ 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.', - 'the_journal_has_been_successfully_deleted': 'The journal #{number} has been successfully deleted.', - 'the_journals_has_been_successfully_deleted': 'The journals {count} have been successfully deleted.', - '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', - 'the_item_category_has_been_successfully_deleted': 'The item category has been successfully deleted.', - 'once_delete_this_item_category_you_will_able_to_restore_it': 'Once you delete this item category, you won\'t be able to restore the item later. Are you sure you want to delete?', - 'once_delete_this_journal_category_you_will_able_to_restore_it': 'Once you delete this journal, you won\'t be able to restore the item later. Are you sure you want to delete?', - 'all': 'All', - 'once_delete_these_journalss_you_will_not_able_restore_them': 'Once you delete these journals, you won\'t be able to retrieve them later. Are you sure you want to delete them?', - 'journal_number_is_already_used': 'Journal number is already used.', - - the_item_categories_has_been_successfully_deleted:'The item categories has been successfully deleted', - once_delete_these_item_categories_you_will_not_able_restore_them:'Once you delete these item categories, you won\'t be able to retrieve them later. Are you sure you want to delete them?', - once_delete_this_exchange_rate_you_will_able_to_restore_it: `Once you delete this exchange rate, you won\'t be able to restore it later. Are you sure you want to delete?`, - once_delete_these_exchange_rates_you_will_not_able_restore_them:'Once you delete these item categories, you won\'t be able to retrieve them later. Are you sure you want to delete them?', - the_accounts_has_been_successfully_activated:'The Accounts has been Successfully activated', - are_sure_to_activate_this_accounts: 'Are you sure you want to activate this accounts? You will be able to inactivate it later', - are_sure_to_inactive_this_accounts: 'Are you sure you want to inactive this accounts? You will be able to activate it later', - the_accounts_has_been_successfully_inactivated: 'The accounts has been successfully inactivated.', - + 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...', + credit_and_debit_not_equal:'credit and debit not equal', + the_currency_has_been_successfully_edited:'The currency has been successfully edited', + the_currency_has_been_successfully_created:'The currency has been successfully created', + // Name Labels + expense_account_id :'Expense account', + payment_account_id: 'Payment account', + currency_code_: 'Currency code', + publish:'Publish', + exchange_rate_:'Exchange rate', + journal_number_:'Journal number', + first_name_: 'First name', + last_name_:'Last name', + phone_number_:'Phone number', + organization_name_:'Organization name', + confirm_password:'Confirm password', + crediential:'Email or Phone number', + account_type_id:'Account type', + account_name_:'Account name', + currency_name_:'Currency name', + cost_account_id:'Cost account', + sell_account_id:'Sell account', + item_type_:'Item type', + item_name_:'Item name', + organization_industry_:'Organization industry', + base_currency_:'Base currency', + date_format_:'Date format', + view_name_:'View name' }; + + + diff --git a/client/src/lang/en/locale.js b/client/src/lang/en/locale.js new file mode 100644 index 000000000..132f85bb6 --- /dev/null +++ b/client/src/lang/en/locale.js @@ -0,0 +1,60 @@ +import printValue from '../printValue'; +export const locale = { + + mixed: { + default: "${path} is invalid", + required: "${path} is a required field ", + oneOf: "${path} must be one of the following values: ${values}", + notOneOf: "${path} must not be one of the following values: ${values}", + notType: ({ path, type, value, originalValue }) => { + let isCast = originalValue != null && originalValue !== value; + let msg = + `${path} must beeeeee a \`${type}\` type, ` + + `but the final value was: \`${printValue(value, true)}\`` + + (isCast + ? ` (cast from the value \`${printValue(originalValue, true)}\`).` + : '.'); + + if (value === null) { + msg += `\n If "null" is intended as an empty value be sure to mark the schema as \`.nullable()\``; + } + + return msg; + }, + defined: '${path} must be defined', + }, + string: { + length: "${path} must be exactly ${length} characters", + min: "${path} must be at least ${min} characters", + max: "${path} must be at most ${max} characters", + matches: '${path} must match the following: "${regex}"', + email: "${path} must be a valid email", + url: "${path} must be a valid URL", + trim: "${path} must be a trimmed string", + lowercase: "${path} must be a lowercase string", + uppercase: "${path} must be a upper case string" + }, + number: { + min: "${path} must be greater than or equal to ${min}", + max: "${path} must be less than or equal to ${max}", + lessThan: "${path} must be less than ${less}", + moreThan: "${path} must be greater than ${more}", + notEqual: "${path} must be not equal to ${notEqual}", + positive: "${path} must be a positive number", + negative: "${path} must be a negative number", + integer: "${path} must be an integer" + }, + date: { + min: "${path} field must be later than ${min}", + max: "${path} field must be at earlier than ${max}" + }, + boolean : {}, + object: { + noUnknown: + "${path} field cannot have keys not specified in the object shape" + }, + array: { + min: "${path} field must have at least ${min} items", + max: "${path} field must have less than or equal to ${max} items" + } +}; diff --git a/client/src/lang/printValue.js b/client/src/lang/printValue.js new file mode 100644 index 000000000..3bf5f0a6f --- /dev/null +++ b/client/src/lang/printValue.js @@ -0,0 +1,48 @@ +const toString = Object.prototype.toString; +const errorToString = Error.prototype.toString; +const regExpToString = RegExp.prototype.toString; +const symbolToString = + typeof Symbol !== 'undefined' ? Symbol.prototype.toString : () => ''; +const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/; + +function printNumber(val) { + if (val != +val) return 'NaN'; + const isNegativeZero = val === 0 && 1 / val < 0; + return isNegativeZero ? '-0' : '' + val; +} + +function printSimpleValue(val, quoteStrings = false) { + if (val == null || val === true || val === false) return '' + val; + + const typeOf = typeof val; + if (typeOf === 'number') return printNumber(val); + if (typeOf === 'string') return quoteStrings ? `"${val}"` : val; + if (typeOf === 'function') + return '[Function ' + (val.name || 'anonymous') + ']'; + if (typeOf === 'symbol') + return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)'); + + const tag = toString.call(val).slice(8, -1); + if (tag === 'Date') + return isNaN(val.getTime()) ? '' + val : val.toISOString(val); + if (tag === 'Error' || val instanceof Error) + return '[' + errorToString.call(val) + ']'; + if (tag === 'RegExp') return regExpToString.call(val); + + return null; +} + +export default function printValue(value, quoteStrings) { + let result = printSimpleValue(value, quoteStrings); + if (result !== null) return result; + + return JSON.stringify( + value, + function(key, value) { + let result = printSimpleValue(this[key], quoteStrings); + if (result !== null) return result; + return value; + }, + 2, + ); +} \ No newline at end of file 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', } } };