Skip to content

Commit

Permalink
#1611 Add tag autocomplete in case template form
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Nov 9, 2020
1 parent db7f789 commit 50c214d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

angular.module('theHiveComponents')
.component('orgCaseTemplateList', {
controller: function($uibModal, $scope, CaseTemplateSrv, UserSrv, AuthenticationSrv, NotificationSrv, UtilsSrv, ModalUtilsSrv) {
controller: function($uibModal, $scope, CaseTemplateSrv, TagSrv, UserSrv, AuthenticationSrv, NotificationSrv, UtilsSrv, ModalUtilsSrv) {
var self = this;

self.task = '';
Expand Down Expand Up @@ -327,6 +327,10 @@
}
});
};

self.getTags = function(query) {
return TagSrv.fromCases(query);
};
},
controllerAs: '$vm',
templateUrl: 'views/components/org/case-template/case-templates.html',
Expand Down
4 changes: 3 additions & 1 deletion frontend/app/views/components/org/case-template/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ <h4 class="vpad10 text-primary">Case basic information</h4>
<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="$vm.tags" placeholder="Tags" replace-spaces-with-dashes="false"></tags-input>
<tags-input min-length="2" name="tags" ng-model="$vm.tags" placeholder="Tags" replace-spaces-with-dashes="false">
<auto-complete min-length="3" debounce-delay="400" source="$vm.getTags($query)"></auto-complete>
</tags-input>
<p class="help-block small vpad5">These will be the default case tags</p>
</div>
</div>
Expand Down

0 comments on commit 50c214d

Please sign in to comment.