Skip to content

Commit

Permalink
Merge pull request #355 from AOEpeople/bugfix/#260326-deactivated-men…
Browse files Browse the repository at this point in the history
…u-color

fixed coloring of disabled and empty days and removed individual days…
  • Loading branch information
hacksch authored Oct 11, 2023
2 parents 572aa50 + 6c2cd72 commit 062ee83
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ node_modules

/src/Resources/style/output.css
/**/*.d.ts
src/Resources/style/output.css.map
2 changes: 2 additions & 0 deletions src/Mealz/MealBundle/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/src/api/getDashboardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ export type Day = {
meals: Dictionary<Meal>,
slots: Dictionary<Slot>,
slotsEnabled: boolean,
isEnabled: boolean
}

export type Week = {
days: Dictionary<Day>,
startDate: DateTime,
endDate: DateTime
endDate: DateTime,
isEnabled: boolean
}

export type Dashboard = {
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/src/components/dashboard/Day.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="day-shadow mx-auto flex h-auto max-w-[414px] rounded bg-white sm:max-w-none">
<div
class="relative grid w-[24px] justify-center gap-2 rounded-l-[5px] py-[2px]"
:class="[day.isLocked ? 'bg-[#80909F]' : 'grid-rows-[minmax(0,1fr)_24px] bg-primary-2']"
:class="[day.isLocked || !day.isEnabled || emptyDay ? 'bg-[#80909F]' : 'bg-primary-2', !day.isLocked && !emptyDay && !guestData ? 'grid-rows-[minmax(0,1fr)_24px]' : '']"
>
<span
class="row-start-1 rotate-180 place-self-center text-center text-[11px] font-bold uppercase leading-4 tracking-[3px] text-white [writing-mode:vertical-lr]"
Expand All @@ -11,14 +11,14 @@
{{ weekday }}
</span>
<GuestButton
v-if="!day.isLocked && !emptyDay && !guestData"
v-if="!day.isLocked && !emptyDay && !guestData && day.isEnabled"
:dayID="dayID"
:index="index"
class="row-start-2 w-[24px] pl-[3px] text-center"
/>
</div>
<div
v-if="!emptyDay"
v-if="!emptyDay && day.isEnabled"
class="z-[1] flex min-w-[290px] flex-1 flex-col"
>
<div
Expand Down Expand Up @@ -57,10 +57,10 @@
</div>
</div>
<div
v-if="emptyDay"
class="z-[1] h-[134px] min-w-[290px]"
v-if="emptyDay || !day.isEnabled"
class="z-[1] grid h-full min-w-[290px] items-center"
>
<span class="description relative top-[53px] ml-[23px] text-primary-1">{{ t('dashboard.no_service') }}</span>
<span class="description relative ml-[23px] text-primary-1">{{ t('dashboard.no_service') }}</span>
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/components/dashboard/Week.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</p>
</div>
<div
v-if="Object.keys(days).length === 0"
v-if="Object.keys(days).length === 0 || !dashboardStore.getWeek(weekID).isEnabled"
class="mb-20 text-center text-[18px] tracking-[1.5px] text-[#acbdc7]"
>
<img
Expand Down

0 comments on commit 062ee83

Please sign in to comment.