Add secondary tabs for database query
Fixes #13621 QBE selenium tests broken since merge of #13342 Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
parent
5b002fa2f5
commit
51cade77fd
@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog
|
||||
- issue #14636 Move operation causes SELECT * FROM `undefined`
|
||||
- issue #14630 Enum '0' produces incorrect search SQL
|
||||
- issue #14223 Fix TypeError in database designer
|
||||
- issue #13621 QBE selenium tests broken since merge of #13342
|
||||
|
||||
4.8.3 (2018-08-22)
|
||||
- issue #14314 Error when naming a database '0'
|
||||
|
||||
20
db_qbe.php
20
db_qbe.php
@ -11,6 +11,7 @@ use PhpMyAdmin\Relation;
|
||||
use PhpMyAdmin\Response;
|
||||
use PhpMyAdmin\SavedSearches;
|
||||
use PhpMyAdmin\Sql;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Util;
|
||||
|
||||
@ -20,9 +21,9 @@ use PhpMyAdmin\Util;
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
$response = Response::getInstance();
|
||||
$relation = new Relation();
|
||||
|
||||
// Gets the relation settings
|
||||
$relation = new Relation();
|
||||
$cfgRelation = $relation->getRelationsParam();
|
||||
|
||||
$savedSearchList = array();
|
||||
@ -138,6 +139,23 @@ unset($message_to_display);
|
||||
// create new qbe search instance
|
||||
$db_qbe = new Qbe($GLOBALS['db'], $savedSearchList, $savedSearch);
|
||||
|
||||
$secondaryTabs = [
|
||||
'multi' => [
|
||||
'link' => 'db_multi_table_query.php',
|
||||
'text' => __('Multi-table query'),
|
||||
],
|
||||
'qbe' => [
|
||||
'link' => 'db_qbe.php',
|
||||
'text' => __('Query by example'),
|
||||
],
|
||||
];
|
||||
$response->addHTML(
|
||||
Template::get('secondary_tabs')->render([
|
||||
'url_params' => $url_params,
|
||||
'sub_tabs' => $secondaryTabs,
|
||||
])
|
||||
);
|
||||
|
||||
$url = 'db_designer.php' . Url::getCommon(
|
||||
array_merge(
|
||||
$url_params,
|
||||
|
||||
@ -35,6 +35,7 @@ class Core
|
||||
'db_export.php',
|
||||
'db_importdocsql.php',
|
||||
'db_multi_table_query.php',
|
||||
'db_qbe.php',
|
||||
'db_structure.php',
|
||||
'db_import.php',
|
||||
'db_operations.php',
|
||||
|
||||
@ -9,6 +9,7 @@ namespace PhpMyAdmin\Database;
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Relation;
|
||||
use PhpMyAdmin\Table;
|
||||
use PhpMyAdmin\Template;
|
||||
|
||||
@ -474,11 +474,18 @@ class Menu
|
||||
$tabs['search']['warning'] = __('Database seems to be empty!');
|
||||
}
|
||||
|
||||
$tabs['multi_table_query']['text'] = __('Query');
|
||||
$tabs['multi_table_query']['icon'] = 's_db';
|
||||
$tabs['multi_table_query']['link'] = 'db_multi_table_query.php';
|
||||
$tabs['query']['text'] = __('Query');
|
||||
$tabs['query']['icon'] = 's_db';
|
||||
$tabs['query']['link'] = 'db_multi_table_query.php';
|
||||
$tabs['query']['active'] = in_array(
|
||||
basename($GLOBALS['PMA_PHP_SELF']),
|
||||
array(
|
||||
'db_multi_table_query.php',
|
||||
'db_qbe.php',
|
||||
)
|
||||
);
|
||||
if ($num_tables == 0) {
|
||||
$tabs['qbe']['warning'] = __('Database seems to be empty!');
|
||||
$tabs['query']['warning'] = __('Database seems to be empty!');
|
||||
}
|
||||
|
||||
$tabs['export']['text'] = __('Export');
|
||||
|
||||
@ -3978,7 +3978,7 @@ class Util
|
||||
'structure' => __('Structure'),
|
||||
'sql' => __('SQL'),
|
||||
'search' => __('Search'),
|
||||
'multi_table_query' => __('Query'),
|
||||
'query' => __('Query'),
|
||||
'export' => __('Export'),
|
||||
'import' => __('Import'),
|
||||
'operation' => __('Operations'),
|
||||
|
||||
@ -1,3 +1,18 @@
|
||||
{% include 'secondary_tabs.twig' with {
|
||||
'url_params': {
|
||||
'db': db
|
||||
},
|
||||
'sub_tabs': [
|
||||
{
|
||||
'link': 'db_multi_table_query.php',
|
||||
'text': 'Multi-table query'|trans
|
||||
},
|
||||
{
|
||||
'link': 'db_qbe.php',
|
||||
'text': 'Query by example'|trans
|
||||
}
|
||||
]
|
||||
} only %}
|
||||
{{ Util_getDivForSliderEffect('query_div', 'Query window'|trans, 'open') }}
|
||||
<form action="" id="query_form">
|
||||
<input type="hidden" id="db_name" value="{{ db }}">
|
||||
|
||||
@ -26,7 +26,6 @@ class QueryByExampleTest extends TestBase
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->markTestSkipped('Broken, see https://github.com/phpmyadmin/phpmyadmin/issues/13621');
|
||||
parent::setUp();
|
||||
|
||||
$this->dbQuery(
|
||||
@ -65,16 +64,19 @@ class QueryByExampleTest extends TestBase
|
||||
$this->waitForElement('byPartialLinkText', 'Query')->click();
|
||||
$this->waitAjax();
|
||||
|
||||
$this->waitForElement('byPartialLinkText', 'Query by example')->click();
|
||||
$this->waitAjax();
|
||||
|
||||
/* Select Columns to be used in the query */
|
||||
$select = $this->select(
|
||||
$this->waitForElement('byName', 'criteriaColumn[0]')
|
||||
);
|
||||
$select->selectOptionByLabel('`test_table`.`id`');
|
||||
$select->selectOptionByValue('`test_table`.`id`');
|
||||
|
||||
$select = $this->select(
|
||||
$this->waitForElement('byName', 'criteriaColumn[1]')
|
||||
);
|
||||
$select->selectOptionByLabel('`test_table`.`val`');
|
||||
$select->selectOptionByValue('`test_table`.`val`');
|
||||
|
||||
/* Set aliases for the columns */
|
||||
$this->waitForElement('byName', 'criteriaAlias[0]')->value('ID');
|
||||
@ -95,12 +97,12 @@ class QueryByExampleTest extends TestBase
|
||||
$select = $this->select(
|
||||
$this->waitForElement('byName', 'criteriaSortOrder[0]')
|
||||
);
|
||||
$select->selectOptionByLabel('2');
|
||||
$select->selectOptionByValue('2');
|
||||
|
||||
$select = $this->select(
|
||||
$this->waitForElement('byName', 'criteriaSortOrder[1]')
|
||||
);
|
||||
$select->selectOptionByLabel('1');
|
||||
$select->selectOptionByValue('1');
|
||||
|
||||
/* Set criteria conditions */
|
||||
$this->waitForElement('byName', 'criteria[0]')->value('> 1');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user