chore: typescript is happy. ring the police.

Signed-off-by: blam <ben@blam.sh>

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-09-28 18:57:46 +02:00
parent d362737143
commit 2548b5a590
4 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ export type NextFieldExtensionOptions<
> = {
name: string;
component: (
props: FieldExtensionComponentProps<TFieldReturnValue, TInputProps>,
props: NextFieldExtensionComponentProps<TFieldReturnValue, TInputProps>,
) => JSX.Element | null;
validation?: NextCustomFieldValidator<TFieldReturnValue>;
};
@@ -18,10 +18,10 @@ import { Routes, Route, useOutlet } from 'react-router';
import { TemplateListPage } from '../TemplateListPage';
import { TemplateWizardPage } from '../TemplateWizardPage';
import {
FieldExtensionOptions,
FIELD_EXTENSION_WRAPPER_KEY,
FIELD_EXTENSION_KEY,
DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS,
NextFieldExtensionOptions,
} from '../../extensions';
import { useElementFilter } from '@backstage/core-plugin-api';
@@ -60,7 +60,7 @@ export const Router = (props: PropsWithChildren<NextRouterProps>) => {
.selectByComponentData({
key: FIELD_EXTENSION_WRAPPER_KEY,
})
.findComponentData<FieldExtensionOptions>({
.findComponentData<NextFieldExtensionOptions>({
key: FIELD_EXTENSION_KEY,
}),
);
@@ -73,7 +73,7 @@ export const Router = (props: PropsWithChildren<NextRouterProps>) => {
customFieldExtension => customFieldExtension.name === name,
),
),
];
] as NextFieldExtensionOptions[]; // here just to coerce the default extensions to the correct type
return (
<Routes>
@@ -22,9 +22,9 @@ import {
Button,
makeStyles,
} from '@material-ui/core';
import { withTheme } from '@rjsf/core';
import { withTheme } from '@rjsf/core-v5';
import { ErrorSchema, FieldValidation } from '@rjsf/utils';
import { Theme as MuiTheme } from '@rjsf/material-ui';
import { Theme as MuiTheme } from '@rjsf/material-ui-v5';
import React, { useMemo, useState } from 'react';
import { NextFieldExtensionOptions } from '../../../extensions';
import { TemplateParameterSchema } from '../../../types';
@@ -53,7 +53,8 @@ export interface StepperProps {
extensions: NextFieldExtensionOptions<any, any>[];
}
const Form = withTheme(MuiTheme);
// This needs an any for some reason, think it coul
const Form = withTheme(MuiTheme as any);
export const Stepper = (props: StepperProps) => {
const { steps } = useTemplateSchema(props.manifest);
@@ -22,7 +22,7 @@ import {
InfoCard,
MarkdownContent,
} from '@backstage/core-components';
import { FieldExtensionOptions } from '../../extensions';
import { NextFieldExtensionOptions } from '../../extensions';
import { Navigate } from 'react-router';
import { stringifyEntityRef } from '@backstage/catalog-model';
import {
@@ -39,7 +39,7 @@ import { BackstageTheme } from '@backstage/theme';
import { nextRouteRef, selectedTemplateRouteRef } from '../../routes';
export interface TemplateWizardPageProps {
customFieldExtensions: FieldExtensionOptions<any, any>[];
customFieldExtensions: NextFieldExtensionOptions<any, any>[];
}
const useStyles = makeStyles<BackstageTheme>(() => ({