Skip to content

File api for non configuration files & monaco file language support#411

Open
Matthbo wants to merge 17 commits intomasterfrom
issue/361-rework-monaco-implementation-editor-endpoints-to-support-more-than-configuration-files
Open

File api for non configuration files & monaco file language support#411
Matthbo wants to merge 17 commits intomasterfrom
issue/361-rework-monaco-implementation-editor-endpoints-to-support-more-than-configuration-files

Conversation

@Matthbo
Copy link
Copy Markdown
Member

@Matthbo Matthbo commented Apr 1, 2026

Creates a new controller and service for managing non-configuration files
Also adds support for content type of the files in monaco editor
A lot of small changes related to behaviour and maintainability, its nowhere near perfect as I have plenty to go through still

Copilot AI review requested due to automatic review settings April 1, 2026 11:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new backend “file” API for non-configuration files (separate from the file-tree API) and updates the frontend editor to load non-XML files with an appropriate Monaco language based on content type, alongside several API route/DTO refactors.

Changes:

  • Added FileService + FileController to read/write/move/delete non-configuration files and expose file MIME type.
  • Refactored file-tree and configuration endpoints/routes/DTOs and updated related frontend service calls.
  • Updated the editor to cache file content with type and set Monaco language dynamically for non-XML files.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
src/test/java/org/frankframework/flow/file/FileTreeServiceTest.java Updates tests for renamed package/service wiring and new folder/file handling split.
src/test/java/org/frankframework/flow/datamapper/DatamapperGeneratorServiceTest.java Adjusts imports/formatting after file-tree package move.
src/test/java/org/frankframework/flow/datamapper/DatamapperConfigServiceTest.java Updates expectations around configuration tree failures.
src/test/java/org/frankframework/flow/configuration/ConfigurationServiceTest.java Updates tests for new ConfigurationService signatures/return types.
src/test/java/org/frankframework/flow/configuration/ConfigurationControllerTest.java Updates controller tests for new routes and DTO changes.
src/main/java/org/frankframework/flow/project/ProjectService.java Simplifies git-repo detection logic using new toAbsolutePath signature.
src/main/java/org/frankframework/flow/filetree/FileTreeController.java Removes old file-tree controller (moved/refactored).
src/main/java/org/frankframework/flow/filetree/FileRenameDTO.java Removes old DTO (replaced under flow.file).
src/main/java/org/frankframework/flow/filetree/FileCreateDTO.java Removes old DTO (replaced under flow.file).
src/main/java/org/frankframework/flow/filesystem/LocalFileSystemStorageService.java Adds readFileType via Files.probeContentType.
src/main/java/org/frankframework/flow/filesystem/FileSystemStorage.java Extends interface with readFileType; changes toAbsolutePath signature.
src/main/java/org/frankframework/flow/filesystem/CloudFileSystemStorageService.java Adds readFileType; adjusts error handling and toAbsolutePath signature.
src/main/java/org/frankframework/flow/file/NodeType.java Moves enum to new flow.file package.
src/main/java/org/frankframework/flow/file/FolderCreateDTO.java Adds DTO for folder creation in new file-tree controller.
src/main/java/org/frankframework/flow/file/FileTreeService.java Refactors to depend on FileService; removes file CRUD in favor of dedicated service.
src/main/java/org/frankframework/flow/file/FileTreeNode.java Moves node model to new flow.file package.
src/main/java/org/frankframework/flow/file/FileTreeController.java Adds new file-tree controller with updated routes.
src/main/java/org/frankframework/flow/file/FileService.java Adds new service for file read/write/move/delete and project-bound validation.
src/main/java/org/frankframework/flow/file/FileRenameDTO.java Adds DTO for file move/rename in new file controller.
src/main/java/org/frankframework/flow/file/FileDTO.java Adds DTO returning file content plus detected MIME type.
src/main/java/org/frankframework/flow/file/FileController.java Adds new controller exposing file CRUD endpoints.
src/main/java/org/frankframework/flow/datamapper/DatamapperGeneratorService.java Updates file-tree import and simplifies toAbsolutePath usage.
src/main/java/org/frankframework/flow/datamapper/DatamapperConfigService.java Returns empty string when datamapper config is auto-created.
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java Refactors configuration read/update/create APIs and return types.
src/main/java/org/frankframework/flow/configuration/ConfigurationPathDTO.java Removes DTO in favor of query-param based API.
src/main/java/org/frankframework/flow/configuration/ConfigurationController.java Refactors routes to query params and returns XmlDTO for create/update.
src/main/frontend/app/utils/api.ts Makes ApiError.messages optional and improves error message fallback.
src/main/frontend/app/stores/editor-tab-store.ts Refactors type import to use a named type import.
src/main/frontend/app/services/file-tree-service.ts Updates file-tree endpoints and removes file CRUD calls from this service.
src/main/frontend/app/services/file-service.ts Adds frontend client for new backend file CRUD/type endpoints.
src/main/frontend/app/services/configuration-service.ts Refactors configuration requests to new endpoints/query params.
src/main/frontend/app/routes/editor/editor.tsx Loads non-XML files via new file API and sets Monaco language dynamically.
src/main/frontend/app/routes/configurations/configuration-manager.tsx Switches delete action to the new file delete API.
src/main/frontend/app/routes/configurations/add-configuration-modal.tsx Switches configuration creation to new configuration API helper.
src/main/frontend/app/components/file-structure/use-studio-context-menu.ts Updates create/rename/delete actions to new services/endpoints.
src/main/frontend/app/components/file-structure/use-file-tree-context-menu.ts Updates create/rename/delete actions to new services/endpoints.
Comments suppressed due to low confidence (1)

src/main/java/org/frankframework/flow/file/FileTreeService.java:23

  • Unused imports (ConfigurationService, ApiException, FileAlreadyExistsException) remain after refactor. In Java this is a compilation error, so please remove any imports that are no longer referenced.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 1, 2026 13:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


try {
validateWithinProject(projectName, path);
if (!Files.exists(filePath)) {

Check warning

Code scanning / SonarCloud

Accessing files should not lead to filesystem oracle attacks Medium

Change this code to not construct the path from user-controlled data. See more on SonarQube Cloud
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But but but, validateWithinProject is right above there...

Copilot AI review requested due to automatic review settings April 2, 2026 10:53
@Matthbo Matthbo review requested due to automatic review settings April 2, 2026 10:53
@Matthbo
Copy link
Copy Markdown
Member Author

Matthbo commented Apr 2, 2026

istg copilot dont you dare

Copilot AI review requested due to automatic review settings April 2, 2026 10:56
@Matthbo Matthbo review requested due to automatic review settings April 2, 2026 10:57
Copilot AI review requested due to automatic review settings April 2, 2026 15:18
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework monaco implementation & editor endpoints to support more than configuration files

3 participants