diff --git a/src/Action/Type/LinkActionType.php b/src/Action/Type/LinkActionType.php index 29e81521..ffd37fe0 100755 --- a/src/Action/Type/LinkActionType.php +++ b/src/Action/Type/LinkActionType.php @@ -34,10 +34,10 @@ public function configureOptions(OptionsResolver $resolver): void $resolver ->setDefaults([ 'href' => '#', - 'target' => '_self', + 'target' => null, ]) ->setAllowedTypes('href', ['string', 'callable']) - ->setAllowedTypes('target', ['string', 'callable']) + ->setAllowedTypes('target', ['null', 'string', 'callable']) ; } } diff --git a/src/Column/Type/LinkColumnType.php b/src/Column/Type/LinkColumnType.php index 18395816..d5c6a98a 100755 --- a/src/Column/Type/LinkColumnType.php +++ b/src/Column/Type/LinkColumnType.php @@ -31,10 +31,10 @@ public function configureOptions(OptionsResolver $resolver): void $resolver ->setDefaults([ 'href' => '#', - 'target' => '_self', + 'target' => null, ]) ->setAllowedTypes('href', ['string', 'callable']) - ->setAllowedTypes('target', ['string', 'callable']) + ->setAllowedTypes('target', ['null', 'string', 'callable']) ; } diff --git a/src/Resources/views/themes/base.html.twig b/src/Resources/views/themes/base.html.twig index 2c4ea7dd..efe06bf8 100755 --- a/src/Resources/views/themes/base.html.twig +++ b/src/Resources/views/themes/base.html.twig @@ -3,7 +3,7 @@ {# Base HTML Theme #} {% block kreyu_data_table %} - + {{ block('action_bar') }} {{ form_start(form, form_variables) }} @@ -186,13 +186,13 @@ {% endblock %} {% block pagination_page %} - + {{ block('pagination_page_message', theme) }} {% endblock %} {% block pagination_page_active %} - + {{ block('pagination_page_message', theme) }} {% endblock %} @@ -200,13 +200,13 @@ {% block pagination_page_message page_number %} {% block pagination_first %} - + {{ block('pagination_first_message', theme) }} {% endblock %} {% block pagination_first_disabled %} - + {{ block('pagination_first_message', theme) }} {% endblock %} @@ -214,7 +214,7 @@ {% block pagination_first_message '«' %} {% block pagination_previous %} - + {{ block('pagination_previous_message', theme) }} {% endblock %} @@ -226,7 +226,7 @@ {% block pagination_previous_message '‹' %} {% block pagination_last %} - + {{ block('pagination_last_message', theme) }} {% endblock %} @@ -238,7 +238,7 @@ {% block pagination_last_message '»' %} {% block pagination_next %} - + {{ block('pagination_next_message', theme) }} {% endblock %} @@ -254,7 +254,7 @@ {% block kreyu_data_table_filters_form %} {% form_theme form with form_themes|default([_self]) %} - {{ form_start(form, { attr: { 'data-turbo-action': 'advance', 'hidden': 'hidden' } }) }} + {{ form_start(form, { attr: { 'data-turbo-action': 'advance', 'data-turbo-frame': '_self', 'hidden': 'hidden' } }) }} {# This form should be empty - all its inputs should be on the outside, referenced using the "form" attribute #} {{ form_end(form, { render_rest: false }) }} @@ -286,7 +286,7 @@ {% endblock %} {% block filtration_form_submit %} - {% endblock %} @@ -320,7 +320,7 @@ {% set query_params = app.request.attributes.get('_route_params')|merge(query_params) %} {% set label_attr = { href: path(app.request.get('_route'), query_params) }|merge(label_attr) %} - {% set label_attr = { 'data-turbo-action': 'advance' }|merge(label_attr) %} + {% set label_attr = { 'data-turbo-action': 'advance', 'data-turbo-frame': '_self' }|merge(label_attr) %} {{- block('column_header_label', theme, _context) -}} @@ -397,7 +397,7 @@ {% endblock %} {% block column_link_value %} - + v != null)|merge(attr) } %}{{- block('attributes') -}}{% endwith %}> {{- block('column_text_value') -}} {% endblock %} @@ -495,7 +495,7 @@ {% endblock %} {% block action_link_value %} - {% set attr = { href, target }|merge(attr|default({})) %} + {% set attr = { href, target }|filter(v => v != null)|merge(attr|default({})) %} {% if batch %} {% set attr = { 'data-kreyu--data-table-bundle--batch-target': 'identifierHolder' }|merge(attr) %} @@ -507,7 +507,7 @@ {% endblock %} {% block action_button_value %} - {% set attr = { href, target }|merge(attr|default({})) %} + {% set attr = { href, target }|filter(v => v != null)|merge(attr|default({})) %} {% if batch %} {% set attr = { 'data-kreyu--data-table-bundle--batch-target': 'identifierHolder' }|merge(attr) %}