diff --git a/resources/js/Components/Dashboard/ThisWeekOverview.vue b/resources/js/Components/Dashboard/ThisWeekOverview.vue index e74308d7..285bc000 100644 --- a/resources/js/Components/Dashboard/ThisWeekOverview.vue +++ b/resources/js/Components/Dashboard/ThisWeekOverview.vue @@ -51,47 +51,49 @@ const props = defineProps<{ }>(); const accentColor = useCssVar('--color-accent-quaternary'); -const seriesData = props.weeklyHistory.map((el) => { - return { - value: el.duration, - ...{ - itemStyle: { - borderColor: new LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: 'rgba(' + accentColor.value + ',0.7)', - }, - { - offset: 1, - color: 'rgba(' + accentColor.value + ',0.5)', - }, - ]), - emphasis: { - color: new LinearGradient(0, 0, 0, 1, [ +const seriesData = computed(() => { + return props.weeklyHistory.map((el) => { + return { + value: el.duration, + ...{ + itemStyle: { + borderColor: new LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: 'rgba(' + accentColor.value + ',0.9)', + color: 'rgba(' + accentColor.value + ',0.7)', }, { offset: 1, + color: 'rgba(' + accentColor.value + ',0.5)', + }, + ]), + emphasis: { + color: new LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: 'rgba(' + accentColor.value + ',0.9)', + }, + { + offset: 1, + color: 'rgba(' + accentColor.value + ',0.7)', + }, + ]), + }, + borderRadius: [12, 12, 0, 0], + color: new LinearGradient(0, 0, 0, 1, [ + { + offset: 0, color: 'rgba(' + accentColor.value + ',0.7)', }, + { + offset: 1, + color: 'rgba(' + accentColor.value + ',0.5)', + }, ]), }, - borderRadius: [12, 12, 0, 0], - color: new LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: 'rgba(' + accentColor.value + ',0.7)', - }, - { - offset: 1, - color: 'rgba(' + accentColor.value + ',0.5)', - }, - ]), }, - }, - }; + }; + }); }); const weekdays = computed(() => { diff --git a/resources/js/Components/TimeTracker.vue b/resources/js/Components/TimeTracker.vue index d11d49e7..2396792c 100644 --- a/resources/js/Components/TimeTracker.vue +++ b/resources/js/Components/TimeTracker.vue @@ -45,12 +45,17 @@ const { tasks } = storeToRefs(taskStore); const clientStore = useClientsStore(); const { clients } = storeToRefs(clientStore); +const emit = defineEmits<{ + change: []; +}>(); + watch(isActive, () => { if (isActive.value) { startLiveTimer(); } else { stopLiveTimer(); } + emit('change'); }); onMounted(async () => { diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index 891e5cbc..145e6c55 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -8,6 +8,7 @@ import ThisWeekOverview from '@/Components/Dashboard/ThisWeekOverview.vue'; import ActivityGraphCard from '@/Components/Dashboard/ActivityGraphCard.vue'; import MainContainer from '@/packages/ui/src/MainContainer.vue'; import { canViewMembers } from '@/utils/permissions'; +import { router } from '@inertiajs/vue3'; const props = defineProps<{ latestTasks: { @@ -46,13 +47,29 @@ const props = defineProps<{ duration: number; }[]; }>(); + +function refreshDashboardData() { + router.reload({ + only: [ + 'latestTasks', + 'latestTeamActivity', + 'lastSevenDays', + 'dailyTrackedHours', + 'weeklyProjectOverview', + 'totalWeeklyTime', + 'totalWeeklyBillableTime', + 'totalWeeklyBillableAmount', + 'weeklyHistory', + ], + }); +}