+
+ );
+}
+
+export const AuthenticatedUser = withAuthentication(
+ ({ authenticatedUserId }) => ({
+ authenticatedUserId,
+ }),
+)(AuthenticatedUserComponent);
+
+export const useAuthenticatedUser = () =>
+ React.useContext(AuthenticatedUserContext);
diff --git a/client/src/components/Dashboard/DashboardBoot.js b/client/src/components/Dashboard/DashboardBoot.js
new file mode 100644
index 000000000..69351ae6b
--- /dev/null
+++ b/client/src/components/Dashboard/DashboardBoot.js
@@ -0,0 +1,76 @@
+import React from 'react';
+import * as R from 'ramda';
+
+import { useUser, useCurrentOrganization } from 'hooks/query';
+import withAuthentication from '../../containers/Authentication/withAuthentication';
+import withDashboardActions from '../../containers/Dashboard/withDashboardActions';
+
+import { setCookie, getCookie } from '../../utils';
+
+/**
+ * Dashboard async booting.
+ */
+function DashboardBootJSX({ setAppIsLoading, authenticatedUserId }) {
+ // Fetches the current user's organization.
+ const { isSuccess: isCurrentOrganizationSuccess, data: organization } =
+ useCurrentOrganization();
+
+ // Authenticated user.
+ const { isSuccess: isAuthUserSuccess, data: authUser } =
+ useUser(authenticatedUserId);
+
+ // Initial locale cookie value.
+ const localeCookie = getCookie('locale');
+
+ // Is the dashboard booted.
+ const isBooted = React.useRef(false);
+
+ // Syns the organization language with locale cookie.
+ React.useEffect(() => {
+ if (organization?.metadata?.language) {
+ setCookie('locale', organization.metadata.language);
+ }
+ }, [organization]);
+
+ React.useEffect(() => {
+ // Can't continue if the organization metadata is not loaded yet.
+ if (!organization?.metadata?.language) {
+ return;
+ }
+ // Can't continue if the organization is already booted.
+ if (isBooted.current) {
+ return;
+ }
+ // Reboot the application in case the initial locale not equal
+ // the current organization language.
+ if (localeCookie !== organization.metadata.language) {
+ window.location.reload();
+ }
+ }, [localeCookie, organization]);
+
+ React.useEffect(() => {
+ // Once the all requests complete change the app loading state.
+ if (
+ isAuthUserSuccess &&
+ isCurrentOrganizationSuccess &&
+ localeCookie === organization?.metadata?.language
+ ) {
+ setAppIsLoading(false);
+ isBooted.current = true;
+ }
+ }, [
+ isAuthUserSuccess,
+ isCurrentOrganizationSuccess,
+ organization,
+ setAppIsLoading,
+ localeCookie,
+ ]);
+ return null;
+}
+
+export const DashboardBoot = R.compose(
+ withAuthentication(({ authenticatedUserId }) => ({
+ authenticatedUserId,
+ })),
+ withDashboardActions,
+)(DashboardBootJSX);
diff --git a/client/src/components/Dashboard/DashboardProvider.js b/client/src/components/Dashboard/DashboardProvider.js
index 6f454214f..5a5fce966 100644
--- a/client/src/components/Dashboard/DashboardProvider.js
+++ b/client/src/components/Dashboard/DashboardProvider.js
@@ -1,13 +1,8 @@
import React from 'react';
-import DashboardLoadingIndicator from './DashboardLoadingIndicator';
/**
* Dashboard provider.
*/
export default function DashboardProvider({ children }) {
- return (
-
- { children }
-
- )
-}
\ No newline at end of file
+ return children;
+}
diff --git a/client/src/components/Dashboard/PrivatePages.js b/client/src/components/Dashboard/PrivatePages.js
index 0d0b5d06c..8c2a2d421 100644
--- a/client/src/components/Dashboard/PrivatePages.js
+++ b/client/src/components/Dashboard/PrivatePages.js
@@ -7,6 +7,7 @@ import SetupWizardPage from 'containers/Setup/WizardSetupPage';
import EnsureOrganizationIsReady from 'components/Guards/EnsureOrganizationIsReady';
import EnsureOrganizationIsNotReady from 'components/Guards/EnsureOrganizationIsNotReady';
import { PrivatePagesProvider } from './PrivatePagesProvider';
+import { DashboardBoot } from '../../components';
import 'style/pages/Dashboard/Dashboard.scss';
@@ -16,6 +17,8 @@ import 'style/pages/Dashboard/Dashboard.scss';
export default function DashboardPrivatePages() {
return (
+
+
@@ -23,7 +26,7 @@ export default function DashboardPrivatePages() {
-
+
@@ -31,4 +34,4 @@ export default function DashboardPrivatePages() {
);
-}
\ No newline at end of file
+}
diff --git a/client/src/components/Dashboard/PrivatePagesProvider.js b/client/src/components/Dashboard/PrivatePagesProvider.js
index 34db3a813..956c6063a 100644
--- a/client/src/components/Dashboard/PrivatePagesProvider.js
+++ b/client/src/components/Dashboard/PrivatePagesProvider.js
@@ -1,17 +1,9 @@
import React from 'react';
-import DashboardLoadingIndicator from 'components/Dashboard/DashboardLoadingIndicator';
-import { useCurrentOrganization } from '../../hooks/query/organization';
+import { AuthenticatedUser } from './AuthenticatedUser';
/**
* Private pages provider.
*/
export function PrivatePagesProvider({ children }) {
- // Fetches the current user's organization.
- const { isLoading } = useCurrentOrganization();
-
- return (
-
- {children}
-
- )
-}
\ No newline at end of file
+ return
{children};
+}
diff --git a/client/src/components/Dashboard/SplashScreen.js b/client/src/components/Dashboard/SplashScreen.js
new file mode 100644
index 000000000..fc32548e4
--- /dev/null
+++ b/client/src/components/Dashboard/SplashScreen.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import * as R from 'ramda';
+import BigcapitalLoading from './BigcapitalLoading';
+import withDashboard from '../../containers/Dashboard/withDashboard';
+
+function SplashScreenComponent({ appIsLoading, appIntlIsLoading }) {
+ return appIsLoading || appIntlIsLoading ?
: null;
+}
+
+export const SplashScreen = R.compose(
+ withDashboard(({ appIsLoading, appIntlIsLoading }) => ({
+ appIsLoading,
+ appIntlIsLoading,
+ })),
+)(SplashScreenComponent);
diff --git a/client/src/components/Dashboard/TopbarUser.js b/client/src/components/Dashboard/TopbarUser.js
index bfd1272e8..80c0f0adb 100644
--- a/client/src/components/Dashboard/TopbarUser.js
+++ b/client/src/components/Dashboard/TopbarUser.js
@@ -11,11 +11,12 @@ import {
import { If, FormattedMessage as T } from 'components';
import { firstLettersArgs } from 'utils';
-import { useAuthActions, useAuthUser } from 'hooks/state';
+import { useAuthActions } from 'hooks/state';
import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
import withSubscriptions from '../../containers/Subscriptions/withSubscriptions';
+import { useAuthenticatedUser } from './AuthenticatedUser';
function DashboardTopbarUser({
openDialog,
@@ -25,7 +26,9 @@ function DashboardTopbarUser({
}) {
const history = useHistory();
const { setLogout } = useAuthActions();
- const user = useAuthUser();
+
+ // Retrieve authenticated user information.
+ const { user } = useAuthenticatedUser();
const onClickLogout = () => {
setLogout();
diff --git a/client/src/components/Dashboard/index.js b/client/src/components/Dashboard/index.js
new file mode 100644
index 000000000..143e73dcb
--- /dev/null
+++ b/client/src/components/Dashboard/index.js
@@ -0,0 +1,4 @@
+
+
+export * from './SplashScreen';
+export * from './DashboardBoot';
\ No newline at end of file
diff --git a/client/src/components/EmptyStatus.js b/client/src/components/EmptyStatus.js
index 5a7bb79ef..e95fac008 100644
--- a/client/src/components/EmptyStatus.js
+++ b/client/src/components/EmptyStatus.js
@@ -1,26 +1,17 @@
import React from 'react';
import classNames from 'classnames';
-import { CLASSES } from 'common/classes';
-import 'style/components/DataTable/DataTableEmptyStatus.scss';
+import Style from 'style/components/DataTable/DataTableEmptyStatus.module.scss';
/**
* Datatable empty status.
*/
-export default function EmptyStatuts({ title, description, action, children }) {
+export default function EmptyStatus({ title, description, action, children }) {
return (
-
-
- {title}
-
-
-
- {description}
-
-
-
- {action}
-
+
+
{title}
+
{description}
+
{action}
{children}
);
diff --git a/client/src/components/Sidebar/SidebarHead.js b/client/src/components/Sidebar/SidebarHead.js
index 3955c9c40..bc5c11c22 100644
--- a/client/src/components/Sidebar/SidebarHead.js
+++ b/client/src/components/Sidebar/SidebarHead.js
@@ -1,9 +1,9 @@
import React from 'react';
import { Button, Popover, Menu, Position } from '@blueprintjs/core';
import Icon from 'components/Icon';
-import { useAuthUser } from 'hooks/state';
import { compose, firstLettersArgs } from 'utils';
import withCurrentOrganization from '../../containers/Organization/withCurrentOrganization';
+import { useAuthenticatedUser } from '../Dashboard/AuthenticatedUser';
// Popover modifiers.
const POPOVER_MODIFIERS = {
@@ -17,7 +17,8 @@ function SidebarHead({
// #withCurrentOrganization
organization,
}) {
- const user = useAuthUser();
+ // Retrieve authenticated user information.
+ const { user } = useAuthenticatedUser();
return (
diff --git a/client/src/components/index.js b/client/src/components/index.js
index 197e79cb9..68db361f5 100644
--- a/client/src/components/index.js
+++ b/client/src/components/index.js
@@ -74,6 +74,7 @@ export * from './Drawer/DrawerMainTabs';
export * from './TotalLines/index'
export * from './Alert';
export * from './Subscriptions';
+export * from './Dashboard';
const Hint = FieldHint;
diff --git a/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js b/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js
index 645e3fcce..0b8e2c793 100644
--- a/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js
+++ b/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js
@@ -1,7 +1,7 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
import ManualJournalsEmptyStatus from './ManualJournalsEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
@@ -91,33 +91,35 @@ function ManualJournalsDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Accounting/JournalsLanding/ManualJournalsList.js b/client/src/containers/Accounting/JournalsLanding/ManualJournalsList.js
index 22c2cb542..c1e6020cc 100644
--- a/client/src/containers/Accounting/JournalsLanding/ManualJournalsList.js
+++ b/client/src/containers/Accounting/JournalsLanding/ManualJournalsList.js
@@ -30,20 +30,19 @@ function ManualJournalsTable({
-
-
-
-
-
-
+
+
+
);
}
export default compose(
- withManualJournals(({ manualJournalsTableState, manualJournalTableStateChanged }) => ({
- journalsTableState: manualJournalsTableState,
- journalsTableStateChanged: manualJournalTableStateChanged,
- })),
+ withManualJournals(
+ ({ manualJournalsTableState, manualJournalTableStateChanged }) => ({
+ journalsTableState: manualJournalsTableState,
+ journalsTableStateChanged: manualJournalTableStateChanged,
+ }),
+ ),
)(ManualJournalsTable);
diff --git a/client/src/containers/Authentication/AuthenticationBoot.js b/client/src/containers/Authentication/AuthenticationBoot.js
new file mode 100644
index 000000000..4ac6c9899
--- /dev/null
+++ b/client/src/containers/Authentication/AuthenticationBoot.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import * as R from 'ramda';
+
+import withDashboardActions from '../../containers/Dashboard/withDashboardActions';
+
+function AuthenticationBootJSX({ setAppIsLoading }) {
+ React.useEffect(() => {
+ setAppIsLoading(false);
+ }, [setAppIsLoading]);
+
+ return null;
+}
+export const AuthenticationBoot = R.compose(withDashboardActions)(
+ AuthenticationBootJSX,
+);
diff --git a/client/src/containers/Authentication/Login.js b/client/src/containers/Authentication/Login.js
index afa1006f8..5f2b38de6 100644
--- a/client/src/containers/Authentication/Login.js
+++ b/client/src/containers/Authentication/Login.js
@@ -20,18 +20,20 @@ export default function Login() {
loginMutate({
crediential: values.crediential,
password: values.password,
- })
- .then(() => {
- setSubmitting(false);
- })
- .catch(({ response: { data: { errors } } }) => {
+ }).catch(
+ ({
+ response: {
+ data: { errors },
+ },
+ }) => {
const toastBuilders = transformLoginErrorsToToasts(errors);
toastBuilders.forEach((builder) => {
Toaster.show(builder);
});
setSubmitting(false);
- });
+ },
+ );
};
return (
@@ -66,4 +68,4 @@ export default function Login() {
);
-}
\ No newline at end of file
+}
diff --git a/client/src/containers/Authentication/Register.js b/client/src/containers/Authentication/Register.js
index 864f8f9a6..9e56dc997 100644
--- a/client/src/containers/Authentication/Register.js
+++ b/client/src/containers/Authentication/Register.js
@@ -1,15 +1,16 @@
-import React, { useMemo } from 'react';
+import React, { useMemo } from 'react';
import { Formik } from 'formik';
-import { Link, useHistory } from 'react-router-dom';
-import {
- Intent,
-} from '@blueprintjs/core';
+import { Link } from 'react-router-dom';
+import { Intent } from '@blueprintjs/core';
import intl from 'react-intl-universal';
import { FormattedMessage as T } from 'components';
import AppToaster from 'components/AppToaster';
import AuthInsider from 'containers/Authentication/AuthInsider';
-import { useAuthLogin, useAuthRegister } from '../../hooks/query/authentication';
+import {
+ useAuthLogin,
+ useAuthRegister,
+} from '../../hooks/query/authentication';
import RegisterForm from './RegisterForm';
import { RegisterSchema, transformRegisterErrorsToForm } from './utils';
@@ -18,11 +19,9 @@ import { RegisterSchema, transformRegisterErrorsToForm } from './utils';
* Register form.
*/
export default function RegisterUserForm() {
- const history = useHistory();
+ const { mutateAsync: authLoginMutate } = useAuthLogin();
+ const { mutateAsync: authRegisterMutate } = useAuthRegister();
- const { mutateAsync: authLoginMutate } = useAuthLogin();
- const { mutateAsync: authRegisterMutate } = useAuthRegister();
-
const initialValues = useMemo(
() => ({
first_name: '',
@@ -41,26 +40,33 @@ export default function RegisterUserForm() {
authLoginMutate({
crediential: values.email,
password: values.password,
- })
- .then(() => {
- history.push('/register/subscription');
- setSubmitting(false);
- })
- .catch(({ response: { data: { errors } } }) => {
+ }).catch(
+ ({
+ response: {
+ data: { errors },
+ },
+ }) => {
AppToaster.show({
message: intl.get('something_wentwrong'),
intent: Intent.SUCCESS,
});
- });
+ },
+ );
})
- .catch(({ response: { data: { errors } } }) => {
- const formErrors = transformRegisterErrorsToForm(errors);
+ .catch(
+ ({
+ response: {
+ data: { errors },
+ },
+ }) => {
+ const formErrors = transformRegisterErrorsToForm(errors);
- setErrors(formErrors);
- setSubmitting(false);
- });
+ setErrors(formErrors);
+ setSubmitting(false);
+ },
+ );
};
-
+
return (
@@ -83,4 +89,4 @@ export default function RegisterUserForm() {
);
-}
\ No newline at end of file
+}
diff --git a/client/src/containers/Authentication/withAuthentication.js b/client/src/containers/Authentication/withAuthentication.js
index 94d846f28..3d6fe3b80 100644
--- a/client/src/containers/Authentication/withAuthentication.js
+++ b/client/src/containers/Authentication/withAuthentication.js
@@ -1,14 +1,15 @@
-import { isAuthenticated } from 'store/authentication/authentication.reducer'
+import { isAuthenticated } from 'store/authentication/authentication.reducer';
import { connect } from 'react-redux';
export default (mapState) => {
const mapStateToProps = (state, props) => {
const mapped = {
isAuthorized: isAuthenticated(state),
- user: state.authentication.user,
+ authenticatedUserId: state.authentication.userId,
currentOrganizationId: state.authentication?.organizationId,
+ currentTenantId: state.authentication?.tenantId,
};
return mapState ? mapState(mapped, state, props) : mapped;
};
return connect(mapStateToProps);
-};
\ No newline at end of file
+};
diff --git a/client/src/containers/Customers/CustomersLanding/CustomersList.js b/client/src/containers/Customers/CustomersLanding/CustomersList.js
index cae241ab7..f4cb9d428 100644
--- a/client/src/containers/Customers/CustomersLanding/CustomersList.js
+++ b/client/src/containers/Customers/CustomersLanding/CustomersList.js
@@ -47,10 +47,7 @@ function CustomersList({
-
-
-
-
+
diff --git a/client/src/containers/Customers/CustomersLanding/CustomersTable.js b/client/src/containers/Customers/CustomersLanding/CustomersTable.js
index 741570929..39cfb1fed 100644
--- a/client/src/containers/Customers/CustomersLanding/CustomersTable.js
+++ b/client/src/containers/Customers/CustomersLanding/CustomersTable.js
@@ -5,7 +5,7 @@ import CustomersEmptyStatus from './CustomersEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
import withCustomers from './withCustomers';
import withCustomersActions from './withCustomersActions';
@@ -100,37 +100,39 @@ function CustomersTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Dashboard/withDashboard.js b/client/src/containers/Dashboard/withDashboard.js
index 5400d48f1..d4303c6dc 100644
--- a/client/src/containers/Dashboard/withDashboard.js
+++ b/client/src/containers/Dashboard/withDashboard.js
@@ -11,6 +11,8 @@ export default (mapState) => {
sidebarExpended: state.dashboard.sidebarExpended,
preferencesPageTitle: state.dashboard.preferencesPageTitle,
dashboardBackLink: state.dashboard.backLink,
+ appIsLoading: state.dashboard.appIsLoading,
+ appIntlIsLoading: state.dashboard.appIntlIsLoading
};
return mapState ? mapState(mapped, state, props) : mapped;
};
diff --git a/client/src/containers/Dashboard/withDashboardActions.js b/client/src/containers/Dashboard/withDashboardActions.js
index 472bbc486..8c188539e 100644
--- a/client/src/containers/Dashboard/withDashboardActions.js
+++ b/client/src/containers/Dashboard/withDashboardActions.js
@@ -2,6 +2,8 @@ import { connect } from 'react-redux';
import t from 'store/types';
import {
toggleExpendSidebar,
+ appIsLoading,
+ appIntlIsLoading
} from 'store/dashboard/dashboard.actions';
const mapActionsToProps = (dispatch) => ({
@@ -55,6 +57,8 @@ const mapActionsToProps = (dispatch) => ({
type: t.SET_DASHBOARD_BACK_LINK,
payload: { backLink },
}),
+ setAppIsLoading: (isLoading) => dispatch(appIsLoading(isLoading)),
+ setAppIntlIsLoading: (isLoading) => dispatch(appIntlIsLoading(isLoading)),
});
export default connect(null, mapActionsToProps);
diff --git a/client/src/containers/Dialogs/PaymentViaVoucherDialog/PaymentViaVoucherDialogContent.js b/client/src/containers/Dialogs/PaymentViaVoucherDialog/PaymentViaVoucherDialogContent.js
index 872b45452..22770dd06 100644
--- a/client/src/containers/Dialogs/PaymentViaVoucherDialog/PaymentViaVoucherDialogContent.js
+++ b/client/src/containers/Dialogs/PaymentViaVoucherDialog/PaymentViaVoucherDialogContent.js
@@ -35,8 +35,12 @@ function PaymentViaLicenseDialogContent({
const handleSubmit = (values, { setSubmitting, setErrors }) => {
setSubmitting(true);
+ const mutateValues = {
+ plan_slug: `${values.plan_slug}-${values.period}ly`,
+ license_code: values.license_code,
+ };
// Payment via voucher mutate.
- paymentViaVoucherMutate({ ...values })
+ paymentViaVoucherMutate({ ...mutateValues })
.then(() => {
Toaster.show({
message: intl.get('payment_via_voucher.success_message'),
diff --git a/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js b/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js
index 2c42c9957..ddd4b0300 100644
--- a/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js
+++ b/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js
@@ -4,6 +4,7 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
import { useExpensesListContext } from './ExpensesListProvider';
+import { DashboardContentTable } from 'components';
import DataTable from 'components/DataTable';
import ExpensesEmptyStatus from './ExpensesEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
@@ -84,32 +85,34 @@ function ExpensesDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js b/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js
index 815b01684..5bbbc1948 100644
--- a/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js
+++ b/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js
@@ -47,10 +47,7 @@ function ExpensesList({
-
-
-
-
+
diff --git a/client/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js b/client/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js
index 0f281a38d..dda5b2cc0 100644
--- a/client/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js
+++ b/client/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js
@@ -12,8 +12,8 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import { APAgingSummaryProvider } from './APAgingSummaryProvider';
import { APAgingSummarySheetLoadingBar } from './components';
-import withSettings from 'containers/Settings/withSettings';
-import withAPAgingSummaryActions from './withAPAgingSummaryActions'
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
+import withAPAgingSummaryActions from './withAPAgingSummaryActions';
import { compose } from 'utils';
/**
@@ -51,9 +51,12 @@ function APAgingSummary({
};
// Hide the report filter drawer once the page unmount.
- useEffect(() => () => {
- toggleDisplayFilterDrawer(false);
- }, [toggleDisplayFilterDrawer])
+ useEffect(
+ () => () => {
+ toggleDisplayFilterDrawer(false);
+ },
+ [toggleDisplayFilterDrawer],
+ );
return (
@@ -79,8 +82,8 @@ function APAgingSummary({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings?.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization?.name,
})),
- withAPAgingSummaryActions
+ withAPAgingSummaryActions,
)(APAgingSummary);
diff --git a/client/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummary.js b/client/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummary.js
index 0a112eb49..fdb0def8f 100644
--- a/client/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummary.js
+++ b/client/src/containers/FinancialStatements/ARAgingSummary/ARAgingSummary.js
@@ -13,7 +13,7 @@ import { ARAgingSummaryProvider } from './ARAgingSummaryProvider';
import { ARAgingSummarySheetLoadingBar } from './components';
import withARAgingSummaryActions from './withARAgingSummaryActions'
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { compose } from 'utils';
@@ -77,8 +77,8 @@ function ReceivableAgingSummarySheet({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withARAgingSummaryActions
)(ReceivableAgingSummarySheet);
diff --git a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js
index e21a53dee..a95c39752 100644
--- a/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js
+++ b/client/src/containers/FinancialStatements/BalanceSheet/BalanceSheet.js
@@ -10,7 +10,7 @@ import { BalanceSheetAlerts, BalanceSheetLoadingBar } from './components';
import { FinancialStatement } from 'components';
import withBalanceSheetActions from './withBalanceSheetActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { BalanceSheetProvider } from './BalanceSheetProvider';
import { compose } from 'utils';
@@ -23,7 +23,7 @@ function BalanceSheet({
organizationName,
// #withBalanceSheetActions
- toggleBalanceSheetFilterDrawer
+ toggleBalanceSheetFilterDrawer,
}) {
const [filter, setFilter] = useState({
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
@@ -52,9 +52,12 @@ function BalanceSheet({
};
// Hides the balance sheet filter drawer once the page unmount.
- useEffect(() => () => {
- toggleBalanceSheetFilterDrawer(false);
- }, [toggleBalanceSheetFilterDrawer])
+ useEffect(
+ () => () => {
+ toggleBalanceSheetFilterDrawer(false);
+ },
+ [toggleBalanceSheetFilterDrawer],
+ );
return (
@@ -81,8 +84,8 @@ function BalanceSheet({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withBalanceSheetActions,
)(BalanceSheet);
diff --git a/client/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js b/client/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
index 514e4838d..2b1071276 100644
--- a/client/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
+++ b/client/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
@@ -9,7 +9,7 @@ import CashFlowStatementHeader from './CashFlowStatementHeader';
import CashFlowStatementTable from './CashFlowStatementTable';
import CashFlowStatementActionsBar from './CashFlowStatementActionsBar';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import withCashFlowStatementActions from './withCashFlowStatementActions';
import { CashFlowStatementProvider } from './CashFlowStatementProvider';
import {
@@ -85,8 +85,8 @@ function CashFlowStatement({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings?.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withCashFlowStatementActions,
)(CashFlowStatement);
diff --git a/client/src/containers/FinancialStatements/CustomersBalanceSummary/CustomersBalanceSummary.js b/client/src/containers/FinancialStatements/CustomersBalanceSummary/CustomersBalanceSummary.js
index 939a519e6..a5681ce9e 100644
--- a/client/src/containers/FinancialStatements/CustomersBalanceSummary/CustomersBalanceSummary.js
+++ b/client/src/containers/FinancialStatements/CustomersBalanceSummary/CustomersBalanceSummary.js
@@ -13,8 +13,7 @@ import CustomersBalanceSummaryTable from './CustomersBalanceSummaryTable';
import { CustomersBalanceLoadingBar } from './components';
import { CustomersBalanceSummaryProvider } from './CustomersBalanceSummaryProvider';
import withCustomersBalanceSummaryActions from './withCustomersBalanceSummaryActions';
-
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import { compose } from 'redux';
@@ -81,8 +80,8 @@ function CustomersBalanceSummary({
);
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withCustomersBalanceSummaryActions,
)(CustomersBalanceSummary);
diff --git a/client/src/containers/FinancialStatements/CustomersTransactions/CustomersTransactions.js b/client/src/containers/FinancialStatements/CustomersTransactions/CustomersTransactions.js
index c919da40f..bfe6de920 100644
--- a/client/src/containers/FinancialStatements/CustomersTransactions/CustomersTransactions.js
+++ b/client/src/containers/FinancialStatements/CustomersTransactions/CustomersTransactions.js
@@ -10,7 +10,7 @@ import CustomersTransactionsTable from './CustomersTransactionsTable';
import CustomersTransactionsActionsBar from './CustomersTransactionsActionsBar';
import withCustomersTransactionsActions from './withCustomersTransactionsActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { CustomersTransactionsLoadingBar } from './components';
import { CustomersTransactionsProvider } from './CustomersTransactionsProvider';
@@ -81,8 +81,8 @@ function CustomersTransactions({
);
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withCustomersTransactionsActions,
)(CustomersTransactions);
diff --git a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js
index 8e52874d8..3cdee521d 100644
--- a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js
+++ b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedger.js
@@ -15,7 +15,7 @@ import {
} from './components';
import withGeneralLedgerActions from './withGeneralLedgerActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import { transformFilterFormToQuery } from 'containers/FinancialStatements/common';
import { compose } from 'utils';
@@ -85,7 +85,7 @@ function GeneralLedger({
export default compose(
withGeneralLedgerActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(GeneralLedger);
diff --git a/client/src/containers/FinancialStatements/InventoryItemDetails/InventoryItemDetails.js b/client/src/containers/FinancialStatements/InventoryItemDetails/InventoryItemDetails.js
index 802cc4188..0c25f6de0 100644
--- a/client/src/containers/FinancialStatements/InventoryItemDetails/InventoryItemDetails.js
+++ b/client/src/containers/FinancialStatements/InventoryItemDetails/InventoryItemDetails.js
@@ -10,7 +10,7 @@ import InventoryItemDetailsHeader from './InventoryItemDetailsHeader';
import InventoryItemDetailsTable from './InventoryItemDetailsTable';
import withInventoryItemDetailsActions from './withInventoryItemDetailsActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { InventoryItemDetailsProvider } from './InventoryItemDetailsProvider';
import {
InventoryItemDetailsLoadingBar,
@@ -84,8 +84,8 @@ function InventoryItemDetails({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings?.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withInventoryItemDetailsActions,
)(InventoryItemDetails);
diff --git a/client/src/containers/FinancialStatements/InventoryValuation/InventoryValuation.js b/client/src/containers/FinancialStatements/InventoryValuation/InventoryValuation.js
index cea4716b1..6317b9fff 100644
--- a/client/src/containers/FinancialStatements/InventoryValuation/InventoryValuation.js
+++ b/client/src/containers/FinancialStatements/InventoryValuation/InventoryValuation.js
@@ -11,7 +11,7 @@ import InventoryValuationTable from './InventoryValuationTable';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import { InventoryValuationLoadingBar } from './components';
import withInventoryValuationActions from './withInventoryValuationActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { compose } from 'utils';
@@ -80,7 +80,7 @@ function InventoryValuation({
export default compose(
withInventoryValuationActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings?.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(InventoryValuation);
diff --git a/client/src/containers/FinancialStatements/Journal/Journal.js b/client/src/containers/FinancialStatements/Journal/Journal.js
index 5eeca928d..f951e79c6 100644
--- a/client/src/containers/FinancialStatements/Journal/Journal.js
+++ b/client/src/containers/FinancialStatements/Journal/Journal.js
@@ -11,7 +11,7 @@ import JournalActionsBar from './JournalActionsBar';
import { JournalSheetProvider } from './JournalProvider';
import { JournalSheetLoadingBar, JournalSheetAlerts } from './components';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withJournalActions from './withJournalActions';
@@ -79,7 +79,7 @@ function Journal({
export default compose(
withDashboardActions,
withJournalActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(Journal);
diff --git a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet.js b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet.js
index e65eba735..1c966ab60 100644
--- a/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet.js
+++ b/client/src/containers/FinancialStatements/ProfitLossSheet/ProfitLossSheet.js
@@ -10,7 +10,7 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withProfitLossActions from './withProfitLossActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import 'style/pages/FinancialStatements/ProfitLossSheet.scss';
import { ProfitLossSheetProvider } from './ProfitLossProvider';
@@ -91,7 +91,7 @@ function ProfitLossSheet({
export default compose(
withDashboardActions,
withProfitLossActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(ProfitLossSheet);
diff --git a/client/src/containers/FinancialStatements/PurchasesByItems/PurchasesByItems.js b/client/src/containers/FinancialStatements/PurchasesByItems/PurchasesByItems.js
index f0afb8566..368cb0f62 100644
--- a/client/src/containers/FinancialStatements/PurchasesByItems/PurchasesByItems.js
+++ b/client/src/containers/FinancialStatements/PurchasesByItems/PurchasesByItems.js
@@ -11,7 +11,7 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import { PurchasesByItemsLoadingBar } from './components';
import withPurchasesByItemsActions from './withPurchasesByItemsActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { compose } from 'utils';
/**
@@ -82,7 +82,7 @@ function PurchasesByItems({
export default compose(
withPurchasesByItemsActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(PurchasesByItems);
diff --git a/client/src/containers/FinancialStatements/SalesByItems/SalesByItems.js b/client/src/containers/FinancialStatements/SalesByItems/SalesByItems.js
index 73c159396..459f61af7 100644
--- a/client/src/containers/FinancialStatements/SalesByItems/SalesByItems.js
+++ b/client/src/containers/FinancialStatements/SalesByItems/SalesByItems.js
@@ -13,7 +13,7 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import { SalesByItemsLoadingBar } from './components';
import withSalesByItemsActions from './withSalesByItemsActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { compose } from 'utils';
@@ -84,7 +84,7 @@ function SalesByItems({
export default compose(
withSalesByItemsActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(SalesByItems);
diff --git a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheet.js b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheet.js
index 6bb6fce25..0025b933a 100644
--- a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheet.js
+++ b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheet.js
@@ -15,7 +15,7 @@ import {
} from './components';
import withTrialBalanceActions from './withTrialBalanceActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import { compose } from 'utils';
@@ -91,7 +91,7 @@ function TrialBalanceSheet({
export default compose(
withTrialBalanceActions,
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
)(TrialBalanceSheet);
diff --git a/client/src/containers/FinancialStatements/VendorsBalanceSummary/VendorsBalanceSummary.js b/client/src/containers/FinancialStatements/VendorsBalanceSummary/VendorsBalanceSummary.js
index bc350c942..72a443e65 100644
--- a/client/src/containers/FinancialStatements/VendorsBalanceSummary/VendorsBalanceSummary.js
+++ b/client/src/containers/FinancialStatements/VendorsBalanceSummary/VendorsBalanceSummary.js
@@ -14,7 +14,7 @@ import { VendorsBalanceSummaryProvider } from './VendorsBalanceSummaryProvider';
import { VendorsSummarySheetLoadingBar } from './components';
import withVendorsBalanceSummaryActions from './withVendorsBalanceSummaryActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { compose } from 'utils';
@@ -82,8 +82,8 @@ function VendorsBalanceSummary({
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings?.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withVendorsBalanceSummaryActions,
)(VendorsBalanceSummary);
diff --git a/client/src/containers/FinancialStatements/VendorsTransactions/VendorsTransactions.js b/client/src/containers/FinancialStatements/VendorsTransactions/VendorsTransactions.js
index 74ed07d60..e6cb8ee64 100644
--- a/client/src/containers/FinancialStatements/VendorsTransactions/VendorsTransactions.js
+++ b/client/src/containers/FinancialStatements/VendorsTransactions/VendorsTransactions.js
@@ -10,7 +10,7 @@ import VendorsTransactionsActionsBar from './VendorsTransactionsActionsBar';
import VendorsTransactionsTable from './VendorsTransactionsTable';
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
-import withSettings from 'containers/Settings/withSettings';
+import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
import { VendorsTransactionsProvider } from './VendorsTransactionsProvider';
import { VendorsTransactionsLoadingBar } from './components';
@@ -81,8 +81,8 @@ function VendorsTransactions({
);
}
export default compose(
- withSettings(({ organizationSettings }) => ({
- organizationName: organizationSettings.name,
+ withCurrentOrganization(({ organization }) => ({
+ organizationName: organization.name,
})),
withVendorsTransactionsActions,
)(VendorsTransactions);
diff --git a/client/src/containers/Items/ItemsDataTable.js b/client/src/containers/Items/ItemsDataTable.js
index 62847e127..3c4205dcf 100644
--- a/client/src/containers/Items/ItemsDataTable.js
+++ b/client/src/containers/Items/ItemsDataTable.js
@@ -2,7 +2,7 @@ import React from 'react';
import { useHistory } from 'react-router-dom';
import { FormattedMessage as T } from 'components';
-import { DataTable } from 'components';
+import { DashboardContentTable, DataTable } from 'components';
import ItemsEmptyStatus from './ItemsEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
@@ -108,41 +108,43 @@ function ItemsDataTable({
}
return (
- }
- {...tableProps}
- />
+
+ }
+ {...tableProps}
+ />
+
);
}
diff --git a/client/src/containers/Items/ItemsEmptyStatus.js b/client/src/containers/Items/ItemsEmptyStatus.js
index e4340a696..3a0c53fe3 100644
--- a/client/src/containers/Items/ItemsEmptyStatus.js
+++ b/client/src/containers/Items/ItemsEmptyStatus.js
@@ -28,7 +28,7 @@ export default function ItemsEmptyStatus() {
>
}
diff --git a/client/src/containers/Items/ItemsList.js b/client/src/containers/Items/ItemsList.js
index 167e4ad04..6af0dddfb 100644
--- a/client/src/containers/Items/ItemsList.js
+++ b/client/src/containers/Items/ItemsList.js
@@ -3,7 +3,7 @@ import { compose } from 'utils';
import 'style/pages/Items/List.scss';
-import { DashboardContentTable, DashboardPageContent } from 'components';
+import { DashboardPageContent } from 'components';
import ItemsActionsBar from './ItemsActionsBar';
import ItemsAlerts from './ItemsAlerts';
@@ -43,10 +43,7 @@ function ItemsList({
-
-
-
-
+
diff --git a/client/src/containers/Preferences/General/GeneralFormPage.js b/client/src/containers/Preferences/General/GeneralFormPage.js
index c6b0e271d..da5125bef 100644
--- a/client/src/containers/Preferences/General/GeneralFormPage.js
+++ b/client/src/containers/Preferences/General/GeneralFormPage.js
@@ -51,6 +51,11 @@ function GeneralFormPage({
intent: Intent.SUCCESS,
});
setSubmitting(false);
+
+ // Reboot the application if the application's language is mutated.
+ if (organization.language !== values.language) {
+ window.location.reload();
+ }
};
// Handle request error.
const onError = (errors) => {
diff --git a/client/src/containers/Purchases/Bills/BillsLanding/BillsList.js b/client/src/containers/Purchases/Bills/BillsLanding/BillsList.js
index 42f8834c0..90d0e4964 100644
--- a/client/src/containers/Purchases/Bills/BillsLanding/BillsList.js
+++ b/client/src/containers/Purchases/Bills/BillsLanding/BillsList.js
@@ -47,10 +47,7 @@ function BillsList({
-
-
-
-
+
diff --git a/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js b/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js
index 0bb5de39b..449c93131 100644
--- a/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js
+++ b/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js
@@ -4,6 +4,7 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
import DataTable from 'components/DataTable';
+import { DashboardContentTable } from 'components';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
@@ -92,6 +93,7 @@ function BillsDataTable({
}
return (
+
+
);
}
diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
index 566e93095..48ac5e0fd 100644
--- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
+++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
@@ -42,10 +42,7 @@ function PaymentMadeList({
-
-
-
-
+
diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js
index 7c720c02b..6844c77e5 100644
--- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js
+++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js
@@ -3,7 +3,8 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
+
import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
@@ -76,31 +77,33 @@ function PaymentMadesTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesDataTable.js b/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesDataTable.js
index 891aabff0..fd1572478 100644
--- a/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesDataTable.js
+++ b/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesDataTable.js
@@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
import EstimatesEmptyStatus from './EstimatesEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
@@ -109,35 +109,37 @@ function EstimatesDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesList.js b/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesList.js
index c94f80753..7b32bd85f 100644
--- a/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesList.js
+++ b/client/src/containers/Sales/Estimates/EstimatesLanding/EstimatesList.js
@@ -42,10 +42,7 @@ function EstimatesList({
-
-
-
-
+
diff --git a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js
index d804e490d..8fbcd47c8 100644
--- a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js
+++ b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js
@@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom';
import InvoicesEmptyStatus from './InvoicesEmptyStatus';
import { compose } from 'utils';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
@@ -108,37 +108,39 @@ function InvoicesDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesList.js b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesList.js
index d440253b9..1af3314a3 100644
--- a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesList.js
+++ b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesList.js
@@ -44,10 +44,7 @@ function InvoicesList({
-
-
-
-
+
diff --git a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesList.js b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesList.js
index 0dbb0c556..352a8ef9c 100644
--- a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesList.js
+++ b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesList.js
@@ -42,10 +42,7 @@ function PaymentReceiveList({
-
-
-
-
+
diff --git a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesTable.js b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesTable.js
index 89b1b2047..af2227528 100644
--- a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesTable.js
+++ b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/PaymentReceivesTable.js
@@ -3,8 +3,8 @@ import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
+import { DataTable, DashboardContentTable } from 'components';
import PaymentReceivesEmptyStatus from './PaymentReceivesEmptyStatus';
-import { DataTable } from 'components';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
@@ -85,32 +85,34 @@ function PaymentReceivesDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsList.js b/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsList.js
index 749450e07..65fcf60c6 100644
--- a/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsList.js
+++ b/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsList.js
@@ -43,10 +43,7 @@ function ReceiptsList({
-
-
-
-
+
diff --git a/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsTable.js b/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsTable.js
index e535e2f3e..4f7cd2f59 100644
--- a/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsTable.js
+++ b/client/src/containers/Sales/Receipts/ReceiptsLanding/ReceiptsTable.js
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
import { useHistory } from 'react-router-dom';
import { compose } from 'utils';
-import { DataTable } from 'components';
+import { DataTable, DashboardContentTable } from 'components';
import ReceiptsEmptyStatus from './ReceiptsEmptyStatus';
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
@@ -101,36 +101,38 @@ function ReceiptsDataTable({
}
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Setup/SetupCongratsPage.js b/client/src/containers/Setup/SetupCongratsPage.js
index 335d8dbbd..56c2f8a35 100644
--- a/client/src/containers/Setup/SetupCongratsPage.js
+++ b/client/src/containers/Setup/SetupCongratsPage.js
@@ -1,6 +1,5 @@
-import React, { useCallback } from 'react';
+import React from 'react';
import { Button, Intent } from '@blueprintjs/core';
-import { useHistory } from 'react-router-dom';
import WorkflowIcon from './WorkflowIcon';
import { FormattedMessage as T } from 'components';
@@ -10,17 +9,16 @@ import { compose } from 'utils';
import 'style/pages/Setup/Congrats.scss';
-
/**
* Setup congrats page.
*/
function SetupCongratsPage({ setOrganizationSetupCompleted }) {
- const history = useHistory();
+ const [isReloading, setIsReloading] = React.useState(false);
- const handleBtnClick = useCallback(() => {
- setOrganizationSetupCompleted(false);
- history.push('/homepage');
- }, [setOrganizationSetupCompleted, history]);
+ const handleBtnClick = () => {
+ setIsReloading(true);
+ window.location.reload();
+ };
return (
@@ -37,7 +35,12 @@ function SetupCongratsPage({ setOrganizationSetupCompleted }) {
-
diff --git a/client/src/containers/Setup/SetupInitializingForm.js b/client/src/containers/Setup/SetupInitializingForm.js
index 3545caa15..0bb1fbcbe 100644
--- a/client/src/containers/Setup/SetupInitializingForm.js
+++ b/client/src/containers/Setup/SetupInitializingForm.js
@@ -20,10 +20,12 @@ function SetupInitializingForm({
}) {
const { refetch, isSuccess } = useCurrentOrganization({ enabled: false });
+ // Job done state.
const [isJobDone, setIsJobDone] = React.useState(false);
const {
data: { running, queued, failed, completed },
+ isFetching: isJobFetching,
} = useJob(organization?.build_job_id, {
refetchInterval: 2000,
enabled: !!organization?.build_job_id,
@@ -45,17 +47,15 @@ function SetupInitializingForm({
return (
);
}
@@ -68,41 +68,60 @@ export default R.compose(
withOrganization(({ organization }) => ({ organization })),
)(SetupInitializingForm);
+/**
+ * State initializing failed state.
+ */
function SetupInitializingFailed() {
return (
-
-
-
-
-
-
-
+
);
}
+/**
+ * Setup initializing running state.
+ */
function SetupInitializingRunning() {
return (
-
-
-
-
-
-
-
+
);
}
+/**
+ * Setup initializing completed state.
+ */
function SetupInitializingCompleted() {
return (
-
-
-
-
-
-
-
+
);
}
diff --git a/client/src/containers/Setup/SetupOrganizationForm.js b/client/src/containers/Setup/SetupOrganizationForm.js
index b7b26e37c..f320dbead 100644
--- a/client/src/containers/Setup/SetupOrganizationForm.js
+++ b/client/src/containers/Setup/SetupOrganizationForm.js
@@ -10,6 +10,7 @@ import {
} from '@blueprintjs/core';
import classNames from 'classnames';
import { TimezonePicker } from '@blueprintjs/timezone';
+import useAutofocus from 'hooks/useAutofocus'
import { FormattedMessage as T } from 'components';
import { getCountries } from 'common/countries';
@@ -29,6 +30,8 @@ export default function SetupOrganizationForm({ isSubmitting, values }) {
const currencies = getAllCurrenciesOptions();
const countries = getCountries();
+ const accountRef = useAutofocus();
+
return (