Add attachment indicator

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-06-12 17:14:54 +02:00
parent ee5a54a575
commit 0137b882c5
7 changed files with 64 additions and 12 deletions

View File

@@ -353,4 +353,11 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
};
};
$scope.attachmentCount = function(attachments) {
if (Array.isArray(attachments)) {
return attachments.filter((obj) => obj.deletedAt === 0).length;
}
return attachments;
};
});

View File

@@ -137,7 +137,7 @@ app.factory('CardService', function (ApiService, $http, $q) {
var deferred = $q.defer();
var self = this;
$http.delete(this.baseUrl + '/' + this.getCurrent().id + '/attachment/' + attachment.id, {}).then(function (response) {
if (response.data.de#letedAt > 0) {
if (response.data.deletedAt > 0) {
let currentAttachment = self.getCurrent().attachments.find(function (obj) {
if (obj.id === attachment.id) {
obj.deletedAt = response.data.deletedAt;