plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
425 stars 575 forks source link

Strip `++api++` from in-browser location changes #4834

Closed JeffersonBledsoe closed 10 months ago

JeffersonBledsoe commented 10 months ago

Solves the Volto part of #4800. We're stripping the ++api++ if it is in a location change as we probably don't want to ever navigate directly to a page with ++api++ in it in the browser. Change the action causes the redux store to be correct, but the URL updating occurs earlier in the react-router stack, and so we also manually update the URL to not have ++api++ in it. History is still preserved correctly (++api++ pages aren't in the history stack but we can still go back and forwards normally).

The logic is currently mixed in with the blacklistRoutes middleware while I get some feedback, but this logic should probably be its own middleware for readability.

netlify[bot] commented 10 months ago

Deploy Preview for volto canceled.

Name Link
Latest commit 222e9b6c0cd71846a06047513df908b98c40434e
Latest deploy log https://app.netlify.com/sites/volto/deploys/6477225d1eb29b00085e7e04
JeffersonBledsoe commented 10 months ago

GitHub bug meant I had to close this PR and re-open it in https://github.com/plone/volto/pull/4854