Skip to content

Commit

Permalink
TheHive-Project#890 Fix UiSettingsSrv service injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Feb 22, 2019
1 parent b8fd37a commit aab6ec2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ui/app/scripts/controllers/RootCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ angular.module('theHiveControllers').controller('RootCtrl',
templates: function(){
return $scope.templates;
},
uiSettings: function(UiSettingsSrv) {
uiSettings: ['UiSettingsSrv', function(UiSettingsSrv) {
return UiSettingsSrv.all();
}
}]
}
});

Expand Down
4 changes: 3 additions & 1 deletion ui/app/scripts/controllers/alert/AlertEventCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';
angular.module('theHiveControllers')
.controller('AlertEventCtrl', function($scope, $rootScope, $state, $uibModal, $uibModalInstance, CustomFieldsCacheSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, clipboard, event, templates) {
.controller('AlertEventCtrl', function($scope, $rootScope, $state, $uibModal, $uibModalInstance, CustomFieldsCacheSrv, CaseResolutionStatus, AlertingSrv, NotificationSrv, UiSettingsSrv, clipboard, event, templates) {
var self = this;
var eventId = event.id;

Expand All @@ -25,6 +25,8 @@
self.similarCasesStats = [];
self.customFieldsCache = CustomFieldsCacheSrv;

self.hideEmptyCaseButton = UiSettingsSrv.hideEmptyCaseButton();

var getTemplateCustomFields = function(customFields) {
var result = [];

Expand Down
6 changes: 3 additions & 3 deletions ui/app/scripts/controllers/alert/AlertListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@
resolve: {
templates: function(){
return templates;
},
uiSettings: function(UiSettingsSrv) {
},
uiSettings: ['UiSettingsSrv', function(UiSettingsSrv) {
return UiSettingsSrv.all();
}
}]
}
});

Expand Down
2 changes: 1 addition & 1 deletion ui/app/views/partials/alert/event.dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h4 class="vpad10 text-primary">
<label class="col-sm-4 control-label">Import alert as</label>
<div class="col-sm-8 input-group">
<select class="form-control" ng-model="dialog.event.caseTemplate" ng-options="template for template in dialog.templates">
<option value="">Empty case</option>
<option value="" ng-if="dialog.templates.length === 0 || !!!dialog.hideEmptyCaseButton">Empty case</option>
</select>
<span class="input-group-btn">
<button class="btn btn-primary" type="submit" ng-disabled="dialog.loading">Yes, Import</button>
Expand Down

0 comments on commit aab6ec2

Please sign in to comment.