Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect 'GET on Preview' link to edit page #2904

Merged
merged 3 commits into from
Nov 9, 2021
Merged

Conversation

bobdenotter
Copy link
Member

Sometimes clients or editors paste links to specific pages with a URL they've copy/pasted from a preview. Like https://example.org/preview/123.

This will give an error like:

image

This PR allows a GET request to that page (assuming it's published, similar to the existing "detail view")

Copy link
Collaborator

@nestordedios nestordedios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Looks good 👍

Copy link
Member

@I-Valchev I-Valchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of fixing that scary error screen... but I'm not sure if rendering the saved version for a preview link is the way to go.

If somebody copies the preview and shares it, they'd expect the unsaved changes to be shown, which we can't do.

Perhaps we could either show a nicer error/explanation why sharing the preview does not work that way, or redirecting to the backend 🤔

@bobdenotter
Copy link
Member Author

The thing is, the people grabbing these links and sharing them will not see this nicer error, because it already works for them. it only breaks for the people receiving the link, and i don't think they'll benefit from a link to the backend..

On the other hand, if we redirect it to the correct "Edit" page for that record.. At least you'd end up in the correct spot without having to dig much deeper. Would that be a good compromise? 🤔

@I-Valchev
Copy link
Member

@bobdenotter yes, that would make sense! Sure, I'm on board 🚂 🚋 🚋

@bobdenotter bobdenotter changed the title Allow GET requests for Preview Redirect 'GET on Preview' link to edit page Nov 8, 2021
@bobdenotter
Copy link
Member Author

@I-Valchev Updated!

Copy link
Member

@I-Valchev I-Valchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yesss, looks good! Let's roll.

@I-Valchev I-Valchev merged commit 7ef2272 into 5.0 Nov 9, 2021
@I-Valchev I-Valchev deleted the get-requests-for-preview branch November 9, 2021 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants