diff --git a/client/src/components/Dashboard/EnsureOrganizationIsReady.js b/client/src/components/Dashboard/EnsureOrganizationIsReady.js
index a0b7e8929..d24e32079 100644
--- a/client/src/components/Dashboard/EnsureOrganizationIsReady.js
+++ b/client/src/components/Dashboard/EnsureOrganizationIsReady.js
@@ -1,16 +1,31 @@
import React from 'react';
+import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
+import { compose } from 'utils';
-export default function EnsureOrganizationIsReady({
+import withAuthentication from 'containers/Authentication/withAuthentication';
+import withOrganization from 'containers/Organization/withOrganization';
+
+
+function EnsureOrganizationIsReady({
+ // #ownProps
children,
-}) {
- const isOrganizationReady = false;
+ redirectTo = '/setup',
- return (isOrganizationReady) ? children : (
+ // #withOrganizationByOrgId
+ isOrganizationBuilt,
+}) {
+ return (isOrganizationBuilt) ? children : (
);
-}
\ No newline at end of file
+}
+
+export default compose(
+ withAuthentication(),
+ connect((state, props) => ({
+ organizationId: props.currentOrganizationId,
+ })),
+ withOrganization(({ isOrganizationBuilt }) => ({ isOrganizationBuilt })),
+)(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..499898113
--- /dev/null
+++ b/client/src/components/Dashboard/PrivatePages.js
@@ -0,0 +1,42 @@
+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({
+
+ // #withOrganizationActions
+ requestAllOrganizations,
+}) {
+ const fetchOrganizations = useQuery(
+ ['organizations'], () => requestAllOrganizations(),
+ );
+
+ 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({
-
+