Skip to content

Commit

Permalink
Merge branch 'NewCaseStatus' into add_critical_severity
Browse files Browse the repository at this point in the history
  • Loading branch information
zpriddy authored Mar 15, 2019
2 parents 5209a78 + 9096e02 commit d0005f5
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 5 deletions.
2 changes: 1 addition & 1 deletion thehive-backend/app/models/Case.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.elastic4play.services.{ FindSrv, SequenceSrv }

object CaseStatus extends Enumeration with HiveEnumeration {
type Type = Value
val Open, Resolved, Deleted = Value
val Open, Resolved, Pending, Hold, Review, Deleted = Value
}

object CaseResolutionStatus extends Enumeration with HiveEnumeration {
Expand Down
5 changes: 4 additions & 1 deletion ui/app/scripts/controllers/case/CaseListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
this.getStatuses = function() {
return $q.resolve([
{text: 'Open'},
{text: 'Resolved'}
{text: 'Resolved'},
{text: 'Hold'},
{text: 'Review'},
{text: 'Pending'}
]);
};

Expand Down
28 changes: 28 additions & 0 deletions ui/app/scripts/controllers/case/CaseMainCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,34 @@
}
};

$scope.caseHold = function() {
$scope.updateField('status', 'Hold')
.then(function() {
NotificationSrv.log('The case #' + $scope.caze.caseId + ' has been set to Hold', 'success');
});
}

$scope.caseReview = function() {
$scope.updateField('status', 'Review')
.then(function() {
NotificationSrv.log('The case #' + $scope.caze.caseId + ' has been set to Review', 'success');
});
}

$scope.casePending = function() {
$scope.updateField('status', 'Pending')
.then(function() {
NotificationSrv.log('The case #' + $scope.caze.caseId + ' has been set to Pending', 'success');
});
}

$scope.caseOpenFromOtherStatus = function() {
$scope.updateField('status', 'Open')
.then(function() {
NotificationSrv.log('The case #' + $scope.caze.caseId + ' has been set to Pending', 'success');
});
}

// update a specific case field
$scope.updateField = function(fieldName, newValue) {
var data = {};
Expand Down
5 changes: 3 additions & 2 deletions ui/app/views/directives/severity.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<span class="label" ng-class="{ true:'label-success', false:'label-default' }[value == 1]" ng-click="update(1)">L</span>
<span class="label" ng-class="{ true:'label-info', false:'label-default' }[value == 2 || !value]" ng-click="update(2)">M</span>
<span class="label" ng-class="{ true:'label-warning', false:'label-default' }[value == 3]" ng-click="update(3)">H</span>
<span class="label" ng-class="{ true:'label-danger', false:'label-default' }[value == 4]" ng-click="update(4)">!!</span>
<span class="label" ng-class="{ true:'label-danger', false:'label-default' }[value == 4]" ng-click="update(4)">!!</span>

</div>
<span ng-if="active != true" ng-switch="value">
<span ng-switch-when="1" class="label label-success">L</span>
<span ng-switch-when="2" class="label label-info">M</span>
<span ng-switch-when="3" class="label label-warning">H</span>
<span ng-switch-when="4" class="label label-danger">!!</span>
<span ng-switch-when="4" class="label label-danger">!!</span>
<span ng-switch-default class="label label-primary">?</span>
</span>
7 changes: 6 additions & 1 deletion ui/app/views/partials/case/case.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,16 @@ <h3 class="box-title">List of cases ({{$vm.list.total || 0}} of {{$vm.caseStats.

</span>
</div>
<div class="text-success" ng-show="currentCase.status !== 'Open'">
<div class="text-success" ng-show="currentCase.status === 'Resolved'">
<small>
(Closed at {{currentCase.endDate | showDate}} as <strong>{{$vm.CaseResolutionStatus[currentCase.resolutionStatus]}}</strong>)
</small>
</div>
<div class="text-success" ng-show="currentCase.status !== 'Open' && currentCase.status !== 'Resolved' ">
<small>
(Status: <strong>{{currentCase.status}}</strong>)
</small>
</div>
<div class="text-danger" ng-if="currentCase.mergeFrom">
<small>
Merged from <a href ui-sref="app.case.details({caseId: currentCase.mergeFrom[0]})"> Case #{{currentCase.stats.mergeFrom[0].caseId}}</a> and
Expand Down
50 changes: 50 additions & 0 deletions ui/app/views/partials/case/case.panelinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ <h3 class="box-title">
<strong>{{CaseResolutionStatus[caze.resolutionStatus]}}</strong>
<span ng-show="isCaseTruePositive()"> with <strong>{{caze.impactStatus === 'NoImpact' ? 'No Impact' : 'Impact'}}</strong></span>)</span>
</span>
<span ng-show="caze.status !== 'Resolved'" class="text-success">(
<span> Status <strong>{{caze.status}}</strong></span>)</span>
</span>
<span class="ml-xxs text-danger" ng-show="links.length > 0">
<i class="glyphicon glyphicon-link"></i>
<strong>
Expand Down Expand Up @@ -93,6 +96,10 @@ <h3 class="box-title">
</a>
</span>

<span class="ml-xxs pull-right">
<span class="text-primary">|</span>
</span>

<span class="ml-xxs pull-right" ng-if="!caze.flag || caze.flag == undefined">
<a href ng-click="switchFlag()" class="text-muted noline" uib-tooltip="Flag case">
<i class="text-muted fa fa-flag" ng-class="setFlag" ng-mouseout="setFlag='text-muted'" ng-mouseover="setFlag='text-yellow'"></i>
Expand All @@ -105,6 +112,49 @@ <h3 class="box-title">
Unflag
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status !== 'Hold'">
<a href ng-click="caseHold()" class="text-muted noline" uib-tooltip="Set case status to Hold">
<i class="text-muted fa fa-pause" ng-class="SetHold" ng-mouseout="SetHold='text-muted'" ng-mouseover="SetHold='text-red'"></i>
Hold
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status === 'Hold'">
<a href ng-click="caseOpenFromOtherStatus()" class="text-red noline" uib-tooltip="Reopen Case">
<i class="text-red fa fa-pause"></i>
Hold
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status !== 'Pending'">
<a href ng-click="casePending()" class="text-muted noline" uib-tooltip="Set case status to Pending">
<i class="text-muted fa fa-exclamation-circle" ng-class="SetPending" ng-mouseout="SetPending='text-muted'" ng-mouseover="SetPending='text-red'"></i>
Pending
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status === 'Pending'">
<a href ng-click="caseOpenFromOtherStatus()" class="text-red noline" uib-tooltip="Reopen Case">
<i class="text-red fa fa-exclamation-circle"></i>
Pending
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status !== 'Review'">
<a href ng-click="caseReview()" class="text-muted noline" uib-tooltip="Set case status to Review">
<i class="text-muted fa fa-user-circle" ng-class="SetReview" ng-mouseout="SetReview='text-muted'" ng-mouseover="SetReview='text-red'"></i>
Review
</a>
</span>

<span class="ml-xxs pull-right" ng-if="caze.status === 'Review'">
<a href ng-click="caseOpenFromOtherStatus()" class="text-red noline" uib-tooltip="Reopen Case">
<i class="text-red fa fa-user-circle"></i>
Review
</a>
</span>

<span class="ml-xxs pull-right" ng-hide="isCaseClosed()">
<a href ng-click="openCloseDialog()" class="text-muted noline" uib-tooltip="Close case">
<i class="text-muted fa fa-check-circle-o" ng-class="CloseCase" ng-mouseout="CloseCase='text-muted glyphicon-ok-circle'" ng-mouseover="CloseCase='text-success glyphicon-ok-sign'"></i>
Expand Down

0 comments on commit d0005f5

Please sign in to comment.