From 57946dbaddb6742ad6405e7e6226c9afde1ab7e9 Mon Sep 17 00:00:00 2001 From: Nic D Date: Wed, 18 Mar 2026 10:45:02 -0400 Subject: [PATCH] feat(timesheet-approval): Add menu that contains shift options, approval-only feature --- src/modules/shared/components/targo-input.vue | 10 +- .../components/details-dialog-shift-menu.vue | 130 ++++++++++++++++++ .../components/shift-list-day-row.vue | 61 +++----- 3 files changed, 157 insertions(+), 44 deletions(-) create mode 100644 src/modules/timesheet-approval/components/details-dialog-shift-menu.vue diff --git a/src/modules/shared/components/targo-input.vue b/src/modules/shared/components/targo-input.vue index 8cba47b..60c7227 100644 --- a/src/modules/shared/components/targo-input.vue +++ b/src/modules/shared/components/targo-input.vue @@ -12,6 +12,7 @@ noTopPadding?: boolean; backgroundColor?: 'bg-secondary' | 'bg-dark'; appendContent?: string | number; + autoFocus?: boolean; }>(); defineOptions({ @@ -28,6 +29,7 @@ v-model="model" v-bind="$attrs" dense + :autofocus="autoFocus" borderless color="accent" label-color="white" @@ -89,8 +91,8 @@ \ No newline at end of file diff --git a/src/modules/timesheet-approval/components/details-dialog-shift-menu.vue b/src/modules/timesheet-approval/components/details-dialog-shift-menu.vue new file mode 100644 index 0000000..6224ad7 --- /dev/null +++ b/src/modules/timesheet-approval/components/details-dialog-shift-menu.vue @@ -0,0 +1,130 @@ + + + \ No newline at end of file diff --git a/src/modules/timesheets/components/shift-list-day-row.vue b/src/modules/timesheets/components/shift-list-day-row.vue index 74e465f..3cbfa62 100644 --- a/src/modules/timesheets/components/shift-list-day-row.vue +++ b/src/modules/timesheets/components/shift-list-day-row.vue @@ -2,9 +2,11 @@ setup lang="ts" > + import DetailsDialogShiftMenu from 'src/modules/timesheet-approval/components/details-dialog-shift-menu.vue'; + import { useI18n } from 'vue-i18n'; import { computed, inject, onMounted, ref } from 'vue'; - import { QSelect, QInput, useQuasar, type QSelectProps, QPopupProxy } from 'quasar'; + import { QSelect, QInput, useQuasar, type QSelectProps } from 'quasar'; import { useUiStore } from 'src/stores/ui-store'; import { useAuthStore } from 'src/stores/auth-store'; import { getCurrentDailyMinutesWorked, getShiftOptions, getTimeStringFromMinutes, SHIFT_OPTIONS } from 'src/modules/timesheets/utils/shift.util'; @@ -51,7 +53,6 @@ const shiftErrorMessage = ref(); const is_showing_delete_confirm = ref(false); const isShowingPredefinedTime = ref(shift.value.type === 'HOLIDAY'); - const popupProxyRef = ref(null); const predefinedHoursString = ref(''); const predefinedHoursBgColor = ref(`bg-${shiftTypeSelected.value?.icon_color ?? ''}`); @@ -59,12 +60,6 @@ const hasPTO = computed(() => currentShifts.some(shift => SHIFT_TYPES_WITH_PREDEFINED_TIMES.includes(shift.type))); - const rightClickMenuIcon = computed(() => shift.value.is_approved ? 'lock_open' : 'lock'); - - const rightClickMenuLabel = computed(() => shift.value.is_approved ? - t('timesheet_approvals.tooltip.unapprove') : - t('timesheet_approvals.tooltip.approve')); - const timeInputProps = computed(() => ({ dense: true, borderless: shift.value.is_approved && isTimesheetApproved, @@ -136,12 +131,9 @@ is_showing_delete_confirm.value = state; } - const onRightClickApprove = () => { + const onclickToogleApproval = () => { if (authStore.user?.user_module_access.includes('timesheets_approval')) shift.value.is_approved = !shift.value.is_approved; - - if (popupProxyRef.value) - popupProxyRef.value.hide(); } const onShiftTypeChange = (option: ShiftOption) => { @@ -179,31 +171,6 @@