diff --git a/Gruntfile.js b/Gruntfile.js index a2a947d..0d411f4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,14 @@ module.exports = function (grunt) { }, clean: { - dist: ['<%= project.dist %>/'], + dist: [ + '<%= project.dist %>/assets/', + '<%= project.dist %>/bower_components/', + '<%= project.dist %>/components/', + '<%= project.dist %>/js/', + '<%= project.dist %>/templates/', + '<%= project.dist %>/index.html' + ], tmp: ['<%= project.tmp %>/'] }, @@ -152,6 +159,15 @@ module.exports = function (grunt) { ], tasks: ['copy:surveil', 'sass:dev', 'jshint:all'] }, + staging: { + files: [ + '<%= project.app %>/**/*.js', + '<%= project.app %>/**/*.html', + '<%= project.app %>/components/live/surveil.js', + '<%= project.assets %>/sass/{,*/}*.{scss,sass}' + ], + tasks: ['production:surveil'] + }, options: { livereload: true } @@ -168,8 +184,11 @@ module.exports = function (grunt) { 'sass', 'copy:surveil', 'jshint:all', 'watch:surveil' ]); + grunt.registerTask('staging:surveil', [ + 'production:surveil', 'watch:staging']); + grunt.registerTask('production:adagios', [ - 'clean', 'sass', 'copy:prod','copy:adagios', 'useminPrepare:html', 'concat:generated', 'uglify:generated', 'usemin:html']); + 'clean', 'sass', 'copy:prod', 'copy:adagios', 'useminPrepare:html', 'concat:generated', 'uglify:generated', 'usemin:html']); grunt.registerTask('production:surveil', [ 'clean', 'sass', 'copy:prod', 'copy:surveil', 'useminPrepare:html', 'concat:generated', 'uglify:generated', 'usemin:html']); diff --git a/Makefile b/Makefile index 6cf60ed..310acc9 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,10 @@ daemon: production: sudo docker run -p 8888:8888 --link surveil_surveil_1:surveil -d -t --name bansho bansho +staging: + sudo docker run -p 8888:8888 --link surveil_surveil_1:surveil -v $(shell pwd)/dist:/opt/bansho/dist -e BANSHO_PROD=false -d -t --name bansho bansho + grunt staging:surveil + kill: sudo docker kill bansho diff --git a/app/components/authentication/authentication.js b/app/components/authentication/authentication.js index 1377cd9..f4d36a6 100644 --- a/app/components/authentication/authentication.js +++ b/app/components/authentication/authentication.js @@ -9,7 +9,7 @@ angular.module('bansho.authentication', []) }); }]) - .controller('LoginController', function ($scope, $rootScope, $location, authService) { + .controller('LoginController', ['$scope', '$rootScope', '$location', 'authService', function ($scope, $rootScope, $location, authService) { $scope.credentials = { 'auth': { 'tenantName': '', @@ -23,7 +23,7 @@ angular.module('bansho.authentication', []) $scope.login = function (credentials) { authService.login(credentials); }; - }) + }]) .factory('authService', ['$http', '$location', '$rootScope', 'session', 'configManager', function ($http, $location, $rootScope, session, configManager) { var authService = {}; diff --git a/app/components/live/surveil.js b/app/components/live/surveil.js index f111acb..da4c0b8 100644 --- a/app/components/live/surveil.js +++ b/app/components/live/surveil.js @@ -338,14 +338,20 @@ angular.module('bansho.live', []) }; var acknowledge = function (host_name, service_description, attrs) { - var data = {}; + var data = {}; data.host_name = host_name; - data.author = attrs.author; - data.comment = attrs.comment; - data.sticky = parseInt(attrs.sticky, 10); - data.notify = parseInt(attrs.notify, 10); - data.persistent = parseInt(attrs.persistent, 10); + if (attrs.sticky) { + data.sticky = parseInt(attrs.sticky, 10); + } + + if (attrs.notify) { + data.notify = parseInt(attrs.notify, 10); + } + + if (attrs.persistent) { + data.persistent = parseInt(attrs.persistent, 10); + } if (service_description !== undefined) { data.service_description = service_description; diff --git a/app/components/table/actionbar/actions/acknowledge_form.html b/app/components/table/actionbar/actions/acknowledge_form.html index e3717d0..798e4ee 100644 --- a/app/components/table/actionbar/actions/acknowledge_form.html +++ b/app/components/table/actionbar/actions/acknowledge_form.html @@ -2,13 +2,13 @@