Explorar o código

add defaults to watch (#3829)

Feroze Mohideen %!s(int64=2) %!d(string=hai) anos
pai
achega
e484a9de12

+ 16 - 4
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/tabs/Resources.tsx

@@ -33,18 +33,30 @@ const Resources: React.FC<ResourcesProps> = ({
   const [showNeedHelpModal, setShowNeedHelpModal] = useState(false);
 
   const autoscalingEnabled = watch(
-    `app.services.${index}.config.autoscaling.enabled`
+    `app.services.${index}.config.autoscaling.enabled`, {
+      readOnly: false,
+      value: false
+    }
   );
 
   const smartOpt = watch(
-    `app.services.${index}.smartOptimization`
+    `app.services.${index}.smartOptimization`, {
+      readOnly: false,
+      value: false
+    }
   );
 
   const memory = watch(
-    `app.services.${index}.ramMegabytes`
+    `app.services.${index}.ramMegabytes`, {
+      readOnly: false,
+      value: 0
+    }
   );
   const cpu = watch(
-    `app.services.${index}.cpuCores`
+    `app.services.${index}.cpuCores`, {
+      readOnly: false,
+      value: 0
+    }
   );
 
   return (