Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the “save configuration” flow so saving XML no longer reformats/normalizes content (preventing cursor/attribute shifting), and updates backend + frontend contracts accordingly.
Changes:
- Backend:
updateConfigurationnow writes raw content to disk and returns no XML payload (controller returns an empty 200 response). - Frontend:
saveConfigurationnow expects no response body; editor no longer replaces content with server-returned XML after save. - Config creation paths now add the flow namespace when creating new XML configuration files; tests updated for the new behaviors.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/frankframework/flow/configuration/ConfigurationService.java | Stops XML normalization on update; adds namespace insertion when creating new configs (now introduces XML transform exceptions). |
| src/main/java/org/frankframework/flow/configuration/ConfigurationController.java | Update endpoint now returns ResponseEntity<Void>; add-config endpoint now declares XML-related checked exceptions. |
| src/main/java/org/frankframework/flow/filetree/FileTreeService.java | Creating .xml files delegates to configuration creation; throws clause updated (currently contains a compile-breaking duplicate). |
| src/main/java/org/frankframework/flow/filetree/FileTreeController.java | Propagates XML-related checked exceptions from file creation endpoint. |
| src/main/frontend/app/services/configuration-service.ts | saveConfiguration now returns Promise<void> and drops the previous XML response type. |
| src/main/frontend/app/routes/editor/editor.tsx | Save no longer sets editor content from a server-returned XML response. |
| src/main/frontend/app/routes/studio/canvas/flow.tsx | Awaits git diff refresh after saving. |
| src/test/java/org/frankframework/flow/configuration/ConfigurationServiceTest.java | Updates assertions to match raw-write behavior (no newline/normalization). |
| src/test/java/org/frankframework/flow/configuration/ConfigurationControllerTest.java | Updates mocks to reflect boolean/void-style update response. |
| src/test/java/org/frankframework/flow/filetree/FileTreeServiceTest.java | Updates test method signatures to match new checked exceptions. |
| src/main/java/org/frankframework/flow/adapter/AdapterService.java | Removes a stray blank line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/filetree/FileTreeController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/filetree/FileTreeService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/configuration/ConfigurationController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/configuration/ConfigurationController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Stijn Potters <stijn.potters1@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/main/java/org/frankframework/flow/filetree/FileTreeService.java:145
FileTreeService.createFilenow exposes XML-processing checked exceptions (ParserConfigurationException,SAXException,TransformerException) in its public signature even though callers may be creating non-XML files. This leaks implementation details and forces controllers/tests to deal with XML-specific exceptions. Consider catching these exceptions insidecreateFile(or insideConfigurationService.addConfigurationToFolder) and rethrowing anApiException/IOExceptionwith context so the signature can remainthrows IOException, ApiException.
public FileTreeNode createFile(String projectName, String parentPath, String fileName)
throws IOException, ApiException, ParserConfigurationException, TransformerException, SAXException {
if (parentPath == null || parentPath.isBlank()) {
throw new IllegalArgumentException("Parent path must not be empty");
}
validateFileName(fileName);
String fullPath = parentPath.endsWith("/") ? parentPath + fileName : parentPath + "/" + fileName;
validateWithinProject(projectName, fullPath);
if (fileName.toLowerCase().endsWith(".xml")) {
configurationService.addConfigurationToFolder(projectName, fileName, parentPath);
} else {
fileSystemStorage.createFile(fullPath);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/configuration/ConfigurationController.java
Outdated
Show resolved
Hide resolved
|
I'm currently also working on the editor, from API endpoints to monaco editor and thus touch a lot of these files too My changes split up some of the endpoints and services in both front and backend, maybe its better to take these changes with me but that's just my opinion |
… Also formats configurations when a flow gets saved
|
|
@Matthbo I have merged this branch with master and also added prettier formatting to be in line with what the backend returns. This PR should be ready for review now |



Now the code is not formatted or normalized when the file is getting saved.
Instead of moving elements, attributes and cursor:
Now the cursor stays where it was left and attributes dont shift
Note: