Skip to content

Commit

Permalink
Don't execute query when changing data sources (fixes getredash#29)
Browse files Browse the repository at this point in the history
Also: show query results for execution after changing data sources (fixes getredash#774)
  • Loading branch information
Allen Short authored and jezdez committed Jan 16, 2020
1 parent ab70991 commit 6cbad1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/app/pages/queries/query.html
Expand Up @@ -229,7 +229,7 @@ <h3>
<!-- End of Query Execution Status -->

<!-- tabs and data -->
<div ng-if="showDataset" class="flex-fill p-relative">
<div ng-if="showDataset && !dataSourceChanged" class="flex-fill p-relative">
<div class="d-flex flex-column p-absolute static-position__mobile" style="left: 0; top: 0; right: 0; bottom: 0;">
<div class="p-10" ng-show="showLog">
<p>Log Information:</p>
Expand Down
4 changes: 3 additions & 1 deletion client/app/pages/queries/view.js
Expand Up @@ -130,6 +130,7 @@ function QueryViewCtrl(
return;
}

$scope.dataSourceChanged = false;
getQueryResult(0, $scope.selectedQueryText);
$scope.lockButton(true);
$scope.cancelling = false;
Expand All @@ -138,6 +139,7 @@ function QueryViewCtrl(
Notifications.getPermissions();
};

$scope.dataSourceChanged = false;
$scope.selectedVisualization = DEFAULT_VISUALIZATION;
$scope.currentUser = currentUser;
$scope.dataSource = {};
Expand Down Expand Up @@ -381,7 +383,7 @@ function QueryViewCtrl(

$scope.dataSource = find($scope.dataSources, ds => ds.id === $scope.query.data_source_id);
getSchema();
$scope.executeQuery();
$scope.dataSourceChanged = true;
};

$scope.setVisualizationTab = visualization => {
Expand Down

0 comments on commit 6cbad1e

Please sign in to comment.