From 79d0f4da8c77a222a202f928089aec3eb754d53f Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 Feb 2019 11:12:28 +0100 Subject: [PATCH 1/9] #893 Skip case template section when creating a case from alerts, if there are no case templates --- ui/app/scripts/controllers/alert/AlertListCtrl.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/app/scripts/controllers/alert/AlertListCtrl.js b/ui/app/scripts/controllers/alert/AlertListCtrl.js index 05c2c9a57c..ee29cdcb4a 100755 --- a/ui/app/scripts/controllers/alert/AlertListCtrl.js +++ b/ui/app/scripts/controllers/alert/AlertListCtrl.js @@ -315,6 +315,10 @@ CaseTemplateSrv.list() .then(function(templates) { + if(!templates || templates.length === 0) { + return $q.resolve(undefined); + } + // Open template selection dialog var modal = $uibModal.open({ templateUrl: 'views/partials/case/case.templates.selector.html', From 6b0163b3c794c59c11b7285c5ddba98f75491add Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 Feb 2019 11:13:31 +0100 Subject: [PATCH 2/9] #890 Fix UiSettingsSrv service injection --- ui/app/scripts/controllers/RootCtrl.js | 4 ++-- ui/app/scripts/controllers/alert/AlertEventCtrl.js | 4 +++- ui/app/scripts/controllers/alert/AlertListCtrl.js | 6 +++--- ui/app/views/partials/alert/event.dialog.html | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/app/scripts/controllers/RootCtrl.js b/ui/app/scripts/controllers/RootCtrl.js index 882465e6b2..acbd718b83 100644 --- a/ui/app/scripts/controllers/RootCtrl.js +++ b/ui/app/scripts/controllers/RootCtrl.js @@ -180,9 +180,9 @@ angular.module('theHiveControllers').controller('RootCtrl', templates: function(){ return $scope.templates; }, - uiSettings: function(UiSettingsSrv) { + uiSettings: ['UiSettingsSrv', function(UiSettingsSrv) { return UiSettingsSrv.all(); - } + }] } }); diff --git a/ui/app/scripts/controllers/alert/AlertEventCtrl.js b/ui/app/scripts/controllers/alert/AlertEventCtrl.js index 1176842eee..1f77b87a15 100644 --- a/ui/app/scripts/controllers/alert/AlertEventCtrl.js +++ b/ui/app/scripts/controllers/alert/AlertEventCtrl.js @@ -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; @@ -25,6 +25,8 @@ self.similarCasesStats = []; self.customFieldsCache = CustomFieldsCacheSrv; + self.hideEmptyCaseButton = UiSettingsSrv.hideEmptyCaseButton(); + var getTemplateCustomFields = function(customFields) { var result = []; diff --git a/ui/app/scripts/controllers/alert/AlertListCtrl.js b/ui/app/scripts/controllers/alert/AlertListCtrl.js index ee29cdcb4a..ba6c919b31 100755 --- a/ui/app/scripts/controllers/alert/AlertListCtrl.js +++ b/ui/app/scripts/controllers/alert/AlertListCtrl.js @@ -328,10 +328,10 @@ resolve: { templates: function(){ return templates; - }, - uiSettings: function(UiSettingsSrv) { + }, + uiSettings: ['UiSettingsSrv', function(UiSettingsSrv) { return UiSettingsSrv.all(); - } + }] } }); diff --git a/ui/app/views/partials/alert/event.dialog.html b/ui/app/views/partials/alert/event.dialog.html index 84d5c44c2e..c59d144ac4 100644 --- a/ui/app/views/partials/alert/event.dialog.html +++ b/ui/app/views/partials/alert/event.dialog.html @@ -166,7 +166,7 @@

From db4d011a319c4cdfd27981c148c54573e1777339 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 Feb 2019 11:37:33 +0100 Subject: [PATCH 3/9] Bump version --- ui/bower.json | 2 +- ui/package.json | 2 +- version.sbt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/bower.json b/ui/bower.json index f56c35e652..cb03f183b9 100644 --- a/ui/bower.json +++ b/ui/bower.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "3.3.0-RC3", + "version": "3.3.0-RC4", "license": "AGPL-3.0", "dependencies": { "angular": "1.5.8", diff --git a/ui/package.json b/ui/package.json index fdcc56fab8..ae3a2388f0 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "3.3.0-RC3", + "version": "3.3.0-RC4", "license": "AGPL-3.0", "repository": { "type": "git", diff --git a/version.sbt b/version.sbt index 84cc17b6f1..48660d98a4 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "3.3.0-RC3" +version in ThisBuild := "3.3.0-RC4" From b252feb91dc63f3b011af8779d3a01bde6989855 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 Feb 2019 14:16:51 +0100 Subject: [PATCH 4/9] #894 Debounce the navigation to search page when coming from dashboard items --- .../scripts/directives/dashboard/counter.js | 22 ++++++++++--------- ui/app/scripts/directives/dashboard/donut.js | 11 ++++++---- ui/app/scripts/services/GlobalSearchSrv.js | 4 ++-- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ui/app/scripts/directives/dashboard/counter.js b/ui/app/scripts/directives/dashboard/counter.js index 6997297622..7c0714581b 100644 --- a/ui/app/scripts/directives/dashboard/counter.js +++ b/ui/app/scripts/directives/dashboard/counter.js @@ -1,6 +1,6 @@ (function() { 'use strict'; - angular.module('theHiveDirectives').directive('dashboardCounter', function($http, $state, DashboardSrv, NotificationSrv, GlobalSearchSrv) { + angular.module('theHiveDirectives').directive('dashboardCounter', function($q, $http, $state, DashboardSrv, NotificationSrv, GlobalSearchSrv) { return { restrict: 'E', scope: { @@ -66,17 +66,19 @@ }; scope.openSearch = function(item) { - if(scope.mode === 'edit') { - return; - } + if(scope.mode === 'edit') { + return; + } - var filters = (scope.options.filters || []).concat(item.serie.filters || []); + var filters = (scope.options.filters || []).concat(item.serie.filters || []); + + $q.resolve(GlobalSearchSrv.saveSection(scope.options.entity, { + search: filters.length === 0 ? '*' : null, + filters: filters + })).then(function() { + $state.go('app.search'); + }); - GlobalSearchSrv.saveSection(scope.options.entity, { - search: filters.length === 0 ? '*' : null, - filters: filters - }); - $state.go('app.search'); }; if (scope.autoload === true) { diff --git a/ui/app/scripts/directives/dashboard/donut.js b/ui/app/scripts/directives/dashboard/donut.js index 078d657031..6b0e2f0d52 100644 --- a/ui/app/scripts/directives/dashboard/donut.js +++ b/ui/app/scripts/directives/dashboard/donut.js @@ -1,6 +1,6 @@ (function() { 'use strict'; - angular.module('theHiveDirectives').directive('dashboardDonut', function(StatSrv, $state, DashboardSrv, NotificationSrv, GlobalSearchSrv) { + angular.module('theHiveDirectives').directive('dashboardDonut', function($q, StatSrv, $state, DashboardSrv, NotificationSrv, GlobalSearchSrv) { return { restrict: 'E', scope: { @@ -93,11 +93,14 @@ value: GlobalSearchSrv.buildDefaultFilterValue(fieldDef, d) }; - GlobalSearchSrv.saveSection(scope.options.entity, { + var filters = (scope.options.filters || []).concat([data]); + + $q.resolve(GlobalSearchSrv.saveSection(scope.options.entity, { search: null, - filters: scope.options.filters.concat([data]) + filters: filters + })).then(function() { + $state.go('app.search'); }); - $state.go('app.search'); } }, donut: { diff --git a/ui/app/scripts/services/GlobalSearchSrv.js b/ui/app/scripts/services/GlobalSearchSrv.js index 994a48c993..3c93648c6b 100644 --- a/ui/app/scripts/services/GlobalSearchSrv.js +++ b/ui/app/scripts/services/GlobalSearchSrv.js @@ -18,7 +18,7 @@ var cfg = this.restore(); return cfg[entity] || {}; - } + }; this.restore = function() { return localStorageService.get('search-section') || { @@ -55,7 +55,7 @@ return { operator: 'any', list: [{text: value.id, label:value.name}] - } + }; } else { switch(fieldDef.type) { case 'number': From b5ca2f01405b4553f8d5b3178eefea161e34247b Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 Feb 2019 14:48:40 +0100 Subject: [PATCH 5/9] Update Changelog --- CHANGELOG.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9ab04631..f1f4ec8472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,18 @@ # Change Log -## [3.3.0-RC3](https://github.com/TheHive-Project/TheHive/tree/3.3.0-RC3) (2019-02-21) +## [3.3.0-RC4](https://github.com/TheHive-Project/TheHive/tree/3.3.0-RC4) (2019-02-22) +[Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.3.0-RC3...3.3.0-RC4) + +**Implemented enhancements:** + +- Use empty case modal when merging alerts and no templates are defined [\#893](https://github.com/TheHive-Project/TheHive/issues/893) +**Fixed bugs:** + +- Issue with navigation from dashboard clickable donuts to search page [\#894](https://github.com/TheHive-Project/TheHive/issues/894) +- Hide Empty Case Button Broken [\#890](https://github.com/TheHive-Project/TheHive/issues/890) + +## [3.3.0-RC3](https://github.com/TheHive-Project/TheHive/tree/3.3.0-RC3) (2019-02-21) [Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.3.0-RC2...3.3.0-RC3) **Implemented enhancements:** @@ -809,4 +820,4 @@ -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* From 70666ee614399c099b9e82b3ecff69b5df2532ef Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sat, 23 Feb 2019 23:31:36 +0100 Subject: [PATCH 6/9] #896 Fix the tags filter pre setting from dashboard clickable items --- ui/app/scripts/services/GlobalSearchSrv.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/scripts/services/GlobalSearchSrv.js b/ui/app/scripts/services/GlobalSearchSrv.js index 3c93648c6b..380f44b4ca 100644 --- a/ui/app/scripts/services/GlobalSearchSrv.js +++ b/ui/app/scripts/services/GlobalSearchSrv.js @@ -51,7 +51,7 @@ }; this.buildDefaultFilterValue = function(fieldDef, value) { - if(fieldDef.type === 'user' || fieldDef.values.length > 0) { + if(fieldDef.name === 'tags' || fieldDef.type === 'user' || fieldDef.values.length > 0) { return { operator: 'any', list: [{text: value.id, label:value.name}] From f6c504c05f14f0f4ed1acddc55b4e2929ee5fa40 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sat, 23 Feb 2019 23:45:13 +0100 Subject: [PATCH 7/9] #897 Add artifact description on mouse over in alert preview dialog --- ui/app/views/partials/alert/event.dialog.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/views/partials/alert/event.dialog.html b/ui/app/views/partials/alert/event.dialog.html index c59d144ac4..fb6ef5305f 100644 --- a/ui/app/views/partials/alert/event.dialog.html +++ b/ui/app/views/partials/alert/event.dialog.html @@ -87,19 +87,19 @@

- + {{attribute.dataType}} -
+
{{attribute.data | fang | ellipsis:250}}
-
+
{{attribute.attachment.name}} ({{attribute.attachment.size}} bytes)
-
+
{{attribute.remoteAttachment.filename}}
From 1b0a71f7583cf5d2d049fd834931c8cdd1595b69 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sat, 23 Feb 2019 23:55:27 +0100 Subject: [PATCH 8/9] #895 Exclude responder jobs from search page --- ui/app/scripts/controllers/SearchCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/scripts/controllers/SearchCtrl.js b/ui/app/scripts/controllers/SearchCtrl.js index 5d910d9970..76bd24bf58 100644 --- a/ui/app/scripts/controllers/SearchCtrl.js +++ b/ui/app/scripts/controllers/SearchCtrl.js @@ -25,7 +25,7 @@ _not: { '_in': { '_field': '_type', - '_values': ['dashboard', 'data', 'user', 'analyzer', 'caseTemplate'] + '_values': ['dashboard', 'data', 'user', 'analyzer', 'caseTemplate', 'reportTemplate', 'action'] } } } From 752cdbc2e57d4e7607976866a4b2bea185c987a3 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sat, 23 Feb 2019 23:59:55 +0100 Subject: [PATCH 9/9] Prepare 3.3.0-RC5 release --- CHANGELOG.md | 12 ++++++++++++ ui/bower.json | 2 +- ui/package.json | 2 +- version.sbt | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f4ec8472..840666dfb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [3.3.0-RC5](https://github.com/TheHive-Project/TheHive/tree/HEAD) (2019-02-24) +[Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.3.0-RC4...3.3.0-RC5) + +**Implemented enhancements:** + +- Mouseover text for alert preview [\#897](https://github.com/TheHive-Project/TheHive/issues/897) + +**Fixed bugs:** + +- dashboard clicks are not correctly translated to tag filters [\#896](https://github.com/TheHive-Project/TheHive/issues/896) +- Search results not visible [\#895](https://github.com/TheHive-Project/TheHive/issues/895) + ## [3.3.0-RC4](https://github.com/TheHive-Project/TheHive/tree/3.3.0-RC4) (2019-02-22) [Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.3.0-RC3...3.3.0-RC4) diff --git a/ui/bower.json b/ui/bower.json index cb03f183b9..6812f70221 100644 --- a/ui/bower.json +++ b/ui/bower.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "3.3.0-RC4", + "version": "3.3.0-RC5", "license": "AGPL-3.0", "dependencies": { "angular": "1.5.8", diff --git a/ui/package.json b/ui/package.json index ae3a2388f0..f76f7ac094 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "3.3.0-RC4", + "version": "3.3.0-RC5", "license": "AGPL-3.0", "repository": { "type": "git", diff --git a/version.sbt b/version.sbt index 48660d98a4..ff5dcf32d6 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "3.3.0-RC4" +version in ThisBuild := "3.3.0-RC5"