Repository navigation
feat(pages): store grid pages and their widgets relationally (#3100, step 1) - #46
Open
rubenvdlinde wants to merge 1 commit into
Open
rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
Adds the data model of nextcloud#3100: pages get a title, emoji and description and the grid page type; widgets, their settings and the node a data widget shows live in tables_contexts_widget, tables_contexts_widget_setting and tables_contexts_widget_source. Deleting an application or page deletes its widgets; removing a node deletes only the widget sources. Scheme and user migration export carry the widgets, import remaps their node. Assisted-by: ClaudeCode:claude-opus-5-5
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.
Step 1 of the page rework on the data model of nextcloud#3100 (follows the review on nextcloud#3075). No API or UI yet.
What
tables_contexts_pagegetstitle,emoji,description(nullable) and an index oncontext_id;Page::TYPE_GRID.tables_contexts_widget(page_id, type, title, grid_x/y/width/height),tables_contexts_widget_setting(unique widget_id + name) andtables_contexts_widget_source(PK widget_id, index node_rel_id), with entities and mappers.WidgetServicereads widgets with their settings and source and writes them. Settings are stored one row per setting, JSON encoded, behindWidgetSettingMapper::findSettingsByWidgetIds()/replaceSettings(), so moving them to one JSON column later touches one class.widget_sourcerows: the widget stays.getScheme) and the user migration export carry each page's widgets;importContext()imports them and remaps the source through the existing$nodeRelMap(a source whose node was not imported is dropped).tables_contexts_page_contentandnode_rel_idare unchanged.nextcloud#3100 points covered
Schema (all of it), "deleting a page or an application deletes its widgets, settings and sources", "removing a table or view deletes only the source row", "scheme export and import copy widgets, settings and sources". Saving and the API follow in the next PR.
Tests (Nextcloud 34, PostgreSQL 16, in the container)
tests/unit/Service/WidgetServiceTest.php(real DB):OK (5 tests, 13 assertions)tests/unit/Db/ContextMapperTest.php(real DB):OK (1 test, 5 assertions)tests/unit/Service/ContextPagesRoundTripTest.php(real DB, export, import, node removal, application deletion):OK (2 tests, 10 assertions)tests/unit/Service/ContextServiceTest.php:OK (6 tests, 18 assertions)tests/unit/TablesMigratorTest.php:OK (12 tests, 20 assertions)OK (370 tests, 723 assertions)composer cs:check: no files;psalm: no errors.Prepared in the Conduction fork for porting upstream by @remko48. Prepared with Claude Code.