Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

426 - assign tasks to users from tasks tab #628

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ui/app/scripts/controllers/case/CaseTasksCtrl.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@
});
};

$scope.updateField = function (fieldName, newValue, task) {
var field = {};
field[fieldName] = newValue;
return CaseTaskSrv.update({
taskId: task.id
}, field, function () {}, function (response) {
NotificationSrv.error('taskList', response.data, response.status);
});
};

$scope.addTask = function() {
CaseTaskSrv.save({
'caseId': $scope.caseId,
Expand Down
5 changes: 5 additions & 0 deletions ui/app/scripts/services/UserInfoSrv.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
this.get = function(userId) {
if (angular.isDefined(this.userCache[userId])) {
return this.userCache[userId];
} else if (userId === undefined) {
return {
'name': 'Not assigned',
'id': 'notassigned'
};
} else {
this.userCache[userId] = UserSrv.getInfo(userId);
return this.userCache[userId];
Expand Down
6 changes: 4 additions & 2 deletions ui/app/views/partials/case/case.tasks.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
<td>{{task.startDate | showDate}}</td>
<td>
<span ng-show="task.owner">
<user user-id="task.owner"></user>
<updatable-user on-update="updateField('owner', newValue, task)" value="task.owner"/>
</span>
<span ng-show="!task.owner">
<updatable-user on-update="updateField('owner', newValue, task)" value="notassigned"/>
</span>
<em ng-show="!task.owner">Not assigned</em>
</td>
<!-- class="task-delete" -->
<td align="right" class="task-actions">
Expand Down