mirror of
https://github.com/getredash/redash.git
synced 2025-12-20 01:47:39 -05:00
Remove reference to query result when changing data source
This commit is contained in:
@@ -238,6 +238,19 @@
|
|||||||
$scope.dirty = (newHash !== pristineHash);
|
$scope.dirty = (newHash !== pristineHash);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.updateDataSource = function() {
|
||||||
|
$scope.query.latest_query_data = null;
|
||||||
|
$scope.query.latest_query_data_id = null;
|
||||||
|
Query.save({
|
||||||
|
'id': $scope.query.id,
|
||||||
|
'data_source_id': $scope.query.data_source_id,
|
||||||
|
'latest_query_data_id': null
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.executeQuery();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
$scope.executeQuery = function () {
|
$scope.executeQuery = function () {
|
||||||
$scope.queryResult = $scope.query.getQueryResult(0);
|
$scope.queryResult = $scope.query.getQueryResult(0);
|
||||||
$scope.lockButton(true);
|
$scope.lockButton(true);
|
||||||
|
|||||||
@@ -309,7 +309,6 @@
|
|||||||
ttl = this.ttl;
|
ttl = this.ttl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var queryResult = null;
|
var queryResult = null;
|
||||||
if (this.latest_query_data && ttl != 0) {
|
if (this.latest_query_data && ttl != 0) {
|
||||||
queryResult = new QueryResult({'query_result': this.latest_query_data});
|
queryResult = new QueryResult({'query_result': this.latest_query_data});
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<span class="glyphicon glyphicon-hdd"></span>
|
<span class="glyphicon glyphicon-hdd"></span>
|
||||||
<span class="text-muted">Data Source</span>
|
<span class="text-muted">Data Source</span>
|
||||||
<select ng-disabled="!isOwner" ng-model="query.data_source_id" ng-options="ds.id as ds.name for ds in dataSources"></select>
|
<select ng-disabled="!isOwner" ng-model="query.data_source_id" ng-change="updateDataSource()" ng-options="ds.id as ds.name for ds in dataSources"></select>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
Reference in New Issue
Block a user