Merge branch 'QA_5_2'

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2024-06-23 13:23:11 -03:00
commit a3f7a2cfaa
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
3 changed files with 25 additions and 10 deletions

View File

@ -18,10 +18,10 @@
</li>
</ul>
<form method="post" action="{{ url('/table/zoom-search') }}" name="insertForm" id="zoom_search_form" class="ajax lock-page">
<form method="post" action="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}" name="insertForm" id="zoom_search_form" class="ajax lock-page">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="goto" value="{{ goto }}">
<input type="hidden" name="back" value="{{ url('/table/zoom-search') }}">
<input type="hidden" name="back" value="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}">
<div class="card mb-3">
<div class="card-header">{{ t('Do a "query by example" (wildcard: "%") for two different columns') }}</div>

View File

@ -1,7 +1,7 @@
<form method="post" action="{{ url('/table/zoom-search') }}" name="displayResultForm" id="zoom_display_form" class="ajax">
<form method="post" action="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}" name="displayResultForm" id="zoom_display_form" class="ajax">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="goto" value="{{ goto }}">
<input type="hidden" name="back" value="{{ url('/table/zoom-search') }}">
<input type="hidden" name="back" value="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}">
<div class="card">
<div class="card-header">{{ t('Browse/Edit the points') }}</div>
@ -19,8 +19,8 @@
{% endif %}
</div>
<div class="modal fade" id="dataPointModal" tabindex="-1" aria-labelledby="dataPointModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal fade" id="dataPointModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="dataPointModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="dataPointModalLabel">{{ t('Loading') }}</h5>
@ -53,20 +53,23 @@
{% include 'table/search/input_box.twig' with {
'str': '',
'column_type': column_types[column_index],
'column_data_type': column_data_types[column_index],
'html_attributes': '',
'column_id': column_types[column_index] ? 'edit_fieldID_' : 'fieldID_',
'in_zoom_search_edit': true,
'foreigners': foreigners,
'column_name': field_popup,
'column_name_hash': column_name_hashes[field_popup],
'column_name_hash': column_names_hashes[field_popup],
'foreign_data': foreign_data[column_index],
'table': table,
'column_index': column_index,
'foreign_max_limit': foreign_max_limit,
'criteria_values': '',
'db': db,
'in_fbs': false,
'foreign_dropdown': foreign_dropdown[column_index],
'search_columns_in_foreigners': search_columns_in_foreigners[column_index]
'foreign_dropdown': foreign_dropdown[column_index] ?? '',
'search_column_in_foreigners': search_columns_in_foreigners[column_index],
'is_integer': column_data_types[column_index] == 'INT',
'is_float': column_data_types[column_index] == 'FLOAT',
} only %}
</th>
</tr>

View File

@ -25,6 +25,7 @@ use PhpMyAdmin\Util;
use PhpMyAdmin\Utils\Gis;
use function __;
use function array_map;
use function array_search;
use function array_values;
use function htmlspecialchars;
@ -414,6 +415,16 @@ final class ZoomSearchController implements InvocableController
);
}
$integerTypes = $this->dbi->types->getIntegerTypes();
$floatTypes = $this->dbi->types->getFloatTypes();
$columnDataTypes = array_map(static function (string $type) use ($integerTypes, $floatTypes): string {
$cleanType = (string) preg_replace('@\(.*@s', '', $type);
$isInteger = in_array($cleanType, $integerTypes, true);
$isFloat = in_array($cleanType, $floatTypes, true);
return $isInteger ? 'INT' : ($isFloat ? 'FLOAT' : strtoupper($cleanType));
}, $this->columnTypes);
$this->response->render('table/zoom_search/result_form', [
'db' => Current::$database,
'table' => Current::$table,
@ -422,6 +433,7 @@ final class ZoomSearchController implements InvocableController
'foreigners' => $this->foreigners,
'column_null_flags' => $this->columnNullFlags,
'column_types' => $this->columnTypes,
'column_data_types' => $columnDataTypes,
'goto' => $goto,
'data' => $data,
'data_json' => json_encode($data),