From e72173894c3e1c8da71954b1a2ca4c1152d8a393 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Sun, 3 May 2020 16:08:54 +0200 Subject: [PATCH] #1257 Display case age in case list and details page. --- frontend/app/index.html | 1 + .../app/scripts/directives/case-duration.js | 15 +++++++++ .../app/views/directives/case-duration.html | 8 +++++ frontend/app/views/partials/alert/list.html | 6 ++-- .../app/views/partials/case/case.links.html | 3 +- .../app/views/partials/case/case.list.html | 3 +- .../views/partials/case/case.panelinfo.html | 31 ++++++++++++------- 7 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 frontend/app/scripts/directives/case-duration.js create mode 100644 frontend/app/views/directives/case-duration.html diff --git a/frontend/app/index.html b/frontend/app/index.html index 2020ac526b..f6b081c997 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -192,6 +192,7 @@ + diff --git a/frontend/app/scripts/directives/case-duration.js b/frontend/app/scripts/directives/case-duration.js new file mode 100644 index 0000000000..c20adc4e82 --- /dev/null +++ b/frontend/app/scripts/directives/case-duration.js @@ -0,0 +1,15 @@ +(function() { + 'use strict'; + angular.module('theHiveDirectives').directive('caseDuration', function() { + return { + restrict: 'E', + scope: { + start: '=', + end: '=', + icon: '@', + indicator: '=' + }, + templateUrl: 'views/directives/case-duration.html' + }; + }); +})(); diff --git a/frontend/app/views/directives/case-duration.html b/frontend/app/views/directives/case-duration.html new file mode 100644 index 0000000000..940c83691a --- /dev/null +++ b/frontend/app/views/directives/case-duration.html @@ -0,0 +1,8 @@ + + + {{indicator ? 'During ' : ''}}{{start | duration:end}} + + + {{start | duration}} {{indicator ? 'ago' : ''}} + + diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index bc976639dc..539a0d2b75 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -17,7 +17,7 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c
+ on-clear-all="$vm.clearFilters()">
@@ -142,7 +142,9 @@

List of alerts ({{$vm.list.total || 0}} of {{alertEvents.c {{::event.artifacts.length || 0}} - {{event.date | showDate}} + + {{event.date | shortDate}} +
- {{item.startDate | shortDate}} + {{item.startDate | shortDate}}
+
- {{currentCase.startDate | duration:currentCase.endDate}} - {{currentCase.startDate | duration}} +
diff --git a/frontend/app/views/partials/case/case.panelinfo.html b/frontend/app/views/partials/case/case.panelinfo.html index cef7d788cf..a4720d4702 100644 --- a/frontend/app/views/partials/case/case.panelinfo.html +++ b/frontend/app/views/partials/case/case.panelinfo.html @@ -23,20 +23,26 @@

- + - Created by + - - - {{caze.createdAt | showDate}} - (Closed at - {{caze.endDate | shortDate}} - as - {{CaseResolutionStatus[caze.resolutionStatus]}} - with {{caze.impactStatus === 'NoImpact' ? 'No Impact' : 'Impact'}}) + + + + {{caze.createdAt | shortDate}} + + + + + {{caze.endDate | shortDate}} as + {{CaseResolutionStatus[caze.resolutionStatus]}} + with {{caze.impactStatus === 'NoImpact' ? 'No Impact' : 'Impact'}} - + + + + @@ -44,7 +50,8 @@

- + +