Berücksichtige lokale Datumswerte bei der Berechnung von Abwesenheiten und verbessere die Testabdeckung für Wochenansichten und Arbeitszeiten.
All checks were successful
Deploy production / deploy (push) Successful in 53s
All checks were successful
Deploy production / deploy (push) Successful in 53s
This commit is contained in:
@@ -103,8 +103,7 @@
|
||||
<div v-if="block.totalWorkTime" class="total-work-time">
|
||||
{{ block.totalWorkTime }}
|
||||
</div>
|
||||
<!-- Laufende Blöcke haben keine Gesamtarbeitszeit. Der Platzhalter hält
|
||||
die anschließenden Pausensummen auf Höhe der Pausenzeit. -->
|
||||
<!-- Platzhalter für ältere API-Antworten ohne laufende Dauer. -->
|
||||
<div v-else-if="block.pauseTimes && block.pauseTimes.length > 0" class="total-work-time" aria-hidden="true">
|
||||
|
||||
</div>
|
||||
@@ -204,6 +203,7 @@ const authStore = useAuthStore()
|
||||
const loading = ref(true)
|
||||
const weekData = ref(null)
|
||||
const weekOffset = ref(0)
|
||||
let refreshInterval = null
|
||||
|
||||
const weekDays = computed(() => {
|
||||
if (!weekData.value) return []
|
||||
@@ -237,9 +237,9 @@ const formatDate = (dateString) => {
|
||||
})
|
||||
}
|
||||
|
||||
const loadWeekData = async () => {
|
||||
const loadWeekData = async (background = false) => {
|
||||
try {
|
||||
loading.value = true
|
||||
if (!background) loading.value = true
|
||||
|
||||
const response = await fetch(`${API_URL}/week-overview?weekOffset=${weekOffset.value}`, {
|
||||
cache: 'no-store',
|
||||
@@ -381,12 +381,14 @@ const handleWorklogUpdate = () => {
|
||||
|
||||
onMounted(() => {
|
||||
loadWeekData()
|
||||
refreshInterval = setInterval(() => loadWeekData(true), 60000)
|
||||
|
||||
// Event-Listener für Worklog-Updates
|
||||
window.addEventListener('worklog-updated', handleWorklogUpdate)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (refreshInterval) clearInterval(refreshInterval)
|
||||
window.removeEventListener('worklog-updated', handleWorklogUpdate)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user