diff --git a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js
index 15ff1f665..3aac6d51e 100644
--- a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js
+++ b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js
@@ -10,7 +10,8 @@ import _get from 'lodash/get'
import { FormattedMessage, injectIntl } from 'react-intl'
import { Link } from 'react-router-dom'
import Steps from '../../../../Bulma/Steps'
-import StepNavigation from '../../../../Bulma/StepNavigation'
+import StepNavigation
+ from '../../../../Bulma/StepNavigation/StepNavigation'
import { CustomFieldTemplate,
MarkdownDescriptionField }
from '../../../../Bulma/RJSFFormFieldAdapter/RJSFFormFieldAdapter'
@@ -141,6 +142,13 @@ export class EditChallenge extends Component {
}
}
+ cancel = () => {
+ _isObject(this.props.challenge) ?
+ this.props.history.push(
+ `/admin/project/${this.props.project.id}/challenge/${this.props.challenge.id}`) :
+ this.props.history.push(`/admin/project/${this.props.project.id}`)
+ }
+
/** Receive updates to the form data, along with any validation errors */
changeHandler = ({formData, errors}) => {
this.setState({
@@ -292,7 +300,7 @@ export class EditChallenge extends Component {
+ finish={this.finish} cancel={this.cancel} />
)
}
diff --git a/src/components/AdminPane/Manage/ManageProjects/EditProject/EditProject.js b/src/components/AdminPane/Manage/ManageProjects/EditProject/EditProject.js
index 4e41dccc6..497f8e0e1 100644
--- a/src/components/AdminPane/Manage/ManageProjects/EditProject/EditProject.js
+++ b/src/components/AdminPane/Manage/ManageProjects/EditProject/EditProject.js
@@ -46,6 +46,12 @@ export class EditProject extends Component {
}
}
+ cancel = () => {
+ _isObject(this.props.project) ?
+ this.props.history.push(`/admin/project/${this.props.project.id}`) :
+ this.props.history.push('/admin/manage')
+ }
+
render() {
const projectData = _merge({}, this.props.project, this.state.formData)
@@ -86,6 +92,12 @@ export class EditProject extends Component {
onChange={this.changeHandler}
onSubmit={this.finish}>
+
+