Truth-in-UI cleanup: wire real dashboard data, fix delete/dialog gaps
Phase 1 of frontend_tasks.md - stop showing fabricated/broken UI:
- Dashboard now fetches real stats (projects, tasks, users, pending
approvals, API keys, developer stats, pending reviews, admin
activity) instead of hardcoded numbers. Added services/developer.ts
and services/review.ts wrappers for previously-unused backend
endpoints.
- Wired ActivityFeed into every project's Overview page in place of
the "coming soon" placeholder.
- Registered the missing /projects/:id/technical-specs route (view
and service already existed, just unreachable).
- Fixed AssetDeleteConfirmDialog's raw styled divs to use the shared
Alert component and wired it into AssetBrowser, matching
ShotBrowser's impact-summary + type-to-confirm safety pattern
(asset deletion was previously less safe than shot deletion).
- Fixed a shared bug in both delete dialogs where the impact-summary
section never rendered (watch on the open prop needed
{ immediate: true }).
- Replaced native confirm()/alert() with styled AlertDialog/Dialog in
NoteItem, TaskAttachments, and UserMenu's keyboard-shortcuts item.
- Removed dead-end UI: Google OAuth stub buttons, UserMenu items
pointing at non-existent routes, the /developer/docs dead link, and
the no-op action button on the API Keys placeholder page.
- Removed leftover debug console logging across 8 files.
Added frontend_report.md (full audit) and frontend_tasks.md (phased
checklist) as the reference for this and future phases.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,23 @@
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<AlertDialog :open="showDeleteDialog" @update:open="showDeleteDialog = $event">
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Attachment</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete this attachment? This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction @click="confirmDeleteAttachment" class="bg-destructive text-destructive-foreground hover:bg-destructive/90">
|
||||
Delete
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -125,6 +142,16 @@ import {
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
} from '@/components/ui/dialog'
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import AttachmentCard from './AttachmentCard.vue'
|
||||
import { taskService, type TaskAttachment } from '@/services/task'
|
||||
import { useToast } from '@/components/ui/toast/use-toast'
|
||||
@@ -148,6 +175,8 @@ const filterType = ref('all')
|
||||
const viewerOpen = ref(false)
|
||||
const selectedAttachment = ref<TaskAttachment | null>(null)
|
||||
const mediaBlobUrl = ref<string | null>(null)
|
||||
const showDeleteDialog = ref(false)
|
||||
const attachmentToDelete = ref<number | null>(null)
|
||||
|
||||
const attachmentTypes = [
|
||||
{ value: 'all', label: 'All' },
|
||||
@@ -197,23 +226,30 @@ async function handleFileSelect(event: Event) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDelete(attachmentId: number) {
|
||||
if (!confirm('Are you sure you want to delete this attachment?')) return
|
||||
function handleDelete(attachmentId: number) {
|
||||
attachmentToDelete.value = attachmentId
|
||||
showDeleteDialog.value = true
|
||||
}
|
||||
|
||||
async function confirmDeleteAttachment() {
|
||||
if (attachmentToDelete.value === null) return
|
||||
|
||||
try {
|
||||
await taskService.deleteTaskAttachment(props.taskId, attachmentId)
|
||||
await taskService.deleteTaskAttachment(props.taskId, attachmentToDelete.value)
|
||||
emit('attachmentsUpdated')
|
||||
toast({
|
||||
title: 'Success',
|
||||
description: 'Attachment deleted successfully'
|
||||
})
|
||||
} catch (error: any) {
|
||||
console.error('Error deleting attachment:', error)
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: error.response?.data?.detail || 'Failed to delete attachment',
|
||||
variant: 'destructive'
|
||||
})
|
||||
} finally {
|
||||
showDeleteDialog.value = false
|
||||
attachmentToDelete.value = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user