config-schema: clean up main page

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-04-10 12:02:41 +02:00
parent a8d3130639
commit 2c27b4f4fd
2 changed files with 4 additions and 18 deletions
@@ -14,15 +14,7 @@
* limitations under the License.
*/
import React, { useMemo } from 'react';
import {
Header,
Page,
Content,
ContentHeader,
HeaderLabel,
SupportButton,
useApi,
} from '@backstage/core';
import { Header, Page, Content, useApi } from '@backstage/core';
import { useObservable } from 'react-use';
import { configSchemaApiRef } from '../../api';
import { SchemaViewer } from '../SchemaViewer';
@@ -35,14 +27,8 @@ export const ConfigSchemaPage = () => {
return (
<Page themeId="tool">
<Header title="Welcome to config-schema!">
<HeaderLabel label="Owner" value="Team X" />
<HeaderLabel label="Lifecycle" value="Alpha" />
</Header>
<Header title="Configuration Documentation" />
<Content stretch>
<ContentHeader title="Plugin title">
<SupportButton>A description of your plugin goes here.</SupportButton>
</ContentHeader>
{schema ? <SchemaViewer schema={schema} /> : 'No schema available'}
</Content>
</Page>
@@ -403,7 +403,7 @@ export function MatchView({
<Typography variant="overline">{label}</Typography>
{schema.map((optionSchema, index) => (
<ChildView
path={`${path}/${index}`}
path={`${path}/${index + 1}`}
depth={depth + 1}
schema={optionSchema}
lastChild={index === schema.length - 1}
@@ -486,7 +486,7 @@ export function createSchemaBrowserItems(
}
if (matchArr) {
return matchArr.map((childSchema, index) => {
const childPath = `${path}.${index}`;
const childPath = `${path}/${index + 1}`;
if (depth > 0) expanded.push(childPath);
return (
<StyledTreeItem