From a2f07ac3fb458fd5a424bc06690ceaa1ca919007 Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Wed, 10 Sep 2025 15:26:32 -0400 Subject: [PATCH] feat(timesheet): added comment popup --- .../timesheet-approval-period-picker.vue | 2 +- .../composables/use-timesheet-approval-api.ts | 21 +- .../deprecated-timesheet-shift-form.vue | 266 ------------------ .../timesheet-details-shifts-row-header.vue | 0 .../timesheet-details-shifts-row.vue | 49 +++- .../timesheet-details-shifts.vue | 2 +- .../timesheet/timesheet-navigation.vue | 102 ++----- .../timesheet-shift-form-overview.vue | 0 .../composables/use-timesheet-api.ts | 81 +++--- .../pages/timesheet-details-overview.vue | 41 ++- 10 files changed, 145 insertions(+), 419 deletions(-) delete mode 100644 src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue rename src/modules/timesheets/components/{ => timesheet}/timesheet-details-shifts-row-header.vue (100%) rename src/modules/timesheets/components/{ => timesheet}/timesheet-details-shifts-row.vue (67%) rename src/modules/timesheets/components/{ => timesheet}/timesheet-details-shifts.vue (96%) delete mode 100644 src/modules/timesheets/components/timesheet/timesheet-shift-form-overview.vue diff --git a/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue b/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue index 8681c73..e185ee2 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue @@ -20,7 +20,7 @@ const onDateSelected = (value: string, reason: string, details: QDateDetails) => { calendar_date.value = value; - is_showing_calendar_picker.value = false; + is_showing_calendar_picker.value = false; emit('date-selected', value, reason, details); } diff --git a/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts b/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts index 952b192..ecdf20a 100644 --- a/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts +++ b/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts @@ -2,6 +2,7 @@ import { useTimesheetStore } from "src/stores/timesheet-store"; import { useAuthStore } from "src/stores/auth-store"; import type { PayPeriodReportFilters } from "../types/timesheet-approval-pay-period-report-interface"; import { default_pay_period_overview_employee, type PayPeriodOverviewEmployee } from "../types/timesheet-approval-pay-period-overview-employee-interface"; +import { date } from "quasar"; export const useTimesheetApprovalApi = () => { const timesheet_store = useTimesheetStore(); @@ -63,11 +64,29 @@ export const useTimesheetApprovalApi = () => { await timesheet_store.getTimesheetApprovalCSVReport(options); }; + const getCurrentPayPerdioOverview = async (): Promise => { + const today = date.formatDate(new Date(), 'YYYY-MM-DD'); + const success = await timesheet_store.getPayPeriodByDate(today); + if(!success) return; + + const { pay_year, pay_period_no } = timesheet_store.current_pay_period; + + await timesheet_store.getTimesheetApprovalPayPeriodEmployeeOverviews( + pay_year, + pay_period_no, + auth_store.user.email + ); + + await timesheet_store.getTimesheetsByPayPeriodAndEmail(auth_store.user.email); + + }; + return { getPayPeriodOverviewByDate, getNextPayPeriodOverview, getPayPeriodOverviewByEmployeeEmail, getTimesheetsByPayPeriodAndEmail, - getTimesheetApprovalCSVReport + getTimesheetApprovalCSVReport, + getCurrentPayPerdioOverview } }; \ No newline at end of file diff --git a/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue b/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue deleted file mode 100644 index 9d3e299..0000000 --- a/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/timesheets/components/timesheet-details-shifts-row-header.vue b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row-header.vue similarity index 100% rename from src/modules/timesheets/components/timesheet-details-shifts-row-header.vue rename to src/modules/timesheets/components/timesheet/timesheet-details-shifts-row-header.vue diff --git a/src/modules/timesheets/components/timesheet-details-shifts-row.vue b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue similarity index 67% rename from src/modules/timesheets/components/timesheet-details-shifts-row.vue rename to src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue index 2fb0ab5..2c7fa7b 100644 --- a/src/modules/timesheets/components/timesheet-details-shifts-row.vue +++ b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue @@ -1,9 +1,35 @@