fix: 7 UX bugs across dashboard, tasks, projects, calendar, settings
- Dashboard: fetch project progress from /api/projects/[id]/progress - Tasks List: add DropdownMenuTrigger to More options button - Projects: add New project button with CreateItemDialog integration - Settings: use color picker value when creating domains - Calendar: use dynamic domain options instead of hardcoded list - Dashboard: make View all button navigate to /tasks - Dashboard: domain names already resolved via domainMap (verified working)
This commit is contained in:
@@ -26,7 +26,21 @@ export function ProjectProgressWidget() {
|
||||
);
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
setProjects(data.items || []);
|
||||
const items = data.items || [];
|
||||
// Fetch progress for each project since the list API doesn't include it
|
||||
const withProgress = await Promise.all(
|
||||
items.map(async (p: { id: string; name: string }) => {
|
||||
try {
|
||||
const progRes = await fetch(`/api/projects/${p.id}/progress`);
|
||||
if (progRes.ok) {
|
||||
const progData = await progRes.json();
|
||||
return { ...p, progress: progData.progress ?? 0 };
|
||||
}
|
||||
} catch {}
|
||||
return { ...p, progress: 0 };
|
||||
})
|
||||
);
|
||||
setProjects(withProgress);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch projects:', error);
|
||||
|
||||
Reference in New Issue
Block a user