From 75691604d39c563613eae32255246c4d41d007d4 Mon Sep 17 00:00:00 2001 From: Zach Priddy Date: Tue, 12 Feb 2019 20:58:38 -0800 Subject: [PATCH 1/4] add mycases --- ui/app/scripts/controllers/MainPageCtrl.js | 18 ++++++++++ ui/app/views/app.main.html | 5 +++ ui/app/views/partials/index-mycases.html | 42 ++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 ui/app/views/partials/index-mycases.html diff --git a/ui/app/scripts/controllers/MainPageCtrl.js b/ui/app/scripts/controllers/MainPageCtrl.js index 0fcfd4b6bf..551f4a431a 100644 --- a/ui/app/scripts/controllers/MainPageCtrl.js +++ b/ui/app/scripts/controllers/MainPageCtrl.js @@ -38,6 +38,24 @@ sort: '-startDate', nparent: 1 }); + } else if ($stateParams.viewId === 'mycases') { + $rootScope.title = 'My cases'; + $scope.view.data = 'mycases'; + $scope.list = PSearchSrv(undefined, 'case', { + scope: $scope, + baseFilter: { + '_and': [{ + '_in': { + '_field': 'status', + '_values': ['Open'] + } + }, { + 'owner': $scope.currentUser.id + }] + }, + sort: ['-flag', '-startDate'], + nparent: 1 + }); } // init values diff --git a/ui/app/views/app.main.html b/ui/app/views/app.main.html index bc7caba6c0..e90f7c469b 100644 --- a/ui/app/views/app.main.html +++ b/ui/app/views/app.main.html @@ -2,6 +2,7 @@
+

My Cases ({{list.total}})

My tasks ({{list.total}})

Waiting tasks ({{list.total}})

@@ -31,6 +32,10 @@

Waiting tasks ({{list.

+
+
+
+
diff --git a/ui/app/views/partials/index-mycases.html b/ui/app/views/partials/index-mycases.html new file mode 100644 index 0000000000..23916551ff --- /dev/null +++ b/ui/app/views/partials/index-mycases.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + +
SeverityGroupCaseDate
+ + {{value.group}} +
+ + +
+
+ Started +
+
+ +
+
+ {{value.startDate | showDate}} +
+ + From d11a0b3627fb10ad79664bdde77dac0009db33da Mon Sep 17 00:00:00 2001 From: Zach Priddy Date: Tue, 12 Feb 2019 21:02:06 -0800 Subject: [PATCH 2/4] Add myCases Ctrl --- ui/app/scripts/controllers/RootCtrl.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/app/scripts/controllers/RootCtrl.js b/ui/app/scripts/controllers/RootCtrl.js index b6b0b35a67..0944cf30ce 100644 --- a/ui/app/scripts/controllers/RootCtrl.js +++ b/ui/app/scripts/controllers/RootCtrl.js @@ -73,6 +73,27 @@ angular.module('theHiveControllers').controller('RootCtrl', field: 'status' }); + $scope.myCases = StreamStatSrv({ + scope: $scope, + rootId: 'any', + query: { + '_and': [ + { + '_in': { + '_field': 'status', + '_values': ['Open'] + } + }, + { + 'owner': $scope.currentUser.id + } + ] + }, + result: {}, + objectType: 'case', + field: 'status' + }); + $scope.waitingTasks = StreamStatSrv({ scope: $scope, rootId: 'any', From 866cda6d91b15f1ed2f198f7b3c6c1d6b1170ff4 Mon Sep 17 00:00:00 2001 From: Zach Priddy Date: Tue, 12 Feb 2019 21:10:29 -0800 Subject: [PATCH 3/4] Update --- ui/app/views/components/header.component.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/app/views/components/header.component.html b/ui/app/views/components/header.component.html index 6725f1f845..1044dd0312 100644 --- a/ui/app/views/components/header.component.html +++ b/ui/app/views/components/header.component.html @@ -43,6 +43,11 @@ --> +
  • + My cases + {{myCases.count}} + +
  • My tasks {{myCurrentTasks.count}} From 0990061b6f619af4ff2995d3121d8f6b228d3015 Mon Sep 17 00:00:00 2001 From: Zach Priddy Date: Tue, 12 Feb 2019 21:18:39 -0800 Subject: [PATCH 4/4] Update mycases --- ui/app/views/partials/index-mycases.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/app/views/partials/index-mycases.html b/ui/app/views/partials/index-mycases.html index 23916551ff..ddf0976b94 100644 --- a/ui/app/views/partials/index-mycases.html +++ b/ui/app/views/partials/index-mycases.html @@ -4,7 +4,6 @@ Severity - Group Case Date @@ -16,16 +15,15 @@ ng-class="{'warning': (value.flag == true)}" ng-click="openEntity(value)"> - + - {{value.group}}
    - Started + Opened