webiny-js icon indicating copy to clipboard operation
webiny-js copied to clipboard

Page Builder - Make Settings Extendable

Open Pavel910 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Trying to develop a plugin which extends Page Builder Website Settings, and the problem arises on settings update. Only the fields present in the validation model are being taken into consideration, and there's no hook which allows me to add an extra field myself:

https://github.com/webiny/webiny-js/blob/next/packages/api-page-builder/src/graphql/crud/settings.crud.ts#L231-L239

Describe the solution you'd like.

Settings input validation should be moved into a hook, same way we do with Pages: https://github.com/webiny/webiny-js/blob/next/packages/api-page-builder/src/graphql/crud/pages.validation.ts

Validation must be removed from the CRUD method itself, and a lifecycle hook should be added. Here's an example of this same approach in the pages.crud.ts: https://github.com/webiny/webiny-js/blob/next/packages/api-page-builder/src/graphql/crud/pages.crud.ts#L477-L481

Describe alternatives you've considered.

No response

Pavel910 avatar Jan 03 '22 14:01 Pavel910