From 757013bd8e6f16fe6552ee6eaf0b935805727b89 Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Tue, 9 Sep 2025 09:02:45 -0400 Subject: [PATCH] feat(i18n): fixed some translation variables --- ...sheet-approval-employee-expenses-chart.vue | 4 ++-- .../timesheet-approval-employee-details.vue | 12 +++++----- .../pages/timesheet-approval.vue | 2 +- .../timesheet/timesheet-shift-form.vue | 24 +++++++++++++------ .../types/timesheet-details-interface.ts | 2 +- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/modules/timesheet-approval/components/graphs/timesheet-approval-employee-expenses-chart.vue b/src/modules/timesheet-approval/components/graphs/timesheet-approval-employee-expenses-chart.vue index 9382ccd..7d78a9c 100644 --- a/src/modules/timesheet-approval/components/graphs/timesheet-approval-employee-expenses-chart.vue +++ b/src/modules/timesheet-approval/components/graphs/timesheet-approval-employee-expenses-chart.vue @@ -32,12 +32,12 @@ expenses_dataset.value = [ { - label: t('timeSheet.refund'), + label: t('timesheet.refund'), data: all_costs, backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-primary').trim(), }, { - label: t('timeSheet.mileage'), + label: t('timesheet.mileage'), data: all_mileage, backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-info').trim(), } diff --git a/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue b/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue index 048b5a7..94c8f5c 100644 --- a/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue +++ b/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue @@ -40,16 +40,16 @@ import { colors } from 'quasar'; const shift_type_legend: shiftColor[] = [ { - type: t('timeSheet.shiftRegular'), + type: t('timesheet.shift_types.REGULAR'), color: 'secondary', text_color: 'grey-8', }, { - type: t('timeSheet.shiftEvening'), + type: t('timesheet.shift_types.EVENING'), color: 'warning', }, { - type: t('timeSheet.shiftEmergency'), + type: t('timesheet.shift_types.EMERGENCY'), color: 'amber-10', }, { @@ -57,15 +57,15 @@ import { colors } from 'quasar'; color: 'negative', }, { - type: t('timeSheet.shiftVacation'), + type: t('timesheet.shift_types.VACATION'), color: 'purple-10', }, { - type: t('timeSheet.shiftHoliday'), + type: t('timesheet.shift_types.HOLIDAY'), color: 'purple-8', }, { - type: t('timeSheet.shiftSick'), + type: t('timesheet.shift_types.SICK'), color: 'grey-8', }, ] diff --git a/src/modules/timesheet-approval/pages/timesheet-approval.vue b/src/modules/timesheet-approval/pages/timesheet-approval.vue index c924c24..a9fa76a 100644 --- a/src/modules/timesheet-approval/pages/timesheet-approval.vue +++ b/src/modules/timesheet-approval/pages/timesheet-approval.vue @@ -48,7 +48,7 @@ class="text-grey-8 text-uppercase q-mx-md" :class="$q.screen.lt.md ? 'text-weight-medium text-caption' : 'text-weight-bold'" > - {{ $t('timeSheet.dateRangesTo') }} + {{ $t('timesheet.dateRangesTo') }}
{ return SHIFT_KEY.map(key => ({ value: key, label: t(`timesheet.shift_types.${key}`)})) }); -const empty_row = { type: '', start_time: '', end_time: '', comment: '', is_approved: false, is_remote: false }; +const empty_row = { date:'', type: '', start_time: '', end_time: '', comment: '', is_approved: false, is_remote: false }; //Week dates const week_dates = computed(() => { const start_date = timesheet_store.current_timesheet.start_day; @@ -53,6 +53,7 @@ const rows = ref( const date_ISO = week_dates.value[index]; const shift = timesheet_store.current_timesheet.shifts.find(sh => sh.date === date_ISO); return shift ? { + date:shift.date || '', type: shift.bank_type || '', start_time: shift.start_time || '', end_time: shift.end_time || '', @@ -88,6 +89,7 @@ const clearRow = (index: number) => { const emit = defineEmits<{ (e: 'save', payload: CreateShiftPayload[]): void }>(); +//onMounted? watch( () => [timesheet_store.current_timesheet.start_day, timesheet_store.current_timesheet.shifts], () => { @@ -95,14 +97,16 @@ watch( rows.value = days.value.map((_, idx)=> { const shift = timesheet_store.current_timesheet.shifts.find(sh => sh.date === dates[idx]); return shift - ? { type: shift.bank_type || '', + ? { date: shift.date || '', + type: shift.bank_type || '', start_time: shift.start_time || '', end_time: shift.end_time || '', comment: shift.description || '', is_approved: shift.is_approved, is_remote: shift.is_remote, } - : { type: '', + : { date: '', + type: '', start_time: '', end_time: '', comment: '', @@ -132,10 +136,16 @@ watch( /> - + -
- +
+ {{ days[index] }}