Fix: visualization tab wasnt updating on add/delete.

This commit is contained in:
Arik Fraimovich 2017-01-05 11:39:25 +02:00
parent 07b6b16fda
commit 9213a18057
2 changed files with 3 additions and 2 deletions

View File

@ -92,7 +92,7 @@ function QuerySourceCtrl(Events, toastr, $controller, $scope, $location, $http,
Events.record('delete', 'visualization', vis.id);
Visualization.delete({ id: vis.id }, () => {
if ($scope.selectedTab === vis.id) {
if ($scope.selectedTab === String(vis.id)) {
$scope.selectedTab = DEFAULT_TAB;
$location.hash($scope.selectedTab);
}

View File

@ -19,10 +19,11 @@ class VisualizationListResource(BaseResource):
vis = models.Visualization(**kwargs)
models.db.session.add(vis)
d = vis.to_dict(with_query=False)
models.db.session.commit()
d = vis.to_dict(with_query=False)
return d
class VisualizationResource(BaseResource):
@require_permission('edit_query')
def post(self, visualization_id):