Skip to content

Commit

Permalink
change investment project admin component to use existing project sta…
Browse files Browse the repository at this point in the history
…ge resource and remove newly created resource, refactor file structure moving state and tasks into existing files at the route of the projects folder inside investments
  • Loading branch information
Richard Pentecost authored and Richard Pentecost committed Feb 7, 2024
1 parent ba012c1 commit 4ef2c99
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 30 deletions.
6 changes: 0 additions & 6 deletions src/client/components/Resource/InvestmentProjectStages.js

This file was deleted.

1 change: 0 additions & 1 deletion src/client/components/Resource/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export { default as InvestmentProjectStageResource } from './ProjectStage'
export { default as InvestmentTypesResource } from './InvestmentTypes'
export { default as InvestorTypesResource } from './InvestorTypes'
export { default as InvestmentInvestorTypesResource } from './InvestmentInvestorTypes'
export { default as InvestmentProjectStagesResource } from './InvestmentProjectStages'
export { default as InvestmentProjectTasksResource } from './InvestmentProjectTasks'
export { default as LargeCapitalInvestmentEquityPercentagesResource } from './LargeCapitalInvestmentEquityPercentages'
export { default as LargeCapitalInvestmentRestrictionsResource } from './LargeCapitalInvestmentRestrictions'
Expand Down
2 changes: 0 additions & 2 deletions src/client/components/Resource/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ import TaskCompletedSettings from './TaskCompletedSettings'
import OmisMarkets from './OmisMarkets'
import OrderPayment from './OrderPayment'
import TaskCompaniesAndProjects from './TaskCompaniesAndProjects'
import InvestmentProjectStages from './InvestmentProjectStages'

export default {
...AssociatedProgramme.tasks,
Expand Down Expand Up @@ -179,5 +178,4 @@ export default {
...OmisMarkets.tasks,
...OrderPayment.tasks,
...TaskCompaniesAndProjects.tasks,
...InvestmentProjectStages.tasks,
}
4 changes: 0 additions & 4 deletions src/client/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import InteractionDetails from './modules/Interactions/InteractionDetails'
import OrdersReconciliationCollection from './modules/Omis/CollectionList/OrdersReconciliationCollection'
import PropositionDetails from './modules/Investments/Projects/Propositions/PropositionDetails'
import CompanyHierarchy from './modules/Companies/CompanyHierarchy'
import InvestmentProjectAdmin from './modules/Investments/Projects/Admin/InvestmentProjectAdmin.jsx'

import Footer from '../client/components/Footer'

Expand Down Expand Up @@ -190,9 +189,6 @@ function App() {
<Mount selector="#interaction-referral-details">
{(props) => <InteractionReferralDetails {...props} />}
</Mount>
<Mount selector="#investment-project-admin">
{(props) => <InvestmentProjectAdmin {...props} />}
</Mount>
<Mount selector="#flash-messages">
{(props) => <FlashMessages {...props} />}
</Mount>
Expand Down
1 change: 0 additions & 1 deletion src/client/modules/Investments/Projects/Admin/state.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/client/modules/Investments/Projects/Admin/tasks.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import { H4, InsetText } from 'govuk-react'
import styled from 'styled-components'
import { SPACING } from '@govuk-react/constants'

import urls from '../../../../../lib/urls'
import urls from '../../../../lib/urls'
import {
InvestmentProjectStageResource,
InvestmentResource,
} from '../../../../components/Resource'
import { buildProjectBreadcrumbs } from '../../utils'
import { transformObjectToOption } from '../../../../../apps/transformers'
} from '../../../components/Resource'
import { buildProjectBreadcrumbs } from '../utils'
import { transformObjectToOption } from '../../../../apps/transformers'
import {
DefaultLayout,
FieldRadios,
Form,
FormLayout,
} from '../../../../components'
import { FORM_LAYOUT } from '../../../../../common/constants'
} from '../../../components'
import { FORM_LAYOUT } from '../../../../common/constants'
import { TASK_UPDATE_STAGE } from './state'

const StyledP = styled('p')`
Expand Down
1 change: 1 addition & 0 deletions src/client/modules/Investments/Projects/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const TASK_EDIT_INVESTMENT_PROJECT_STATUS =
'TASK_EDIT_INVESTMENT_PROJECT_STATUS'
export const TASK_UPDATE_INVESTMENT_PROJECT_STAGE =
'TASK_UPDATE_INVESTMENT_PROJECT_STAGE'
export const TASK_UPDATE_STAGE = 'TASK_UPDATE_STAGE'

export const INVESTMENT_PROJECTS_ID = 'projectsList'
export const INVESTMENT_PROJECT_ID = 'investmentProject'
Expand Down
5 changes: 5 additions & 0 deletions src/client/modules/Investments/Projects/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ export const completeInvestmentPropositions = (values) =>
`v3/investment/${values.investmentProjectId}/proposition/${values.propositionId}/complete`
)
.then(({ data }) => data)

export const updateProjectStage = ({ values, projectId }) =>
apiProxyAxios.post(`/v3/investment/${projectId}/update-stage`, {
stage: { id: values.projectStageId },
})
2 changes: 1 addition & 1 deletion src/client/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import CompanyProjectsCollection from './modules/Companies/CompanyInvestments/Co
import LargeCapitalProfile from './modules/Companies/CompanyInvestments/LargeCapitalProfile'
import ExportsIndex from './modules/Companies/CompanyExports/ExportsIndex'
import ExportsHistory from './modules/Companies/CompanyExports/ExportHistory'
import InvestmentProjectAdmin from './modules/Investments/Projects/Admin/InvestmentProjectAdmin'
import InvestmentProjectAdmin from './modules/Investments/Projects/InvestmentProjectAdmin'

const routes = {
companies: [
Expand Down
5 changes: 2 additions & 3 deletions src/client/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {
TASK_EDIT_INVESTMENT_PROJECT_STATUS,
TASK_UPDATE_INVESTMENT_PROJECT_STAGE,
TASK_GET_INVESTMENT_PROJECT,
TASK_UPDATE_STAGE,
} from './modules/Investments/Projects/state'
import * as investmentProjectTasks from './modules/Investments/Projects/tasks'

Expand Down Expand Up @@ -436,8 +437,6 @@ import {
getExportProject,
getExportWin,
} from '../client/modules/ExportWins/Form/tasks'
import { TASK_UPDATE_STAGE } from './modules/Investments/Projects/Admin/state'
import * as investmentAdminTasks from './modules/Investments/Projects/Admin/tasks'

export const tasks = {
'Create list': createList,
Expand Down Expand Up @@ -465,7 +464,7 @@ export const tasks = {
[TASK_SAVE_INTERACTION]: addInteractionFormTasks.saveInteraction,
[TASK_GET_INTERACTION_INITIAL_VALUES]:
addInteractionFormTasks.getInitialFormValues,
[TASK_UPDATE_STAGE]: investmentAdminTasks.updateProjectStage,
[TASK_UPDATE_STAGE]: investmentProjectTasks.updateProjectStage,
[TASK_SAVE_OPPORTUNITY_DETAILS]:
investmentOpportunitiesDetailsTasks.saveOpportunityDetails,
[TASK_SAVE_OPPORTUNITY_STATUS]:
Expand Down

0 comments on commit 4ef2c99

Please sign in to comment.