refactor(frontend): clean up FlowEditor and FormRenderer components

### Changes
- Removed console log from `OutputNodeHandle` to reduce clutter.
- Cleaned up imports in `FormRenderer` by removing unused `FieldPathList`.
- Eliminated the `noValidate` prop in `FormRenderer` for simplification.
- Refactored `FieldTemplate` to improve advanced field visibility logic.

### Impact
These changes enhance the readability and maintainability of the FlowEditor and FormRenderer components, contributing to a cleaner codebase.
This commit is contained in:
abhi1992002
2026-01-03 20:29:44 +05:30
parent 0fe8fcb9aa
commit 798786b0ab
3 changed files with 5 additions and 7 deletions

View File

@@ -46,7 +46,6 @@ const OutputNodeHandle = ({
const isOutputConnected = useEdgeStore((state) =>
state.isOutputConnected(nodeId, field_name),
);
console.log(field_name, isOutputConnected);
return (
<Handle
type={"source"}

View File

@@ -1,4 +1,4 @@
import { FieldPathList, RJSFSchema } from "@rjsf/utils";
import { RJSFSchema } from "@rjsf/utils";
import { preprocessInputSchema } from "./utils/input-schema-pre-processor";
import { useMemo } from "react";
import { customValidator } from "./utils/custom-validator";
@@ -35,7 +35,6 @@ export const FormRenderer2 = ({
onChange={handleChange}
uiSchema={uiSchema}
formData={initialValues}
noValidate={true}
liveValidate={false}
/>
</div>

View File

@@ -40,10 +40,6 @@ export default function FieldTemplate(props: FieldTemplateProps) {
const showAdvanced = useNodeStore(
(state) => state.nodeAdvancedStates[registry.formContext.nodeId ?? ""],
);
const isAdvancedField = (schema as any).advanced === true;
if (!showAdvanced && isAdvancedField) {
return null;
}
if (hidden) {
return <div className="hidden">{children}</div>;
@@ -79,6 +75,10 @@ export default function FieldTemplate(props: FieldTemplateProps) {
const shouldShowTitleSection = !isAnyOfSchema(schema) && !additional;
const shouldShowChildren = isAnyOfSchema(schema) || !isHandleConnected;
const isAdvancedField = (schema as any).advanced === true;
if (!showAdvanced && isAdvancedField && !isHandleConnected) {
return null;
}
return (
<WrapIfAdditionalTemplate
classNames={classNames}