feat: complete requirements gaps - backup/restore, uat signoff, pm attachments, templates, and filters

This commit is contained in:
Atharv1705
2026-11-13 18:15:32 +05:30
parent cd9eb27a98
commit d9ca4bbb02
38 changed files with 1403 additions and 69 deletions
+35
View File
@@ -11,6 +11,7 @@ import {
ChevronLeft,
ChevronRight,
Search,
Paperclip,
} from "lucide-react";
import {
pmApi,
@@ -28,6 +29,7 @@ import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Modal } from "@/components/ui/dialog";
import { ScheduleStatusBadge } from "@/components/StatusBadge";
import { Attachments } from "@/components/Attachments";
import {
NewPMScheduleModal,
CompletePMModal,
@@ -96,6 +98,7 @@ export function PMPage() {
const [completingRec, setCompletingRec] = useState<PMRecordItem | null>(null);
const [reschedulingRec, setReschedulingRec] = useState<PMRecordItem | null>(null);
const [calendarDetailRec, setCalendarDetailRec] = useState<PMRecordItem | null>(null);
const [attachRec, setAttachRec] = useState<PMRecordItem | null>(null);
const effectiveCalendarMonth = monthFilter || currentYearMonth();
@@ -236,6 +239,23 @@ export function PMPage() {
</span>
),
},
{
id: "attachments",
header: "Reports",
enableSorting: false,
enableColumnFilter: false,
cell: ({ row }) => (
<Button
size="sm"
variant="ghost"
onClick={() => setAttachRec(row.original)}
aria-label={`Attachments for PM ${row.original.id}`}
>
<Paperclip className="h-3.5 w-3.5 mr-1" />
Docs
</Button>
),
},
...(canManagePm
? [
{
@@ -726,6 +746,21 @@ export function PMPage() {
}
assetId={reschedulingRec?.asset_id}
/>
{attachRec && (
<Modal
open={Boolean(attachRec)}
onOpenChange={(o) => !o && setAttachRec(null)}
title={`PM Service Reports — ${attachRec.asset_code} (${attachRec.asset_name})`}
>
<Attachments
entityType="pm_record"
entityId={attachRec.id}
canUpload={canManagePm}
canDelete={canManagePm}
/>
</Modal>
)}
</div>
);
}