@hed-hog/operations 0.0.329 → 0.0.331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/controllers/operations-collaborators.controller.d.ts +7 -216
- package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
- package/dist/controllers/operations-contracts.controller.d.ts +6 -6
- package/dist/controllers/operations-projects.controller.d.ts +25 -0
- package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
- package/dist/controllers/operations-projects.controller.js +48 -0
- package/dist/controllers/operations-projects.controller.js.map +1 -1
- package/dist/controllers/operations-reports.controller.d.ts +1 -1
- package/dist/controllers/operations-tasks.controller.d.ts +30 -5
- package/dist/controllers/operations-tasks.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.js +43 -32
- package/dist/controllers/operations-tasks.controller.js.map +1 -1
- package/dist/controllers/operations-timesheets.controller.d.ts +9 -9
- package/dist/dashboard/components/DashboardLayout.d.ts +30 -0
- package/dist/dashboard/components/DashboardLayout.d.ts.map +1 -0
- package/dist/dashboard/components/DashboardLayout.js +87 -0
- package/dist/dashboard/components/DashboardLayout.js.map +1 -0
- package/dist/dashboard/components/widget-registry.d.ts +23 -0
- package/dist/dashboard/components/widget-registry.d.ts.map +1 -0
- package/dist/dashboard/components/widget-registry.js +245 -0
- package/dist/dashboard/components/widget-registry.js.map +1 -0
- package/dist/dashboard/hooks/useDashboardData.d.ts +20 -0
- package/dist/dashboard/hooks/useDashboardData.d.ts.map +1 -0
- package/dist/dashboard/hooks/useDashboardData.js +24 -0
- package/dist/dashboard/hooks/useDashboardData.js.map +1 -0
- package/dist/dashboard/types/widgets.types.d.ts +233 -0
- package/dist/dashboard/types/widgets.types.d.ts.map +1 -0
- package/dist/dashboard/types/widgets.types.js +6 -0
- package/dist/dashboard/types/widgets.types.js.map +1 -0
- package/dist/dashboard/widgets/CapacityDistribution.d.ts +23 -0
- package/dist/dashboard/widgets/CapacityDistribution.d.ts.map +1 -0
- package/dist/dashboard/widgets/CapacityDistribution.js +11 -0
- package/dist/dashboard/widgets/CapacityDistribution.js.map +1 -0
- package/dist/dashboard/widgets/EffortByProject.d.ts +22 -0
- package/dist/dashboard/widgets/EffortByProject.d.ts.map +1 -0
- package/dist/dashboard/widgets/EffortByProject.js +11 -0
- package/dist/dashboard/widgets/EffortByProject.js.map +1 -0
- package/dist/dashboard/widgets/HeadcountByArea.d.ts +24 -0
- package/dist/dashboard/widgets/HeadcountByArea.d.ts.map +1 -0
- package/dist/dashboard/widgets/HeadcountByArea.js +11 -0
- package/dist/dashboard/widgets/HeadcountByArea.js.map +1 -0
- package/dist/dashboard/widgets/ManagedProjectsStatus.d.ts +18 -0
- package/dist/dashboard/widgets/ManagedProjectsStatus.d.ts.map +1 -0
- package/dist/dashboard/widgets/ManagedProjectsStatus.js +12 -0
- package/dist/dashboard/widgets/ManagedProjectsStatus.js.map +1 -0
- package/dist/dashboard/widgets/MyHoursPeriodKpi.d.ts +22 -0
- package/dist/dashboard/widgets/MyHoursPeriodKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyHoursPeriodKpi.js +12 -0
- package/dist/dashboard/widgets/MyHoursPeriodKpi.js.map +1 -0
- package/dist/dashboard/widgets/MyOpenRequestsKpi.d.ts +19 -0
- package/dist/dashboard/widgets/MyOpenRequestsKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyOpenRequestsKpi.js +17 -0
- package/dist/dashboard/widgets/MyOpenRequestsKpi.js.map +1 -0
- package/dist/dashboard/widgets/MyPendingRequestsList.d.ts +23 -0
- package/dist/dashboard/widgets/MyPendingRequestsList.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyPendingRequestsList.js +14 -0
- package/dist/dashboard/widgets/MyPendingRequestsList.js.map +1 -0
- package/dist/dashboard/widgets/MyProjectAllocationsKpi.d.ts +22 -0
- package/dist/dashboard/widgets/MyProjectAllocationsKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyProjectAllocationsKpi.js +11 -0
- package/dist/dashboard/widgets/MyProjectAllocationsKpi.js.map +1 -0
- package/dist/dashboard/widgets/MyQuickActions.d.ts +23 -0
- package/dist/dashboard/widgets/MyQuickActions.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyQuickActions.js +18 -0
- package/dist/dashboard/widgets/MyQuickActions.js.map +1 -0
- package/dist/dashboard/widgets/MyRelevantDeadlines.d.ts +23 -0
- package/dist/dashboard/widgets/MyRelevantDeadlines.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyRelevantDeadlines.js +22 -0
- package/dist/dashboard/widgets/MyRelevantDeadlines.js.map +1 -0
- package/dist/dashboard/widgets/MyTimesheetStatusKpi.d.ts +17 -0
- package/dist/dashboard/widgets/MyTimesheetStatusKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyTimesheetStatusKpi.js +11 -0
- package/dist/dashboard/widgets/MyTimesheetStatusKpi.js.map +1 -0
- package/dist/dashboard/widgets/MyWeeklyJourney.d.ts +21 -0
- package/dist/dashboard/widgets/MyWeeklyJourney.d.ts.map +1 -0
- package/dist/dashboard/widgets/MyWeeklyJourney.js +19 -0
- package/dist/dashboard/widgets/MyWeeklyJourney.js.map +1 -0
- package/dist/dashboard/widgets/PortfolioCostsKpi.d.ts +19 -0
- package/dist/dashboard/widgets/PortfolioCostsKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/PortfolioCostsKpi.js +12 -0
- package/dist/dashboard/widgets/PortfolioCostsKpi.js.map +1 -0
- package/dist/dashboard/widgets/PortfolioEffortKpi.d.ts +18 -0
- package/dist/dashboard/widgets/PortfolioEffortKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/PortfolioEffortKpi.js +8 -0
- package/dist/dashboard/widgets/PortfolioEffortKpi.js.map +1 -0
- package/dist/dashboard/widgets/PortfolioProjectsKpi.d.ts +22 -0
- package/dist/dashboard/widgets/PortfolioProjectsKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/PortfolioProjectsKpi.js +56 -0
- package/dist/dashboard/widgets/PortfolioProjectsKpi.js.map +1 -0
- package/dist/dashboard/widgets/PortfolioRiskKpi.d.ts +19 -0
- package/dist/dashboard/widgets/PortfolioRiskKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/PortfolioRiskKpi.js +11 -0
- package/dist/dashboard/widgets/PortfolioRiskKpi.js.map +1 -0
- package/dist/dashboard/widgets/ProjectStatusOverview.d.ts +19 -0
- package/dist/dashboard/widgets/ProjectStatusOverview.d.ts.map +1 -0
- package/dist/dashboard/widgets/ProjectStatusOverview.js +18 -0
- package/dist/dashboard/widgets/ProjectStatusOverview.js.map +1 -0
- package/dist/dashboard/widgets/StrategicDeadlines.d.ts +24 -0
- package/dist/dashboard/widgets/StrategicDeadlines.d.ts.map +1 -0
- package/dist/dashboard/widgets/StrategicDeadlines.js +22 -0
- package/dist/dashboard/widgets/StrategicDeadlines.js.map +1 -0
- package/dist/dashboard/widgets/TeamApprovalQueue.d.ts +24 -0
- package/dist/dashboard/widgets/TeamApprovalQueue.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamApprovalQueue.js +12 -0
- package/dist/dashboard/widgets/TeamApprovalQueue.js.map +1 -0
- package/dist/dashboard/widgets/TeamCapacityKpi.d.ts +18 -0
- package/dist/dashboard/widgets/TeamCapacityKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamCapacityKpi.js +19 -0
- package/dist/dashboard/widgets/TeamCapacityKpi.js.map +1 -0
- package/dist/dashboard/widgets/TeamHeadcountKpi.d.ts +22 -0
- package/dist/dashboard/widgets/TeamHeadcountKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamHeadcountKpi.js +56 -0
- package/dist/dashboard/widgets/TeamHeadcountKpi.js.map +1 -0
- package/dist/dashboard/widgets/TeamHoursKpi.d.ts +19 -0
- package/dist/dashboard/widgets/TeamHoursKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamHoursKpi.js +13 -0
- package/dist/dashboard/widgets/TeamHoursKpi.js.map +1 -0
- package/dist/dashboard/widgets/TeamPendingApprovalsKpi.d.ts +20 -0
- package/dist/dashboard/widgets/TeamPendingApprovalsKpi.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamPendingApprovalsKpi.js +11 -0
- package/dist/dashboard/widgets/TeamPendingApprovalsKpi.js.map +1 -0
- package/dist/dashboard/widgets/TeamUtilizationOverview.d.ts +18 -0
- package/dist/dashboard/widgets/TeamUtilizationOverview.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamUtilizationOverview.js +17 -0
- package/dist/dashboard/widgets/TeamUtilizationOverview.js.map +1 -0
- package/dist/dashboard/widgets/TeamWorkloadAlerts.d.ts +24 -0
- package/dist/dashboard/widgets/TeamWorkloadAlerts.d.ts.map +1 -0
- package/dist/dashboard/widgets/TeamWorkloadAlerts.js +19 -0
- package/dist/dashboard/widgets/TeamWorkloadAlerts.js.map +1 -0
- package/dist/dashboard/widgets/index.d.ts +24 -0
- package/dist/dashboard/widgets/index.d.ts.map +1 -0
- package/dist/dashboard/widgets/index.js +54 -0
- package/dist/dashboard/widgets/index.js.map +1 -0
- package/dist/dto/create-collaborator.dto.d.ts +0 -1
- package/dist/dto/create-collaborator.dto.d.ts.map +1 -1
- package/dist/dto/create-collaborator.dto.js +0 -6
- package/dist/dto/create-collaborator.dto.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/operations.controller.d.ts +42 -0
- package/dist/operations.controller.d.ts.map +1 -1
- package/dist/operations.service.d.ts +178 -264
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +2170 -1340
- package/dist/operations.service.js.map +1 -1
- package/dist/operations.service.spec.js +345 -174
- package/dist/operations.service.spec.js.map +1 -1
- package/hedhog/data/dashboard_component.yaml +66 -0
- package/hedhog/data/dashboard_component_role.yaml +8 -8
- package/hedhog/data/dashboard_item.yaml +25 -25
- package/hedhog/data/dashboard_role.yaml +1 -1
- package/hedhog/data/menu.yaml +6 -16
- package/hedhog/data/role.yaml +1 -1
- package/hedhog/data/route.yaml +116 -55
- package/hedhog/frontend/app/_components/async-options-combobox.tsx.ejs +15 -9
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +39 -99
- package/hedhog/frontend/app/_components/collaborator-picker.tsx.ejs +158 -0
- package/hedhog/frontend/app/_components/my-project-summary-screen.tsx.ejs +314 -116
- package/hedhog/frontend/app/_components/project-assignments-tab.tsx.ejs +434 -449
- package/hedhog/frontend/app/_components/project-costs-section.tsx.ejs +51 -81
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +328 -423
- package/hedhog/frontend/app/_components/project-file-attachments.tsx.ejs +371 -0
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +446 -377
- package/hedhog/frontend/app/_components/task-detail-sheet.tsx.ejs +803 -581
- package/hedhog/frontend/app/_components/task-file-attachments.tsx.ejs +14 -9
- package/hedhog/frontend/app/_components/task-form-fields.tsx.ejs +406 -0
- package/hedhog/frontend/app/_components/task-form-sheet.tsx.ejs +629 -784
- package/hedhog/frontend/app/_components/task-info-display.tsx.ejs +137 -0
- package/hedhog/frontend/app/_components/timesheet-entry-create-sheet.tsx.ejs +306 -0
- package/hedhog/frontend/app/_lib/api.ts.ejs +480 -476
- package/hedhog/frontend/app/_lib/hooks/use-values-visibility.ts.ejs +61 -0
- package/hedhog/frontend/app/_lib/types.ts.ejs +66 -5
- package/hedhog/frontend/app/_lib/utils/format.ts.ejs +0 -2
- package/hedhog/frontend/app/_lib/utils/task-ui.ts.ejs +43 -0
- package/hedhog/frontend/app/approvals/page.tsx.ejs +11 -2
- package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +6 -1
- package/hedhog/frontend/app/collaborators/page.tsx.ejs +127 -42
- package/hedhog/frontend/app/contracts/page.tsx.ejs +29 -8
- package/hedhog/frontend/app/dashboard/widgets/CapacityDistribution.tsx.ejs +84 -0
- package/hedhog/frontend/app/dashboard/widgets/EffortByProject.tsx.ejs +85 -0
- package/hedhog/frontend/app/dashboard/widgets/HeadcountByArea.tsx.ejs +101 -0
- package/hedhog/frontend/app/dashboard/widgets/ManagedProjectsStatus.tsx.ejs +113 -0
- package/hedhog/frontend/app/dashboard/widgets/MyHoursPeriodKpi.tsx.ejs +87 -0
- package/hedhog/frontend/app/dashboard/widgets/MyOpenRequestsKpi.tsx.ejs +97 -0
- package/hedhog/frontend/app/dashboard/widgets/MyPendingRequestsList.tsx.ejs +99 -0
- package/hedhog/frontend/app/dashboard/widgets/MyProjectAllocationsKpi.tsx.ejs +78 -0
- package/hedhog/frontend/app/dashboard/widgets/MyQuickActions.tsx.ejs +130 -0
- package/hedhog/frontend/app/dashboard/widgets/MyRelevantDeadlines.tsx.ejs +144 -0
- package/hedhog/frontend/app/dashboard/widgets/MyTimesheetStatusKpi.tsx.ejs +78 -0
- package/hedhog/frontend/app/dashboard/widgets/MyWeeklyJourney.tsx.ejs +99 -0
- package/hedhog/frontend/app/dashboard/widgets/PortfolioCostsKpi.tsx.ejs +112 -0
- package/hedhog/frontend/app/dashboard/widgets/PortfolioEffortKpi.tsx.ejs +93 -0
- package/hedhog/frontend/app/dashboard/widgets/PortfolioProjectsKpi.tsx.ejs +96 -0
- package/hedhog/frontend/app/dashboard/widgets/PortfolioRiskKpi.tsx.ejs +115 -0
- package/hedhog/frontend/app/dashboard/widgets/ProjectStatusOverview.tsx.ejs +120 -0
- package/hedhog/frontend/app/dashboard/widgets/StrategicDeadlines.tsx.ejs +146 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamApprovalQueue.tsx.ejs +108 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamCapacityKpi.tsx.ejs +97 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamHeadcountKpi.tsx.ejs +100 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamHoursKpi.tsx.ejs +104 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamPendingApprovalsKpi.tsx.ejs +110 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamUtilizationOverview.tsx.ejs +115 -0
- package/hedhog/frontend/app/dashboard/widgets/TeamWorkloadAlerts.tsx.ejs +117 -0
- package/hedhog/frontend/app/dashboard/widgets/index.ts.ejs +26 -0
- package/hedhog/frontend/app/departments/page.tsx.ejs +6 -1
- package/hedhog/frontend/app/my-projects/page.tsx.ejs +59 -16
- package/hedhog/frontend/app/my-tasks/page.tsx.ejs +329 -106
- package/hedhog/frontend/app/project-cost-categories/page.tsx.ejs +58 -52
- package/hedhog/frontend/app/project-cost-types/page.tsx.ejs +58 -51
- package/hedhog/frontend/app/projects/page.tsx.ejs +436 -35
- package/hedhog/frontend/app/reports/collaborators/page.tsx.ejs +65 -52
- package/hedhog/frontend/app/reports/projects/page.tsx.ejs +80 -82
- package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +13 -2
- package/hedhog/frontend/app/time-off/page.tsx.ejs +6 -1
- package/hedhog/frontend/app/timesheets/page.tsx.ejs +10 -4
- package/hedhog/frontend/messages/en.json +460 -61
- package/hedhog/frontend/messages/operations/en.json +61 -52
- package/hedhog/frontend/messages/operations/pt.json +59 -43
- package/hedhog/frontend/messages/pt.json +460 -61
- package/hedhog/frontend/widgets/capacity-distribution.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/effort-by-project.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/headcount-by-area.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/index.ts.ejs +25 -0
- package/hedhog/frontend/widgets/managed-projects-status.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-hours-period-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-open-requests-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-pending-requests-list.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-project-allocations-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-quick-actions.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-relevant-deadlines.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-timesheet-status-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/my-weekly-journey.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/portfolio-costs-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/portfolio-effort-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/portfolio-projects-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/portfolio-risk-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/project-status-overview.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/shared-operations-widget.tsx.ejs +170 -0
- package/hedhog/frontend/widgets/strategic-deadlines.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-approval-queue.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-capacity-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-headcount-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-hours-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-pending-approvals-kpi.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-utilization-overview.tsx.ejs +17 -0
- package/hedhog/frontend/widgets/team-workload-alerts.tsx.ejs +17 -0
- package/hedhog/table/operations_collaborator.yaml +8 -13
- package/hedhog/table/operations_project.yaml +1 -1
- package/hedhog/table/operations_project_file.yaml +23 -0
- package/hedhog/table/operations_task.yaml +76 -69
- package/hedhog/table/operations_task_activity.yaml +51 -0
- package/package.json +7 -6
- package/src/controllers/operations-projects.controller.ts +41 -8
- package/src/controllers/operations-tasks.controller.ts +156 -166
- package/src/dashboard/README.md +214 -0
- package/src/dashboard/components/DashboardLayout.tsx +131 -0
- package/src/dashboard/components/widget-registry.ts +255 -0
- package/src/dashboard/hooks/useDashboardData.ts +29 -0
- package/src/dashboard/types/widgets.types.ts +237 -0
- package/src/dashboard/widgets/CapacityDistribution.tsx +56 -0
- package/src/dashboard/widgets/EffortByProject.tsx +51 -0
- package/src/dashboard/widgets/HeadcountByArea.tsx +57 -0
- package/src/dashboard/widgets/ManagedProjectsStatus.tsx +53 -0
- package/src/dashboard/widgets/MyHoursPeriodKpi.tsx +87 -0
- package/src/dashboard/widgets/MyOpenRequestsKpi.tsx +51 -0
- package/src/dashboard/widgets/MyPendingRequestsList.tsx +63 -0
- package/src/dashboard/widgets/MyProjectAllocationsKpi.tsx +57 -0
- package/src/dashboard/widgets/MyQuickActions.tsx +62 -0
- package/src/dashboard/widgets/MyRelevantDeadlines.tsx +84 -0
- package/src/dashboard/widgets/MyTimesheetStatusKpi.tsx +65 -0
- package/src/dashboard/widgets/MyWeeklyJourney.tsx +57 -0
- package/src/dashboard/widgets/PortfolioCostsKpi.tsx +48 -0
- package/src/dashboard/widgets/PortfolioEffortKpi.tsx +41 -0
- package/src/dashboard/widgets/PortfolioRiskKpi.tsx +50 -0
- package/src/dashboard/widgets/ProjectStatusOverview.tsx +52 -0
- package/src/dashboard/widgets/StrategicDeadlines.tsx +93 -0
- package/src/dashboard/widgets/TeamApprovalQueue.tsx +70 -0
- package/src/dashboard/widgets/TeamCapacityKpi.tsx +50 -0
- package/src/dashboard/widgets/TeamHoursKpi.tsx +51 -0
- package/src/dashboard/widgets/TeamPendingApprovalsKpi.tsx +53 -0
- package/src/dashboard/widgets/TeamUtilizationOverview.tsx +62 -0
- package/src/dashboard/widgets/TeamWorkloadAlerts.tsx +81 -0
- package/src/dashboard/widgets/index.ts +26 -0
- package/src/dto/create-collaborator.dto.ts +4 -11
- package/src/index.ts +3 -0
- package/src/operations.service.spec.ts +988 -764
- package/src/operations.service.ts +4300 -2538
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { DollarSign } from 'lucide-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
interface PortfolioCostsKpiProps {
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
roleSlug: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
data?: {
|
|
14
|
+
totalCosts: number;
|
|
15
|
+
budgetAmount: number;
|
|
16
|
+
costsByCategoryCount: number;
|
|
17
|
+
savingsPercent: number;
|
|
18
|
+
costTrend: 'up' | 'down' | 'stable';
|
|
19
|
+
};
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const PortfolioCostsKpi: React.FC<PortfolioCostsKpiProps> = ({
|
|
24
|
+
title,
|
|
25
|
+
data = {
|
|
26
|
+
totalCosts: 0,
|
|
27
|
+
budgetAmount: 0,
|
|
28
|
+
costsByCategoryCount: 0,
|
|
29
|
+
savingsPercent: 0,
|
|
30
|
+
costTrend: 'stable',
|
|
31
|
+
},
|
|
32
|
+
style,
|
|
33
|
+
}) => {
|
|
34
|
+
const t = useTranslations('operations.PortfolioCostsKpi');
|
|
35
|
+
const budgetUtilization = Math.round(
|
|
36
|
+
(data.totalCosts / data.budgetAmount) * 100
|
|
37
|
+
);
|
|
38
|
+
const isBudgetHealth = budgetUtilization <= 85;
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
className="bg-linear-to-br from-white to-green-50 rounded-lg shadow-sm p-4 border border-green-100"
|
|
42
|
+
style={style}
|
|
43
|
+
>
|
|
44
|
+
<div className="flex items-center justify-between mb-4">
|
|
45
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
46
|
+
<DollarSign className="w-4 h-4 text-green-600" />
|
|
47
|
+
</div>
|
|
48
|
+
<div className="bg-linear-to-r from-green-500 to-emerald-600 rounded-lg p-4 text-white mb-3">
|
|
49
|
+
<div className="flex items-center justify-between">
|
|
50
|
+
<div>
|
|
51
|
+
<div className="text-xs opacity-90">{t('label')}</div>
|
|
52
|
+
<div className="text-3xl font-bold">
|
|
53
|
+
{(data.totalCosts / 1000).toFixed(1)}k
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<DollarSign className="w-12 h-12 opacity-30" />
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div className="space-y-2">
|
|
60
|
+
<div className="flex justify-between items-center">
|
|
61
|
+
<span className="text-xs font-medium text-gray-700">
|
|
62
|
+
{t('budgetUtilization')}
|
|
63
|
+
</span>
|
|
64
|
+
<span
|
|
65
|
+
className={`text-sm font-bold px-2 py-1 rounded-full ${isBudgetHealth ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700'}`}
|
|
66
|
+
>
|
|
67
|
+
{budgetUtilization}%
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
<div className="relative w-full h-4 bg-gray-200 rounded-full overflow-hidden">
|
|
71
|
+
<div
|
|
72
|
+
className={`h-full transition-all duration-500 ease-out rounded-full ${isBudgetHealth ? 'bg-linear-to-r from-green-400 to-green-600' : 'bg-linear-to-r from-yellow-400 to-yellow-600'}`}
|
|
73
|
+
style={{ width: `${Math.min(budgetUtilization, 100)}%` }}
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="flex justify-between text-xs text-gray-600">
|
|
77
|
+
<span>
|
|
78
|
+
{t('spent', { value: (data.totalCosts / 1000).toFixed(1) })}
|
|
79
|
+
</span>
|
|
80
|
+
<span>
|
|
81
|
+
{t('budgeted', { value: (data.budgetAmount / 1000).toFixed(1) })}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div className="grid grid-cols-2 gap-2 bg-green-50 rounded-lg p-3 border border-green-200 mt-3">
|
|
86
|
+
<div>
|
|
87
|
+
<div className="text-xs text-gray-600 mb-1">{t('savings')}</div>
|
|
88
|
+
<div className="text-2xl font-bold text-green-600">
|
|
89
|
+
{data.savingsPercent}%
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div>
|
|
93
|
+
<div className="text-xs text-gray-600 mb-1">{t('trend')}</div>
|
|
94
|
+
<div
|
|
95
|
+
className={`text-sm font-bold flex items-center gap-1 ${data.costTrend === 'down' ? 'text-green-600' : data.costTrend === 'up' ? 'text-red-600' : 'text-gray-600'}`}
|
|
96
|
+
>
|
|
97
|
+
{data.costTrend === 'down' && '📉'}
|
|
98
|
+
{data.costTrend === 'up' && '📈'}
|
|
99
|
+
{data.costTrend === 'stable' && '➡️'}
|
|
100
|
+
{data.costTrend === 'down'
|
|
101
|
+
? t('decreasing')
|
|
102
|
+
: data.costTrend === 'up'
|
|
103
|
+
? t('increasing')
|
|
104
|
+
: t('stable')}
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export default PortfolioCostsKpi;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Activity, Clock } from 'lucide-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
interface PortfolioEffortKpiProps {
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
roleSlug: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
data?: {
|
|
14
|
+
totalEffortHours: number;
|
|
15
|
+
allocatedHours: number;
|
|
16
|
+
availableHours: number;
|
|
17
|
+
effortUtilization: number;
|
|
18
|
+
};
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const PortfolioEffortKpi: React.FC<PortfolioEffortKpiProps> = ({
|
|
23
|
+
title,
|
|
24
|
+
data = {
|
|
25
|
+
totalEffortHours: 0,
|
|
26
|
+
allocatedHours: 0,
|
|
27
|
+
availableHours: 0,
|
|
28
|
+
effortUtilization: 0,
|
|
29
|
+
},
|
|
30
|
+
style,
|
|
31
|
+
}) => {
|
|
32
|
+
const t = useTranslations('operations.PortfolioEffortKpi');
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
className="bg-linear-to-br from-white to-orange-50 rounded-lg shadow-sm p-4 border border-orange-100"
|
|
36
|
+
style={style}
|
|
37
|
+
>
|
|
38
|
+
<div className="flex items-center justify-between mb-4">
|
|
39
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
40
|
+
<Activity className="w-4 h-4 text-orange-600" />
|
|
41
|
+
</div>
|
|
42
|
+
<div className="bg-linear-to-r from-orange-500 to-amber-600 rounded-lg p-4 text-white mb-3">
|
|
43
|
+
<div className="flex items-center justify-between">
|
|
44
|
+
<div>
|
|
45
|
+
<div className="text-xs opacity-90">{t('label')}</div>
|
|
46
|
+
<div className="text-3xl font-bold">{data.totalEffortHours}</div>
|
|
47
|
+
<div className="text-xs opacity-90">horas</div>
|
|
48
|
+
</div>
|
|
49
|
+
<Clock className="w-12 h-12 opacity-30" />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div className="space-y-2">
|
|
53
|
+
<div className="flex justify-between items-center">
|
|
54
|
+
<span className="text-xs font-medium text-gray-700">
|
|
55
|
+
{t('utilizationRate')}
|
|
56
|
+
</span>
|
|
57
|
+
<span className="text-sm font-bold text-orange-600">
|
|
58
|
+
{data.effortUtilization}%
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="relative w-full h-4 bg-gray-200 rounded-full overflow-hidden">
|
|
62
|
+
<div
|
|
63
|
+
className="h-full bg-linear-to-r from-orange-400 to-orange-600 transition-all"
|
|
64
|
+
style={{ width: `${Math.min(data.effortUtilization, 100)}%` }}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="grid grid-cols-2 gap-2 mt-3">
|
|
69
|
+
<div className="bg-orange-100 rounded-lg p-3 border border-orange-200">
|
|
70
|
+
<div className="text-xs text-orange-700 mb-1">{t('allocated')}</div>
|
|
71
|
+
<div className="text-2xl font-bold text-orange-600">
|
|
72
|
+
{data.allocatedHours}h
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div className="bg-amber-100 rounded-lg p-3 border border-amber-200">
|
|
76
|
+
<div className="text-xs text-amber-700 mb-1">{t('available')}</div>
|
|
77
|
+
<div className="text-2xl font-bold text-amber-600">
|
|
78
|
+
{data.availableHours}h
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div className="text-center text-xs text-gray-600 pt-2 border-t border-orange-100 mt-3">
|
|
83
|
+
{data.effortUtilization > 90
|
|
84
|
+
? t('highDemand')
|
|
85
|
+
: data.effortUtilization > 70
|
|
86
|
+
? t('balanced')
|
|
87
|
+
: t('availableCapacity')}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default PortfolioEffortKpi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Briefcase } from 'lucide-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
interface PortfolioProjectsKpiProps {
|
|
7
|
+
slug: string;
|
|
8
|
+
title: string;
|
|
9
|
+
roleSlug: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
data?: {
|
|
13
|
+
totalProjects: number;
|
|
14
|
+
activeProjects: number;
|
|
15
|
+
completedProjects: number;
|
|
16
|
+
onHoldProjects: number;
|
|
17
|
+
healthyPercent: number;
|
|
18
|
+
};
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const PortfolioProjectsKpi: React.FC<PortfolioProjectsKpiProps> = ({
|
|
23
|
+
title,
|
|
24
|
+
data = {
|
|
25
|
+
totalProjects: 0,
|
|
26
|
+
activeProjects: 0,
|
|
27
|
+
completedProjects: 0,
|
|
28
|
+
onHoldProjects: 0,
|
|
29
|
+
healthyPercent: 0,
|
|
30
|
+
},
|
|
31
|
+
style,
|
|
32
|
+
}) => {
|
|
33
|
+
const activePercent =
|
|
34
|
+
data.totalProjects > 0
|
|
35
|
+
? Math.round((data.activeProjects / data.totalProjects) * 100)
|
|
36
|
+
: 0;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className="bg-linear-to-br from-white to-indigo-50 rounded-lg shadow-sm p-4 border border-indigo-100"
|
|
41
|
+
style={style}
|
|
42
|
+
>
|
|
43
|
+
<div className="flex items-center justify-between mb-4">
|
|
44
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
45
|
+
<Briefcase className="w-4 h-4 text-indigo-600" />
|
|
46
|
+
</div>
|
|
47
|
+
<div className="bg-linear-to-r from-indigo-500 to-purple-600 rounded-lg p-4 text-white mb-3">
|
|
48
|
+
<div className="flex items-center justify-between">
|
|
49
|
+
<div>
|
|
50
|
+
<div className="text-xs opacity-90">Total de Projetos</div>
|
|
51
|
+
<div className="text-3xl font-bold">{data.totalProjects}</div>
|
|
52
|
+
</div>
|
|
53
|
+
<Briefcase className="w-12 h-12 opacity-30" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div className="space-y-2">
|
|
57
|
+
<div className="flex justify-between items-center">
|
|
58
|
+
<span className="text-xs font-medium text-gray-700">
|
|
59
|
+
Projetos Ativos
|
|
60
|
+
</span>
|
|
61
|
+
<span className="text-sm font-bold px-2 py-1 rounded-full bg-indigo-100 text-indigo-700">
|
|
62
|
+
{activePercent}%
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
<div className="relative w-full h-4 bg-gray-200 rounded-full overflow-hidden">
|
|
66
|
+
<div
|
|
67
|
+
className="h-full transition-all duration-500 ease-out rounded-full bg-linear-to-r from-indigo-400 to-indigo-600"
|
|
68
|
+
style={{ width: `${activePercent}%` }}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div className="grid grid-cols-3 gap-2 bg-indigo-50 rounded-lg p-3 border border-indigo-200 mt-3">
|
|
73
|
+
<div>
|
|
74
|
+
<div className="text-xs text-gray-600 mb-1">Ativos</div>
|
|
75
|
+
<div className="text-xl font-bold text-indigo-600">
|
|
76
|
+
{data.activeProjects}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<div className="text-xs text-gray-600 mb-1">Concluídos</div>
|
|
81
|
+
<div className="text-xl font-bold text-green-600">
|
|
82
|
+
{data.completedProjects}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<div className="text-xs text-gray-600 mb-1">Em Espera</div>
|
|
87
|
+
<div className="text-xl font-bold text-yellow-600">
|
|
88
|
+
{data.onHoldProjects}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default PortfolioProjectsKpi;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { AlertTriangle, TrendingUp } from 'lucide-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
interface PortfolioRiskKpiProps {
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
roleSlug: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
data?: {
|
|
14
|
+
totalRisks: number;
|
|
15
|
+
criticalRisks: number;
|
|
16
|
+
highRisks: number;
|
|
17
|
+
mediumRisks: number;
|
|
18
|
+
riskTrend: 'increasing' | 'stable' | 'decreasing';
|
|
19
|
+
};
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const PortfolioRiskKpi: React.FC<PortfolioRiskKpiProps> = ({
|
|
24
|
+
title,
|
|
25
|
+
data = {
|
|
26
|
+
totalRisks: 0,
|
|
27
|
+
criticalRisks: 0,
|
|
28
|
+
highRisks: 0,
|
|
29
|
+
mediumRisks: 0,
|
|
30
|
+
riskTrend: 'stable',
|
|
31
|
+
},
|
|
32
|
+
style,
|
|
33
|
+
}) => {
|
|
34
|
+
const t = useTranslations('operations.PortfolioRiskKpi');
|
|
35
|
+
const hasHighRisk = data.criticalRisks > 0 || data.highRisks > 3;
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
className={`bg-linear-to-br from-white to-red-50 rounded-lg shadow-sm p-4 border ${hasHighRisk ? 'border-red-400 border-2' : 'border-red-100'} transition-all`}
|
|
39
|
+
style={style}
|
|
40
|
+
>
|
|
41
|
+
<div className="flex items-center justify-between mb-4">
|
|
42
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
43
|
+
{hasHighRisk && (
|
|
44
|
+
<div className="relative">
|
|
45
|
+
<div
|
|
46
|
+
className="absolute inset-0 bg-red-600 rounded-full animate-pulse"
|
|
47
|
+
style={{ opacity: 0.25 }}
|
|
48
|
+
/>
|
|
49
|
+
<AlertTriangle className="w-5 h-5 text-red-600 relative" />
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
</div>
|
|
53
|
+
<div
|
|
54
|
+
className={`rounded-lg p-4 ${data.totalRisks > 10 ? 'bg-red-500 text-white' : data.totalRisks > 5 ? 'bg-yellow-500 text-white' : 'bg-green-500 text-white'}`}
|
|
55
|
+
>
|
|
56
|
+
<div className="flex items-center justify-between">
|
|
57
|
+
<div>
|
|
58
|
+
<div className="text-xs opacity-90">{t('label')}</div>
|
|
59
|
+
<div className="text-3xl font-bold">{data.totalRisks}</div>
|
|
60
|
+
</div>
|
|
61
|
+
<AlertTriangle className="w-12 h-12 opacity-30" />
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div className="space-y-2 mt-3">
|
|
65
|
+
{data.criticalRisks > 0 && (
|
|
66
|
+
<div className="flex items-center justify-between bg-red-50 p-2 rounded-lg border border-red-200">
|
|
67
|
+
<span className="text-xs font-medium text-red-700">
|
|
68
|
+
{t('critical')}
|
|
69
|
+
</span>
|
|
70
|
+
<span className="text-sm font-bold text-red-600">
|
|
71
|
+
{data.criticalRisks}
|
|
72
|
+
</span>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
{data.highRisks > 0 && (
|
|
76
|
+
<div className="flex items-center justify-between bg-yellow-50 p-2 rounded-lg border border-yellow-200">
|
|
77
|
+
<span className="text-xs font-medium text-yellow-700">
|
|
78
|
+
{t('high')}
|
|
79
|
+
</span>
|
|
80
|
+
<span className="text-sm font-bold text-yellow-600">
|
|
81
|
+
{data.highRisks}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
{data.mediumRisks > 0 && (
|
|
86
|
+
<div className="flex items-center justify-between bg-blue-50 p-2 rounded-lg border border-blue-200">
|
|
87
|
+
<span className="text-xs font-medium text-blue-700">
|
|
88
|
+
{t('medium')}
|
|
89
|
+
</span>
|
|
90
|
+
<span className="text-sm font-bold text-blue-600">
|
|
91
|
+
{data.mediumRisks}
|
|
92
|
+
</span>
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
<div className="flex items-center gap-2 pt-2 border-t border-red-100 mt-3">
|
|
97
|
+
<TrendingUp
|
|
98
|
+
className={`w-4 h-4 ${data.riskTrend === 'increasing' ? 'text-red-600' : data.riskTrend === 'decreasing' ? 'text-green-600' : 'text-gray-600'}`}
|
|
99
|
+
/>
|
|
100
|
+
<span className="text-xs font-medium text-gray-700">
|
|
101
|
+
{t('trendLabel')} {data.riskTrend === 'increasing' && t('increasing')}
|
|
102
|
+
{data.riskTrend === 'decreasing' && t('decreasing')}
|
|
103
|
+
{data.riskTrend === 'stable' && t('stable')}
|
|
104
|
+
</span>
|
|
105
|
+
</div>
|
|
106
|
+
{hasHighRisk && (
|
|
107
|
+
<div className="bg-red-100 rounded-lg p-2 border border-red-300 text-xs text-red-700 font-semibold text-center mt-3">
|
|
108
|
+
{t('urgentAttention')}
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default PortfolioRiskKpi;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { CheckCircle2 } from 'lucide-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
interface ProjectStatusOverviewProps {
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
roleSlug: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
data?: {
|
|
14
|
+
planning: number;
|
|
15
|
+
inProgress: number;
|
|
16
|
+
review: number;
|
|
17
|
+
completed: number;
|
|
18
|
+
onHold: number;
|
|
19
|
+
};
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ProjectStatusOverview: React.FC<ProjectStatusOverviewProps> = ({
|
|
24
|
+
title,
|
|
25
|
+
data = { planning: 0, inProgress: 0, review: 0, completed: 0, onHold: 0 },
|
|
26
|
+
style,
|
|
27
|
+
}) => {
|
|
28
|
+
const t = useTranslations('operations.ProjectStatusOverview');
|
|
29
|
+
const total =
|
|
30
|
+
data.planning +
|
|
31
|
+
data.inProgress +
|
|
32
|
+
data.review +
|
|
33
|
+
data.completed +
|
|
34
|
+
data.onHold;
|
|
35
|
+
const statuses = [
|
|
36
|
+
{
|
|
37
|
+
label: t('statuses.planning'),
|
|
38
|
+
count: data.planning,
|
|
39
|
+
emoji: '📋',
|
|
40
|
+
color: 'blue',
|
|
41
|
+
width: total > 0 ? (data.planning / total) * 100 : 0,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: t('statuses.inProgress'),
|
|
45
|
+
count: data.inProgress,
|
|
46
|
+
emoji: '🚀',
|
|
47
|
+
color: 'green',
|
|
48
|
+
width: total > 0 ? (data.inProgress / total) * 100 : 0,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: t('statuses.review'),
|
|
52
|
+
count: data.review,
|
|
53
|
+
emoji: '👀',
|
|
54
|
+
color: 'yellow',
|
|
55
|
+
width: total > 0 ? (data.review / total) * 100 : 0,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: t('statuses.completed'),
|
|
59
|
+
count: data.completed,
|
|
60
|
+
emoji: '✅',
|
|
61
|
+
color: 'purple',
|
|
62
|
+
width: total > 0 ? (data.completed / total) * 100 : 0,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: t('statuses.onHold'),
|
|
66
|
+
count: data.onHold,
|
|
67
|
+
emoji: '⏸️',
|
|
68
|
+
color: 'gray',
|
|
69
|
+
width: total > 0 ? (data.onHold / total) * 100 : 0,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
className="bg-linear-to-br from-white to-violet-50 rounded-lg shadow-sm p-4 border border-violet-100"
|
|
76
|
+
style={style}
|
|
77
|
+
>
|
|
78
|
+
<div className="flex items-center justify-between mb-4">
|
|
79
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
80
|
+
<CheckCircle2 className="w-4 h-4 text-violet-600" />
|
|
81
|
+
</div>
|
|
82
|
+
<div className="flex gap-1 h-8 rounded-lg overflow-hidden bg-gray-100 border border-gray-200 mb-3">
|
|
83
|
+
{statuses.map(
|
|
84
|
+
(status) =>
|
|
85
|
+
status.width > 0 && (
|
|
86
|
+
<div
|
|
87
|
+
key={status.label}
|
|
88
|
+
className={`bg-${status.color}-500 hover:brightness-110 transition-all`}
|
|
89
|
+
style={{ width: `${status.width}%` }}
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
<div className="grid grid-cols-2 gap-2">
|
|
95
|
+
{statuses.map((status) => (
|
|
96
|
+
<div
|
|
97
|
+
key={status.label}
|
|
98
|
+
className={`bg-${status.color}-50 rounded-lg p-3 border border-${status.color}-200`}
|
|
99
|
+
>
|
|
100
|
+
<div className="text-lg mb-1">{status.emoji}</div>
|
|
101
|
+
<div className={`text-2xl font-bold text-${status.color}-600`}>
|
|
102
|
+
{status.count}
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-xs text-gray-600 truncate">{status.label}</div>
|
|
105
|
+
</div>
|
|
106
|
+
))}
|
|
107
|
+
</div>
|
|
108
|
+
<div className="pt-2 border-t border-violet-100 mt-3">
|
|
109
|
+
<div className="flex items-center justify-between text-xs">
|
|
110
|
+
<span className="text-gray-700 font-medium">
|
|
111
|
+
{t('totalProjects')}
|
|
112
|
+
</span>
|
|
113
|
+
<span className="text-lg font-bold text-violet-600">{total}</span>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default ProjectStatusOverview;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { AlertTriangle, CheckCircle2, Flag } from 'lucide-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
interface StrategicDeadline {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
deadline: string;
|
|
11
|
+
daysLeft: number;
|
|
12
|
+
status: 'on-track' | 'at-risk' | 'critical';
|
|
13
|
+
priority: 'high' | 'critical';
|
|
14
|
+
impact: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface StrategicDeadlinesProps {
|
|
18
|
+
slug: string;
|
|
19
|
+
title: string;
|
|
20
|
+
roleSlug: string;
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
data?: { deadlines: StrategicDeadline[] };
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const StrategicDeadlines: React.FC<StrategicDeadlinesProps> = ({
|
|
28
|
+
title,
|
|
29
|
+
data = { deadlines: [] },
|
|
30
|
+
style,
|
|
31
|
+
}) => {
|
|
32
|
+
const t = useTranslations('operations.StrategicDeadlines');
|
|
33
|
+
const criticalCount = data.deadlines.filter(
|
|
34
|
+
(d) => d.status === 'critical'
|
|
35
|
+
).length;
|
|
36
|
+
const atRiskCount = data.deadlines.filter(
|
|
37
|
+
(d) => d.status === 'at-risk'
|
|
38
|
+
).length;
|
|
39
|
+
|
|
40
|
+
const getStatusColor = (status: string) => {
|
|
41
|
+
switch (status) {
|
|
42
|
+
case 'critical':
|
|
43
|
+
return {
|
|
44
|
+
bg: 'bg-red-50',
|
|
45
|
+
border: 'border-red-300 border-l-4',
|
|
46
|
+
dot: 'bg-red-600 animate-pulse',
|
|
47
|
+
};
|
|
48
|
+
case 'at-risk':
|
|
49
|
+
return {
|
|
50
|
+
bg: 'bg-yellow-50',
|
|
51
|
+
border: 'border-yellow-300 border-l-4',
|
|
52
|
+
dot: 'bg-yellow-600',
|
|
53
|
+
};
|
|
54
|
+
default:
|
|
55
|
+
return {
|
|
56
|
+
bg: 'bg-green-50',
|
|
57
|
+
border: 'border-green-300 border-l-4',
|
|
58
|
+
dot: 'bg-green-600',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={`bg-linear-to-br from-white to-rose-50 rounded-lg shadow-sm p-4 border ${criticalCount > 0 ? 'border-rose-400 border-2' : 'border-rose-100'} transition-all`}
|
|
66
|
+
style={style}
|
|
67
|
+
>
|
|
68
|
+
<div className="flex items-center justify-between mb-4">
|
|
69
|
+
<h3 className="text-sm font-medium text-gray-700">{title}</h3>
|
|
70
|
+
<Flag className="w-4 h-4 text-rose-600" />
|
|
71
|
+
</div>
|
|
72
|
+
<div className="space-y-3">
|
|
73
|
+
{data.deadlines.length === 0 ? (
|
|
74
|
+
<div className="text-center py-8">
|
|
75
|
+
<CheckCircle2 className="w-8 h-8 text-green-500 mx-auto mb-2" />
|
|
76
|
+
<p className="text-sm text-gray-600">{t('empty')}</p>
|
|
77
|
+
</div>
|
|
78
|
+
) : (
|
|
79
|
+
<>
|
|
80
|
+
{(criticalCount > 0 || atRiskCount > 0) && (
|
|
81
|
+
<div className="flex gap-2 mb-2">
|
|
82
|
+
{criticalCount > 0 && (
|
|
83
|
+
<div className="bg-red-100 rounded-lg px-3 py-1 text-xs font-bold text-red-700 flex items-center gap-1">
|
|
84
|
+
<AlertTriangle className="w-3 h-3" />
|
|
85
|
+
{criticalCount} crítico{criticalCount !== 1 ? 's' : ''}
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
{atRiskCount > 0 && (
|
|
89
|
+
<div className="bg-yellow-100 rounded-lg px-3 py-1 text-xs font-bold text-yellow-700">
|
|
90
|
+
{atRiskCount} em risco
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
<div className="space-y-2 max-h-72 overflow-y-auto">
|
|
96
|
+
{data.deadlines.map((deadline) => {
|
|
97
|
+
const colors = getStatusColor(deadline.status);
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
key={deadline.id}
|
|
101
|
+
className={`${colors.bg} rounded-lg p-3 border ${colors.border} hover:shadow-md transition-all`}
|
|
102
|
+
>
|
|
103
|
+
<div className="flex items-start gap-2">
|
|
104
|
+
<div
|
|
105
|
+
className={`w-3 h-3 rounded-full ${colors.dot} flex-shrink-0 mt-1`}
|
|
106
|
+
/>
|
|
107
|
+
<div className="flex-1">
|
|
108
|
+
<div className="flex items-start justify-between gap-2 mb-1">
|
|
109
|
+
<p className="text-sm font-bold text-gray-900 truncate">
|
|
110
|
+
{deadline.title}
|
|
111
|
+
</p>
|
|
112
|
+
<span
|
|
113
|
+
className={`text-xs font-bold px-2 py-1 rounded-full flex-shrink-0 ${deadline.priority === 'critical' ? 'bg-red-100 text-red-700' : 'bg-orange-100 text-orange-700'}`}
|
|
114
|
+
>
|
|
115
|
+
{deadline.priority === 'critical' ? '🔴' : '🟠'}
|
|
116
|
+
</span>
|
|
117
|
+
</div>
|
|
118
|
+
<p className="text-xs text-gray-700 mb-2">
|
|
119
|
+
{deadline.impact}
|
|
120
|
+
</p>
|
|
121
|
+
<div className="flex items-center justify-between text-xs">
|
|
122
|
+
<span className="text-gray-600">
|
|
123
|
+
{deadline.deadline}
|
|
124
|
+
</span>
|
|
125
|
+
<span
|
|
126
|
+
className={`font-bold ${deadline.daysLeft <= 0 ? 'text-red-600' : deadline.daysLeft <= 7 ? 'text-orange-600' : 'text-gray-600'}`}
|
|
127
|
+
>
|
|
128
|
+
{deadline.daysLeft <= 0
|
|
129
|
+
? '❌ Vencido'
|
|
130
|
+
: `⏱️ ${deadline.daysLeft}d`}
|
|
131
|
+
</span>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
})}
|
|
138
|
+
</div>
|
|
139
|
+
</>
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export default StrategicDeadlines;
|