added suggested changes

Signed-off-by: npiyush97 <npiyush35@gmail.com>
This commit is contained in:
npiyush97
2023-09-19 15:08:53 +05:30
parent 3c5e2762a9
commit b337d78c3b
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
fixed issue related template editor fails with multiple templates per file.
@@ -123,7 +123,10 @@ export function TemplateEditorForm(props: TemplateEditorFormProps) {
setSteps(undefined);
return;
}
const parsed: JsonValue = yaml.parse(content);
const parsed: JsonValue = yaml
.parseAllDocuments(content)
.map(c => c.toJSON())
.filter(c => c)[0];
if (!isJsonObject(parsed)) {
setSteps(undefined);