diff --git a/js/src/functions.js b/js/src/functions.js index 853487926c..12331589a8 100644 --- a/js/src/functions.js +++ b/js/src/functions.js @@ -3405,7 +3405,7 @@ Functions.indexDialogModal = function (routeUrl, url, title, callbackSuccess, ca .insertAfter('#index_header'); var $editIndexDialog = $('#indexDialogModal'); if ($editIndexDialog.length > 0) { - $editIndexDialog.dialog('close'); + $editIndexDialog.modal('hide'); } $('div.no_indexes_defined').hide(); if (callbackSuccess) { diff --git a/js/src/navigation.js b/js/src/navigation.js index 676e0f04bd..355e3443b2 100644 --- a/js/src/navigation.js +++ b/js/src/navigation.js @@ -444,26 +444,6 @@ $(function () { } ); - /** New index */ - $(document).on('click', '#pma_navigation_tree li.new_index a.ajax', function (event) { - event.preventDefault(); - var url = $(this).attr('href').substring( - $(this).attr('href').indexOf('?') + 1 - ) + CommonParams.get('arg_separator') + 'ajax_request=true'; - var title = Messages.strAddIndex; - Functions.indexEditorDialog(url, title); - }); - - /** Edit index */ - $(document).on('click', 'li.index a.ajax', function (event) { - event.preventDefault(); - var url = $(this).attr('href').substring( - $(this).attr('href').indexOf('?') + 1 - ) + CommonParams.get('arg_separator') + 'ajax_request=true'; - var title = Messages.strEditIndex; - Functions.indexEditorDialog(url, title); - }); - /** New view */ $(document).on('click', 'li.new_view a.ajax', function (event) { event.preventDefault(); diff --git a/libraries/classes/Controllers/Table/IndexesController.php b/libraries/classes/Controllers/Table/IndexesController.php index 003cbc9a0d..e378f4cdd1 100644 --- a/libraries/classes/Controllers/Table/IndexesController.php +++ b/libraries/classes/Controllers/Table/IndexesController.php @@ -147,6 +147,7 @@ class IndexesController extends AbstractController 'add_fields' => $add_fields, 'create_edit_table' => isset($_POST['create_edit_table']), 'default_sliders_state' => $GLOBALS['cfg']['InitialSlidersState'], + 'is_from_nav' => isset($_POST['is_from_nav']), ]); } } diff --git a/templates/footer.twig b/templates/footer.twig index 1c47f43117..74d09e7c11 100644 --- a/templates/footer.twig +++ b/templates/footer.twig @@ -1,7 +1,6 @@ {{ include('modals/function_confirm.twig') }} {{ include('modals/add_index.twig') }} {{ include('modals/page_settings.twig') }} -{{ include('modals/index_dialog_modal.twig') }} {% if not is_ajax %} {% endif %} diff --git a/templates/navigation/tree/node.twig b/templates/navigation/tree/node.twig index fc1fb00f23..060a26ebe7 100644 --- a/templates/navigation/tree/node.twig +++ b/templates/navigation/tree/node.twig @@ -35,6 +35,10 @@ {% if node_is_container %}  {{ node.name }} + {% elseif 'index' in node.classes %} + + {{- node.displayName ?? node.realName -}} + {% else %} {{- node.displayName ?? node.realName -}} diff --git a/templates/table/index_form.twig b/templates/table/index_form.twig index 1d0f9f7102..ac79ee9aed 100644 --- a/templates/table/index_form.twig +++ b/templates/table/index_form.twig @@ -5,6 +5,9 @@ class="ajax"> {{ get_hidden_inputs(form_params) }} + {% if is_from_nav %} + + {% endif %}
@@ -237,6 +240,10 @@
+
+{% if is_from_nav %} + {{ include('modals/preview_sql_modal.twig') }} +{% endif %} diff --git a/test/classes/FooterTest.php b/test/classes/FooterTest.php index 52e2ab15e5..787d4b3919 100644 --- a/test/classes/FooterTest.php +++ b/test/classes/FooterTest.php @@ -128,8 +128,7 @@ class FooterTest extends AbstractTestCase $this->assertEquals( $template->render('modals/function_confirm') . "\n" . $template->render('modals/add_index') . "\n" - . $template->render('modals/page_settings') . "\n" - . $template->render('modals/index_dialog_modal') . "\n", + . $template->render('modals/page_settings') . "\n", $footer->getDisplay() ); } @@ -171,8 +170,7 @@ class FooterTest extends AbstractTestCase $this->assertEquals( $template->render('modals/function_confirm') . "\n" . $template->render('modals/add_index') . "\n" - . $template->render('modals/page_settings') . "\n" - . $template->render('modals/index_dialog_modal') + . $template->render('modals/page_settings') . "\n \n \n\n", $footer->getDisplay() );