-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Add setting unwantedControlPanelsFields and use it in the function filterControlPanelsSchema #4819
Conversation
✅ Deploy Preview for volto ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
95b1589
to
81a6aaa
Compare
Passing run #5325 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating docs! 🤗
I reviewed docs only. A maintainer should review the source code.
news/4819.feature
Outdated
@@ -0,0 +1 @@ | |||
Replaces ``filterControlPanelsSchema`` setting by ``unwantedControlPanelsFields`. @wesleybl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaces ``filterControlPanelsSchema`` setting by ``unwantedControlPanelsFields`. @wesleybl | |
Renames `filterControlPanelsSchema` setting to `unwantedControlPanelsFields`. @wesleybl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing support for a custom filterControlPanelsSchema
function is a breaking change that could only happen in a new major version of volto. I'd suggest keeping it, but change the default implementation to use the new unwantedControlPanelFields
setting. Then it can be backported for volto 16.
@davisagli but isn't the master branch for Volto 17, which is a breaking release? Can't we keep |
@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? |
@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. |
81a6aaa
to
26c4c02
Compare
✅ Deploy Preview for plone-components canceled.
|
@davisagli @sneridagh @stevepiercy I kept the Can you take a look please? |
04f2756
to
a3d42a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor grammar correction to the narrative docs made me notice that there might be a grammatical mistake in the naming of the schema factory. Why do use filterControlPanelsSchema
and unwantedControlPanelsFields
instead of filterControlPanelSchema
and unwantedControlPanelFields
? Obviously it is not worth refactoring the deprecated filterControlPanelsSchema
, but it might be worth refactoring the new factory to unwantedControlPanelFields
. I understand that the endpoint is @controlpanels
. Thoughts?
|
@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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now.
unwantedControlPanelsFields 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.
Co-authored-by: Steve Piercy <[email protected]>
a49236f
to
35894b9
Compare
@davisagli @ichim-david I updated the code and resolved the conflicts. Can we merge it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
filterControlPanelsSchema
has been migrated toControlpanel.jsx
and uses theunwantedControlPanelsFields
setting. So, if any portal wants to add fields in the Control Panel, it will be necessary to customize only theunwantedControlPanelsFields
configuration, instead of customizing the entirefilterControlPanelsSchema
function.This is an improvement for #3904