File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
packages/connect-react/src Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 11import { FormContext } from "../hooks/form-context" ;
22import { FormFieldContext } from "../hooks/form-field-context" ;
3- import { ConfigurableProp , ConfigurableProps } from "@pipedream/sdk" ;
3+ import {
4+ ConfigurableProp ,
5+ ConfigurableProps ,
6+ } from "@pipedream/sdk" ;
47// import { ControlAny } from "./ControlAny"
58import { ControlApp } from "./ControlApp" ;
69import { ControlBoolean } from "./ControlBoolean" ;
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ import type {
33 CSSProperties , FormEventHandler ,
44} from "react" ;
55import { useCustomize } from "../hooks/customization-context" ;
6- import { useFormContext , skippablePropTypes } from "../hooks/form-context" ;
6+ import {
7+ useFormContext ,
8+ skippablePropTypes ,
9+ } from "../hooks/form-context" ;
710import { InternalField } from "./InternalField" ;
811import { Alert } from "./Alert" ;
912import { ErrorBoundary } from "./ErrorBoundary" ;
Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ export type FormContext<T extends ConfigurableProps> = {
3434 userId : string ;
3535} ;
3636
37- export const skippablePropTypes = [ "$.service.db" , "$.interface.http" , "$.interface.apphook" ]
37+ export const skippablePropTypes = [
38+ "$.service.db" ,
39+ "$.interface.http" ,
40+ "$.interface.apphook" ,
41+ ]
3842
3943export const FormContext = createContext < FormContext < any /* XXX fix */ > | undefined > ( undefined ) ; // eslint-disable-line @typescript-eslint/no-explicit-any
4044
@@ -171,8 +175,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
171175 const propErrors = < T extends ConfigurableProps > ( prop : ConfigurableProp , value : unknown ) : string [ ] => {
172176 const errs : string [ ] = [ ] ;
173177 if ( value === undefined ) {
174- if ( prop . optional || prop . hidden || skippablePropTypes . includes ( prop . type ) ) {
175- } else {
178+ if ( ! prop . optional && ! prop . hidden && ! skippablePropTypes . includes ( prop . type ) ) {
176179 errs . push ( "required" ) ;
177180 }
178181 } else if ( prop . type === "integer" ) { // XXX type should be "number"? we don't support floats otherwise...
You can’t perform that action at this time.
0 commit comments