Support for Nextcloud 34 and 35 (resolves #125, resolves #126) - #129
Draft
martin-rueegg wants to merge 2 commits into
Draft
martin-rueegg wants to merge 2 commits into
martin-rueegg wants to merge 2 commits into
Conversation
Swap the three $.ajax() calls (metadata fetch, Nominatim reverse geocode, Nominatim search) for axios requests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…0631#126) Nextcloud 34 no longer provides jQuery. Building on gino0631#127, which replaced the $.ajax calls, the metadata table is now built with the DOM API, the map opens in a native <dialog>, and imagePath comes from @nextcloud/router. The app's own route uses @nextcloud/axios; the Nominatim calls keep plain axios, so the request token is not sent to a third-party host. The CSP additions for Nominatim and OpenStreetMap are added through AddContentSecurityPolicyEvent instead of the deprecated addDefaultPolicy(), still only for requests that load the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes the metadata tab on Nextcloud 34, which no longer provides jQuery (
$ is not defined, #125), and adds Nextcloud 35.This builds on #127 and includes its commit unchanged, so the two can be merged in either order: #127 first and then this, or this alone.
Changes on top of #127
src/tabview.jsno longer uses jQuery. The table is built with the DOM API, the OpenStreetMap view opens in a native<dialog>(Escape, close button or a click outside closes it), andimagePathcomes from@nextcloud/routerinstead ofOC.imagePath.@nextcloud/axios, which adds the request token and refreshes it on a CSRF failure. The Nominatim calls keep the plainaxiosfrom Replace jQuery ajax calls with axios #127, so the token is not sent to a third-party host.AddContentSecurityPolicyEventinstead of the deprecatedIContentSecurityPolicyManager::addDefaultPolicy()via\OC::$server->query(). As before, it is added only for requests that load the sidebar.max-version35, astable35Travis job, and the CHANGELOG.The Vue migration mentioned in #126 can still follow separately. This keeps the change small so that 34 and 35 work now.
Testing
Tested in Chromium on Nextcloud 33.0.8, 34.0.3 and 35.0.1:
requesttokenheaderWith the current master build on 34, the tab stays at "Reading metadata …".
A test for the sidebar tab?
@gino0631 Travis stayed green while the tab was broken on 34, because nothing tests the frontend. We'd be happy to add a browser test of the sidebar tab in a separate PR (or as a separate commit on top of this), either in Travis or as a GitHub Action, whichever you prefer. Would that be welcome? The standalone Playwright script used for the testing above is in this gist.
🤖 Generated with Claude Code