Skip to content
Snippets Groups Projects
Commit ea4972ba authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- fixed isse where we can't save/update a custom project after creation...

- fixed isse where we can't save/update a custom project after creation because the component was not re-mounted (and no new ids are loaded)
parent 2f99397c
No related branches found
No related tags found
No related merge requests found
...@@ -225,8 +225,9 @@ class App extends React.Component<Props, any> { ...@@ -225,8 +225,9 @@ class App extends React.Component<Props, any> {
{ {
//edit custom projects site (create, edit) //edit custom projects site (create, edit)
//maybe the key is not needed here but why not
} }
<Route exact path={constants.createCustomProjectSiteToLinkPath} <Route exact key={constants.createCustomProjectSiteToLinkPath} path={constants.createCustomProjectSiteToLinkPath}
render={(props: RouteComponentProps<any>) => render={(props: RouteComponentProps<any>) =>
<PageContentWrapper <PageContentWrapper
headerBar={ headerBar={
...@@ -239,7 +240,12 @@ class App extends React.Component<Props, any> { ...@@ -239,7 +240,12 @@ class App extends React.Component<Props, any> {
</PageContentWrapper> </PageContentWrapper>
}/> }/>
<Route exact path={constants.getCustomProjectMatchLinkPath} render={(props: RouteComponentProps<any>) => {
//we need key to re-mount component so we fully load the new project after creation
//see https://github.com/ReactTraining/react-router/issues/1703
//see https://stackoverflow.com/questions/47804798/how-to-re-render-the-same-component-being-used-in-different-routes
}
<Route exact key={constants.getCustomProjectMatchLinkPath} path={constants.getCustomProjectMatchLinkPath} render={(props: RouteComponentProps<any>) =>
<PageContentWrapper <PageContentWrapper
headerBar={ headerBar={
<CommonHeaderBar> <CommonHeaderBar>
......
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
descriptionEditorDebounceInMs, descriptionEditorDebounceInMs,
editExerciseExerciseDescriptionEditorPanelViewEditorId editExerciseExerciseDescriptionEditorPanelViewEditorId
} from '../../../../constants' } from '../../../../constants'
import {getNextFrontendId} from '../../../../helpers/frontendIdHelper'
//const css = require('./styles.styl'); //const css = require('./styles.styl');
...@@ -29,8 +30,7 @@ const mapStateToProps = (rootState: RootState, props: MyProps) => { ...@@ -29,8 +30,7 @@ const mapStateToProps = (rootState: RootState, props: MyProps) => {
return { return {
//test0: rootState... //test0: rootState...
//test: props.test //test: props.test
descriptionContent: props.descriptionContent, ...props,
setContent: props.setContent,
} }
} }
......
...@@ -54,8 +54,6 @@ class headerBar extends React.Component<Props, any> { ...@@ -54,8 +54,6 @@ class headerBar extends React.Component<Props, any> {
render(): JSX.Element { render(): JSX.Element {
console.log(this.props.systemSettings)
const leftArea = ( const leftArea = (
<div className="flexed"> <div className="flexed">
......
...@@ -13,7 +13,7 @@ import Logger from './helpers/logger' ...@@ -13,7 +13,7 @@ import Logger from './helpers/logger'
* y - breaking changes / new features * y - breaking changes / new features
* z - fixes, small changes * z - fixes, small changes
*/ */
export const versionString = '2.5.9' export const versionString = '2.5.11'
export const supportMail = 'yapex@informatik.uni-halle.de' export const supportMail = 'yapex@informatik.uni-halle.de'
......
...@@ -311,7 +311,6 @@ export function loadEditCustomProjectSite(customProjectId: number | null, isCrea ...@@ -311,7 +311,6 @@ export function loadEditCustomProjectSite(customProjectId: number | null, isCrea
await dispatch(getCustomProjectAsync(customProjectId)) await dispatch(getCustomProjectAsync(customProjectId))
await dispatch(getCustomProjectTestResultsAsync(customProjectId, getState().editCustomProjectSiteState.customProject.solution.pLangId)) await dispatch(getCustomProjectTestResultsAsync(customProjectId, getState().editCustomProjectSiteState.customProject.solution.pLangId))
// await dispatch( // await dispatch(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment