Skip to content

Commit

Permalink
Show error notification when saving a query fails (FED #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirnissim committed Dec 30, 2013
1 parent d4fa34f commit 4249839
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 14 deletions.
67 changes: 53 additions & 14 deletions rd_ui/app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,58 @@
angular.module('redash', ['redash.directives', 'redash.admin_controllers', 'redash.controllers', 'redash.filters', 'redash.services',
'redash.renderers',
'ui.codemirror', 'highchart', 'angular-growl', 'angularMoment', 'ui.bootstrap', 'smartTable.table', 'ngResource']).
config(['$routeProvider', '$locationProvider', '$compileProvider', function ($routeProvider, $locationProvider, $compileProvider) {
angular.module('redash', [
'redash.directives',
'redash.admin_controllers',
'redash.controllers',
'redash.filters',
'redash.services',
'redash.renderers',
'ui.codemirror',
'highchart',
'angular-growl',
'angularMoment',
'ui.bootstrap',
'smartTable.table',
'ngResource'
]).config(['$routeProvider', '$locationProvider', '$compileProvider', 'growlProvider',
function($routeProvider, $locationProvider, $compileProvider, growlProvider) {

$compileProvider.urlSanitizationWhitelist(/^\s*(https?|http|data):/);

$locationProvider.html5Mode(true);
$routeProvider.when('/dashboard/:dashboardSlug', {templateUrl: '/views/dashboard.html', controller: 'DashboardCtrl'});
$routeProvider.when('/queries', {templateUrl: '/views/queries.html', controller: 'QueriesCtrl', reloadOnSearch: false});
$routeProvider.when('/queries/new', {templateUrl: '/views/queryfiddle.html', controller: 'QueryFiddleCtrl', reloadOnSearch: false});
$routeProvider.when('/queries/:queryId', {templateUrl: '/views/queryfiddle.html', controller: 'QueryFiddleCtrl', reloadOnSearch: false});
$routeProvider.when('/admin/status', {templateUrl: '/views/admin_status.html', controller: 'AdminStatusCtrl'});
$routeProvider.when('/', {templateUrl: '/views/index.html', controller: 'IndexCtrl'});
$routeProvider.otherwise({redirectTo: '/'});
growlProvider.globalTimeToLive(2000);

Highcharts.setOptions({colors: ["#4572A7", "#AA4643", "#89A54E", "#80699B", "#3D96AE", "#DB843D", "#92A8CD", "#A47D7C", "#B5CA92"]});
}]);
$routeProvider.when('/dashboard/:dashboardSlug', {
templateUrl: '/views/dashboard.html',
controller: 'DashboardCtrl'
});
$routeProvider.when('/queries', {
templateUrl: '/views/queries.html',
controller: 'QueriesCtrl',
reloadOnSearch: false
});
$routeProvider.when('/queries/new', {
templateUrl: '/views/queryfiddle.html',
controller: 'QueryFiddleCtrl',
reloadOnSearch: false
});
$routeProvider.when('/queries/:queryId', {
templateUrl: '/views/queryfiddle.html',
controller: 'QueryFiddleCtrl',
reloadOnSearch: false
});
$routeProvider.when('/admin/status', {
templateUrl: '/views/admin_status.html',
controller: 'AdminStatusCtrl'
});
$routeProvider.when('/', {
templateUrl: '/views/index.html',
controller: 'IndexCtrl'
});
$routeProvider.otherwise({
redirectTo: '/'
});

Highcharts.setOptions({
colors: ["#4572A7", "#AA4643", "#89A54E", "#80699B", "#3D96AE",
"#DB843D", "#92A8CD", "#A47D7C", "#B5CA92"]
});
}
]);
2 changes: 2 additions & 0 deletions rd_ui/app/scripts/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
$location.path($location.path().replace(oldId, q.id)).replace();
}
}
}, function(httpResponse) {
growl.addErrorMessage("Query could not be saved");
});
};

Expand Down
1 change: 1 addition & 0 deletions rd_ui/app/styles/redash.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ a.navbar-brand {
right: 10px;
float: right;
width: 250px;
z-index: 10000;
}

.growl-item.ng-enter,
Expand Down

0 comments on commit 4249839

Please sign in to comment.