diff --git a/client/src/components/Dashboard/EnsureOrganizationIsReady.js b/client/src/components/Dashboard/EnsureOrganizationIsReady.js
index a0b7e8929..a36d48896 100644
--- a/client/src/components/Dashboard/EnsureOrganizationIsReady.js
+++ b/client/src/components/Dashboard/EnsureOrganizationIsReady.js
@@ -1,16 +1,29 @@
import React from 'react';
+import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
+import { compose } from 'utils';
+import withAuthentication from 'containers/Authentication/withAuthentication';
+import withOrganizationByOrgId from 'containers/Organization/withOrganizationByOrgId';
-export default function EnsureOrganizationIsReady({
+function EnsureOrganizationIsReady({
+ // #ownProps
children,
-}) {
- const isOrganizationReady = false;
+ redirectTo = '/setup',
- return (isOrganizationReady) ? children : (
+ // #withOrganizationByOrgId
+ organization,
+}) {
+ return (organization.is_ready) ? children : (
);
-}
\ No newline at end of file
+}
+
+export default compose(
+ withAuthentication(),
+ connect((state, props) => ({
+ organizationId: props.currentOrganizationId,
+ })),
+ withOrganizationByOrgId(),
+)(EnsureOrganizationIsReady);
\ No newline at end of file
diff --git a/client/src/components/Dashboard/PrivatePages.js b/client/src/components/Dashboard/PrivatePages.js
new file mode 100644
index 000000000..54791a355
--- /dev/null
+++ b/client/src/components/Dashboard/PrivatePages.js
@@ -0,0 +1,41 @@
+import React from 'react';
+import { Switch, Route } from 'react-router';
+import { useQuery } from 'react-query';
+
+import Dashboard from 'components/Dashboard/Dashboard';
+import SetupWizardPage from 'containers/Setup/WizardSetupPage';
+import DashboardLoadingIndicator from 'components/Dashboard/DashboardLoadingIndicator';
+
+import withOrganizationActions from 'containers/Organization/withOrganizationActions';
+
+import { compose } from 'utils';
+
+/**
+ * Dashboard inner private pages.
+ */
+function DashboardPrivatePages({
+ requestOrganizationsList,
+}) {
+ const fetchOrganizations = useQuery(
+ ['organizations'],
+ () => requestOrganizationsList(),
+ );
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+export default compose(
+ withOrganizationActions,
+)(DashboardPrivatePages);
\ No newline at end of file
diff --git a/client/src/containers/Authentication/Login.js b/client/src/containers/Authentication/Login.js
index fa73a5aab..6dabb1606 100644
--- a/client/src/containers/Authentication/Login.js
+++ b/client/src/containers/Authentication/Login.js
@@ -19,18 +19,15 @@ import Icon from 'components/Icon';
import { If } from 'components';
import withAuthenticationActions from './withAuthenticationActions';
-import withOrganizationsActions from 'containers/Organization/withOrganizationActions';
import { compose } from 'utils';
-
const ERRORS_TYPES = {
INVALID_DETAILS: 'INVALID_DETAILS',
USER_INACTIVE: 'USER_INACTIVE',
};
function Login({
requestLogin,
- requestOrganizationsList,
}) {
const { formatMessage } = useIntl();
const history = useHistory();
@@ -105,7 +102,7 @@ function Login({
-
+