Skip to content

Commit

Permalink
Merge branch 'QA_4_8'
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed Nov 1, 2018
2 parents d4cf2f6 + cf22b37 commit 235dac6
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 11 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -29,6 +29,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'
Expand Down
21 changes: 20 additions & 1 deletion db_qbe.php
Expand Up @@ -13,6 +13,7 @@
use PhpMyAdmin\Response;
use PhpMyAdmin\SavedSearches;
use PhpMyAdmin\Sql;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;

Expand All @@ -22,9 +23,10 @@
require_once 'libraries/common.inc.php';

$response = Response::getInstance();
$relation = new Relation($GLOBALS['dbi']);
$template = new Template();

// Gets the relation settings
$relation = new Relation($GLOBALS['dbi']);
$cfgRelation = $relation->getRelationsParam();

$savedSearchList = [];
Expand Down Expand Up @@ -140,6 +142,23 @@
// create new qbe search instance
$db_qbe = new Qbe($GLOBALS['dbi'], $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->render('secondary_tabs', [
'url_params' => $url_params,
'sub_tabs' => $secondaryTabs,
])
);

$url = 'db_designer.php' . Url::getCommon(
array_merge(
$url_params,
Expand Down
1 change: 1 addition & 0 deletions libraries/classes/Core.php
Expand Up @@ -37,6 +37,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',
Expand Down
15 changes: 11 additions & 4 deletions libraries/classes/Menu.php
Expand Up @@ -480,11 +480,18 @@ private function _getDbTabs()
$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');
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Util.php
Expand Up @@ -4051,7 +4051,7 @@ public static function getMenuTabList($level = null)
'structure' => __('Structure'),
'sql' => __('SQL'),
'search' => __('Search'),
'multi_table_query' => __('Query'),
'query' => __('Query'),
'export' => __('Export'),
'import' => __('Import'),
'operation' => __('Operations'),
Expand Down
15 changes: 15 additions & 0 deletions templates/database/multi_table_query/form.twig
@@ -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 %}
{% include 'div_for_slider_effect.twig' with {
'id': 'query_div',
'message': 'Query window'|trans,
Expand Down
12 changes: 7 additions & 5 deletions test/selenium/QueryByExampleTest.php
Expand Up @@ -27,7 +27,6 @@ class QueryByExampleTest extends TestBase
*/
protected function setUp()
{
$this->markTestSkipped('Broken, see https://github.com/phpmyadmin/phpmyadmin/issues/13621');
parent::setUp();

$this->dbQuery(
Expand Down Expand Up @@ -57,13 +56,16 @@ public function testQueryByExample()
$this->waitForElement('partialLinkText', 'Query')->click();
$this->waitAjax();

$this->waitForElement('partialLinkText', 'Query by example')->click();
$this->waitAjax();

/* Select Columns to be used in the query */
$this->selectByLabel(
$this->selectByValue(
$this->waitForElement('name', 'criteriaColumn[0]'),
'`test_table`.`id`'
);

$this->selectByLabel(
$this->selectByValue(
$this->waitForElement('name', 'criteriaColumn[1]'),
'`test_table`.`val`'
);
Expand All @@ -84,12 +86,12 @@ public function testQueryByExample()
);

/* Select sort order amongst columns */
$this->selectByLabel(
$this->selectByValue(
$this->waitForElement('name', 'criteriaSortOrder[0]'),
'2'
);

$this->selectByLabel(
$this->selectByValue(
$this->waitForElement('name', 'criteriaSortOrder[1]'),
'1'
);
Expand Down

0 comments on commit 235dac6

Please sign in to comment.