Skip to content

Commit 6f3317b

Browse files
author
Ruben van Leeuwen
committed
1830: Resolves MR comments
1 parent c7b056c commit 6f3317b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

frontend/packages/pydantic-forms/src/components/componentMatcher.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ export const componentsMatcher = (
6666
return components;
6767
};
6868

69+
const defaultComponent: ElementMatch = {
70+
Element: TextField,
71+
isControlledElement: true,
72+
};
73+
6974
export const fieldToComponentMatcher = (
7075
pydanticFormField: PydanticFormField,
7176
customComponentMatcher: PydanticFormsContextConfig['componentMatcher'],
@@ -75,12 +80,8 @@ export const fieldToComponentMatcher = (
7580

7681
const ElementMatch: ElementMatch = matchedComponent
7782
? matchedComponent.ElementMatch
78-
: {
79-
Element: TextField,
80-
isControlledElement: true,
81-
};
83+
: defaultComponent; // Defaults to textField when there are no matches
8284

83-
// Defaults to textField when there are no matches
8485
return {
8586
Element: ElementMatch,
8687
pydanticFormField: pydanticFormField,

frontend/packages/pydantic-forms/src/core/hooks/usePydanticFormParser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const getPydanticFormField = (
8585
attributes: getFieldAttributes(propertySchema),
8686
schema: propertySchema,
8787
validations: getFieldValidation(propertySchema),
88-
columns: 6, // TODO: Is this still relevant?
88+
columns: 6, // TODO: Is this still relevant? https://github.com/workfloworchestrator/orchestrator-ui-library/issues/1891
8989
properties: parseProperties(
9090
propertySchema.properties || {},
9191
propertySchema.required || [],

0 commit comments

Comments
 (0)