fix(cp-frontend): handle non existing service in scale
This commit is contained in:
parent
db58882a15
commit
d4877e8bb9
@ -31,6 +31,20 @@ class ServiceScale extends Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCloseClick = evt => {
|
||||||
|
const closeUrl = match.url.split('/').slice(0, -2).join('/');
|
||||||
|
history.replace(closeUrl);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmitClick = values => {
|
||||||
|
scale(service.id, values.replicas).then(handleCloseClick);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!service) {
|
||||||
|
setTimeout(handleCloseClick, 33);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const ServiceScaleForm = reduxForm({
|
const ServiceScaleForm = reduxForm({
|
||||||
form: 'scale-service',
|
form: 'scale-service',
|
||||||
destroyOnUnmount: true,
|
destroyOnUnmount: true,
|
||||||
@ -41,15 +55,6 @@ class ServiceScale extends Component {
|
|||||||
}
|
}
|
||||||
})(ServiceScaleComponent);
|
})(ServiceScaleComponent);
|
||||||
|
|
||||||
const handleCloseClick = evt => {
|
|
||||||
const closeUrl = match.url.split('/').slice(0, -2).join('/');
|
|
||||||
history.replace(closeUrl);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmitClick = values => {
|
|
||||||
scale(service.id, values.replicas).then(handleCloseClick);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal width={460} onCloseClick={handleCloseClick}>
|
<Modal width={460} onCloseClick={handleCloseClick}>
|
||||||
<ServiceScaleForm
|
<ServiceScaleForm
|
||||||
|
Loading…
Reference in New Issue
Block a user