Unified Condition Builder Validation#205
Conversation
…lidation. Here is a summary of the improvements: * **Enhanced Validation Logic**: Updated `condition_validator.js` to return detailed error metadata, including node IDs and specific field names. * **UI Component Updates**: Added support for visual error highlighting in `ComboBoxControl`, `SelectControl`, and `FlexValueControl`. * **Real-time Validation**: Implemented a hybrid flow where errors appear after a save attempt and update live as the user makes corrections. * **Widespread Integration**: Integrated these validation checks into the configuration modules for assignments, notifications, switches, and loops. * **Improved Scannability**: Added visual indicators, such as badges and icons, to parent containers to make broken rules easy to identify. * **Input Enforcement**: Prevented the finalization of the "Run If" editor in the assignment configuration when conditions are invalid. * **Code Quality**: Resolved several linting issues regarding undefined imports and empty blocks. * **Final Verification**: Confirmed all changes meet quality standards through a full suite of automated checks.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Enhanced standardized controls to support metadata-driven validation via `df.reqd`. - Replaced raw HTML elements with standardized controls in `SimpleCondition`, `CollectionUI`, `WaitNodeConfig`, and `SwitchNodeConfig`. - Implemented `validate()` methods in all core controls to ensure consistency with Frappe patterns. - Provided detailed error metadata and visual highlighting (red borders, badges) across the rule builder. - Enforced save-blocking for invalid conditions in popups. - Passed all `pre-commit` checks including linting and formatting.
… standards - Refactored `SimpleCondition`, `AssignmentConfig`, and other components to use dynamic `reqd` properties in field definitions. - Ensured validation logic in standardized controls reactively responds to changes in operator state (e.g., toggling `reqd` for values). - Replaced remaining raw HTML elements with standardized `SelectControl`, `DataControl`, and `TextControl`. - Verified reactive validation behavior across Condition, Assignment, and Logic nodes. - Passed all `pre-commit` checks including formatting and linting.
- Enhanced `ComboBoxControl.vue` to detect and flag incomplete references like "doc." or "vars." when the field is required. - Improved `condition_validator.js` to provide better feedback for these specific edge cases. - Ensured that newly added condition rows immediately show validation state if the builder was already in validation mode. - Passed all `pre-commit` checks including linting and formatting.
- Refactored `ComboBoxControl.vue` validation to verify values against available options when custom values are disallowed, ensuring validity in Link and FieldPicker contexts. - Removed brittle string-prefix checks in favor of a metadata-driven approach. - Ensured all standardized controls (`DataControl`, `SelectControl`, `FlexValueControl`, etc.) correctly respect `df.reqd`. - Integrated validation across all action types: Condition, Assignment, Notify, Switch, Loop, and Wait. - Provided clear visual feedback with red highlighting and error indicators in parent containers. - Enforced blocking of save actions in popups when validation fails. - Passed all `pre-commit` checks including linting and formatting.
- Extracted structured value validation into a shared `validateStructuredValue` utility in `builder_utils.js`. - Refactored `condition_validator.js` and `AssignmentConfig.vue` to use the consolidated utility, reducing duplication. - Enhanced `ComboBoxControl.vue` with context-aware error messages (specific to FieldPicker/DocField types). - Implemented automatic re-validation in `ComboBoxControl` upon completion of async option loading to clear transient invalid states. - Re-verified all changes with `pre-commit run --all`.
- Implemented mode-aware validation in `FilterGroup.vue` and integrated it into `QueryRecordsConfig.vue`. - Consolidated structured value validation into a shared utility `validateStructuredValue` in `builder_utils.js`. - Enhanced `validation_service.py` to recursively extract variables from Assignment actions and nested conditions. - Improved `ComboBoxControl.vue` with context-aware errors and automatic re-validation after async loading. - Refactored `SimpleCondition`, `AssignmentConfig`, and `FilterGroup` to strictly follow Frappe's metadata-driven `reqd` pattern. - Updated all standardized controls to support consistent `validate()` and `invalid` prop behavior. - Passed all `pre-commit` checks including formatting and linting.
This PR implements a robust, unified validation strategy for the Condition Builder across the entire application. It ensures that users cannot save invalid rules, provides clear visual feedback on which fields are broken, and makes errors easily discoverable even when nested inside popups or steps.
Key Changes:
PR created automatically by Jules for task 4639326814281587868 started by @ruzaqiarkan-eng