feat: migrate files app integration to new API#1462
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the Nextcloud Maps app's files integration from the legacy OCA.Files API to the modern @nextcloud/files API for compatibility with Nextcloud 28+. The migration introduces TypeScript support and follows current Nextcloud app development best practices.
Key changes:
- Replaces legacy jQuery-based file actions with modern TypeScript implementations
- Migrates to the new
@nextcloud/filesAPI for file action registration - Updates webpack configuration to support TypeScript and asset bundling
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| webpack.js | Adds TypeScript entry point and asset loading rule for new files integration |
| src/init-files.ts | New TypeScript entry point that registers file actions using the modern API |
| src/filetypes.js | Removed legacy jQuery-based file actions implementation |
| src/files-actions/view-in-maps.ts | New TypeScript file action for viewing files in Maps |
| src/files-actions/import-favorite.ts | New TypeScript file action for importing files as favorites |
| src/files-actions/import-devices.ts | New TypeScript file action for importing files as devices |
| package.json | Adds TypeScript dependencies and new Nextcloud packages |
| lib/Service/MyMapsService.php | Adds method to lookup maps by ID and fixes variable assignment |
| lib/Listener/LoadAdditionalScriptsListener.php | Updates script loading to use new init script |
| lib/Controller/PageController.php | Updates dependency injection and adds redirect logic for map file IDs |
| css/filetypes.css | Removes legacy CSS file |
| .eslintignore | Removes reference to deleted filetypes.js file |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Since Nextcloud 28 the files app does not support `OCA.Files` for actions and similar integrations anymore. Instead we need to use the new files API provided by `@nextcloud/files`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
fd718a3 to
cf9d52b
Compare
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
ee324b7 to
ea29e2f
Compare
come-nc
approved these changes
Sep 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Nextcloud 28 the files app does not support
OCA.Filesfor actions and similar integrations anymore.Instead we need to use the new files API provided by
@nextcloud/files.So this migrates the files app integration to the new API for Nextcloud 28 and newer (to make it work with current 31 or 32) using current Nextcloud app best practices e.g. using Typescript.