Merge branch 'QA_5_2'

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2022-06-15 21:14:18 -03:00
commit 7a6bd9eb57
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
7 changed files with 15 additions and 26 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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']),
]);
}
}

View File

@ -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 %}
</div>
{% endif %}

View File

@ -35,6 +35,10 @@
{% if node_is_container %}
&nbsp;<a class="hover_show_full" href="{{ url(text_link.route, text_link.params) }}">{{ node.name }}</a>
{% elseif 'index' in node.classes %}
<a class="hover_show_full" href="{{ url(text_link.route) }}" data-post="{{ get_common(text_link.params|merge({'is_from_nav': true})) }}" title="{{ text_link.title }}">
{{- node.displayName ?? node.realName -}}
</a>
{% else %}
<a class="hover_show_full{{ text_link.is_ajax ? ' ajax' }}" href="{{ url(text_link.route, text_link.params) }}" title="{{ text_link.title }}">
{{- node.displayName ?? node.realName -}}

View File

@ -5,6 +5,9 @@
class="ajax">
{{ get_hidden_inputs(form_params) }}
{% if is_from_nav %}
<input type="hidden" name="do_save_data" value="1">
{% endif %}
<fieldset class="pma-fieldset" id="index_edit_fields">
<div class="index_info">
@ -237,6 +240,10 @@
</div>
</fieldset>
<fieldset class="pma-fieldset tblFooters">
<button class="btn btn-primary" type="submit">{% trans 'Go' %}</button>
<button class="btn btn-secondary" type="submit" id="preview_index_frm">{% trans 'Preview SQL' %}</button>
</fieldset>
</form>
{% if is_from_nav %}
{{ include('modals/preview_sql_modal.twig') }}
{% endif %}

View File

@ -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 </div>\n </body>\n</html>\n",
$footer->getDisplay()
);