From fbf81146664eb80a7402d59628c2f7850784f896 Mon Sep 17 00:00:00 2001 From: Nicolas Drolet Date: Fri, 5 Sep 2025 17:08:43 -0400 Subject: [PATCH] feat(details): add ui elements to shift rows in employee details --- src/i18n/en-ca/index.ts | 14 +-- src/i18n/fr-ca/index.ts | 12 +- ...val-employee-details-shifts-row-header.vue | 58 +++++++++ ...t-approval-employee-details-shifts-row.vue | 116 +++++++++++++++--- ...sheet-approval-employee-details-shifts.vue | 96 ++++++--------- ...t-approval-employee-overview-list-item.vue | 2 +- ...esheet-approval-employee-overview-list.vue | 13 +- .../timesheet-approval-employee-details.vue | 13 +- .../types/timesheet-shift-interface.ts | 8 ++ ...d-calculator.ts => date-and-time-utils.ts} | 2 +- 10 files changed, 231 insertions(+), 103 deletions(-) create mode 100644 src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row-header.vue rename src/utils/{pay-period-calculator.ts => date-and-time-utils.ts} (96%) diff --git a/src/i18n/en-ca/index.ts b/src/i18n/en-ca/index.ts index beebf76..eaf461a 100644 --- a/src/i18n/en-ca/index.ts +++ b/src/i18n/en-ca/index.ts @@ -342,13 +342,13 @@ export default { reportFilterVacation: 'Vacation', }, shiftColumns: { - title: 'Shifts', - column_1: 'Type', - column_2: 'Start time', - column_3: 'End time', - column_4: 'Comment', - column_5: 'Status', - column_6: 'Supervisor’s report', + title: 'shifts', + labelType: 'type', + labelIn: 'start', + labelOut: 'end', + labelComment: 'comment', + labelState: 'state', + labelSupervisorReport: 'supervisor report', }, expenseColumns: { title: 'Expenses', diff --git a/src/i18n/fr-ca/index.ts b/src/i18n/fr-ca/index.ts index 8e4aeba..873ab03 100644 --- a/src/i18n/fr-ca/index.ts +++ b/src/i18n/fr-ca/index.ts @@ -236,12 +236,12 @@ export default { }, shiftColumns: { title: 'Quarts de travail', - column_1: 'Type', - column_2: 'Entrée', - column_3: 'Sortie', - column_4: 'Commentaire', - column_5: 'État', - column_6: 'Rapport du superviseur', + labelType: 'type', + labelIn: 'entrée', + labelOut: 'sortie', + labelComment: 'commentaire', + labelState: 'état', + labelSupervisorReport: 'rapport du superviseur', }, shiftsTemplate: { tabTitle1: 'Quarts de travail', diff --git a/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row-header.vue b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row-header.vue new file mode 100644 index 0000000..4cb2735 --- /dev/null +++ b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row-header.vue @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row.vue b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row.vue index 7e1a586..741360f 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts-row.vue @@ -1,28 +1,112 @@ \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts.vue b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts.vue index c8fa840..24432cc 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-employee-details-shifts.vue @@ -1,77 +1,57 @@ \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list-item.vue b/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list-item.vue index 94a9f62..4952663 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list-item.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list-item.vue @@ -60,7 +60,7 @@ {{$t(button.label)}} diff --git a/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list.vue b/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list.vue index 55424b0..d7626a9 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-employee-overview-list.vue @@ -2,24 +2,19 @@ /* eslint-disable */ import { computed, onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; - import { useTimesheetStore } from 'src/stores/timesheet-store'; import { useTimesheetApprovalApi } from '../composables/use-timesheet-approval-api'; - import TimesheetApprovalPeriodPicker from '../components/timesheet-approval-period-picker.vue'; import TimesheetApprovalEmployeeOverviewListItem from './timesheet-approval-employee-overview-list-item.vue'; import TimesheetApprovalEmployeeDetails from 'src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue'; - import { date, type QTableColumn } from 'quasar'; import type { PayPeriodOverviewEmployee } from '../types/timesheet-approval-pay-period-overview-employee-interface'; const { t } = useI18n(); const timesheet_store = useTimesheetStore(); const timesheet_approval_api = useTimesheetApprovalApi(); - const FORWARD = 1 const BACKWARD = -1 - const filter = ref(''); const original_approvals = ref>({}); const is_showing_details = ref(false); @@ -28,7 +23,6 @@ const clicked_employee_name = ref(''); const clicked_employee_email = ref(''); const update_key = ref(0); - const columns = computed((): QTableColumn[] => [ { name: 'employee_name', @@ -76,25 +70,21 @@ sortable: true } ]); - const has_changes = computed(() => { return timesheet_store.pay_period_overview_employees.some(emp => { return emp.is_approved !== original_approvals.value[emp.email]; }); }); - const is_not_enough_filters = computed(() => { return report_filter_company.value.filter(val => val === true).length < 1 || report_filter_type.value.filter(val => val === true).length < 1; }) - const filter_types_labels = [ t('timeSheetValidations.reportFilterShifts'), t('timeSheetValidations.reportFilterExpenses'), t('timeSheetValidations.reportFilterHoliday'), t('timeSheetValidations.reportFilterVacation'), ] - const is_calendar_limit = computed( () => { return timesheet_store.current_pay_period.pay_year === 2024 && timesheet_store.current_pay_period.pay_period_no <= 1; @@ -150,7 +140,7 @@ transition-show="jump-down" transition-hide="jump-down" @before-show="() => update_key += 1" - :full-width="$q.screen.gt.sm" + full-width :full-height="$q.screen.gt.sm" > 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 9c94a89..60e6ff2 100644 --- a/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue +++ b/src/modules/timesheet-approval/pages/timesheet-approval-employee-details.vue @@ -8,12 +8,14 @@ import TimesheetApprovalEmployeeExpensesChart from 'src/modules/timesheet-approval/components/graphs/timesheet-approval-employee-expenses-chart.vue'; import type { PayPeriodOverviewEmployee } from 'src/modules/timesheet-approval/types/timesheet-approval-pay-period-overview-employee-interface'; import type { PayPeriodEmployeeDetails } from '../types/timesheet-approval-pay-period-employee-details-interface'; +import { PayPeriod } from 'src/modules/shared/types/pay-period-interface'; const props = defineProps<{ isLoading: boolean; employeeName: string; employeeOverview: PayPeriodOverviewEmployee; employeeDetails: PayPeriodEmployeeDetails; + currentPayPeriod: PayPeriod; updateKey: number; }>(); @@ -23,7 +25,7 @@