initial support of ui options in scaffolder forms

Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
Alex Rybchenko
2022-11-18 14:47:10 +01:00
parent 94a2e86ce1
commit 596b7cf1a0
5 changed files with 10 additions and 0 deletions
@@ -4,6 +4,8 @@ metadata:
name: bitbucket-demo
title: Test Bitbucket RepoUrlPicker template
description: scaffolder v1beta3 template demo publishing to bitbucket
ui:options:
finishButtonLabel: Publish
spec:
owner: backstage/techdocs-core
type: service
@@ -259,6 +259,7 @@ export async function createRouter(
res.json({
title: template.metadata.title ?? template.metadata.name,
description: template.metadata.description,
'ui:options': template.metadata['ui:options'],
steps: parameters.map(schema => ({
title: schema.title ?? 'Please enter the following information',
description: schema.description,
+3
View File
@@ -640,6 +640,9 @@ export type TemplateGroupFilter = {
export type TemplateParameterSchema = {
title: string;
description?: string;
['ui:options']?: {
finishButtonLabel?: string;
};
steps: Array<{
title: string;
description?: string;
@@ -152,6 +152,7 @@ export const TemplatePage = ({
onReset={handleFormReset}
onFinish={handleCreate}
layouts={layouts}
finishButtonLabel={schema['ui:options']?.finishButtonLabel}
steps={schema.steps.map(step => {
return {
...step,
+3
View File
@@ -80,6 +80,9 @@ export type ScaffolderTaskOutput = {
export type TemplateParameterSchema = {
title: string;
description?: string;
['ui:options']?: {
finishButtonLabel?: string;
};
steps: Array<{
title: string;
description?: string;