feat: nmc/6466 add Nextcloud 33 compatibility for sharing file actions and popup - #72
Open
suet-kei-chan wants to merge 3 commits into
Open
feat: nmc/6466 add Nextcloud 33 compatibility for sharing file actions and popup#72suet-kei-chan wants to merge 3 commits into
suet-kei-chan wants to merge 3 commits into
Conversation
Nextcloud 33 ships @nextcloud/files v4, which scopes the file-action
registry by library major version and removes the OCA.Files.Sidebar API.
The actions registered with the v3 library were no longer picked up (the
sharing buttons disappeared) and the sidebar-based sharing popup no
longer opened.
- Migrate the file actions to the v4 API: plain object literals instead
of the removed FileAction class, and destructured action context
(exec/enabled receive { nodes, view, folder })
- Open the MagentaCLOUD sharing popup as a standalone modal instead of a
removed sidebar tab, exposed via window.OCA.Nmcsharing.openSharingPopup;
the "Show sharing options" and "Share" actions use it
- Keep "Manage shares" opening the files sidebar via getSidebar()
- Decouple SharingPopup from the removed OCA.Files.Sidebar API
(close/isSharedWithMe/openSharingManage)
- Bump @nextcloud/files to ^4.0.0
Note: package-lock.json still needs regenerating against @nextcloud/files
v4 (and a v4-compatible @nextcloud/dialogs) before release. The v4 library
only works on Nextcloud 33+, so info.xml still declares min-version 30 -
consider raising it to 33.
The Nextcloud 33 compatibility work left the sharing entry point broken: the "Create new link" entry failed to render and the "Show sharing options" file-list action was missing. Three separate NC33 breaking changes were involved. - Link share entry crash: NC33 removed the OCA.Sharing.ExternalLinkActions global. SharingEntryLink read `.state` off it inside data(), which threw and aborted the component's data init (also leaving SHARE_TYPES unset, so isEmailShareType failed too), so the link entry never rendered. Drop the dead ExternalLegacyLinkActions references, mirroring upstream NC33 which keeps only ExternalShareActions. - Missing "Show sharing options" action: @nextcloud/files v4 moved the file-action registry from window._nc_fileactions to the version-scoped window._nc_files_scope.v4_0.fileActions. Actions registered via the app's v3 build landed in a registry core no longer reads, so custom actions (sharing-popup) never appeared. Register directly into the v4 scoped registry that core consumes, mirroring v4's registerFileAction. - Sidebar open: replace the v4-only getSidebar() import in the "Manage shares" action with the window.OCA.Files._sidebar() runtime global it proxies, so it works from the v3 build. Dependency alignment: the branch had bumped @nextcloud/files to ^4.0.0, which is incompatible with the app's Vue 2 stack (files v4 pulls in dialogs v7 / @nextcloud/vue v9 / Vue 3) and broke the webpack build. Pin @nextcloud/files to ^3.12.2 (still exposes every API the app uses) and @nextcloud/dialogs to ^6.3.1, bump @nextcloud/vue to ^8.23.1, and add the babel-loader build dependency explicitly. The app stays on Vue 2 while bridging to NC33's runtime globals for the few v4-scoped integrations.
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.
Nextcloud 33 ships @nextcloud/files v4, which scopes the file-action registry by library major version and removes the OCA.Files.Sidebar API. The actions registered with the v3 library were no longer picked up (the sharing buttons disappeared) and the sidebar-based sharing popup no longer opened.
Note: package-lock.json still needs regenerating against @nextcloud/files v4 (and a v4-compatible @nextcloud/dialogs) before release. The v4 library only works on Nextcloud 33+, so info.xml still declares min-version 30 - consider raising it to 33.
Notable finding
origin/main had already bumped the version to 33.0.1 and declared NC 30–34, but never migrated the sharing code — it still ships @nextcloud/files@^3, new FileAction(...), and OCA.Files.Sidebar. So this branch is the actual NC 33 fix, not a duplicate. The old nmc/4516 I initially branched from was just 4 commits behind main with no unique work.
Two things flagged in the commit for the reviewer
package-lock.json regen against @nextcloud/files v4 (+ a v4-compatible @nextcloud/dialogs) is still required before release — the working bundles came from the local node_modules overlay, not the committed lockfile.
min-version: main declares 30, but the v4 library only works on NC 33+, so the sharing actions won't register on 30–32. I left it at main's 30 rather than change policy — consider raising to 33.