@@ -13,9 +13,7 @@ import { Dispatch } from 'react';
|
||||
import { Extension } from '@backstage/core-plugin-api';
|
||||
import { FieldExtensionComponent } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldProps } from '@rjsf/core';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { FieldValidation as FieldValidation_2 } from '@rjsf/core';
|
||||
import { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
@@ -26,6 +24,7 @@ import { default as React_2 } from 'react';
|
||||
import { ReactElement } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderRJSFFieldProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderRJSFFormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderStep } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderTaskOutput } from '@backstage/plugin-scaffolder-react';
|
||||
@@ -86,7 +85,7 @@ export type FormValidation = {
|
||||
// @alpha
|
||||
export type LegacyCustomFieldValidator<TFieldReturnValue> = (
|
||||
data: TFieldReturnValue,
|
||||
field: FieldValidation_2,
|
||||
field: FieldValidation,
|
||||
context: {
|
||||
apiHolder: ApiHolder;
|
||||
},
|
||||
@@ -96,9 +95,9 @@ export type LegacyCustomFieldValidator<TFieldReturnValue> = (
|
||||
export interface LegacyFieldExtensionComponentProps<
|
||||
TFieldReturnValue,
|
||||
TUiOptions = unknown,
|
||||
> extends FieldProps<TFieldReturnValue> {
|
||||
> extends ScaffolderRJSFFieldProps<TFieldReturnValue> {
|
||||
// (undocumented)
|
||||
uiSchema: FieldProps['uiSchema'] & {
|
||||
uiSchema: ScaffolderRJSFFieldProps['uiSchema'] & {
|
||||
'ui:options'?: TUiOptions;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ import { ErrorTransformer } from '@rjsf/utils';
|
||||
import { Experimental_DefaultFormStateBehavior } from '@rjsf/utils';
|
||||
import { Extension } from '@backstage/core-plugin-api';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import Form from '@rjsf/core-v5';
|
||||
import Form from '@rjsf/core';
|
||||
import { FormContextType } from '@rjsf/utils';
|
||||
import { FormEvent } from 'react';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core-v5';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core';
|
||||
import { GenericObjectType } from '@rjsf/utils';
|
||||
import { HTMLAttributes } from 'react';
|
||||
import { IChangeEvent } from '@rjsf/core-v5';
|
||||
import { IChangeEvent } from '@rjsf/core';
|
||||
import { IdSchema } from '@rjsf/utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
|
||||
@@ -60,10 +60,8 @@
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.61",
|
||||
"@react-hookz/web": "^20.0.0",
|
||||
"@rjsf/core": "^3.2.1",
|
||||
"@rjsf/core-v5": "npm:@rjsf/core@5.13.0",
|
||||
"@rjsf/material-ui": "^3.2.1",
|
||||
"@rjsf/material-ui-v5": "npm:@rjsf/material-ui@5.13.0",
|
||||
"@rjsf/core": "5.13.0",
|
||||
"@rjsf/material-ui": "5.13.0",
|
||||
"@rjsf/utils": "5.13.0",
|
||||
"@rjsf/validator-ajv8": "5.13.0",
|
||||
"@types/json-schema": "^7.0.9",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user