Skip to content

Commit 3948df3

Browse files
authored
Add a modal id prop on the delete modal component (#359)
Needed for my WIP work at Jolicode. ```twig {{ component('sylius_bootstrap_admin_ui:delete_modal', { id: directory, modal_id: 'delete-directory-modal-' ~ loop.index , path: path('joli_media_sylius_admin_delete_directory', {'key': directory}) }) }} ``` Here my path is a directory label, so it could contains any characters.
2 parents 480590a + 1792a2e commit 3948df3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/BootstrapAdminUi/templates/shared/components/delete_modal.html.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{% extends '@SyliusBootstrapAdminUi/shared/components/confirmation_modal.html.twig' %}
22
{% import '@SyliusBootstrapAdminUi/shared/helper/button.html.twig' as button %}
33

4-
{% props id = null, path = null, label = 'sylius.ui.delete', icon = 'tabler:trash-x', disabled = false, form_attr = null, type = 'delete' %}
5-
{% set modal_id = 'delete-modal-' ~ id %}
4+
{% props id = null, path = null, label = 'sylius.ui.delete', icon = 'tabler:trash-x', disabled = false, form_attr = null, type = 'delete', modal_id = null %}
5+
6+
{% if modal_id is null %}
7+
{% set modal_id = 'delete-modal-' ~ id %}
8+
{% endif %}
69

710
{% block trigger %}
811
<div data-bs-toggle="tooltip" data-bs-title="{{ label|trans }}">

0 commit comments

Comments
 (0)