diff --git a/quasar.config.ts b/quasar.config.ts index 205b2f3..7a69943 100644 --- a/quasar.config.ts +++ b/quasar.config.ts @@ -66,10 +66,13 @@ export default defineConfig((ctx) => { // polyfillModulePreload: true, // distDir - extendViteConf: (_config) => ({ + extendViteConf: (config) => ({ optimizeDeps: { exclude: ['tesseract.js'] - } + }, + define: { + __VUE_PROD_DEVTOOLS__: config.mode !== 'production' + }, }), // viteVuePluginOptions: {}, diff --git a/src/modules/timesheet-approval/components/details-dialog.vue b/src/modules/timesheet-approval/components/details-dialog.vue index 0c3f08a..93136b7 100644 --- a/src/modules/timesheet-approval/components/details-dialog.vue +++ b/src/modules/timesheet-approval/components/details-dialog.vue @@ -2,20 +2,21 @@ setup lang="ts" > - 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 ExpenseDialogForm from 'src/modules/timesheets/components/expense-dialog-form.vue'; + + import { date } from 'quasar'; + import { useI18n } from 'vue-i18n'; + import { computed, ref } from 'vue'; + import { useTimesheetStore } from 'src/stores/timesheet-store'; import { useTimesheetApprovalApi } from '../composables/use-timesheet-approval-api'; import { useShiftApi } from 'src/modules/timesheets/composables/use-shift-api'; import { useExpensesStore } from 'src/stores/expense-store'; import { Expense } from 'src/modules/timesheets/models/expense.models'; - import { date } from 'quasar'; // ========== state ======================================== @@ -25,6 +26,7 @@ const timesheetApprovalApi = useTimesheetApprovalApi(); const shiftApi = useShiftApi(); const isDialogOpen = ref(false); + const refreshKey = ref(0); // ========== computed ======================================== @@ -34,9 +36,9 @@ t('shared.label.unlock') : t('shared.label.lock') ); - + const approveButtonIcon = computed(() => isApproved.value ? 'las la-lock' : 'las la-unlock'); - + const hasExpenses = computed(() => timesheetStore.timesheets.some(timesheet => Object.values(timesheet.weekly_expenses).some(hours => hours > 0)) ); @@ -60,13 +62,22 @@ expenseStore.is_showing_create_form = false; } - const onClickExpenseCreate = () => { + const onClickNewExpense = () => { expenseStore.mode = 'create'; if (timesheetStore.pay_period) expenseStore.current_expense = new Expense(timesheetStore.pay_period.period_start); else expenseStore.current_expense = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD')); } + + const onClickSaveNewExpense = () => { + expenseStore.is_showing_create_form = false; + } + + const onShowDetailsDialog = () => { + isDialogOpen.value = true; + expenseStore.is_showing_create_form = false; + }