From db6ec4bc90dd48dd266aa26d1694ac759fe5835f Mon Sep 17 00:00:00 2001 From: Nic D Date: Tue, 3 Feb 2026 15:31:06 -0500 Subject: [PATCH] feat(approvals): add more functionalities to details window, see notes Add ability to approve whole time from details dialog directly, in a sticky bar at top with employee name Add possibility of right-clicking on individual shifts to approve or unapprove --- .../chatbot/components/chatbot-drawer.vue | 6 +- .../components/details-dialog.vue | 64 +++++++++++++++++-- .../components/overview-list-filters.vue | 6 +- .../composables/use-timesheet-approval-api.ts | 5 +- .../components/shift-list-day-row.vue | 54 ++++++++++++++-- .../timesheets/components/shift-list-day.vue | 1 - .../components/timesheet-wrapper.vue | 3 +- src/stores/timesheet-store.ts | 6 +- 8 files changed, 121 insertions(+), 24 deletions(-) diff --git a/src/modules/chatbot/components/chatbot-drawer.vue b/src/modules/chatbot/components/chatbot-drawer.vue index 380c991..ca1ce8f 100644 --- a/src/modules/chatbot/components/chatbot-drawer.vue +++ b/src/modules/chatbot/components/chatbot-drawer.vue @@ -45,7 +45,7 @@
@@ -92,6 +92,7 @@ color="accent" size="2em" class="shadow-5" + style="pointer-events: auto;" @click="chatbot_store.is_showing_chatbot = true" />
@@ -103,5 +104,6 @@ :deep(.q-drawer) { background: rgba(0, 0, 0, 0); overflow: hidden; + pointer-events: none; } \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/details-dialog.vue b/src/modules/timesheet-approval/components/details-dialog.vue index 5cbc813..07e3afe 100644 --- a/src/modules/timesheet-approval/components/details-dialog.vue +++ b/src/modules/timesheet-approval/components/details-dialog.vue @@ -2,17 +2,39 @@ setup lang="ts" > - /* eslint-disable */ - import { ref } from 'vue'; + import { useI18n } from 'vue-i18n'; + import { computed, ref } from 'vue'; import { useTimesheetStore } from 'src/stores/timesheet-store'; import DetailsDialogChartHoursWorked from 'src/modules/timesheet-approval/components/details-dialog-chart-hours-worked.vue'; import DetailsDialogChartShiftTypes from 'src/modules/timesheet-approval/components/details-dialog-chart-shift-types.vue'; import DetailsDialogChartExpenses from 'src/modules/timesheet-approval/components/details-dialog-chart-expenses.vue'; import TimesheetWrapper from 'src/modules/timesheets/components/timesheet-wrapper.vue'; import ExpenseDialogList from 'src/modules/timesheets/components/expense-dialog-list.vue'; + import { useTimesheetApprovalApi } from '../composables/use-timesheet-approval-api'; + const { t } = useI18n(); const timesheet_store = useTimesheetStore(); + const timesheetApprovalApi = useTimesheetApprovalApi(); const is_dialog_open = ref(false); + + const isApproved = computed(() => timesheet_store.timesheets.every(timesheet => timesheet.is_approved)); + const approveButtonLabel = computed(() => isApproved.value ? + t('timesheet_approvals.table.verified') : + t('timesheet_approvals.table.unverified') + ); + const approveButtonIcon = computed(() => isApproved.value ? 'lock' : 'lock_open'); + + const onClickApproveAll = async () => { + const employeeEmail = timesheet_store.current_pay_period_overview?.email; + const isApproved = timesheet_store.timesheets.every(timesheet => timesheet.is_approved); + + if (employeeEmail !== undefined && isApproved !== undefined) { + await timesheetApprovalApi.toggleTimesheetsApprovalByEmployeeEmail( + employeeEmail, + !isApproved + ); + } + } \ No newline at end of file + + + \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/overview-list-filters.vue b/src/modules/timesheet-approval/components/overview-list-filters.vue index 588dab1..fb82c72 100644 --- a/src/modules/timesheet-approval/components/overview-list-filters.vue +++ b/src/modules/timesheet-approval/components/overview-list-filters.vue @@ -18,8 +18,8 @@