Skip to content

Commit 3b4123c

Browse files
committed
feat: dont show input if its blocked
1 parent 1a70fe2 commit 3b4123c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import {
2020
import {Schema} from "@code0-tech/triangulum/dist/util/schema.util";
2121

2222
export interface DataTypeInputComponentProps extends Omit<InputWrapperProps<NodeParameterValue | NodeFunction>, "onChange"> {
23-
schema: (NodeSchema | Schema) & {blocked?: boolean}
23+
schema: (NodeSchema | Schema)
2424
clearable?: boolean
25-
onChange?: (value: ReferenceValue | SubFlowValue | LiteralValue | NodeFunction | undefined) => void
25+
onChange?: (value: ReferenceValue | SubFlowValue | LiteralValue | NodeFunction | null) => void
2626
suggestions?: (NodeFunction | SubFlowValue | ReferenceValue | LiteralValue)[]
2727
onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void
2828
}
@@ -31,11 +31,10 @@ export const DataTypeInputComponent: React.FC<DataTypeInputComponentProps> = (pr
3131

3232
const {schema, ...rest} = props
3333

34-
const suggestions = "schema" in schema ? schema?.schema?.suggestions as (NodeFunction | ReferenceValue | LiteralValue)[] : []
35-
const inputName = "schema" in schema ? (schema?.schema?.input === "generic" ? schema.functionSchema.input : schema?.schema?.input) : schema.input
36-
const blocked = schema?.blocked
34+
const suggestions = "schema" in (schema ?? {}) ? (schema as NodeSchema)?.schema?.suggestions as (NodeFunction | ReferenceValue | LiteralValue)[] : []
35+
const inputName = "schema" in (schema ?? {}) ? ((schema as NodeSchema)?.schema?.input === "generic" ? (schema as NodeSchema).functionSchema.input : (schema as NodeSchema)?.schema?.input) : (schema as Schema).input
3736

38-
if (blocked) {
37+
if ("schema" in (schema ?? {}) && ((schema as NodeSchema).blockedBy?.length ?? 0) > 0) {
3938
return null
4039
}
4140

0 commit comments

Comments
 (0)