show deleted cards in sidebar tab (styling still wip)

Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info>

card undo delete done, styling still wip

Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info>

fix Codacy findings

Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info>
This commit is contained in:
Manuel Arno Korfmann
2018-07-11 22:13:31 +02:00
committed by Julius Härtl
parent 2ef4b55af4
commit f2795f120b
9 changed files with 65 additions and 29 deletions

View File

@@ -144,7 +144,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
}, function (error) {
$scope.statusservice.setError('Error occured', error);
});
}
};
$scope.loadDefault = function () {
StackService.fetchAll($scope.id).then(function (data) {
@@ -203,10 +203,25 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
}
CardService.delete(card.id).then(function () {
StackService.removeCard(card);
$scope.loadDeletedCards();
$scope.deletedCards.push(card);
});
});
};
$scope.cardUndoDelete = function (deletedCard) {
CardService.undoDelete(deletedCard);
StackService.addCard(deletedCard);
$scope.removeFromDeletedCards(deletedCard);
};
$scope.removeFromDeletedCards = function(deletedCard) {
for(var i=0;i<$scope.deletedCards.length;i++) {
if($scope.deletedCards[i].id === deletedCard.id) {
$scope.deletedCards.splice(i, 1);
}
}
};
$scope.cardArchive = function (card) {
CardService.archive(card);
StackService.removeCard(card);
@@ -247,6 +262,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
// TODO: remove from cards
};
$scope.labelCreate = function (label) {
alert(label);
label.boardId = $scope.id;
LabelService.create(label).then(function (data) {
$scope.newStack.title = '';