From 06967561600390563b78894a3216140142318f92 Mon Sep 17 00:00:00 2001 From: laxman h Date: Fri, 3 Apr 2026 20:32:40 +0530 Subject: [PATCH] caht enhanced and made centralized componet separate FDD ui creted for document upload --- src/App.tsx | 22 +- .../applications/ApplicationDetails.tsx | 108 +--- .../ConstitutionalChangeDetails.tsx | 122 +---- .../applications/FDDApplicationDetails.tsx | 478 ++++++++++++++++++ .../applications/FinanceOnboardingPage.tsx | 3 +- src/components/applications/FnFDetails.tsx | 43 +- .../ProspectiveApplicationDetails.tsx | 295 +++++++++++ .../applications/RelocationRequestDetails.tsx | 170 ++----- .../applications/RelocationRequestPage.tsx | 451 +---------------- .../applications/ResignationDetails.tsx | 57 +-- .../applications/ResignationPage.tsx | 226 +-------- .../applications/TerminationDetails.tsx | 74 ++- src/components/applications/WorkNotesPage.tsx | 266 +++++++--- src/components/applications/WorknotePage.tsx | 398 --------------- src/components/dashboard/FDDDashboardPage.tsx | 207 ++++++++ src/components/dashboard/FinanceDashboard.tsx | 3 +- .../dashboard/ProspectiveDashboardPage.tsx | 352 +++++-------- src/components/layout/Sidebar.tsx | 2 + src/components/ui/DocumentPreviewModal.tsx | 199 ++------ src/services/collaboration.service.ts | 33 ++ src/services/eor.service.ts | 9 +- 21 files changed, 1571 insertions(+), 1947 deletions(-) create mode 100644 src/components/applications/FDDApplicationDetails.tsx create mode 100644 src/components/applications/ProspectiveApplicationDetails.tsx delete mode 100644 src/components/applications/WorknotePage.tsx create mode 100644 src/components/dashboard/FDDDashboardPage.tsx create mode 100644 src/services/collaboration.service.ts diff --git a/src/App.tsx b/src/App.tsx index 36c199c..b45e4d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,6 +14,8 @@ import { Dashboard } from './components/dashboard/Dashboard'; import { FinanceDashboard } from './components/dashboard/FinanceDashboard'; import { DealerDashboard } from './components/dashboard/DealerDashboard'; import { ProspectiveDashboardPage } from './components/dashboard/ProspectiveDashboardPage'; +import { FDDDashboardPage } from './components/dashboard/FDDDashboardPage'; +import { FDDApplicationDetails } from './components/applications/FDDApplicationDetails'; import { ApplicationsPage } from './components/applications/ApplicationsPage'; import { AllApplicationsPage } from './components/applications/AllApplicationsPage'; import { OpportunityRequestsPage } from './components/applications/OpportunityRequestsPage'; @@ -146,6 +148,7 @@ export default function App() { '/dealer-relocation': 'Dealer Relocation Requests', '/questionnaire-builder': 'Questionnaire Builder', '/approval-policies': 'Approval Policies', + '/fdd-dashboard': 'FDD Dashboard', }; return titles[pathname] || 'Dashboard'; }; @@ -181,7 +184,7 @@ export default function App() { {/* Prospective Dealer Route - STRICTLY ISOLATED */} @@ -189,6 +192,8 @@ export default function App() { } /> + + {/* Internal & Dealer Routes - EXCLUDES Prospective Dealers */} @@ -209,11 +214,10 @@ export default function App() { {/* Applications */} navigate(`/applications/${id}`)} initialFilter="all" />} /> } /> - window.history.back()} /> } /> @@ -222,6 +226,10 @@ export default function App() { currentUser?.role === 'DD' ? navigate(`/applications/${id}`)} initialFilter="all" /> : } /> + {/* FDD Routes - Integrated into Layout */} + } /> + } /> + {/* Admin/Lead Routes */} navigate(`/applications/${id}`)} />} /> navigate(`/applications/${id}`)} />} /> @@ -256,10 +264,10 @@ export default function App() { navigate('/finance-fnf')} />} /> navigate(`/constitutional-change/${id}`)} />} /> - navigate('/constitutional-change')} currentUser={currentUser} onOpenWorknote={() => { }} />} /> + navigate('/constitutional-change')} currentUser={currentUser} />} /> navigate(`/relocation-requests/${id}`)} />} /> - navigate('/relocation-requests')} currentUser={currentUser} onOpenWorknote={() => { }} />} /> + navigate('/relocation-requests')} currentUser={currentUser} />} /> {/* Dealer Routes */} navigate(`/resignation/${id}`)} />} /> diff --git a/src/components/applications/ApplicationDetails.tsx b/src/components/applications/ApplicationDetails.tsx index 6124361..b26aff3 100644 --- a/src/components/applications/ApplicationDetails.tsx +++ b/src/components/applications/ApplicationDetails.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { toast } from 'sonner'; -import { mockWorkNotes, Application, ApplicationStatus } from '../../lib/mock-data'; +import { Application, ApplicationStatus } from '../../lib/mock-data'; import { onboardingService } from '../../services/onboarding.service'; import { auditService } from '../../services/audit.service'; import { eorService } from '../../services/eor.service'; @@ -395,7 +395,6 @@ export function ApplicationDetails() { const [rejectionReason, setRejectionReason] = useState(''); const [scheduledInterviewParticipants, setScheduledInterviewParticipants] = useState([]); - const [showWorkNoteModal, setShowWorkNoteModal] = useState(false); const [showScheduleModal, setShowScheduleModal] = useState(false); const [showKTMatrixModal, setShowKTMatrixModal] = useState(false); const [showLevel2FeedbackModal, setShowLevel2FeedbackModal] = useState(false); @@ -405,7 +404,6 @@ export function ApplicationDetails() { const [selectedStage, setSelectedStage] = useState(null); const [interviewMode, setInterviewMode] = useState('virtual'); const [approvalRemark, setApprovalRemark] = useState(''); - const [workNote, setWorkNote] = useState(''); const [expandedBranches, setExpandedBranches] = useState<{ [key: string]: boolean }>({ 'architectural-work': true, 'statutory-documents': true @@ -1514,16 +1512,6 @@ export function ApplicationDetails() { } }; - const handleWorkNote = () => { - if (!workNote.trim()) { - toast.warning('Please enter a note'); - return; - } - toast.info(`Work note added: ${workNote}`); - setShowWorkNoteModal(false); - setWorkNote(''); - }; - const handleAddParticipant = async () => { if (!selectedUser) { toast.warning('Please select a user'); @@ -1663,7 +1651,20 @@ export function ApplicationDetails() {
- {/* Actions can be added here in the future */} +
@@ -1898,7 +1899,7 @@ export function ApplicationDetails() { "w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold text-white", approver.status === 'approved' ? "bg-green-500" : approver.status === 'rejected' ? "bg-red-500" : "bg-slate-300" )}> - {approver.name.split(' ').map(n => n[0]).join('').substring(0, 2).toUpperCase()} + {approver.name.split(' ').map((n: string) => n[0]).join('').substring(0, 2).toUpperCase()}
{approver.name} @@ -2826,7 +2827,7 @@ export function ApplicationDetails() {
@@ -3218,48 +3186,6 @@ export function ApplicationDetails() { - {/* Work Note Modal */} - < Dialog open={showWorkNoteModal} onOpenChange={setShowWorkNoteModal} > - - - Add Work Note - - Add a note to track progress and communicate with team members. - - -
-
- -