From 0f5f5a332c0c464d5866435cbde9fa7c2acfcb71 Mon Sep 17 00:00:00 2001 From: Feroze Mohideen Date: Tue, 27 Feb 2024 14:08:57 -0500 Subject: [PATCH] fix service validation error (#4335) --- .../home/app-dashboard/create-app/CreateApp.tsx | 4 +++- .../src/shared/ClusterResourcesContext.tsx | 17 +++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx b/dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx index 5aa959875b..0d0ae21855 100644 --- a/dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx +++ b/dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx @@ -409,6 +409,8 @@ const CreateApp: React.FC = ({ history }) => { // TODO: create a more unified way of parsing form/apply errors, unified with the logic in AppDataContainer const errorKeys = Object.keys(errors); if (errorKeys.length > 0) { + const stringifiedJson = JSON.stringify(errors); + let errorMessage = "App could not be deployed as defined."; if (errorKeys.includes("app")) { const appErrors = Object.keys(errors.app ?? {}); @@ -431,7 +433,7 @@ const CreateApp: React.FC = ({ history }) => { void updateAppStep({ step: "stack-launch-failure", - errorMessage: `Form validation error: ${errorMessage}`, + errorMessage: `Form validation error (visible to user): ${errorMessage}. Stringified JSON errors (invisible to user): ${stringifiedJson}`, appName: name.value, }); diff --git a/dashboard/src/shared/ClusterResourcesContext.tsx b/dashboard/src/shared/ClusterResourcesContext.tsx index 0a3038b6fd..cbb625a26a 100644 --- a/dashboard/src/shared/ClusterResourcesContext.tsx +++ b/dashboard/src/shared/ClusterResourcesContext.tsx @@ -41,7 +41,7 @@ const ClusterResourcesProvider = ({ }): JSX.Element => { const { currentCluster, currentProject } = useContext(Context); - var { + const { maxCPU, maxRAM, defaultCPU, @@ -56,21 +56,14 @@ const ClusterResourcesProvider = ({ clusterStatus: currentCluster?.status, }); - if (currentProject?.sandbox_enabled) { - defaultCPU = 0.1 - defaultRAM = 120 - maxRAM = 250 - maxCPU = 0.2 - } - return (