From b779e9875664ee2e966b13d51d91cb615564a8c4 Mon Sep 17 00:00:00 2001 From: Zander Franks Date: Thu, 4 May 2023 12:37:35 -0500 Subject: [PATCH] fix(scaffolder): requested changes Signed-off-by: Zander Franks --- .changeset/heavy-penguins-burn.md | 4 ++-- .../features/software-templates/writing-templates.md | 4 ++-- .../src/Template.v1beta3.schema.json | 12 ++++++------ plugins/scaffolder-react/api-report.md | 2 +- plugins/scaffolder-react/src/api/types.ts | 2 +- .../TemplateOutputs/DefaultTemplateOutputs.tsx | 2 +- .../next/components/TemplateOutputs/TextOutputs.tsx | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.changeset/heavy-penguins-burn.md b/.changeset/heavy-penguins-burn.md index f9fba9bfb8..b8c243a99b 100644 --- a/.changeset/heavy-penguins-burn.md +++ b/.changeset/heavy-penguins-burn.md @@ -1,6 +1,6 @@ --- -'@backstage/plugin-scaffolder-common': patch -'@backstage/plugin-scaffolder-react': patch +'@backstage/plugin-scaffolder-common': minor +'@backstage/plugin-scaffolder-react': minor --- Add support for Markdown text blob outputs from templates diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 2508f4a592..44bd5e5928 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -522,8 +522,8 @@ output: icon: catalog entityRef: ${{ steps['register'].output.entityRef }} # link to the entity that has been ingested to the catalog text: - - title: More data - data: | + - title: More information + content: | Access the \[remote repository\](${{ steps['publish'].output.remoteUrl }}). ``` diff --git a/plugins/scaffolder-common/src/Template.v1beta3.schema.json b/plugins/scaffolder-common/src/Template.v1beta3.schema.json index beb86f43cb..1de68205b2 100644 --- a/plugins/scaffolder-common/src/Template.v1beta3.schema.json +++ b/plugins/scaffolder-common/src/Template.v1beta3.schema.json @@ -221,15 +221,15 @@ }, "text": { "type": "array", - "description": "A list of text blobs, like output data from the template.", + "description": "A list of Markdown text blobs, like output data from the template.", "items": { "type": "object", "required": [], "properties": { "title": { "type": "string", - "description": "A user friendly display name for the text blob.", - "examples": ["Output Data"], + "description": "A user friendly display name for the text.", + "examples": ["Output Content"], "minLength": 1 }, "icon": { @@ -238,10 +238,10 @@ "examples": ["dashboard"], "minLength": 1 }, - "data": { + "content": { "type": "string", - "description": "The text blob to display in the UI.", - "examples": ["{}"] + "description": "The text blob to display in the UI, rendered as Markdown.", + "examples": ["**hey** _I'm_ Markdown"] } } } diff --git a/plugins/scaffolder-react/api-report.md b/plugins/scaffolder-react/api-report.md index a2a7dca3b2..1761c88edf 100644 --- a/plugins/scaffolder-react/api-report.md +++ b/plugins/scaffolder-react/api-report.md @@ -221,7 +221,7 @@ export type ScaffolderOutputLink = { export type ScaffolderOutputText = { title?: string; icon?: string; - data?: string; + content?: string; }; // @public diff --git a/plugins/scaffolder-react/src/api/types.ts b/plugins/scaffolder-react/src/api/types.ts index 64bb0d05ac..2adecdd0d2 100644 --- a/plugins/scaffolder-react/src/api/types.ts +++ b/plugins/scaffolder-react/src/api/types.ts @@ -88,7 +88,7 @@ export type ScaffolderOutputLink = { export type ScaffolderOutputText = { title?: string; icon?: string; - data?: string; + content?: string; }; /** @public */ diff --git a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx index de52b62700..a495e4ca9e 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx @@ -64,7 +64,7 @@ export const DefaultTemplateOutputs = (props: { titleTypographyProps={{ component: 'h2' }} > - + diff --git a/plugins/scaffolder-react/src/next/components/TemplateOutputs/TextOutputs.tsx b/plugins/scaffolder-react/src/next/components/TemplateOutputs/TextOutputs.tsx index 8600a281a0..4a9110d79c 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateOutputs/TextOutputs.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateOutputs/TextOutputs.tsx @@ -38,7 +38,7 @@ export const TextOutputs = (props: { return ( <> {text - .filter(({ data }) => data) + .filter(({ content }) => content !== undefined) .map(({ title, icon }, i) => { const Icon = iconResolver(icon); return (