|
|
@ -46,7 +46,6 @@ class PlatformCreate extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(props, nextprops) {
|
|
|
|
componentWillReceiveProps(props, nextprops) {
|
|
|
|
this.setState({open: props.open})
|
|
|
|
this.setState({open: props.open})
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -67,7 +66,6 @@ class PlatformCreate extends Component {
|
|
|
|
const {stepIndex} = this.state;
|
|
|
|
const {stepIndex} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
if (stepIndex + 1 > 2) {
|
|
|
|
if (stepIndex + 1 > 2) {
|
|
|
|
console.log(this.state);
|
|
|
|
|
|
|
|
this.onSubmit();
|
|
|
|
this.onSubmit();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -75,8 +73,6 @@ class PlatformCreate extends Component {
|
|
|
|
finished: stepIndex + 1 > 1
|
|
|
|
finished: stepIndex + 1 > 1
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -96,9 +92,6 @@ class PlatformCreate extends Component {
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
onSubmit(platformProps) {
|
|
|
|
onSubmit(platformProps) {
|
|
|
|
let {general, configure} = this.state;
|
|
|
|
let {general, configure} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(general);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let platformCreatePromise = PlatformMgtApi.createPlatform(general, configure, platformProps);
|
|
|
|
let platformCreatePromise = PlatformMgtApi.createPlatform(general, configure, platformProps);
|
|
|
|
platformCreatePromise.then(response => {
|
|
|
|
platformCreatePromise.then(response => {
|
|
|
|
console.log(response.data)
|
|
|
|
console.log(response.data)
|
|
|
@ -116,7 +109,6 @@ class PlatformCreate extends Component {
|
|
|
|
* @param data: The form data of the step.
|
|
|
|
* @param data: The form data of the step.
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
setStepData(step, data) {
|
|
|
|
setStepData(step, data) {
|
|
|
|
console.log(data); //TODO: Remove this
|
|
|
|
|
|
|
|
switch (step) {
|
|
|
|
switch (step) {
|
|
|
|
case "general": {
|
|
|
|
case "general": {
|
|
|
|
this.setState({general: data}, this.onNextClick());
|
|
|
|
this.setState({general: data}, this.onNextClick());
|
|
|
@ -138,14 +130,12 @@ class PlatformCreate extends Component {
|
|
|
|
* This clears the data in the current step and returns to the previous step.
|
|
|
|
* This clears the data in the current step and returns to the previous step.
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
onPrevClick() {
|
|
|
|
onPrevClick() {
|
|
|
|
console.log(this.state.stepIndex);
|
|
|
|
|
|
|
|
const {stepIndex} = this.state;
|
|
|
|
const {stepIndex} = this.state;
|
|
|
|
if (stepIndex > 0) {
|
|
|
|
if (stepIndex > 0) {
|
|
|
|
this.setState({stepIndex: stepIndex - 1, finished: false});
|
|
|
|
this.setState({stepIndex: stepIndex - 1, finished: false});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Defines all the Steps in the stepper. (Wizard)
|
|
|
|
* Defines all the Steps in the stepper. (Wizard)
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -188,7 +178,6 @@ class PlatformCreate extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getStepperHeaders() {
|
|
|
|
getStepperHeaders() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
[{index: 1, text: "General"},
|
|
|
|
[{index: 1, text: "General"},
|
|
|
|