mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
WIP: register setup wizard pages.
This commit is contained in:
37
client/src/containers/Organization/withOrganization.js
Normal file
37
client/src/containers/Organization/withOrganization.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getOrganizationByIdFactory,
|
||||
isOrganizationReadyFactory,
|
||||
isOrganizationSeededFactory,
|
||||
isOrganizationBuiltFactory,
|
||||
isOrganizationSeedingFactory,
|
||||
isOrganizationInitializingFactory,
|
||||
isOrganizationSubscribedFactory,
|
||||
} from 'store/organizations/organizations.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const getOrganizationById = getOrganizationByIdFactory();
|
||||
const isOrganizationReady = isOrganizationReadyFactory();
|
||||
|
||||
const isOrganizationSeeded = isOrganizationSeededFactory();
|
||||
const isOrganizationBuilt = isOrganizationBuiltFactory();
|
||||
|
||||
const isOrganizationInitializing = isOrganizationInitializingFactory();
|
||||
const isOrganizationSeeding = isOrganizationSeedingFactory();
|
||||
|
||||
const isOrganizationSubscribed = isOrganizationSubscribedFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
organization: getOrganizationById(state, props),
|
||||
isOrganizationReady: isOrganizationReady(state, props),
|
||||
isOrganizationSeeded: isOrganizationSeeded(state, props),
|
||||
isOrganizationInitialized: isOrganizationBuilt(state, props),
|
||||
isOrganizationSeeding: isOrganizationInitializing(state, props),
|
||||
isOrganizationInitializing: isOrganizationSeeding(state, props),
|
||||
isOrganizationSubscribed: isOrganizationSubscribed(state, props),
|
||||
};
|
||||
return (mapState) ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
@@ -5,10 +5,10 @@ import {
|
||||
seedTenant,
|
||||
} from 'store/organizations/organizations.actions';
|
||||
|
||||
export const mapDispatchToProps = (dispatch) => ({
|
||||
requestOrganizationsList: () => dispatch(fetchOrganizations()),
|
||||
requestBuildTenant: () => dispatch(buildTenant()),
|
||||
requestSeedTenant: () => dispatch(seedTenant()),
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
requestOrganizationBuild: () => dispatch(buildTenant()),
|
||||
requestOrganizationSeed: () => dispatch(seedTenant()),
|
||||
requestAllOrganizations: () => dispatch(fetchOrganizations()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getOrganizationByOrgIdFactory,
|
||||
} from 'store/organizations/organizations.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const getOrganizationByOrgId = getOrganizationByOrgIdFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
organization: getOrganizationByOrgId(state, props),
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getOrganizationByTenantIdFactory,
|
||||
} from 'store/organizations/organizations.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const getOrgByTenId = getOrganizationByTenantIdFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
organization: getOrgByTenId(state, props),
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
Reference in New Issue
Block a user