Repository navigation
feat(contexts): carry pages and their widgets through scheme export and import - #3201
Open
rubenvdlinde wants to merge 2 commits into
Open
rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
3 of 5 tasks
rubenvdlinde
force-pushed
the
feat/noid/scheme-pages-and-widgets
branch
from
November 3, 2026 14:51
c30848c to
4010828
Compare
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 3, 2026 14:51
a1b94a7 to
2471ff4
Compare
…nd import A scheme now names the table or view of every widget source by targetType and targetUuid. Importing it with pages updates the start page and every grid page with the same technical name, adds the others, and replaces the widgets of each grid page. A widget is checked as the API would save it, and its table or view must be a node of the application once the nodes of the scheme are imported; a widget never adds a node. Skipped pages and widgets get a reason, in the log and in the preview, and the menu is read after the pages so it can open a page the same import adds. The import screen has a Pages switch next to the Menu switch. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 4, 2026 12:35
2471ff4 to
6368c26
Compare
rubenvdlinde
force-pushed
the
feat/noid/scheme-pages-and-widgets
branch
from
November 4, 2026 12:35
4010828 to
8da4db7
Compare
rubenvdlinde
marked this pull request as ready for review
November 6, 2026 08:25
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.
Part of #3099, on top of #3138 (menu export and import). An application's pages and their widgets now travel with its scheme, the same way the menu does: pages by technical name, and the table or view a widget shows by UUID.
Size: 778 lines: 465 code, 294 tests and 19 generated OpenAPI.
What changes
targetType(tableorview) andtargetUuidto each widget'ssource, next to thenodeRelIdit already had. The old id still means nothing on another instance; the UUID does.importScheme, new optionalpagesparameter) applies each page of the scheme:importablePages()): only start pages and grid pages, and at most one start page, through one shared checkpage_<id>, in which case it gets a name of its ownGridWidgetTypes), through the same code the user migration import now uses. A widget may only show a table or view that is a node of the application once the scheme's nodes are imported, the same rulePageServicefollows. The import still adds the nodes the scheme lists, as before, but a widget never adds a node by itself. The user migration import (importContext) didn't change.MenuServicetakes the page ids by the name the scheme gives them for this.compareSchemeChanges) returnspageswithfrom,to(the scheme pages with the kept widgets) andskipped. It counts as resources the nodes of the scheme the import would keep: ones the application has, ones the import adds, and ones that are here and manageable by the user. With the Resources switch off, the import checks the widgets again against the nodes that are sent. The menu preview no longer skips items for pages the import adds.Porting note: the frontend follows the Menu section of #3138. The fork branch
stack/s3-export-importwas used as a reference for the import rules (match by technical name, widgets replace the page's widgets), but its model (emoji, title-based names, a separate scheme service, grid views) doesn't apply upstream.This and #3202 both rework the node loop in
importScheme(), so whichever is merged second needs a small manual merge. It's simplest to merge #3202 first: this one then only adds$nodeIdsto the loop.How it was tested
On Nextcloud 34 with PostgreSQL:
ContextPagesRoundTripTest: an application with a table, a view, a grid page with three widgets and a page with an automatic name, plus a menu item on that page, is exported, previewed against an empty application and imported into it once it holds the scheme's two nodes. The pages and widgets arrive on the table and view the scheme's nodes resolve to, the automatically named page gets a new name and the menu item follows it (without the page ids, this test fails), and two widgets are skipped with their reason in the preview and left out by the import: one on a table the user can't manage, and one on a table that is here and manageable but isn't a node of the scheme. The application ends up with only the scheme's two nodes. A second test previews a scheme whose table and view the import would add: widgets on them are kept, and a widget on a view that isn't here is skipped.ContextServiceTest: the skip rules above, with their log linescomposer cs:check, psalm, rector,npm run lint,npm run stylelint,npm run typescript:checkandnpm run build, all clean (one inherited eslint warning insrc/store/store.js)ImportContextSchemePreview.cy.js: the import sends the pages, leaves them out when the switch is off, and lists skipped pages and widgets.🖼️ Screenshots
Screenshots follow in a comment.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)