@@ -4,14 +4,15 @@ import { Dialog } from '@jupyterlab/apputils';
44import { FormComponent } from '@jupyterlab/ui-components' ;
55import { Signal } from '@lumino/signaling' ;
66import { IChangeEvent , ISubmitEvent } from '@rjsf/core' ;
7+ import { RJSFSchema , UiSchema } from '@rjsf/utils' ;
78import validatorAjv8 from '@rjsf/validator-ajv8' ;
89import * as React from 'react' ;
910
1011import { deepCopy } from '@/src/tools' ;
1112import { IDict } from '@/src/types' ;
1213
1314export interface IBaseFormStates {
14- schema ?: IDict ;
15+ schema ?: RJSFSchema ;
1516 extraErrors ?: any ;
1617}
1718
@@ -118,8 +119,8 @@ export class BaseForm extends React.Component<IBaseFormProps, IBaseFormStates> {
118119
119120 protected processSchema (
120121 data : IDict < any > | undefined ,
121- schema : IDict ,
122- uiSchema : IDict ,
122+ schema : RJSFSchema ,
123+ uiSchema : UiSchema ,
123124 ) : void {
124125 if ( ! schema [ 'properties' ] ) {
125126 return ;
@@ -251,13 +252,15 @@ export class BaseForm extends React.Component<IBaseFormProps, IBaseFormStates> {
251252 protected removeFormEntry (
252253 entry : string ,
253254 data : IDict < any > | undefined ,
254- schema : IDict ,
255- uiSchema : IDict ,
255+ schema : RJSFSchema ,
256+ uiSchema : UiSchema ,
256257 ) {
257258 if ( data ) {
258259 delete data [ entry ] ;
259260 }
260- delete schema . properties [ entry ] ;
261+ if ( schema . properties ) {
262+ delete schema . properties [ entry ] ;
263+ }
261264 delete uiSchema [ entry ] ;
262265 if ( schema . required && schema . required . includes ( entry ) ) {
263266 schema . required . splice ( schema . required . indexOf ( entry ) , 1 ) ;
0 commit comments