-
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.
Add delete option to proposition document
Add delete call for proposition documents
- Loading branch information
Showing
9 changed files
with
128 additions
and
18 deletions.
There are no files selected for viewing
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
60 changes: 60 additions & 0 deletions
60
src/client/modules/Investments/Projects/Propositions/DeletePropositionDocument.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react' | ||
import { useParams } from 'react-router-dom' | ||
|
||
import { DefaultLayout } from '../../../../components' | ||
import Task from '../../../../components/Task' | ||
import { | ||
DELETE_PROPOSITION_DOCUMENT_ID, | ||
TASK_DELETE_PROPOSITION_DOCUMENT, | ||
} from './state' | ||
import urls from '../../../../../lib/urls' | ||
import { InvestmentResource } from '../../../../components/Resource' | ||
import { buildProjectBreadcrumbs } from '../../utils' | ||
|
||
const DeletePropositionDocument = () => { | ||
const { projectId, propositionId, documentId } = useParams() | ||
return ( | ||
<InvestmentResource id={projectId}> | ||
{(project) => ( | ||
<DefaultLayout | ||
heading={'Deleting proposition document'} | ||
pageTitle={`Delete proposition document - ${project.name} - Projects - Investments`} | ||
breadcrumbs={buildProjectBreadcrumbs([ | ||
{ | ||
link: urls.investments.projects.details(project.id), | ||
text: project.name, | ||
}, | ||
{ | ||
link: urls.investments.projects.proposition.details(project.id), | ||
text: 'Proposition', | ||
}, | ||
{ | ||
text: 'Delete proposition document', | ||
}, | ||
])} | ||
useReactRouter={false} | ||
> | ||
<Task.Status | ||
name={TASK_DELETE_PROPOSITION_DOCUMENT} | ||
id={DELETE_PROPOSITION_DOCUMENT_ID} | ||
progressMessage={'Deleting proposition document'} | ||
startOnRender={{ | ||
payload: { projectId, propositionId, documentId }, | ||
}} | ||
> | ||
{() => | ||
window.location.assign( | ||
urls.investments.projects.proposition.details( | ||
projectId, | ||
propositionId | ||
) | ||
) | ||
} | ||
</Task.Status> | ||
</DefaultLayout> | ||
)} | ||
</InvestmentResource> | ||
) | ||
} | ||
|
||
export default DeletePropositionDocument |
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
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
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