mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 19:00:09 -04:00
Unless data source set already, set it to the first one.
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
var leavingPageText = "You will lose your changes if you leave";
|
||||
var route = $route.current;
|
||||
|
||||
$scope.dataSources = DataSource.get();
|
||||
$scope.dataSources = DataSource.get(function(dataSources) {
|
||||
$scope.query.data_source_id = $scope.query.data_source_id || dataSources[0].id;
|
||||
});
|
||||
|
||||
$scope.dirty = undefined;
|
||||
$scope.isNewQuery = false;
|
||||
@@ -92,6 +94,7 @@
|
||||
}
|
||||
|
||||
delete $scope.query.latest_query_data;
|
||||
|
||||
$scope.query.$save(function (q) {
|
||||
pristineHash = q.getHash();
|
||||
$scope.dirty = false;
|
||||
|
||||
Reference in New Issue
Block a user