volto icon indicating copy to clipboard operation
volto copied to clipboard

Add setting unwantedControlPanelsFields and use it in the function filterControlPanelsSchema

Open wesleybl opened this issue 1 year ago • 9 comments

filterControlPanelsSchema has been migrated to Controlpanel.jsx and uses the unwantedControlPanelsFields setting. So, if any portal wants to add fields in the Control Panel, it will be necessary to customize only the unwantedControlPanelsFields configuration, instead of customizing the entire filterControlPanelsSchema function.

This is an improvement for #3904

wesleybl avatar May 25 '23 16:05 wesleybl

Deploy Preview for volto ready!

Name Link
Latest commit a49236f1188c90935b57b74a48fca779b8d2bc90
Latest deploy log https://app.netlify.com/sites/volto/deploys/66201975e760c10008518bbf
Deploy Preview https://deploy-preview-4819--volto.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 25 '23 16:05 netlify[bot]

Passing run #5325 ↗︎

0 493 20 0 Flakiness 0

Details:

Replaces filterControlPanelsSchema setting by
Project: Volto Commit: 81a6aaaddb
Status: Passed Duration: 14:56 💡
Started: May 25, 2023 4:21 PM Ended: May 25, 2023 4:36 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

cypress[bot] avatar May 25 '23 16:05 cypress[bot]

Removing support for a custom filterControlPanelsSchema function is a breaking change that could only happen in a new major version of volto.

@davisagli but isn't the master branch for Volto 17, which is a breaking release? Can't we keep filterControlPanelsSchema only on branch 16? If we don't remove it now, when will we remove it? How will we remember to remove it in the future?

wesleybl avatar May 26 '23 12:05 wesleybl

@wesleybl Yeah, we can make this change for 17. In general my bias is to keep backwards compatibility if it's easy. But that does inflate the number of options over time, and in this particular case I doubt the filterControlPanelsSchema setting is being used much. Any preference, @sneridagh?

davisagli avatar May 27 '23 17:05 davisagli

@wesleybl I'm with @davisagli in this one... agreed that it cleans up the implementation, but that is hardly a reason for introducing a breaking if there is not delivering a clear direct advantage over the previous one.

sneridagh avatar Jul 16 '23 16:07 sneridagh

Deploy Preview for plone-components canceled.

Name Link
Latest commit a49236f1188c90935b57b74a48fca779b8d2bc90
Latest deploy log https://app.netlify.com/sites/plone-components/deploys/662019754ae84a0008d22aa7

netlify[bot] avatar Apr 16 '24 19:04 netlify[bot]

@davisagli @sneridagh @stevepiercy I kept the filterControlPanelsSchema function and used unwantedControlPanelsFields in it.

Can you take a look please?

wesleybl avatar Apr 16 '24 20:04 wesleybl

I understand that the endpoint is @controlpanels. Thoughts?

Yes: https://github.com/plone/plone.restapi/blob/11275deb4bc9488e0c10929bd7c76a1cfd6edc96/src/plone/restapi/services/controlpanels/configure.zcml#L32

wesleybl avatar Apr 17 '24 18:04 wesleybl

@wesleybl let's leave it as is without a refactor. Plural makes sense. I made a minor change to my suggestion, and if you accept, then I can approve and move this forward. Thank you!

stevepiercy avatar Apr 17 '24 18:04 stevepiercy