Card,Stack undo delete: CardServiceTest fix
Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Stack,Card undo delete: Test Fix 2 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Card, Stack undo delete: Test fix 3 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Card,Stack undo delete: Test fix 4 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Stack, Card undo delete: Relative time in deleted entity listings Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Card, Stack undo delete: Test Fix 5 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Test Fix 6 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> Test Fix 7 Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info> fix codacy Signed-off-by: Manuel Arno Korfmann <manu@korfmann.info>
This commit is contained in:
committed by
Julius Härtl
parent
41d30d4fd4
commit
5ddfb66633
@@ -68,6 +68,12 @@ class StackService {
|
||||
|
||||
private function enrichStackWithCards($stack) {
|
||||
$cards = $this->cardMapper->findAll($stack->id);
|
||||
|
||||
if(is_null($cards)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$labels = $this->labelMapper->liveOrMemoizedLabelsForBoardId($stack->getBoardId());
|
||||
foreach ($cards as $cardIndex => $card) {
|
||||
$assignedUsers = $this->assignedUsersMapper->find($card->getId());
|
||||
$card->setAssignedUsers($assignedUsers);
|
||||
@@ -76,11 +82,12 @@ class StackService {
|
||||
}
|
||||
$card->setAttachmentCount($this->attachmentService->count($card->getId()));
|
||||
}
|
||||
|
||||
$stack->setCards($cards);
|
||||
}
|
||||
|
||||
private function enrichStacksWithCards($stacks) {
|
||||
foreach ($stacks as $stackIndex => $stack) {
|
||||
foreach ($stacks as $stack) {
|
||||
$this->enrichStackWithCards($stack);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +95,6 @@ class StackService {
|
||||
public function findAll($boardId) {
|
||||
$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_READ);
|
||||
$stacks = $this->stackMapper->findAll($boardId);
|
||||
$labels = $this->labelMapper->getAssignedLabelsForBoard($boardId);
|
||||
$this->enrichStacksWithCards($stacks);
|
||||
return $stacks;
|
||||
}
|
||||
@@ -140,7 +146,7 @@ class StackService {
|
||||
$this->stackMapper->update($stack);
|
||||
|
||||
$this->enrichStackWithCards($stack);
|
||||
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user