diff --git a/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx b/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx index 429fd5c43..bcde5fbd8 100644 --- a/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx +++ b/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx @@ -6,6 +6,7 @@ import type { } from "core/usecases/launcher/decoupledLogic/formTypes"; import { AccordionGroupComponent } from "./AccordionGroupComponent"; import type { FormCallbacks } from "./FormCallbacks"; +import { id } from "tsafe/id"; type Props = { className?: string; @@ -20,14 +21,21 @@ export function ConfigurationTopLevelGroup(props: Props) { const { cx, classes } = useStyles(); const { main_formFields, main_formFieldGroups } = useMemo(() => { - const main_formFields: FormField[] = []; - const main_formFieldGroups: FormFieldGroup[] = []; + const main_formFields: Exclude[] = []; + const main_formFieldGroups: (FormFieldGroup | FormField.YamlCodeBlock)[] = []; for (const node of main) { - if (node.type === "field") { - main_formFields.push(node); - } else { - main_formFieldGroups.push(node); + switch (node.type) { + case "field": + if (node.fieldType === "yaml code block") { + main_formFieldGroups.push(node); + break; + } + main_formFields.push(node); + break; + case "group": + main_formFieldGroups.push(node); + break; } } @@ -61,15 +69,36 @@ export function ConfigurationTopLevelGroup(props: Props) { "nodes": main_formFields } ]), - ...main_formFieldGroups.map( - ({ nodes, description, helmValuesPath, canAdd, canRemove }) => ({ - helmValuesPath, - description, - canAdd, - canRemove, - nodes - }) - ) + ...main_formFieldGroups.map(node => { + if (node.type === "field") { + return { + "helmValuesPath": [node.title], + "description": node.description, + "canAdd": false, + "canRemove": false, + "nodes": [ + id({ + "type": "field", + "fieldType": "yaml code block", + "description": "", + "expectedDataType": node.expectedDataType, + "helmValuesPath": node.helmValuesPath, + "isReadonly": node.isReadonly, + "title": "", + "value": node.value + }) + ] + }; + } + + return { + "helmValuesPath": node.helmValuesPath, + "description": node.description, + "canAdd": node.canAdd, + "canRemove": node.canRemove, + "nodes": node.nodes + }; + }) ]} callbacks={callbacks} /> diff --git a/web/src/ui/pages/launcher/RootFormComponent/FormFieldGroupComponent/FormFieldGroupComponent.tsx b/web/src/ui/pages/launcher/RootFormComponent/FormFieldGroupComponent/FormFieldGroupComponent.tsx index fd46dd210..e276884e8 100644 --- a/web/src/ui/pages/launcher/RootFormComponent/FormFieldGroupComponent/FormFieldGroupComponent.tsx +++ b/web/src/ui/pages/launcher/RootFormComponent/FormFieldGroupComponent/FormFieldGroupComponent.tsx @@ -218,6 +218,7 @@ export function FormFieldGroupComponentInner( return (