-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make action button icons configurable #7166
Conversation
Nice PR ! Could you try something similar to https://github.com/sonata-project/SonataAdminBundle/pull/4968/files When |
Also some documentation similar to https://github.com/sonata-project/SonataAdminBundle/blob/01677b25381aa3c3d87dfaf7fe8699d9bc4744f3/docs/cookbook/recipe_icheck.rst could be great. And the following files https://github.com/sonata-project/SonataAdminBundle/blob/ed8cb53be5356ff58e7991a02a47596076e77671/src/SonataConfiguration.php and https://github.com/sonata-project/SonataAdminBundle/blob/01677b25381aa3c3d87dfaf7fe8699d9bc4744f3/docs/reference/configuration.rst have to be updated with the new config option. |
I've added the |
Please review @sonata-project/contributors |
|
||
sonata_admin: | ||
options: | ||
# Choices are: text,icon or both (default) |
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.
# Choices are: text,icon or both (default) | |
# Choices are: text, icon or both (default) |
@@ -699,6 +699,20 @@ You need to add option ``show_mosaic_button`` in your admin services: | |||
tags: | |||
- { name: sonata.admin, manager_type: orm, group: admin, label: News, show_mosaic_button: false } | |||
|
|||
Icons on action buttons |
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.
Icons on action buttons | |
Show Icons on Action Buttons |
?
'both', | ||
'icon', | ||
'text', | ||
]) |
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.
]) | |
]) |
->enumNode('button_mode') | ||
->defaultValue('both') | ||
->values([ | ||
'both', |
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.
I think we should use a more representative term here, while bringing more flexibility to this feature.
"both" is useful only in case where 2 options are allowed, but what if we decide to add more in the future?
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.
What could we add in the future ? Prior to this change this was always button + text, I don't know what could be added.
Do you have another suggestion ?
An array with the value ['icon', 'text'] ? An option all
?
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.
I think "all", "full" or something like that could be good choices.
BTW, maybe we could also use other name for the option, as the current one is not clear enough to me regarding its presentation purposes. Personally, the "mode" term makes me think about other options like "readonly=yes/no" or "action=edit/show".
I guess choices like "button_view", "button_view_mode", "button_content", "button_render" could work.
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.
We could also add context to the list.
action_buttons
or list_action_buttons
seems better than button
.
Hi @vindert, do you have time to take in account the review ? :) |
Closing in favor of #7325 |
Subject
I am targeting this branch, because it is BC.
It make it possible to choose if icon will be shown on action buttons, in the list view.
This is my first pull request and first contribution to a project.
Any comments are welcome
Closes #6970
Changelog
### Added Make action button icons configurable