diff --git a/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx b/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx index 86da40d5e6..5b8a84c49f 100644 --- a/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx +++ b/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx @@ -267,7 +267,7 @@ export const RenderSchema = ({ key: 'description', title: t('renderSchema.tableCell.description'), render: renderDescriptionCell, - width: '1fr', + width: '3fr', }); } } @@ -282,7 +282,7 @@ export const RenderSchema = ({ key: 'description', title: t('renderSchema.tableCell.description'), render: renderDescriptionCell, - width: '1fr', + width: '3fr', }, { key: 'type', @@ -302,87 +302,91 @@ export const RenderSchema = ({ return ( - {columns && - elements && - elements.map(el => { - const id = generateId(el, context); - const info = inspectSchema(el.schema); - const hasDetails = - typeof el.schema !== 'boolean' && - (info.canSubschema || info.hasEnum); - const s = - typeof el.schema !== 'boolean' - ? (el.schema as JSONSchema7) - : undefined; - const isOpen = - hasDetails && s && (!getTypes(s) || isExpanded[id]); - - return ( - - - - {columns.map((col, index) => ( - - {col.title} - - ))} - - - - {col => col.render(el, context)} - - - - {isOpen && ( -
+ + + {columns.map((col, index) => ( + - {info.canSubschema && ( - + ))} + + + {elements.map(el => ( + + {col => col.render(el, context)} + + ))} + + + {elements.map(el => { + const id = generateId(el, context); + const info = inspectSchema(el.schema); + const hasDetails = + typeof el.schema !== 'boolean' && + (info.canSubschema || info.hasEnum); + const s = + typeof el.schema !== 'boolean' + ? (el.schema as JSONSchema7) + : undefined; + const isOpen = + hasDetails && s && (!getTypes(s) || isExpanded[id]); + + if (!isOpen) { + return null; + } + + return ( +
+ {info.canSubschema && ( + + )} + {info.hasEnum && ( + <> + + Valid values: + + - )} - {info.hasEnum && ( - <> - - Valid values: - - - - )} -
- )} - - ); - })} + + )} +
+ ); + })} + + )} {(Object.keys(subschemas) as Array).map(sk => { const subId = `${context.parentId}_${sk}`; const isSubOpen = isExpanded[subId];