From 67d0214b7f4c34d60d8fa526caec4a30f6e2d58c Mon Sep 17 00:00:00 2001 From: Felix Ruf Date: Tue, 10 Oct 2023 13:39:45 +0200 Subject: [PATCH] fixed coloring of disabled and empty days and removed individual days in disabled weeks --- src/Mealz/MealBundle/Controller/ApiController.php | 2 ++ src/Resources/src/api/getDashboardData.ts | 4 +++- src/Resources/src/components/dashboard/Day.vue | 12 ++++++------ src/Resources/src/components/dashboard/Week.vue | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Mealz/MealBundle/Controller/ApiController.php b/src/Mealz/MealBundle/Controller/ApiController.php index e7f26ff25..e76e626e2 100644 --- a/src/Mealz/MealBundle/Controller/ApiController.php +++ b/src/Mealz/MealBundle/Controller/ApiController.php @@ -80,6 +80,7 @@ public function getDashboardData(): JsonResponse 'startDate' => $week->getStartTime(), 'endDate' => $week->getEndTime(), 'days' => [], + 'isEnabled' => $week->isEnabled(), ]; /* @var Day $day */ foreach ($week->getDays() as $day) { @@ -100,6 +101,7 @@ public function getDashboardData(): JsonResponse 'slotsEnabled' => count($slots) > 0, 'slots' => [], 'meals' => [], + 'isEnabled' => $day->isEnabled(), ]; $this->addSlots($response[$week->getId()]['days'][$day->getId()]['slots'], $slots, $day, $activeParticipations); diff --git a/src/Resources/src/api/getDashboardData.ts b/src/Resources/src/api/getDashboardData.ts index 613fa85b6..4746851d5 100644 --- a/src/Resources/src/api/getDashboardData.ts +++ b/src/Resources/src/api/getDashboardData.ts @@ -43,12 +43,14 @@ export type Day = { meals: Dictionary, slots: Dictionary, slotsEnabled: boolean, + isEnabled: boolean } export type Week = { days: Dictionary, startDate: DateTime, - endDate: DateTime + endDate: DateTime, + isEnabled: boolean } export type Dashboard = { diff --git a/src/Resources/src/components/dashboard/Day.vue b/src/Resources/src/components/dashboard/Day.vue index 17b712c90..5a5bc895f 100644 --- a/src/Resources/src/components/dashboard/Day.vue +++ b/src/Resources/src/components/dashboard/Day.vue @@ -2,7 +2,7 @@
- {{ t('dashboard.no_service') }} + {{ t('dashboard.no_service') }}
diff --git a/src/Resources/src/components/dashboard/Week.vue b/src/Resources/src/components/dashboard/Week.vue index fc934c350..acd1670af 100644 --- a/src/Resources/src/components/dashboard/Week.vue +++ b/src/Resources/src/components/dashboard/Week.vue @@ -8,7 +8,7 @@