fix(ui): reset auto-scaling formvalues if needed [EE-6544] (#10969)

pull/10974/head
Prabhat Khera 2024-01-18 07:59:00 +13:00 committed by GitHub
parent 115b01cee3
commit bf66b6c5f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -286,7 +286,7 @@ class KubernetesCreateApplicationController {
onAutoScaleChange(values) {
return this.$async(async () => {
// when enabling the auto scaler, set the default values
if (!this.formValues.AutoScaler.isUsed && values.isUsed) {
if (!this.oldFormValues.AutoScaler.isUsed && values.isUsed) {
this.formValues.AutoScaler = {
isUsed: values.isUsed,
minReplicas: 1,
@ -297,6 +297,11 @@ class KubernetesCreateApplicationController {
}
// otherwise, just update the values
this.formValues.AutoScaler = values;
// reset it to previous form values if the user disables the auto scaler
if (!this.oldFormValues.AutoScaler.isUsed && !values.isUsed) {
this.formValues.AutoScaler = this.oldFormValues.AutoScaler;
}
});
}
/* #endregion */