diff --git a/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx b/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx index be446db1d..ec70cfa0f 100644 --- a/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx +++ b/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx @@ -267,6 +267,7 @@ export const ManifestEdit: React.FunctionComponent = ({ editedManifest, s onClick={() => onModeChange("builder")} size="sm" className="flex-grow rounded-e-none sm:flex-grow-0" + disabled={!!parsingError && selectedSdlEditMode === "yaml"} > Builder diff --git a/apps/deploy-web/src/components/new-deployment/SdlBuilder.tsx b/apps/deploy-web/src/components/new-deployment/SdlBuilder.tsx index d03c224bc..d7a165a21 100644 --- a/apps/deploy-web/src/components/new-deployment/SdlBuilder.tsx +++ b/apps/deploy-web/src/components/new-deployment/SdlBuilder.tsx @@ -40,7 +40,7 @@ export const SdlBuilder = React.forwardRef(({ sdlStrin name: "services", keyName: "id" }); - const { services: _services } = watch(); + const { services: _services = [] } = watch(); const { data: gpuModels } = useGpuModels(); const [serviceCollapsed, setServiceCollapsed] = useState([]); @@ -115,21 +115,22 @@ export const SdlBuilder = React.forwardRef(({ sdlStrin ) : (
- {services.map((service, serviceIndex) => ( - - ))} + {_services && + services.map((service, serviceIndex) => ( + + ))} {error && ( diff --git a/apps/deploy-web/src/components/sdl/SimpleServiceFormControl.tsx b/apps/deploy-web/src/components/sdl/SimpleServiceFormControl.tsx index b86f90bca..568d51493 100644 --- a/apps/deploy-web/src/components/sdl/SimpleServiceFormControl.tsx +++ b/apps/deploy-web/src/components/sdl/SimpleServiceFormControl.tsx @@ -66,7 +66,7 @@ export const SimpleServiceFormControl: React.FunctionComponent = ({ const muiTheme = useMuiTheme(); const isDesktop = useMediaQuery(muiTheme.breakpoints.up("sm")); const expanded = !serviceCollapsed.some(x => x === serviceIndex); - const currentService: Service = _services[serviceIndex] || ({} as any); + const currentService: Service = _services[serviceIndex]; const _isEditingEnv = serviceIndex === isEditingEnv; const _isEditingCommands = serviceIndex === isEditingCommands; const _isEditingExpose = serviceIndex === isEditingExpose; @@ -81,6 +81,8 @@ export const SimpleServiceFormControl: React.FunctionComponent = ({ } }); }; + + if (!currentService) return null; return (