From a14b49f77f41172a6f4dd83f6a7636b5d9fe0b9e Mon Sep 17 00:00:00 2001 From: nxtcoder36 Date: Thu, 14 Mar 2024 13:01:01 +0530 Subject: [PATCH] image pull policy check box added, modifications in app setting for compute and scaling --- src/apps/console/page-components/app-states.tsx | 1 + .../new-app/app-environment-variables.tsx | 17 ++++++++--------- .../$environment+/new-app/app-review.tsx | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/apps/console/page-components/app-states.tsx b/src/apps/console/page-components/app-states.tsx index fe6d5ccf9..8d84065e5 100644 --- a/src/apps/console/page-components/app-states.tsx +++ b/src/apps/console/page-components/app-states.tsx @@ -20,6 +20,7 @@ const defaultApp: AppIn = { { image: '', name: 'container-1', + env: [], }, ], }, diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-environment-variables.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-environment-variables.tsx index 82b15467d..24d2d1ad1 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-environment-variables.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-environment-variables.tsx @@ -230,7 +230,7 @@ export const EnvironmentVariables = () => { submit, resetValues: resetAppValue, } = useForm({ - initialValues: getContainer().env || [], + initialValues: getContainer().env, validationSchema: Yup.array(entry), onSubmit: (val) => { setContainer((c) => ({ @@ -252,15 +252,16 @@ export const EnvironmentVariables = () => { }, [hasChanges]); const addEntry = (val: IEnvVariable) => { + const tempVal = val || []; setValues((v = []) => { const data = { - key: val.key, - type: val.type, - refName: val.refName || '', - refKey: val.refKey || '', - value: val.value || '', + key: tempVal.key, + type: tempVal.type, + refName: tempVal.refName || '', + refKey: tempVal.refKey || '', + value: tempVal.value || '', }; - return [...v, data]; + return [...(v || []), data]; }); }; @@ -312,8 +313,6 @@ export const EnvironmentVariables = () => { }), }), onSubmit: () => { - console.log(eValues); - if (eValues.textInputValue) { const ev: IEnvVariable = { key: eValues.key, diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-review.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-review.tsx index 754f23e2b..7d4f8e277 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-review.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/new-app/app-review.tsx @@ -51,7 +51,6 @@ const AppReview = () => { useEffect(() => { const res = validateType(app, 'AppIn'); - // console.log('res', res); setErrors(res); }, []);