diff --git a/ui/app/scripts/controllers/RootCtrl.js b/ui/app/scripts/controllers/RootCtrl.js index b6b0b35a67..882465e6b2 100644 --- a/ui/app/scripts/controllers/RootCtrl.js +++ b/ui/app/scripts/controllers/RootCtrl.js @@ -179,13 +179,16 @@ angular.module('theHiveControllers').controller('RootCtrl', resolve: { templates: function(){ return $scope.templates; + }, + uiSettings: function(UiSettingsSrv) { + return UiSettingsSrv.all(); } } }); modal.result.then(function(template) { $scope.createNewCase(template); - }) + }); }; $scope.aboutTheHive = function() { diff --git a/ui/app/scripts/controllers/alert/AlertListCtrl.js b/ui/app/scripts/controllers/alert/AlertListCtrl.js index 1b190023f8..05c2c9a57c 100755 --- a/ui/app/scripts/controllers/alert/AlertListCtrl.js +++ b/ui/app/scripts/controllers/alert/AlertListCtrl.js @@ -324,6 +324,9 @@ resolve: { templates: function(){ return templates; + }, + uiSettings: function(UiSettingsSrv) { + return UiSettingsSrv.all(); } } }); diff --git a/ui/app/scripts/controllers/case/CaseTemplatesDialogCtrl.js b/ui/app/scripts/controllers/case/CaseTemplatesDialogCtrl.js index b65aa6a574..770afac4e8 100644 --- a/ui/app/scripts/controllers/case/CaseTemplatesDialogCtrl.js +++ b/ui/app/scripts/controllers/case/CaseTemplatesDialogCtrl.js @@ -1,11 +1,13 @@ (function() { 'use strict'; angular.module('theHiveControllers').controller('CaseTemplatesDialogCtrl', - function($scope, $uibModalInstance, templates) { + function($scope, $uibModalInstance, UiSettingsSrv, templates, uiSettings) { this.templates = templates; + this.uiSettings = uiSettings; this.state = { filter: null, - selected: null + selected: null, + hideEmptyCaseButton: UiSettingsSrv.hideEmptyCaseButton() }; this.selectTemplate = function(template) { @@ -18,7 +20,7 @@ this.next = function(template) { $uibModalInstance.close(template); - } + }; this.cancel = function() { $uibModalInstance.dismiss(); diff --git a/ui/app/scripts/services/UiSettingsSrv.js b/ui/app/scripts/services/UiSettingsSrv.js index ccadd40bd5..27103e4e99 100644 --- a/ui/app/scripts/services/UiSettingsSrv.js +++ b/ui/app/scripts/services/UiSettingsSrv.js @@ -4,12 +4,12 @@ var settings = null; - return { - keys: [ - 'hideEmptyCaseButton', - 'hideMyTasks', - 'hideWaitingTasks' - ], + var keys = [ + 'hideEmptyCaseButton' + ]; + + var factory = { + keys: keys, clearCache: function() { settings = null; }, @@ -63,5 +63,13 @@ return deferred.promise; } }; + + keys.forEach(function(key) { + factory[key] = function() { + return (settings[key] || {}).value; + }; + }); + + return factory; }); })(); diff --git a/ui/app/views/partials/admin/ui-settings.html b/ui/app/views/partials/admin/ui-settings.html index ef677430f3..4e48545343 100644 --- a/ui/app/views/partials/admin/ui-settings.html +++ b/ui/app/views/partials/admin/ui-settings.html @@ -18,28 +18,6 @@
OR
+OR
+