mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Merge pull request #7724 from GSadee/grid-action-links-visible
[Grid] Add possibility to set visible parameter for each link in links action
This commit is contained in:
commit
2710777360
3 changed files with 26 additions and 11 deletions
|
|
@ -78,16 +78,6 @@ Here you will find all configuration options of ``sylius_grid``.
|
|||
enabled: true
|
||||
icon: ~
|
||||
position: 100
|
||||
options:
|
||||
links:
|
||||
simple:
|
||||
label: sylius.ui.simple_user
|
||||
icon: plus
|
||||
route: app_admin_user_create_simple
|
||||
configurable:
|
||||
label: sylius.ui.configurable_user
|
||||
icon: plus
|
||||
route: app_admin_user_create
|
||||
item:
|
||||
update:
|
||||
type: update
|
||||
|
|
@ -122,3 +112,23 @@ Here you will find all configuration options of ``sylius_grid``.
|
|||
position: 100
|
||||
options:
|
||||
restore_label: sylius.ui.restore
|
||||
subitem:
|
||||
addresses:
|
||||
type: links
|
||||
label: sylius.ui.manage_addresses
|
||||
options:
|
||||
icon: cubes
|
||||
links:
|
||||
index:
|
||||
label: sylius.ui.list_addresses
|
||||
icon: list
|
||||
route: app_admin_user_address_index
|
||||
visible: resource.hasAddress
|
||||
parameters:
|
||||
userId: resource.id
|
||||
create:
|
||||
label: sylius.ui.generate
|
||||
icon: random
|
||||
route: app_admin_user_address_create
|
||||
parameters:
|
||||
userId: resource.id
|
||||
|
|
|
|||
|
|
@ -87,5 +87,6 @@ sylius_grid:
|
|||
label: sylius.ui.generate
|
||||
icon: random
|
||||
route: sylius_admin_product_variant_generate
|
||||
visible: resource.hasOptions
|
||||
parameters:
|
||||
productId: resource.id
|
||||
|
|
|
|||
|
|
@ -13,7 +13,11 @@
|
|||
<div class="divider"></div>
|
||||
{% endif %}
|
||||
{% for link in options.links %}
|
||||
{% include '@SyliusUi/Grid/Action/_link.html.twig' %}
|
||||
{% set is_link_visible = link.visible is defined ? link.visible : true %}
|
||||
|
||||
{% if is_link_visible %}
|
||||
{% include '@SyliusUi/Grid/Action/_link.html.twig' %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue