chore: remove old rjsf

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2023-10-13 08:22:41 +02:00
committed by Patrik Oldsberg
parent 72b7dc147f
commit fadd3ca42a
25 changed files with 62 additions and 105 deletions
@@ -15,7 +15,7 @@
*/
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
import type { FormProps as SchemaFormProps } from '@rjsf/core-v5';
import type { FormProps as SchemaFormProps } from '@rjsf/core';
import { UiSchema } from '@rjsf/utils';
import { JsonObject } from '@backstage/types';
@@ -33,7 +33,7 @@ import {
ErrorTransformer,
} from '@rjsf/utils';
import { HTMLAttributes } from 'react';
import Form, { IChangeEvent } from '@rjsf/core-v5';
import Form, { IChangeEvent } from '@rjsf/core';
/**
* The props for the `Field` components
@@ -16,7 +16,7 @@
import { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from './keys';
import { attachComponentData, Extension } from '@backstage/core-plugin-api';
import type { FormProps as SchemaFormProps } from '@rjsf/core-v5';
import type { FormProps as SchemaFormProps } from '@rjsf/core';
import React from 'react';
/**
@@ -14,8 +14,11 @@
* limitations under the License.
*/
import { ApiHolder } from '@backstage/core-plugin-api';
import { FieldValidation, FieldProps } from '@rjsf/core';
import { CustomFieldExtensionSchema } from '@backstage/plugin-scaffolder-react';
import { FieldValidation } from '@rjsf/utils';
import {
CustomFieldExtensionSchema,
ScaffolderRJSFFieldProps,
} from '@backstage/plugin-scaffolder-react';
/**
* Field validation type for Custom Field Extensions.
@@ -55,8 +58,8 @@ export type LegacyFieldExtensionOptions<
export interface LegacyFieldExtensionComponentProps<
TFieldReturnValue,
TUiOptions = unknown,
> extends FieldProps<TFieldReturnValue> {
uiSchema: FieldProps['uiSchema'] & {
> extends ScaffolderRJSFFieldProps<TFieldReturnValue> {
uiSchema: ScaffolderRJSFFieldProps['uiSchema'] & {
'ui:options'?: TUiOptions;
};
}
@@ -14,18 +14,16 @@
* limitations under the License.
*/
import { withTheme } from '@rjsf/core-v5';
import { withTheme } from '@rjsf/core';
import React from 'react';
import { PropsWithChildren } from 'react';
import { FieldTemplate } from './FieldTemplate';
import { DescriptionFieldTemplate } from './DescriptionFieldTemplate';
import { FieldProps } from '@rjsf/utils';
import { ScaffolderRJSFFormProps } from '@backstage/plugin-scaffolder-react';
import { Theme as MuiTheme } from '@rjsf/material-ui';
// TODO(blam): We require here, as the types in this package depend on @rjsf/core explicitly
// which is what we're using here as the default types, it needs to depend on @rjsf/core-v5 because
// of the re-writing we're doing. Once we've migrated, we can import this the exact same as before.
const WrappedForm = withTheme(require('@rjsf/material-ui-v5').Theme);
const WrappedForm = withTheme(MuiTheme);
/**
* The Form component
@@ -23,7 +23,7 @@ import {
makeStyles,
LinearProgress,
} from '@material-ui/core';
import { type IChangeEvent } from '@rjsf/core-v5';
import { type IChangeEvent } from '@rjsf/core';
import { ErrorSchema } from '@rjsf/utils';
import React, {
useCallback,