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

Rerender page from the page builder #2092

Merged
merged 3 commits into from Dec 9, 2021
Merged

Rerender page from the page builder #2092

merged 3 commits into from Dec 9, 2021

Conversation

kedrzu
Copy link
Contributor

@kedrzu kedrzu commented Dec 3, 2021

Changes

Right now, the only way for users to re-render a page is to create a new revision of it and publish it again, which is pretty annoying. This adds a feature of re-rendering the page from the page preview:
image

Also there is a new dedicated mutation pageBuilder.rerenderPage that you can use in your own scripts.

How Has This Been Tested?

Manual tests of the new rerenderPage mutation and admin app.

@kedrzu kedrzu changed the title feat(app-page-builder): rerender page functionality Rerender page from the page builder Dec 3, 2021
@adrians5j adrians5j added this to the 5.20.0 milestone Dec 3, 2021
@kedrzu
Copy link
Contributor Author

kedrzu commented Dec 6, 2021

We decided to remove the button in the UI and leave only GQL mutation. This way we basically restrict it from non-technical users, that will not be aware what is the purpose of the button.
For technical users & developers - you will still be able to rerender the page with a simple gql query, for example using our embedded GQL playground.

Copy link
Member

@adrians5j adrians5j left a comment

Choose a reason for hiding this comment

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

Looks good.

import { GraphQLSchemaPlugin } from "@webiny/handler-graphql/types";
import { Page, PbContext } from "~/types";
import Error from "@webiny/error";
import resolve from "./utils/resolve";
import pageSettings from "./pages/pageSettings";
import { fetchEmbed, findProvider } from "./pages/oEmbed";
import lodashGet from "lodash/get";
import { PageSecurityPermission } from "@webiny/api-page-builder/types";
import checkBasePermissions from "@webiny/api-page-builder/graphql/crud/utils/checkBasePermissions";
Copy link
Member

Choose a reason for hiding this comment

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

BTW @kedrzu, check these two imports. Use "~" when importing from package root.

Wouldn't mention this, but CI/CD threw an error related to these two imports. Using "~" will fix it.

Copy link
Member

Choose a reason for hiding this comment

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

Also, PageSecurityPermission can be added to the import statement in line 8.

@adrians5j adrians5j merged commit 39716e5 into next Dec 9, 2021
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.

None yet

2 participants