Merge branch 'develop' into feat/week-comments
# Conflicts: # src/State/WorkHourWeeklySummaryProvider.php # tests/State/WorkHourWeeklySummaryProviderTest.php
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
class="text-left leading-4 rounded-md px-2 py-1"
|
||||
:class="daily.hasAbsence ? 'text-white' : ''"
|
||||
:style="getDailyCellStyle(daily)"
|
||||
:title="daily.absenceLabel ?? ''"
|
||||
:title="cellTitle(daily)"
|
||||
>
|
||||
<div>J {{ formatMinutes(daily.dayMinutes) }}</div>
|
||||
<div>N {{ formatMinutes(daily.nightMinutes) }}</div>
|
||||
@@ -96,12 +96,27 @@
|
||||
import type { WeeklyWorkHourSummary } from '~/services/dto/work-hour'
|
||||
import { contractNatureLabel } from '~/utils/contract'
|
||||
|
||||
const HOLIDAY_BG_COLOR = '#b3e5fc'
|
||||
|
||||
const getDailyCellStyle = (daily: {
|
||||
hasAbsence?: boolean
|
||||
absenceColor?: string | null
|
||||
holidayLabel?: string | null
|
||||
}) => {
|
||||
if (!daily.hasAbsence) return undefined
|
||||
return { backgroundColor: daily.absenceColor || '#dc2626' }
|
||||
if (daily.hasAbsence) return { backgroundColor: daily.absenceColor || '#dc2626' }
|
||||
if (daily.holidayLabel) return { backgroundColor: HOLIDAY_BG_COLOR }
|
||||
return undefined
|
||||
}
|
||||
|
||||
const cellTitle = (daily: {
|
||||
hasAbsence?: boolean
|
||||
absenceLabel?: string | null
|
||||
holidayLabel?: string | null
|
||||
}) => {
|
||||
const parts: string[] = []
|
||||
if (daily.absenceLabel) parts.push(daily.absenceLabel)
|
||||
if (daily.holidayLabel) parts.push(`Férié : ${daily.holidayLabel}`)
|
||||
return parts.join(' — ')
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
|
||||
Reference in New Issue
Block a user