frontend build issue resolved
This commit is contained in:
parent
02182daa65
commit
12d1094f45
@ -514,7 +514,7 @@ function AppRoutes({ onLogout }: AppProps) {
|
|||||||
path="/approver-performance"
|
path="/approver-performance"
|
||||||
element={
|
element={
|
||||||
<PageLayout currentPage="approver-performance" onNavigate={handleNavigate} onNewRequest={handleNewRequest} onLogout={onLogout}>
|
<PageLayout currentPage="approver-performance" onNavigate={handleNavigate} onNewRequest={handleNewRequest} onLogout={onLogout}>
|
||||||
<ApproverPerformance onViewRequest={handleViewRequest} />
|
<ApproverPerformance />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -258,11 +258,6 @@ export function ConfigurationManager({ onConfigUpdate }: ConfigurationManagerPro
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCategoryColor = (category: string) => {
|
|
||||||
// Use uniform slate color for all category icons
|
|
||||||
return 'bg-gradient-to-br from-slate-600 to-slate-700 text-white';
|
|
||||||
};
|
|
||||||
|
|
||||||
// Filter out notification rules and dashboard layout categories
|
// Filter out notification rules and dashboard layout categories
|
||||||
const excludedCategories = ['NOTIFICATION_RULES', 'DASHBOARD_LAYOUT'];
|
const excludedCategories = ['NOTIFICATION_RULES', 'DASHBOARD_LAYOUT'];
|
||||||
const filteredConfigurations = configurations.filter(
|
const filteredConfigurations = configurations.filter(
|
||||||
|
|||||||
@ -192,9 +192,6 @@ export function AddSpectatorModal({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Count existing participants (initiator + approvers + spectators)
|
// Count existing participants (initiator + approvers + spectators)
|
||||||
const existingApprovers = existingParticipants.filter(
|
|
||||||
p => (p.participantType || '').toUpperCase() === 'APPROVER'
|
|
||||||
);
|
|
||||||
const totalParticipants = existingParticipants.length + 1; // +1 for the new spectator
|
const totalParticipants = existingParticipants.length + 1; // +1 for the new spectator
|
||||||
|
|
||||||
// Check maximum participants
|
// Check maximum participants
|
||||||
|
|||||||
@ -107,7 +107,7 @@ export function ApprovalStepCard({
|
|||||||
const isWaiting = step.status === 'waiting';
|
const isWaiting = step.status === 'waiting';
|
||||||
|
|
||||||
const tatHours = Number(step.tatHours || 0);
|
const tatHours = Number(step.tatHours || 0);
|
||||||
const actualHours = step.actualHours;
|
const actualHours = step.actualHours ?? 0;
|
||||||
const savedHours = isCompleted && actualHours ? Math.max(0, tatHours - actualHours) : 0;
|
const savedHours = isCompleted && actualHours ? Math.max(0, tatHours - actualHours) : 0;
|
||||||
|
|
||||||
// Calculate if breached
|
// Calculate if breached
|
||||||
|
|||||||
@ -169,7 +169,7 @@ export function useRequestSocket(
|
|||||||
* 1. Increment unread badge if user is not on Work Notes tab
|
* 1. Increment unread badge if user is not on Work Notes tab
|
||||||
* 2. Refresh merged messages to show new note
|
* 2. Refresh merged messages to show new note
|
||||||
*/
|
*/
|
||||||
const handleNewWorkNote = (data: any) => {
|
const handleNewWorkNote = (_data: any) => {
|
||||||
// New work note received - logging removed
|
// New work note received - logging removed
|
||||||
|
|
||||||
// Update unread badge (only if not viewing work notes)
|
// Update unread badge (only if not viewing work notes)
|
||||||
|
|||||||
@ -29,13 +29,12 @@ import {
|
|||||||
ArrowRight
|
ArrowRight
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { dashboardService, type DashboardKPIs, type DateRange, type AIRemarkUtilization, type ApproverPerformance } from '@/services/dashboard.service';
|
import { dashboardService, type DashboardKPIs, type DateRange, type AIRemarkUtilization, type ApproverPerformance, type DepartmentStats, type PriorityDistribution, type UpcomingDeadline, type RecentActivity, type CriticalRequest } from '@/services/dashboard.service';
|
||||||
import { useAuth, hasManagementAccess } from '@/contexts/AuthContext';
|
import { useAuth, hasManagementAccess } from '@/contexts/AuthContext';
|
||||||
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, PieChart as RechartsPieChart, Pie, Cell, BarChart, Bar } from 'recharts';
|
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, PieChart as RechartsPieChart, Pie, Cell, BarChart, Bar } from 'recharts';
|
||||||
import { KPICard } from '@/components/dashboard/KPICard';
|
import { KPICard } from '@/components/dashboard/KPICard';
|
||||||
import { StatCard } from '@/components/dashboard/StatCard';
|
import { StatCard } from '@/components/dashboard/StatCard';
|
||||||
import { CriticalAlertCard, CriticalAlertData } from '@/components/dashboard/CriticalAlertCard';
|
import { CriticalAlertCard, CriticalAlertData } from '@/components/dashboard/CriticalAlertCard';
|
||||||
import type { CriticalRequest } from '@/services/dashboard.service';
|
|
||||||
import { ActivityFeedItem, ActivityData } from '@/components/dashboard/ActivityFeedItem';
|
import { ActivityFeedItem, ActivityData } from '@/components/dashboard/ActivityFeedItem';
|
||||||
import { Pagination } from '@/components/common/Pagination';
|
import { Pagination } from '@/components/common/Pagination';
|
||||||
import { formatHoursMinutes } from '@/utils/slaTracker';
|
import { formatHoursMinutes } from '@/utils/slaTracker';
|
||||||
@ -213,13 +212,12 @@ export function Dashboard({ onNavigate, onNewRequest }: DashboardProps) {
|
|||||||
] : [];
|
] : [];
|
||||||
|
|
||||||
// Fetch all data in parallel
|
// Fetch all data in parallel
|
||||||
const [
|
const results = await Promise.all([...commonPromises, ...adminPromises]);
|
||||||
kpisData,
|
|
||||||
activityResult,
|
const kpisData = results[0] as DashboardKPIs;
|
||||||
criticalResult,
|
const activityResult = results[1] as { activities: RecentActivity[]; pagination: { currentPage: number; totalPages: number; totalRecords: number; limit: number } };
|
||||||
deadlinesResult,
|
const criticalResult = results[2] as { criticalRequests: CriticalRequest[]; pagination: { currentPage: number; totalPages: number; totalRecords: number; limit: number } };
|
||||||
...adminResults
|
const deadlinesResult = results[3] as { deadlines: UpcomingDeadline[]; pagination: { currentPage: number; totalPages: number; totalRecords: number; limit: number } };
|
||||||
] = await Promise.all([...commonPromises, ...adminPromises]);
|
|
||||||
|
|
||||||
setKpis(kpisData);
|
setKpis(kpisData);
|
||||||
setRecentActivity(activityResult.activities);
|
setRecentActivity(activityResult.activities);
|
||||||
@ -238,8 +236,11 @@ export function Dashboard({ onNavigate, onNewRequest }: DashboardProps) {
|
|||||||
setDeadlinesTotalRecords(deadlinesResult.pagination.totalRecords);
|
setDeadlinesTotalRecords(deadlinesResult.pagination.totalRecords);
|
||||||
|
|
||||||
// Only set admin-specific data if user is admin
|
// Only set admin-specific data if user is admin
|
||||||
if (isAdmin && adminResults.length === 4) {
|
if (isAdmin && results.length >= 8) {
|
||||||
const [deptStats, priorityDist, aiUtilization, approverResult] = adminResults;
|
const deptStats = results[4] as DepartmentStats[];
|
||||||
|
const priorityDist = results[5] as PriorityDistribution[];
|
||||||
|
const aiUtilization = results[6] as AIRemarkUtilization;
|
||||||
|
const approverResult = results[7] as { performance: ApproverPerformance[]; pagination: { currentPage: number; totalPages: number; totalRecords: number; limit: number } };
|
||||||
setDepartmentStats(deptStats);
|
setDepartmentStats(deptStats);
|
||||||
setPriorityDistribution(priorityDist);
|
setPriorityDistribution(priorityDist);
|
||||||
setAiRemarkUtilization(aiUtilization);
|
setAiRemarkUtilization(aiUtilization);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user