rename preview layout
Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
@@ -105,10 +105,7 @@ import { ApacheAirflowPage } from '@backstage/plugin-apache-airflow';
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
||||
import { PlaylistIndexPage } from '@backstage/plugin-playlist';
|
||||
import {
|
||||
AnotherCustomlayout,
|
||||
CustomLayout,
|
||||
} from './components/scaffolder/customScaffolderLayouts';
|
||||
import { TwoColumnLayout } from './components/scaffolder/customScaffolderLayouts';
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
@@ -225,7 +222,7 @@ const routes = (
|
||||
<LowerCaseValuePickerFieldExtension />
|
||||
</ScaffolderFieldExtensions>
|
||||
<ScaffolderLayouts>
|
||||
<CustomLayout />
|
||||
<TwoColumnLayout />
|
||||
</ScaffolderLayouts>
|
||||
</>
|
||||
</Route>
|
||||
|
||||
@@ -21,11 +21,7 @@ import {
|
||||
} from '@backstage/plugin-scaffolder';
|
||||
import { Grid } from '@material-ui/core';
|
||||
|
||||
const TwoColumLayout: ObjectFieldTemplate = ({
|
||||
properties,
|
||||
description,
|
||||
title,
|
||||
}) => {
|
||||
const TwoColum: ObjectFieldTemplate = ({ properties, description, title }) => {
|
||||
const mid = Math.ceil(properties.length / 2);
|
||||
const left = properties.slice(0, mid);
|
||||
const right = properties.slice(mid);
|
||||
@@ -50,9 +46,9 @@ const TwoColumLayout: ObjectFieldTemplate = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const CustomLayout = scaffolderPlugin.provide(
|
||||
export const TwoColumnLayout = scaffolderPlugin.provide(
|
||||
createScaffolderLayout({
|
||||
name: 'CustomLayout',
|
||||
component: TwoColumLayout,
|
||||
name: 'TwoColumn',
|
||||
component: TwoColum,
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
export const defaultPreviewTemplate = `# Edit the template parameters below to see how they will render in the scaffolder form UI
|
||||
parameters:
|
||||
- title: Fill in some steps
|
||||
ui:layout: 'CustomLayout'
|
||||
ui:layout: 'TwoColumn'
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user