show in dashboard and overview all my assigned cards and on private boards all due cards
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
committed by
Julius Härtl
parent
aa244108c8
commit
3880b25705
@@ -109,17 +109,30 @@ class OverviewService {
|
|||||||
|
|
||||||
public function findAssignedCards(string $userId): array {
|
public function findAssignedCards(string $userId): array {
|
||||||
$userBoards = $this->findAllBoardsFromUser($userId);
|
$userBoards = $this->findAllBoardsFromUser($userId);
|
||||||
$allAssignedCards = [];
|
$findCards = [];
|
||||||
foreach ($userBoards as $userBoard) {
|
foreach ($userBoards as $userBoard) {
|
||||||
$service = $this;
|
$service = $this;
|
||||||
$allAssignedCards[] = array_map(static function ($card) use ($service, $userBoard, $userId) {
|
|
||||||
$service->enrich($card, $userId);
|
if (count($userBoard->getAcl()) == 0) {
|
||||||
$cardData = $card->jsonSerialize();
|
// get cards with due date
|
||||||
$cardData['boardId'] = $userBoard->getId();
|
$findCards[] = array_map(static function ($card) use ($service, $userBoard, $userId) {
|
||||||
return $cardData;
|
$service->enrich($card, $userId);
|
||||||
}, $this->cardMapper->findAssignedCards($userBoard->getId(), $userId));
|
$cardData = $card->jsonSerialize();
|
||||||
|
$cardData['boardId'] = $userBoard->getId();
|
||||||
|
return $cardData;
|
||||||
|
}, $this->cardMapper->findAllWithDue($userBoard->getId()));
|
||||||
|
} else {
|
||||||
|
// get assigned cards
|
||||||
|
$findCards[] = array_map(static function ($card) use ($service, $userBoard, $userId) {
|
||||||
|
$service->enrich($card, $userId);
|
||||||
|
$cardData = $card->jsonSerialize();
|
||||||
|
$cardData['boardId'] = $userBoard->getId();
|
||||||
|
return $cardData;
|
||||||
|
}, $this->cardMapper->findAssignedCards($userBoard->getId(), $userId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return $allAssignedCards;
|
return $findCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This is duplicate code with the board service
|
// FIXME: This is duplicate code with the board service
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
<AppNavigationVue :class="{'icon-loading': loading}">
|
<AppNavigationVue :class="{'icon-loading': loading}">
|
||||||
<template #list>
|
<template #list>
|
||||||
<AppNavigationItem
|
<AppNavigationItem
|
||||||
:title="t('deck', 'Assigned cards')"
|
:title="t('deck', 'Upcoming cards')"
|
||||||
icon="icon-group"
|
icon="icon-desktop"
|
||||||
to="/overview/assigned" />
|
to="/overview/assigned" />
|
||||||
<AppNavigationBoardCategory
|
<AppNavigationBoardCategory
|
||||||
id="deck-navigation-all"
|
id="deck-navigation-all"
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ export default {
|
|||||||
filterDisplayName() {
|
filterDisplayName() {
|
||||||
switch (this.filter) {
|
switch (this.filter) {
|
||||||
case FILTER_ASSIGNED:
|
case FILTER_ASSIGNED:
|
||||||
return t('deck', 'Assigned cards')
|
return t('deck', 'Upcoming cards')
|
||||||
default:
|
default:
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user