From 16e966174d39d2c1159c18d0275a50b35f48853a Mon Sep 17 00:00:00 2001 From: Sander de Jong Date: Mon, 25 Mar 2024 14:26:22 +0100 Subject: [PATCH] feat: show end of life message to users starting April (#879) * feat: show end of life message to users starting April * chore: make it prettier --- components/end-of-life.vue | 44 +++++++++++++++++++++++++ components/records/weekly-timesheet.vue | 26 ++++++++++++--- pages/_year/_week.vue | 8 ++++- 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 components/end-of-life.vue diff --git a/components/end-of-life.vue b/components/end-of-life.vue new file mode 100644 index 00000000..45c8b6d8 --- /dev/null +++ b/components/end-of-life.vue @@ -0,0 +1,44 @@ + + + diff --git a/components/records/weekly-timesheet.vue b/components/records/weekly-timesheet.vue index 49bb8f39..6e197388 100644 --- a/components/records/weekly-timesheet.vue +++ b/components/records/weekly-timesheet.vue @@ -23,7 +23,7 @@ nl: />
- + + @@ -24,10 +26,12 @@ export default defineComponent({ const week = computed(() => parseInt(router.currentRoute.params.week, 10)); const pageTitle = computed(() => `${i18n.t('timesheets')} - ${employee.value?.name}`); + const isFreelancer = computed(() => !!employee?.value?.freelancer); + const isEndOfLife = computed(() => year.value >= 2024 && week.value >= 14); + if (!router.currentRoute.params.year || !router.currentRoute.params.week) { router.replace(format(new Date(), '/yyyy/I')); } - watch([employee], () => { if (employee.value && !employee.value?.billable) { router.push(store.state.employee.employee?.isAdmin ? '/admin/reports' : '/welcome') @@ -42,6 +46,8 @@ export default defineComponent({ employee, year, week, + isFreelancer, + isEndOfLife, }; },