diff --git a/web/src/views/DashboardView.vue b/web/src/views/DashboardView.vue index 83c6c81..0e1b5b6 100644 --- a/web/src/views/DashboardView.vue +++ b/web/src/views/DashboardView.vue @@ -9,10 +9,14 @@ import CardTitle from '@/components/ui/CardTitle.vue' import CardContent from '@/components/ui/CardContent.vue' import Progress from '@/components/ui/Progress.vue' import Button from '@/components/ui/Button.vue' +import { useTasksStore } from '@/stores/tasks' +import { useDevopsStore } from '@/stores/devops' import { formatDuration, formatDate, isoDateStr } from '@/lib/utils' import type { KpiSummary, ProjectSummary, MonthlyDataPoint, DailyPoint, DowDataPoint, ToolUsage } from '@/types' const router = useRouter() +const tasksStore = useTasksStore() +const devopsStore = useDevopsStore() type Preset = 'today' | '7d' | '30d' | 'custom' @@ -26,6 +30,7 @@ const monthly = ref([]) const dow = ref([]) const tools = ref([]) const loading = ref(false) +const completingTask = ref(null) const dateRange = computed(() => { const now = new Date() @@ -73,7 +78,32 @@ watch(preset, () => { if (preset.value !== 'custom') loadData() }) -onMounted(() => loadData()) +async function quickComplete(taskId: string) { + if (completingTask.value) return + completingTask.value = taskId + try { + await tasksStore.complete(taskId) + await tasksStore.fetchForDate(isoDateStr(new Date())) + } finally { + completingTask.value = null + } +} + +const topAdoItems = computed(() => + devopsStore.workItems + .filter((wi) => !['Closed', 'Done', 'Removed'].includes(wi.state)) + .sort((a, b) => (a.priority ?? 3) - (b.priority ?? 3)) + .slice(0, 5) +) + +onMounted(async () => { + loadData() + tasksStore.fetchForDate(isoDateStr(new Date())) + try { + await devopsStore.fetchIntegration() + if (devopsStore.integration) devopsStore.fetchWorkItems() + } catch { /* no integration */ } +}) const maxMonthlyHours = computed(() => Math.max(...monthly.value.map((d) => d.hours), 1)) const maxDowHours = computed(() => Math.max(...dow.value.map((d) => d.hours), 1)) @@ -172,6 +202,102 @@ const DOW_LABELS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] /> + +
+ + + +
+ Tasks Today + View all → +
+
+ +
+ + + +

No pending tasks for today

+
+
+
+ + {{ task.title }} + in progress + urgent +
+
+
+
+ + + + +
+ ADO Priority Items + View all → +
+
+ +
+

No open work items

+
+ +
+
+ + + + + + + +

Connect Azure DevOps in

+ Settings → DevOps +
+
+
+