webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.24k stars 590 forks source link

feat(app-page-builder): make website settings view configurable #4145

Closed Pavel910 closed 1 month ago

Pavel910 commented 2 months ago

LOW IMPACT BREAKING CHANGE! The API has changed slightly, so this can be considered a breaking change. However, this feature was never documented, and from our own sources, there are only 1-2 projects that have extended website settings in the past. Migration instructions will be included with the release, and the migration will take only a minute or two. See a diff below to get an idea of the difference in the API.

Changes

This PR upgrades the Page Builder Website Settings view to use the config API, like most of our apps. This makes it easy to add, modify, and remove fields and groups to Website Settings. This also allows us to decorate individual components and control their visibility through security permissions, or any other logic.

Visually, there are no changes, and the GraphQL API is the same. The changes are primarily on how you extend and modify this view.

CleanShot 2024-05-22 at 18 21 56

CleanShot 2024-05-22 at 18 22 26

Comparison with the Old API

In the following image, you can see how the API changed. The new API has a top-level WebsiteSettingsConfig component which you can use multiple times to mount configurations. Individual Elements now require a name prop, which allows us to target individual elements and modify/remove them, or position before/after other elements.

CleanShot 2024-05-22 at 18 31 52

How Has This Been Tested?

Manually.

Documentation

TODO