Fix table values loading issue in inbound-endpoints#2401
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR updates form parameter handling in two components: edited parameters are normalized before reset, and inbound connector values are extracted and serialized with simplified fallback and array formatting. ChangesForm Parameter Value Handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
workspaces/mi/mi-diagram/src/components/Form/GigaParamManager/ParameterManager.tsx (1)
122-124: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winPreserve expression objects by value shape, not only by input type.
Line 122 relies on a local allowlist, so any missing/new expression-capable
inputTypewill still pass throughgetFieldValueand loseisExpression/namespaces. Guard theExpressionFieldValueshape before flattening.Proposed adjustment
+ const isExpressionFieldValue = (value: unknown): value is ExpressionFieldValue => + typeof value === "object" && + value !== null && + "isExpression" in value && + "value" in value && + "namespaces" in value; + formData?.elements?.forEach((el: any) => { const fieldName = el?.value?.name; const inputType = el?.value?.inputType; if (fieldName && !EXPRESSION_INPUT_TYPES.includes(inputType) + && !isExpressionFieldValue(normalized[fieldName]) && typeof normalized[fieldName] === 'object' && normalized[fieldName] !== null) { normalized[fieldName] = getFieldValue(normalized[fieldName]); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@workspaces/mi/mi-diagram/src/components/Form/GigaParamManager/ParameterManager.tsx` around lines 122 - 124, The flattening logic in ParameterManager should not rely only on EXPRESSION_INPUT_TYPES, because new expression-capable input types can still be reduced by getFieldValue and lose ExpressionFieldValue metadata. Update the normalization path in ParameterManager/normalize handling to detect the object shape first (for example, by checking for expression-specific fields like isExpression/namespaces) and skip flattening those values, while still flattening plain nested objects for non-expression fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx`:
- Around line 209-214: The table value builder in inboundConnectorForm’s
value-mapping logic is manually interpolating propertyName and propertyValue
into a string, which can break when either contains quotes, backslashes, or
newlines. Update the mapping in the value processing block to build the pair
data as arrays/objects and serialize the final payload with JSON.stringify
instead of concatenating string literals. Keep the change localized around the
items mapping and paramFields assignment so the generated table payload stays
valid for all values.
---
Nitpick comments:
In
`@workspaces/mi/mi-diagram/src/components/Form/GigaParamManager/ParameterManager.tsx`:
- Around line 122-124: The flattening logic in ParameterManager should not rely
only on EXPRESSION_INPUT_TYPES, because new expression-capable input types can
still be reduced by getFieldValue and lose ExpressionFieldValue metadata. Update
the normalization path in ParameterManager/normalize handling to detect the
object shape first (for example, by checking for expression-specific fields like
isExpression/namespaces) and skip flattening those values, while still
flattening plain nested objects for non-expression fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a6ac0f20-de7d-44a7-90ed-747d2c1cb6ec
📒 Files selected for processing (2)
workspaces/mi/mi-diagram/src/components/Form/GigaParamManager/ParameterManager.tsxworkspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx
This PR will fix the issue wso2/mi-vscode#1079
Summary by CodeRabbit