Skip to content

Commit

Permalink
#1281 Fix case template update operation
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 29, 2020
1 parent 89b5c12 commit 8781d45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
pap: 2,
tlp: 2
});
self.template.tasks = _.sortBy(self.template.tasks, 'order');
self.tags = UtilsSrv.objectify(self.template.tags, 'text');
self.templateCustomFields = getTemplateCustomFields(template.customFields);

Expand Down Expand Up @@ -154,7 +155,7 @@
var order = self.template.tasks ? self.template.tasks.length : 0;

self.openTaskDialog({
order: order
order: order
}, 'Add');
};

Expand Down Expand Up @@ -321,7 +322,7 @@
controllerAs: '$vm',
templateUrl: 'views/components/org/case-template/case-templates.html',
bindings: {
templates: '<',
templates: '=',
fields: '<',
onReload: '&',
onEdit: '&'
Expand Down
3 changes: 1 addition & 2 deletions frontend/app/views/components/org/case-template/tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ <h4 class="vpad10 text-primary">
<div class="empty-message" ng-if="!$vm.template.tasks || $vm.template.tasks.length === 0">
No tasks have been specified. <a href class="mr-xxxs" ng-click="$vm.addTask()">Add a task</a>
</div>

<div ng-if="$vm.template.tasks.length !== 0" ui-sortable="$vm.sortableOptions" ng-model="$vm.template.tasks">
<div class="task-item" ng-init="isCollapsed=true" ng-repeat="t in $vm.template.tasks | orderBy:'order'">
<div class="task-item" ng-init="isCollapsed=true" ng-repeat="t in $vm.template.tasks | orderBy:'order' track by $index">
<div class="panel-heading">
<span class="drag-handle text-primary clickable mr-xxs">
<i class="fa fa-bars"></i>
Expand Down

0 comments on commit 8781d45

Please sign in to comment.