Merge pull request #20009 from npiyush97/fix-18778
Fix 18778 : template editor fails with multiple templates per file
This commit is contained in:
@@ -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)
|
||||
.filter(c => c)
|
||||
.map(c => c.toJSON())[0];
|
||||
|
||||
if (!isJsonObject(parsed)) {
|
||||
setSteps(undefined);
|
||||
|
||||
Reference in New Issue
Block a user