-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for page versions #44
Merged
Merged
Conversation
This file contains 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
mamhoff
reviewed
Mar 2, 2021
mamhoff
reviewed
Mar 2, 2021
Decorates a page returning elements from given page_version.
Since we now use a eager loaded elements collection on the page, we do not need this any more.
tvdeyen
force-pushed
the
page-versions
branch
2 times, most recently
from
March 3, 2021 13:48
39cf89f
to
cd34e8b
Compare
mamhoff
approved these changes
Mar 3, 2021
@mamhoff ready for re-review |
mamhoff
approved these changes
Mar 5, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE
The element has a page through its page version now.
Uses our page with eager loaded elements collection in our controllers
Page versions has been introduced with Alchemy 6.0
We only support Alchemy v6 for now
This is meant to be used from the admin pages preview frame and always returns elements from the draft version.
We do not need the parent_element relation in element serializer because usually you render top to bottom.
Somehow CanCanCan is not always able to get the correct class
We sometimes use the pages urlname in the preview window as well. For instance if using a static site generator.
The only difference is the page version we want to load elements for.
You might want to preview layoutpages as well.
The former version returned a draft version of a public page even for not admin users. Lets lock this route down completely.
Unauthentiated users must not see unpublished layoutpages.
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.
This refactors this gem by using page versions of Alchemy v6
This is a breaking change. Older versions of Alchemy are not supported anymore!
It makes some assumptions:
Elements are always loaded from the public version of requested page, besides in the new admin pages controller. Here we always load elements from the draft version of the page. This is meant to be used for the admin page preview.