mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
WIP: register setup wizard pages.
This commit is contained in:
@@ -2,8 +2,10 @@ 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';
|
||||
import withOrganization from 'containers/Organization/withOrganization';
|
||||
|
||||
|
||||
function EnsureOrganizationIsReady({
|
||||
// #ownProps
|
||||
@@ -11,9 +13,9 @@ function EnsureOrganizationIsReady({
|
||||
redirectTo = '/setup',
|
||||
|
||||
// #withOrganizationByOrgId
|
||||
organization,
|
||||
isOrganizationBuilt,
|
||||
}) {
|
||||
return (organization.is_ready) ? children : (
|
||||
return (isOrganizationBuilt) ? children : (
|
||||
<Redirect
|
||||
to={{ pathname: redirectTo }}
|
||||
/>
|
||||
@@ -25,5 +27,5 @@ export default compose(
|
||||
connect((state, props) => ({
|
||||
organizationId: props.currentOrganizationId,
|
||||
})),
|
||||
withOrganizationByOrgId(),
|
||||
withOrganization(({ isOrganizationBuilt }) => ({ isOrganizationBuilt })),
|
||||
)(EnsureOrganizationIsReady);
|
||||
@@ -14,11 +14,12 @@ import { compose } from 'utils';
|
||||
* Dashboard inner private pages.
|
||||
*/
|
||||
function DashboardPrivatePages({
|
||||
requestOrganizationsList,
|
||||
|
||||
// #withOrganizationActions
|
||||
requestAllOrganizations,
|
||||
}) {
|
||||
const fetchOrganizations = useQuery(
|
||||
['organizations'],
|
||||
() => requestOrganizationsList(),
|
||||
['organizations'], () => requestAllOrganizations(),
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user