Skip to content

Commit

Permalink
#30 Add the ability to assign a case to a user different from the one…
Browse files Browse the repository at this point in the history
… who created the case
  • Loading branch information
nadouani committed Dec 30, 2016
1 parent d9ffad7 commit d553c24
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ui/app/scripts/controllers/MainPageCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';
angular.module('theHiveControllers').controller('MainPageCtrl',
function($rootScope, $scope, $window, $stateParams, $state, CaseTaskSrv, PSearchSrv, EntitySrv) {
function($rootScope, $scope, $window, $stateParams, $state, CaseTaskSrv, PSearchSrv, EntitySrv, UserInfoSrv) {

$scope.live = function() {
$window.open($state.href('live'), 'TheHiveLive',
Expand Down Expand Up @@ -66,6 +66,7 @@
// init values
$scope.showFlow = true;
$scope.openEntity = EntitySrv.open;
$scope.getUserInfo = UserInfoSrv;

$scope.openWTask = function(task) {
if (task.status === 'Waiting') {
Expand Down
9 changes: 8 additions & 1 deletion ui/app/views/partials/case/case.details.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ <h4 class="vpad10 text-primary">Basic information</h4>
</dd>
</dl>

<dl class="dl-horizontal">
<dt class="pull-left">Assigned to</dt>
<dd>
<updatable-user on-update="updateField('owner', newValue)" value="caze.owner"/>
</dd>
</dl>

<dl class="dl-horizontal clear">
<dt class="pull-left">Date</dt>
<dd>
Expand Down Expand Up @@ -134,7 +141,7 @@ <h4 class="vpad10 text-primary">
</ul>
</span>
</h4>

<div ng-if="hasNoMetrics(caze)">
<em>No metrics need to be set</em>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/views/partials/case/case.panelinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h4>
<div class="col-md-12">
<span class="ml-s">
<i class="glyphicon glyphicon-user"></i>
<span ng-bind="getUserInfo(caze.user) | getField: 'name'"></span>
Created by <span ng-bind="getUserInfo(caze.user) | getField: 'name'"></span>
</span>
<span class="ml-xxs">
<i class="glyphicon glyphicon-calendar"></i>
Expand Down
6 changes: 4 additions & 2 deletions ui/app/views/partials/index-closedcases.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<th style="width: 250px">Tags</th>
<th style="width: 150px">Tasks</th>
<th style="width: 100px">Observables</th>
<th style="width: 100px">Assigned To</th>
<th style="width: 160px">Closed Date</th>
</tr>
</thead>
Expand All @@ -13,9 +14,9 @@
<tr ng-repeat="closedCase in list.values">
<td>
<tlp value="closedCase.tlp"></tlp>
<a ui-sref="app.case.details({caseId: closedCase.id})">#{{closedCase.caseId}} - {{closedCase.title}}</a>
<a ui-sref="app.case.details({caseId: closedCase.id})">#{{closedCase.caseId}} - {{closedCase.title}}</a>
<div class="merge-hints text-danger" ng-if="closedCase.mergeInto">
<small>Merged into <a href ui-sref="app.case.details({caseId: closedCase.mergedInto})"> Case #{{closedCase.stats.mergeInto.caseId}}</a></small>
<small>Merged into <a href ui-sref="app.case.details({caseId: closedCase.mergedInto})"> Case #{{closedCase.stats.mergeInto.caseId}}</a></small>
</div>
</td>
<td>
Expand All @@ -35,6 +36,7 @@
<td>
<a ui-sref="app.case.observables({caseId: closedCase.id})">{{closedCase.stats.artifacts.count}}</a>
</td>
<td ng-bind="getUserInfo(currentCase.owner) | getField: 'name'"></td>
<td>{{closedCase.endDate | showDate}}</td>
</tr>
</tbody>
Expand Down
4 changes: 3 additions & 1 deletion ui/app/views/partials/index-currentcases.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<th style="width: 250px">Tags</th>
<th style="width: 150px">Tasks</th>
<th style="width: 100px">Observables</th>
<th style="width: 100px">Assigned To</th>
<th style="width: 160px">Date</th>
</tr>
</thead>
Expand All @@ -20,7 +21,7 @@
<small>
Merged from <a href ui-sref="app.case.details({caseId: currentCase.mergeFrom[0]})"> Case #{{currentCase.stats.mergeFrom[0].caseId}}</a> and
<a href ui-sref="app.case.details({caseId: currentCase.mergeFrom[1]})"> Case #{{currentCase.stats.mergeFrom[1].caseId}}</a>
</small>
</small>
</div>
</td>
<td>
Expand All @@ -40,6 +41,7 @@
<td>
<a ui-sref="app.case.observables({caseId: currentCase.id})">{{currentCase.stats.artifacts.count}}</a>
</td>
<td ng-bind="getUserInfo(currentCase.owner) | getField: 'name'"></td>
<td>{{currentCase.startDate | showDate}}</td>
</tr>
</tbody>
Expand Down

0 comments on commit d553c24

Please sign in to comment.