diff --git a/src/modules/timesheets/components/timesheet/timesheet-navigation.vue b/src/modules/shared/components/pay-period-navigator.vue similarity index 74% rename from src/modules/timesheets/components/timesheet/timesheet-navigation.vue rename to src/modules/shared/components/pay-period-navigator.vue index ada6b56..d440b8b 100644 --- a/src/modules/timesheets/components/timesheet/timesheet-navigation.vue +++ b/src/modules/shared/components/pay-period-navigator.vue @@ -1,27 +1,28 @@ @@ -33,39 +34,43 @@ icon="keyboard_arrow_left" color="primary" @click="emit('pressed-previous-button')" - :disable="props.isPreviousLimit || props.isDisabled" + :disable="is_previous_pay_period_limit || timesheet_store.is_loading" class="q-mr-sm q-px-sm" > {{ $t( 'timesheet.nav_button.previous_week' )}} + > + {{ $t( 'timesheet.nav_button.previous_week' )}} + {{ $t('timesheet.nav_button.calendar_date_picker') }} + > + {{ $t('timesheet.nav_button.calendar_date_picker') }} + (); - const expenses_dataset = ref[]>([]); - const expenses_labels = ref([]); + // const expenses_dataset = ref[]>([]); + // const expenses_labels = ref([]); - const getExpensesData = (): ChartData<'bar'> => { - if (props.rawData) { - const all_weeks = [props.rawData.week1, props.rawData.week2]; - const all_days = all_weeks.flatMap( week => Object.values(week.expenses)); - const all_days_dates = all_weeks.flatMap( week => Object.values(week.shifts)) + // const getExpensesData = (): ChartData<'bar'> => { + // if (timesheetDetails) { + // const all_weeks = [timesheetDetails.week1, timesheetDetails.week2]; + // const all_days = all_weeks.flatMap( week => Object.values(week.expenses)); + // const all_days_dates = all_weeks.flatMap( week => Object.values(week.shifts)) - const all_costs = all_days.map( day => getTotalAmounts(day.cash)); - const all_mileage = all_days.map( day => getTotalAmounts(day.km)); + // const all_costs = all_days.map( day => getTotalAmounts(day.cash)); + // const all_mileage = all_days.map( day => getTotalAmounts(day.km)); - expenses_dataset.value = [ - { - label: t('timesheet_approvals.table.expenses'), - data: all_costs, - backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-primary').trim(), - }, - { - label: t('timesheet_approvals.table.mileage'), - data: all_mileage, - backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-info').trim(), - } - ] + // expenses_dataset.value = [ + // { + // label: t('timesheet_approvals.table.expenses'), + // data: all_costs, + // backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-primary').trim(), + // }, + // { + // label: t('timesheet_approvals.table.mileage'), + // data: all_mileage, + // backgroundColor: getComputedStyle(document.body).getPropertyValue('--q-info').trim(), + // } + // ] - expenses_labels.value = all_days_dates.map( day => day.short_date); - } + // expenses_labels.value = all_days_dates.map( day => day.short_date); + // } - return { - datasets: expenses_dataset.value, - labels: expenses_labels.value - }; - }; + // return { + // datasets: expenses_dataset.value, + // labels: expenses_labels.value + // }; + // }; const getTotalAmounts = (expenses: Expense[]): number => { let total_amount = 0; diff --git a/src/modules/timesheet-approval/components/detailed-chart-hours-worked.vue b/src/modules/timesheet-approval/components/detailed-dialog-chart-hours-worked.vue similarity index 100% rename from src/modules/timesheet-approval/components/detailed-chart-hours-worked.vue rename to src/modules/timesheet-approval/components/detailed-dialog-chart-hours-worked.vue diff --git a/src/modules/timesheet-approval/components/detailed-chart-shift-types.vue b/src/modules/timesheet-approval/components/detailed-dialog-chart-shift-types.vue similarity index 100% rename from src/modules/timesheet-approval/components/detailed-chart-shift-types.vue rename to src/modules/timesheet-approval/components/detailed-dialog-chart-shift-types.vue diff --git a/src/modules/timesheet-approval/pages/timesheet-approval-detailed.vue b/src/modules/timesheet-approval/components/detailed-dialog.vue similarity index 71% rename from src/modules/timesheet-approval/pages/timesheet-approval-detailed.vue rename to src/modules/timesheet-approval/components/detailed-dialog.vue index b7f1f1b..5b547ea 100644 --- a/src/modules/timesheet-approval/pages/timesheet-approval-detailed.vue +++ b/src/modules/timesheet-approval/components/detailed-dialog.vue @@ -1,25 +1,23 @@