-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#362 Allow assigning a default task owner on case templates
- Loading branch information
Showing
7 changed files
with
205 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
ui/app/views/partials/admin/case-template/custom-fields.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<h4 class="vpad10 text-primary"> | ||
Custom fields ({{keys(template.customFields).length}}) | ||
<span uib-dropdown class="pull-right"> | ||
<a href class="dropdown-toggle" uib-dropdown-toggle> | ||
<i class="fa fa-plus"></i> | ||
Add custom field | ||
<span class="caret"></span> | ||
</a> | ||
<ul class="dropdown-menu" uib-dropdown-menu> | ||
<li ng-repeat="(key, value) in fields"> | ||
<a ng-click="addCustomField(value)">{{value.name}}</a> | ||
</li> | ||
</ul> | ||
</span> | ||
</h4> | ||
|
||
<div ng-if="templateCustomFields.length !== 0" ng-init="isCollapsed=true" ui-sortable="sortableFields" ng-model="templateCustomFields"> | ||
<div class="panel panel-default" ng-repeat="m in templateCustomFields" ng-init="description=fields[m].description"> | ||
<div class="panel-heading"> | ||
<span class="drag-handle text-primary clickable mr-xxs"> | ||
<i class="fa fa-bars"></i> | ||
</span> | ||
<a href ng-click="isCollapsed=!isCollapsed"> | ||
<i class="fa" ng-class="{'fa-caret-down': isCollapsed, 'fa-caret-up': !isCollapsed}"></i> | ||
</a> | ||
<span class="hpad5">{{fields[m].name}}</span> | ||
<span class="pull-right"> | ||
<a class="text-danger" href ng-click="removeCustomField(m)"> | ||
<i class="fa fa-times"></i> Delete</a> | ||
</span> | ||
</div> | ||
<div class="panel-body" ng-hide="isCollapsed"> | ||
<p ng-show="description != ''">{{description}}</p> | ||
<p class="text-warning" ng-show="!description || description===''"> | ||
<em>No description specified</em> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="empty-message" ng-if="templateCustomFields.length === 0"> | ||
No custom fields have been added | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<h4 class="vpad10 text-primary">Case basic information</h4> | ||
<div class="form-group"> | ||
<label class="col-md-3 control-label">Template name | ||
<i class="fa fa-asterisk text-danger"></i> | ||
</label> | ||
<div class="col-md-9"> | ||
<input autocomplete="off" class="form-control" name="name" ng-model="template.name" placeholder="Template name" required type="text" /> | ||
<p class="help-block small">This name should be unique</p> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label class="col-md-3 control-label">Title prefix</label> | ||
<div class="col-md-9"> | ||
<input class="form-control" name="titlePrefix" ng-model="template.titlePrefix" placeholder="Case title prefix" type="text" /> | ||
<p class="help-block small">This is used to prefix the case name</p> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-md-3 control-label">Severity | ||
<i class="fa fa10asterisk text-danger"></i> | ||
</label> | ||
<div class="col-md-9"> | ||
<a class="clearfix" href ng-click="activeSev = true" ng-init="activeSev = false"> | ||
<!-- <severity value="caze.severity" active="activeSev" on-update="updateField('severity', newValue)"></severity> --> | ||
<severity active="activeSev" style="float:left; font-size:16px" value="template.severity"></severity> | ||
</a> | ||
<p class="help-block small vpad5">This will be the default case severity</p> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-md-3 control-label">TLP | ||
<i class="fa fa10asterisk text-danger"></i> | ||
</label> | ||
<div class="col-md-9"> | ||
<a class="clearfix" href ng-click="activeTlp = 'active'" ng-init="activeTlp = 'static'"> | ||
<tlp format="activeTlp" on-update="updateTlp(newValue)" style="float:left; font-size:16px" value="template.tlp"></tlp> | ||
</a> | ||
<p class="help-block small vpad5">This will be the default case TLP</p> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-md-3 control-label">Tags</label> | ||
<div class="col-md-9"> | ||
<tags-input min-length="2" name="tags" ng-model="tags" placeholder="Tags" replace-spaces-with-dashes="false"></tags-input> | ||
<p class="help-block small vpad5">These will be the default case tags</p> | ||
</div> | ||
</div> | ||
<div class="form-group" ng-class="{ 'has-error' : templateEditForm.description.$invalid && !templateEditForm.description.$pristine }"> | ||
<label class="col-md-3 control-label">Description | ||
<i class="fa fa-asterisk text-danger"></i> | ||
</label> | ||
<div class="col-md-9"> | ||
<textarea class="form-control" name="description" ng-model="template.description" placeholder="Case description" required rows="3"></textarea> | ||
<p class="help-block" ng-show="templateEditForm.description.$invalid && !templateEditForm.description.$pristine">The case description is required.</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<h4 class="vpad10 text-primary"> | ||
Metrics ({{template.metricNames.length || 0}}) | ||
|
||
<span uib-dropdown class="pull-right"> | ||
<a href class="dropdown-toggle" uib-dropdown-toggle> | ||
<i class="fa fa-plus"></i> | ||
Add metric | ||
<span class="caret"></span> | ||
</a> | ||
<ul class="dropdown-menu" uib-dropdown-menu> | ||
<li ng-repeat="(key, value) in metrics"> | ||
<a ng-click="addMetric(value)">{{value.title}}</a> | ||
</li> | ||
</ul> | ||
</span> | ||
</h4> | ||
|
||
<div ng-if="template.metricNames.length !== 0" ng-init="isCollapsed=true"> | ||
<div class="panel panel-default" ng-repeat="m in template.metricNames" ng-init="description=metrics[m].description"> | ||
<div class="panel-heading"> | ||
<a href ng-click="isCollapsed=!isCollapsed"> | ||
<i class="fa" ng-class="{'fa-caret-down': isCollapsed, 'fa-caret-up': !isCollapsed}"></i> | ||
</a> | ||
<span class="hpad5">{{metrics[m].title}}</span> | ||
<span class="pull-right"> | ||
<a class="text-danger" href ng-click="removeMetric(m)"> | ||
<i class="fa fa-times"></i> Delete</a> | ||
</span> | ||
</div> | ||
<div class="panel-body" ng-hide="isCollapsed"> | ||
<p ng-show="description != ''">{{description}}</p> | ||
<p class="text-warning" ng-show="!description || description===''"> | ||
<em>No description specified</em> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="empty-message" ng-if="!template.metricNames ||template.metricNames.length === 0"> | ||
No metrics have been added | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<h4 class="vpad10 text-primary"> | ||
Tasks ({{template.tasks.length || 0}}) | ||
<a class="pull-right" href ng-click="addTask()"> | ||
<i class="fa fa-plus"></i> | ||
Add task</a> | ||
</h4> | ||
<div ng-if="template.tasks.length !== 0" ui-sortable="sortableOptions" ng-model="template.tasks"> | ||
<div class="panel panel-default" ng-init="isCollapsed=true" ng-repeat="t in template.tasks"> | ||
<div class="panel-heading"> | ||
<span class="drag-handle text-primary clickable mr-xxs"> | ||
<i class="fa fa-bars"></i> | ||
</span> | ||
<span> | ||
<a href ng-click="isCollapsed=!isCollapsed"> | ||
<i class="fa" ng-class="{'fa-caret-down': isCollapsed, 'fa-caret-up': !isCollapsed}"></i> | ||
</a> | ||
</span> | ||
<span class="hpad5">{{t.title}}</span> | ||
<span class="mr-xxs" ng-if="t.owner">(Assigned to <em>{{getUserInfo.get(t.owner) | getField:'name'}}</em>)</span> | ||
|
||
<span class="pull-right"> | ||
<a class="text-default" href ng-click="editTask(t)"> | ||
<i class="fa fa-pencil"></i> Edit</a> | ||
<span class="hpad5"></span> | ||
<a class="text-danger" href ng-click="removeTask(t)"> | ||
<i class="fa fa-times"></i> Delete</a> | ||
</span> | ||
</div> | ||
<div class="panel-body" ng-hide="isCollapsed"> | ||
<p btf-markdown="t.description" ng-show="t.description != ''"></p> | ||
<p class="text-warning" ng-show="!t.description || t.description===''"> | ||
<em>No description specified</em> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="empty-message" ng-if="!template.tasks || template.tasks.length === 0"> | ||
No tasks have been specified | ||
</div> |
Oops, something went wrong.