This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve the scenario form and edit components * Remove DefaultScenarioHelpText from scenario form to fix scenario page crashing on click * Fix explanationText as JSX element
- Loading branch information
1 parent
9ac5997
commit 0a05028
Showing
6 changed files
with
14 additions
and
22 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 |
---|---|---|
|
@@ -11,9 +11,9 @@ import { CancelButton } from '../../form/CancelButton'; | |
import { useForm, Values } from '../../form/useForm'; | ||
import { minLength } from '../../form/validators'; | ||
import { addNotification } from '../../actions'; | ||
import { scenarioFormHelpText } from '../../utils/help_texts/helpTextForScenarios'; | ||
import threediIcon from "../../images/[email protected]"; | ||
import formStyles from './../../styles/Forms.module.css'; | ||
import { scenarioFormHelpText, DefaultScenarioExplanationText } from '../../utils/help_texts/helpTextForScenarios'; | ||
|
||
interface Props { | ||
currentRecord: any | ||
|
@@ -25,7 +25,7 @@ interface RouteParams { | |
uuid: string; | ||
}; | ||
|
||
const ScenarioFormModel: React.FC<Props & PropsFromDispatch & RouteComponentProps<RouteParams>> = (props) => { | ||
const ScenarioForm: React.FC<Props & PropsFromDispatch & RouteComponentProps<RouteParams>> = (props) => { | ||
const { currentRecord } = props; | ||
const organisations = useSelector(getOrganisations).available; | ||
const scenarioOrganisation = organisations.find((org: any) => org.uuid === currentRecord.organisation.uuid); | ||
|
@@ -87,7 +87,7 @@ const ScenarioFormModel: React.FC<Props & PropsFromDispatch & RouteComponentProp | |
headerText={"3Di Scenarios"} | ||
explanationText={ | ||
scenarioFormHelpText[fieldOnFocus] || | ||
DefaultScenarioExplanationText() | ||
scenarioFormHelpText['default'] | ||
} | ||
backUrl={"/management/data_management/scenarios/"} | ||
fieldName={fieldOnFocus} | ||
|
@@ -199,6 +199,4 @@ const mapPropsToDispatch = (dispatch: any) => ({ | |
addNotification: (message: string | number, timeout: number) => dispatch(addNotification(message, timeout)) | ||
}); | ||
|
||
const ScenarioForm = connect(null, mapPropsToDispatch)(withRouter(ScenarioFormModel)); | ||
|
||
export { ScenarioForm }; | ||
export default connect(null, mapPropsToDispatch)(withRouter(ScenarioForm)); |
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