From 1a707bf05bc125f7f0ee2a6e344ba297c0d0603f Mon Sep 17 00:00:00 2001 From: Nicolas Drolet Date: Wed, 7 Jan 2026 10:32:19 -0500 Subject: [PATCH] fix(timesheet): adjustment to mobile UI, reduce header space, remove footer --- src/layouts/main-layout.vue | 2 +- .../components/page-header-template.vue | 2 +- .../components/pay-period-navigator.vue | 2 +- .../shift-list-weekly-overview-mobile.vue | 72 +++++++++++-------- .../components/shift-list-scrollable.vue | 2 +- .../components/timesheet-wrapper.vue | 20 +++--- src/stores/expense-store.ts | 5 +- 7 files changed, 60 insertions(+), 45 deletions(-) diff --git a/src/layouts/main-layout.vue b/src/layouts/main-layout.vue index 0e42eb5..5f49afd 100644 --- a/src/layouts/main-layout.vue +++ b/src/layouts/main-layout.vue @@ -39,6 +39,6 @@ - + \ No newline at end of file diff --git a/src/modules/shared/components/page-header-template.vue b/src/modules/shared/components/page-header-template.vue index 59f8401..e58704c 100644 --- a/src/modules/shared/components/page-header-template.vue +++ b/src/modules/shared/components/page-header-template.vue @@ -34,7 +34,7 @@ :key="startDate" v-if="startDate.length > 0" class="col row flex-center full-width q-py-none q-my-none" - :class="$q.platform.is.mobile ? 'q-mb-md' : ''" + :class="$q.platform.is.mobile ? 'q-my-sm' : ''" >
{{ $d(date.extractDate(startDate, 'YYYY-MM-DD'), date_format_options) }} diff --git a/src/modules/shared/components/pay-period-navigator.vue b/src/modules/shared/components/pay-period-navigator.vue index 17cbb74..de20dfc 100644 --- a/src/modules/shared/components/pay-period-navigator.vue +++ b/src/modules/shared/components/pay-period-navigator.vue @@ -73,7 +73,7 @@ color="accent" @click="is_showing_calendar_picker = !is_showing_calendar_picker" :disable="timesheet_store.is_loading || is_disabled" - class="q-px-xl" + :class="$q.platform.is.mobile ? 'q-px-md' : 'q-px-xl'" > + import { ref } from 'vue'; import { useTimesheetApi } from 'src/modules/timesheets/composables/use-timesheet-api'; import { useTimesheetStore } from 'src/stores/timesheet-store'; + import { getHoursMinutesStringFromHoursFloat } from 'src/utils/date-and-time-utils'; const timesheet_store = useTimesheetStore(); const timesheet_api = useTimesheetApi(); + + const show_autofill = ref(false); + + const onClickApplyPreset = async (timesheet_id: number) => { + show_autofill.value = false; + await timesheet_api.applyPreset(timesheet_id); + } \ No newline at end of file diff --git a/src/modules/timesheets/components/shift-list-scrollable.vue b/src/modules/timesheets/components/shift-list-scrollable.vue index d101a97..60cbe6d 100644 --- a/src/modules/timesheets/components/shift-list-scrollable.vue +++ b/src/modules/timesheets/components/shift-list-scrollable.vue @@ -29,7 +29,7 @@ const handleSwipe: TouchSwipeValue = (details) => { mobile_animation_direction.value = details.direction === 'left' ? 'fadeInRight' : 'fadeInLeft'; - if (details.distance && details.distance.x && Math.abs(details.distance.x) > 30) { + if (details.distance && details.distance.x && Math.abs(details.distance.x) > 15) { timesheet_api.getTimesheetsBySwiping(details.direction === 'left' ? 1 : -1).catch(error => console.error(error)); } }; diff --git a/src/modules/timesheets/components/timesheet-wrapper.vue b/src/modules/timesheets/components/timesheet-wrapper.vue index 358a91d..5da004d 100644 --- a/src/modules/timesheets/components/timesheet-wrapper.vue +++ b/src/modules/timesheets/components/timesheet-wrapper.vue @@ -115,16 +115,16 @@ /> - +
+ +
diff --git a/src/stores/expense-store.ts b/src/stores/expense-store.ts index 715638c..1fdcf5c 100644 --- a/src/stores/expense-store.ts +++ b/src/stores/expense-store.ts @@ -9,7 +9,7 @@ export const useExpensesStore = defineStore('expenses', () => { const timesheet_store = useTimesheetStore(); const is_open = ref(false); const is_loading = ref(false); - const is_showing_create_form = ref(true); + const is_showing_create_form = ref(false); const mode = ref<'create' | 'update' | 'delete'>('create'); const current_expense = ref(new Expense(date.formatDate(new Date(), 'YYYY-MM-DD'))); const initial_expense = ref(new Expense(date.formatDate(new Date(), 'YYYY-MM-DD'))); @@ -17,6 +17,7 @@ export const useExpensesStore = defineStore('expenses', () => { const open = (): void => { is_open.value = true; + is_showing_create_form.value = false; if (timesheet_store.pay_period !== undefined) { current_expense.value = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD')); initial_expense.value = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD')); @@ -26,7 +27,7 @@ export const useExpensesStore = defineStore('expenses', () => { const close = () => { is_open.value = false; - is_showing_create_form.value = true; + is_showing_create_form.value = false; }; const upsertExpense = async (expense: Expense, email?: string): Promise => {