[BI] Fix config editor issues when updating field values in nested record configurables#1751
[BI] Fix config editor issues when updating field values in nested record configurables#1751NipunaRanasinghe wants to merge 1 commit intowso2:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA dependency array optimization in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adjusts the ConfigObjectEditor record-config loading effect to avoid unwanted form resets when parent components re-render with new typeValue object references, improving nested record configurable editing.
Changes:
- Introduces a derived
typeKeyto make theuseEffectdependency stable across re-renders. - Updates the
useEffectdependency array to triggerloadRecordConfig()only when the file/type changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| loadRecordConfig(); | ||
| }, [fileName, typeValue, configValue]); | ||
| }, [typeKey]); | ||
|
|
| // Derive a stable string key so loadRecordConfig only fires when the actual | ||
| // type or file changes — not when the parent passes a new typeValue object reference | ||
| // on every re-render (which would reset the form mid-edit). | ||
| const typeKey = `${fileName}::${String(typeValue?.value)}`; | ||
|
|
||
| useEffect(() => { | ||
| loadRecordConfig(); | ||
| }, [fileName, typeValue, configValue]); | ||
| }, [typeKey]); |
Purpose
$subject.
Partially fixes wso2/product-integrator#116
Goals
Approach
UI Component Development
npm run storybookfrom the root directory to view current components.Manage Icons
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Summary by CodeRabbit