From b9613889f5e2af0b8922df2b7208ee7277ca4096 Mon Sep 17 00:00:00 2001 From: Nic D Date: Thu, 22 Jan 2026 10:38:08 -0500 Subject: [PATCH 1/5] fix(approvals): adjust scripts to handle timesheet modifications made through approvals page --- .../components/expense-dialog-list-item.vue | 2 +- .../components/shift-list-day-row.vue | 75 +++++++++---------- .../timesheets/components/shift-list-day.vue | 5 +- .../timesheets/composables/use-shift-api.ts | 4 +- .../timesheets/services/shift-service.ts | 21 +++++- src/pages/timesheet-approval-page.vue | 12 +-- src/stores/shift-store.ts | 12 +-- 7 files changed, 71 insertions(+), 60 deletions(-) diff --git a/src/modules/timesheets/components/expense-dialog-list-item.vue b/src/modules/timesheets/components/expense-dialog-list-item.vue index 7003990..5b29602 100644 --- a/src/modules/timesheets/components/expense-dialog-list-item.vue +++ b/src/modules/timesheets/components/expense-dialog-list-item.vue @@ -199,7 +199,7 @@ /> + import { useI18n } from 'vue-i18n'; import { onMounted, ref } from 'vue'; - import { QSelect, QInput } from 'quasar'; + import { QSelect, QInput, useQuasar } from 'quasar'; import { useUiStore } from 'src/stores/ui-store'; import { SHIFT_OPTIONS } from 'src/modules/timesheets/utils/shift.util'; import type { Shift } from 'src/modules/timesheets/models/shift.models'; + const q = useQuasar(); + const { t } = useI18n(); const ui_store = useUiStore(); const COMMENT_LENGTH_MAX = 280; @@ -24,6 +27,24 @@ holiday?: boolean | undefined; }>(); + const time_input_props = { + dense: true, + borderless: shift.value.is_approved && isTimesheetApproved, + readonly: shift.value.is_approved && isTimesheetApproved, + standout: q.dark.isActive ? 'bg-blue-grey-3' : 'bg-blue-grey-9', + labelSlot: true, + lazyRules: true, + noErrorIcon: true, + hideBottomSpace: true, + error: shift.value.has_error, + errorMessage: errorMessage ? t(errorMessage) : (error_message.value ? t(error_message.value) : undefined), + labelColor: shift.value.is_approved ? 'white' : (holiday ? 'purple-5' : 'accent'), + class: `col rounded-5 bg-dark q-mx-xs ${shift.value.id === -2 ? 'bg-negative' : ''} ${shift.value.is_approved || isTimesheetApproved ? 'cursor-not-allowed inset-shadow' : ''}`, + inputClass: `text-weight-medium ${shift.value.id === -2 ? 'text-white ' : ' '} ${shift.value.is_approved ? 'text-white cursor-not-allowed q-px-sm' : ''}`, + style: shift.value.is_approved ? (holiday ? 'background-color: #7b1fa2 !important' : 'background-color: #0a7d32 !important;') : '', + inputStyle: "font-size: 1.2em;" + } + const emit = defineEmits<{ 'requestDelete': [void]; 'onTimeFieldBlur': [void]; @@ -37,7 +58,7 @@ shift.value.has_error = false; error_message.value = undefined; emit('onTimeFieldBlur'); - } + } } const onBlurShiftTypeSelect = () => { @@ -141,7 +162,7 @@ dense keep-color size="3em" - :color="holiday? 'purple-5' : 'accent'" + :color="holiday ? 'purple-5' : 'accent'" icon="las la-building" checked-icon="las la-laptop" > @@ -158,13 +179,14 @@