Copilot commented on code in PR #697:
URL: https://github.com/apache/shenyu-dashboard/pull/697#discussion_r4152919869
##########
src/routes/Plugin/McpServer/ToolsModal.js:
##########
@@ -551,7 +569,67 @@ class AddModal extends Component {
requestConfig: parsedJson.requestConfig || "{}",
};
- // Convert flattened data back to original format and add required
rule-level fields
+ const currentFormValues =
+ form && form.getFieldsValue ? form.getFieldsValue() : {};
+
+ const rawSort =
+ parsedJson.sort !== undefined
+ ? parsedJson.sort
+ : currentFormValues.sort !== undefined
+ ? currentFormValues.sort
Review Comment:
Rule overrides are only consumed when submitting directly from JSON mode. If
a user edits any of these rule-level fields, switches to form mode, and then
returns to JSON mode, both JSON-to-form sync methods ignore the fields; the
form renders the old prop values and `syncFormToJson` overwrites
`formRuleValues`, silently losing the override. Synchronize all five rule
fields into the form/state during JSON-to-form transitions so mode switching
round-trips them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]