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

Refactor API to work with a single Page entity and update UI accordingly. #264

Merged
merged 21 commits into from
Oct 26, 2018

Conversation

Pavel910
Copy link
Collaborator

Working with both Pages and revisions became quite complicate so I refactored the entire logic to work with a single Page entity. When a page is created, it automatically gets a version 1, and its parent field is the same as its id.

When a new revision is created - a new Page entity is stored, and it has a parent value of the original page (the actual root page, not the revision used to create the revision). So when you look at the data in the DB, all revisions related to the same page have the same value of parent field.

To load the page list data we use a custom SQL query, which groups all revisions by the parent field and orders the results by either published field od version field.

Besides the pages list, this PR also contains a lot of bug fixes and minor refactors to make the entire CMS structure better and easier to understand.

@Pavel910 Pavel910 merged commit 97b014d into development Oct 26, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.969% when pulling 5537c86 on cms/page-entity into 65c980b on development.

Pavel910 added a commit that referenced this pull request Oct 31, 2018
@Pavel910 Pavel910 deleted the cms/page-entity branch November 23, 2018 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants