initial support of ui options in scaffolder forms
Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -80,6 +80,9 @@ export type ScaffolderTaskOutput = {
|
||||
export type TemplateParameterSchema = {
|
||||
title: string;
|
||||
description?: string;
|
||||
['ui:options']?: {
|
||||
finishButtonLabel?: string;
|
||||
};
|
||||
steps: Array<{
|
||||
title: string;
|
||||
description?: string;
|
||||
|
||||
Reference in New Issue
Block a user