-
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 react router route for edit export win
- Loading branch information
Showing
5 changed files
with
75 additions
and
47 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,41 @@ | ||
import AddExportWinForm from './AddExportWinForm' | ||
import React from 'react' | ||
|
||
export default AddExportWinForm | ||
import { TASK_GET_EXPORT_WIN, TASK_GET_EXPORT_PROJECT } from './state' | ||
import { getQueryParamsFromLocation } from '../../../utils/url' | ||
import ExportWinForm from './ExportWinForm' | ||
|
||
// If we're converting an export project to an export win | ||
// then we'll have the export id, otherwise we're creating | ||
// the export win from scratch. | ||
export const CreateExportWin = ({ location }) => { | ||
const queryParams = getQueryParamsFromLocation(location) | ||
return ( | ||
<ExportWinForm | ||
title="Add export win" | ||
companyId={queryParams.company} | ||
initialValuesTaskName={ | ||
queryParams.export ? TASK_GET_EXPORT_PROJECT : null | ||
} | ||
initialValuesPayload={{ | ||
id: queryParams.export ? queryParams.export : null, | ||
}} | ||
/> | ||
) | ||
} | ||
|
||
// Here we're editing an existing win so we'll have the | ||
// export win id. | ||
export const EditExportWin = ({ location, match }) => { | ||
const queryParams = getQueryParamsFromLocation(location) | ||
return ( | ||
<ExportWinForm | ||
title="Edit export win" | ||
companyId={queryParams.company} | ||
exportWinId={match.params.exportWinId} | ||
initialValuesTaskName={TASK_GET_EXPORT_WIN} | ||
initialValuesPayload={{ | ||
id: match.params.exportWinId, | ||
}} | ||
/> | ||
) | ||
} |
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