-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate company investment tabs to React Router
- Loading branch information
Showing
16 changed files
with
68 additions
and
164 deletions.
There are no files selected for viewing
5 changes: 0 additions & 5 deletions
5
src/apps/companies/apps/investments/large-capital-profile/controllers/index.js
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/apps/companies/apps/investments/large-capital-profile/controllers/profile.js
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/apps/companies/apps/investments/large-capital-profile/router.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/apps/companies/apps/investments/large-capital-profile/views/profile.njk
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/apps/companies/apps/investments/projects/controllers/index.js
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/apps/companies/apps/investments/projects/controllers/list.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 21 additions & 14 deletions
35
src/client/modules/Companies/CompanyInvestments/CompanyProjectsCollection.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
import React from 'react' | ||
import { connect } from 'react-redux' | ||
import { useParams } from 'react-router-dom' | ||
|
||
import { CompanyResource } from '../../../components/Resource' | ||
import CompanyLayout from '../../../components/Layout/CompanyLayout' | ||
import ProjectsCollection from '../../Investments/Projects/ProjectsCollection' | ||
import { state2props } from '../../Investments/Projects/state' | ||
import DefaultLayoutBase from '../../../components/Layout/DefaultLayoutBase' | ||
|
||
const CompanyProjectsCollection = ({ companyId, returnUrl, ...props }) => ( | ||
<CompanyResource id={companyId}> | ||
{(company) => ( | ||
<CompanyLayout | ||
company={company} | ||
breadcrumbs={[{ text: 'Investment' }]} | ||
returnUrl={returnUrl} | ||
isInvestment={true} | ||
> | ||
<ProjectsCollection company={company} {...props} /> | ||
</CompanyLayout> | ||
)} | ||
</CompanyResource> | ||
) | ||
const CompanyProjectsCollection = ({ ...props }) => { | ||
const { companyId } = useParams() | ||
return ( | ||
<DefaultLayoutBase> | ||
<CompanyResource id={companyId}> | ||
{(company) => ( | ||
<CompanyLayout | ||
company={company} | ||
breadcrumbs={[{ text: 'Investment' }]} | ||
isInvestment={true} | ||
pageTitle="Investments" | ||
> | ||
<ProjectsCollection company={company} {...props} /> | ||
</CompanyLayout> | ||
)} | ||
</CompanyResource> | ||
</DefaultLayoutBase> | ||
) | ||
} | ||
|
||
export default connect(state2props)(CompanyProjectsCollection) |
54 changes: 27 additions & 27 deletions
54
src/client/modules/Companies/CompanyInvestments/LargeCapitalProfile/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { useParams } from 'react-router-dom' | ||
|
||
import { | ||
CompanyResource, | ||
LargeInvestorProfileResource, | ||
} from '../../../../components/Resource' | ||
import CompanyLayout from '../../../../components/Layout/CompanyLayout' | ||
import DefaultLayoutBase from '../../../../components/Layout/DefaultLayoutBase' | ||
|
||
import CreateLargeCapitalProfile from './CreateLargeCapitalProfile' | ||
import EditLargeCapitalProfile from './EditLargeCapitalProfile' | ||
|
||
const LargeCapitalProfile = ({ companyId, flashMessages }) => { | ||
const LargeCapitalProfile = () => { | ||
const { companyId } = useParams() | ||
return ( | ||
<LargeInvestorProfileResource id={companyId}> | ||
{(profile) => ( | ||
<CompanyResource id={companyId}> | ||
{(company) => ( | ||
<CompanyLayout | ||
company={company} | ||
breadcrumbs={[{ text: 'Investments' }]} | ||
flashMessages={flashMessages} | ||
isInvestment={true} | ||
isLCP={true} | ||
> | ||
{profile.results.length != 0 ? ( | ||
<EditLargeCapitalProfile profile={profile} /> | ||
) : ( | ||
<CreateLargeCapitalProfile companyId={companyId} /> | ||
)} | ||
</CompanyLayout> | ||
)} | ||
</CompanyResource> | ||
)} | ||
</LargeInvestorProfileResource> | ||
<DefaultLayoutBase> | ||
<LargeInvestorProfileResource id={companyId}> | ||
{(profile) => ( | ||
<CompanyResource id={companyId}> | ||
{(company) => ( | ||
<CompanyLayout | ||
company={company} | ||
breadcrumbs={[{ text: 'Investments' }]} | ||
isInvestment={true} | ||
isLCP={true} | ||
pageTitle="Large capital profile" | ||
> | ||
{profile.results.length != 0 ? ( | ||
<EditLargeCapitalProfile profile={profile} /> | ||
) : ( | ||
<CreateLargeCapitalProfile companyId={companyId} /> | ||
)} | ||
</CompanyLayout> | ||
)} | ||
</CompanyResource> | ||
)} | ||
</LargeInvestorProfileResource> | ||
</DefaultLayoutBase> | ||
) | ||
} | ||
|
||
LargeCapitalProfile.propTypes = { | ||
companyId: PropTypes.string.isRequired, | ||
} | ||
|
||
export default LargeCapitalProfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters