-
Notifications
You must be signed in to change notification settings - Fork 188
Add occ commands and frontend options for importing/exporting articles #3437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this 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 refactors the article import/export functionality by extracting the logic into dedicated service classes and adding both occ commands and frontend UI options for backup and restore operations.
- Moves article import/export logic from controllers to new
ImportServiceandExportServiceclasses - Adds two new occ commands:
news:item:importandnews:items:exportfor CLI-based backup operations - Implements frontend upload/download buttons in the sidebar settings for article import/export
- Updates tests to reflect the refactored architecture
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Service/ImportService.php | Refactored importArticles() to articles() method with improved error handling and boolean return type |
| lib/Service/ExportService.php | New service class extracting article export logic from controller |
| lib/Controller/ImportController.php | New controller handling article import endpoint with JSON validation |
| lib/Controller/ExportController.php | Refactored to use ExportService instead of direct service calls |
| lib/Controller/FeedController.php | Removed import() method and ImportService dependency |
| lib/Command/Config/ItemImport.php | New occ command for importing articles from JSON file |
| lib/Command/Config/ItemExport.php | New occ command for exporting articles to JSON |
| src/components/Sidebar.vue | Added upload/download UI buttons and methods for article import/export |
| tests/javascript/unit/components/Sidebar.spec.ts | Added comprehensive tests for import/export methods |
| tests/Unit/Controller/ImportControllerTest.php | New test suite for ImportController::articles() |
| tests/Unit/Controller/ExportControllerTest.php | Updated to test refactored export controller |
| tests/Unit/Controller/FeedControllerTest.php | Removed tests for deprecated import() method |
| tests/Unit/Service/ImportServiceTest.php | Updated tests for renamed method and boolean return type |
| appinfo/routes.php | Added new routes and removed deprecated feed import route |
| appinfo/info.xml | Registered new occ commands |
| CHANGELOG.md | Documented new features |
6195783 to
6614c94
Compare
Signed-off-by: Wolfgang <github@linux-dude.de>
Signed-off-by: Wolfgang <github@linux-dude.de>
Signed-off-by: Wolfgang <github@linux-dude.de>
6614c94 to
4f89103
Compare
Changed - Drop Support for Nextcloud 31 (#3485) - Add Support for Nextcloud 33 (#3485) - Add feature to Group starred Items per Feed (#3148) - Add `occ` commands for importing/exporting articles (#3437) - Add importing/exporting articles to frontend settings (#3437) - App settings are now displayed in an app settings dialog (#3500) Fixed - Special characters may be displayed incorrectly when full text is enabled (#3472) - Wrong url to feed page (#3486) - Long articles are cut short (#3489) - Imported feeds or newly created folders do not disappear immediately when `showAll` is not set (#3500) Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Changed - Drop Support for Nextcloud 31 (#3485) - Add Support for Nextcloud 33 (#3485) - Add feature to Group starred Items per Feed (#3148) - Add `occ` commands for importing/exporting articles (#3437) - Add importing/exporting articles to frontend settings (#3437) - App settings are now displayed in an app settings dialog (#3500) Fixed - Special characters may be displayed incorrectly when full text is enabled (#3472) - Wrong url to feed page (#3486) - Long articles are cut short (#3489) - Imported feeds or newly created folders do not disappear immediately when `showAll` is not set (#3500) Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Summary
This PR refactored the existing logic for the starred/unread article im- and export.
Changes
Checklist