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

Page Builder - fixes UI bugs in revisions list #588

Merged
merged 2 commits into from
Nov 1, 2019
Merged

Page Builder - fixes UI bugs in revisions list #588

merged 2 commits into from
Nov 1, 2019

Conversation

adrians5j
Copy link
Member

@adrians5j adrians5j commented Nov 1, 2019

Related Issue

This PR fixes issues with updating the revisions list and revision content when selecting different revisions from the dropdown menu (see screenshot).

When doing a publishRevision mutation, we must require id and published in the response data fields so Apollo client can update its cache. That's, in general, a needed practice, we should avoid not-listing any data fields when doing updates (unless there is a good reason not to list any of course).

Your solution

Added id and published fields in response data, so Apollo can update its cache. I also added the key prop to the RenderElement component, with the value of currently selected revision id, so the revision content gets re-rendered when selecting different revisions (packages/app-page-builder/src/admin/plugins/pageDetails/previewContent/PagePreview.js:63).

How Has This Been Tested?

Manual testing.

Screenshots (if relevant):

image
List will now update correctly when doing changes in page builder. The content of active revision will also change when selecting different revisions.

@adrians5j adrians5j added the bug label Nov 1, 2019
@adrians5j adrians5j self-assigned this Nov 1, 2019
Copy link
Collaborator

@Pavel910 Pavel910 left a comment

Choose a reason for hiding this comment

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

Nice to see a simple fix to so many bugs at once 🚀

@Pavel910 Pavel910 merged commit ca19431 into webiny:master Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants