@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
|
@@ -93,6 +93,7 @@ import {
|
|
|
93
93
|
updateProjectCost,
|
|
94
94
|
type Currency,
|
|
95
95
|
} from '../_lib/api';
|
|
96
|
+
import { MASKED_VALUE } from '../_lib/hooks/use-values-visibility';
|
|
96
97
|
import type {
|
|
97
98
|
FullCostSummary,
|
|
98
99
|
PaginatedResponse,
|
|
@@ -189,14 +190,23 @@ function costToForm(cost: ProjectCost): CostFormState {
|
|
|
189
190
|
|
|
190
191
|
type Props = {
|
|
191
192
|
projectId: number;
|
|
193
|
+
valuesVisible?: boolean;
|
|
192
194
|
};
|
|
193
195
|
|
|
194
|
-
export function ProjectCostsSection({
|
|
196
|
+
export function ProjectCostsSection({
|
|
197
|
+
projectId,
|
|
198
|
+
valuesVisible = false,
|
|
199
|
+
}: Props) {
|
|
195
200
|
const t = useTranslations('operations.ProjectCostsSection');
|
|
196
201
|
const commonT = useTranslations('operations.Common');
|
|
197
202
|
const { request, showToastHandler, getSettingValue, currentLocaleCode } =
|
|
198
203
|
useApp();
|
|
199
204
|
|
|
205
|
+
const fmtCurrency = (amount: number): string =>
|
|
206
|
+
valuesVisible
|
|
207
|
+
? formatCurrency(amount, getSettingValue, currentLocaleCode)
|
|
208
|
+
: MASKED_VALUE;
|
|
209
|
+
|
|
200
210
|
const queryClient = useQueryClient();
|
|
201
211
|
const [isSheetOpen, setIsSheetOpen] = useState(false);
|
|
202
212
|
const [editingCost, setEditingCost] = useState<ProjectCost | null>(null);
|
|
@@ -415,11 +425,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
415
425
|
<p className="text-xs text-muted-foreground">
|
|
416
426
|
{t('grandTotal')}:{' '}
|
|
417
427
|
<span className="font-medium text-foreground">
|
|
418
|
-
{
|
|
419
|
-
grandTotal,
|
|
420
|
-
getSettingValue,
|
|
421
|
-
currentLocaleCode
|
|
422
|
-
)}
|
|
428
|
+
{fmtCurrency(grandTotal)}
|
|
423
429
|
</span>
|
|
424
430
|
</p>
|
|
425
431
|
) : null}
|
|
@@ -457,11 +463,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
457
463
|
</span>
|
|
458
464
|
</div>
|
|
459
465
|
<p className="text-sm font-semibold tabular-nums">
|
|
460
|
-
{
|
|
461
|
-
fullSummary.budget_amount,
|
|
462
|
-
getSettingValue,
|
|
463
|
-
currentLocaleCode
|
|
464
|
-
)}
|
|
466
|
+
{fmtCurrency(fullSummary.budget_amount)}
|
|
465
467
|
</p>
|
|
466
468
|
</div>
|
|
467
469
|
<div className="rounded-xl border bg-card p-3">
|
|
@@ -472,11 +474,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
472
474
|
</span>
|
|
473
475
|
</div>
|
|
474
476
|
<p className="text-sm font-semibold tabular-nums">
|
|
475
|
-
{
|
|
476
|
-
fullSummary.extra_cost_total,
|
|
477
|
-
getSettingValue,
|
|
478
|
-
currentLocaleCode
|
|
479
|
-
)}
|
|
477
|
+
{fmtCurrency(fullSummary.extra_cost_total)}
|
|
480
478
|
</p>
|
|
481
479
|
</div>
|
|
482
480
|
<div className="rounded-xl border bg-card p-3">
|
|
@@ -487,11 +485,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
487
485
|
</span>
|
|
488
486
|
</div>
|
|
489
487
|
<p className="text-sm font-semibold tabular-nums">
|
|
490
|
-
{
|
|
491
|
-
fullSummary.total_project_cost,
|
|
492
|
-
getSettingValue,
|
|
493
|
-
currentLocaleCode
|
|
494
|
-
)}
|
|
488
|
+
{fmtCurrency(fullSummary.total_project_cost)}
|
|
495
489
|
</p>
|
|
496
490
|
</div>
|
|
497
491
|
<div className="rounded-xl border bg-card p-3">
|
|
@@ -514,11 +508,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
514
508
|
fullSummary.remaining_budget < 0 ? 'text-destructive' : ''
|
|
515
509
|
)}
|
|
516
510
|
>
|
|
517
|
-
{
|
|
518
|
-
fullSummary.remaining_budget,
|
|
519
|
-
getSettingValue,
|
|
520
|
-
currentLocaleCode
|
|
521
|
-
)}
|
|
511
|
+
{fmtCurrency(fullSummary.remaining_budget)}
|
|
522
512
|
</p>
|
|
523
513
|
</div>
|
|
524
514
|
<div className="rounded-xl border bg-card p-3">
|
|
@@ -552,11 +542,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
552
542
|
</span>
|
|
553
543
|
</div>
|
|
554
544
|
<p className="text-sm font-semibold tabular-nums">
|
|
555
|
-
{
|
|
556
|
-
fullSummary.realized_total,
|
|
557
|
-
getSettingValue,
|
|
558
|
-
currentLocaleCode
|
|
559
|
-
)}
|
|
545
|
+
{fmtCurrency(fullSummary.realized_total)}
|
|
560
546
|
</p>
|
|
561
547
|
</div>
|
|
562
548
|
</div>
|
|
@@ -616,11 +602,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
616
602
|
{entry.category_name}
|
|
617
603
|
</span>
|
|
618
604
|
<span className="ml-auto shrink-0 text-xs font-medium tabular-nums">
|
|
619
|
-
{
|
|
620
|
-
entry.total,
|
|
621
|
-
getSettingValue,
|
|
622
|
-
currentLocaleCode
|
|
623
|
-
)}
|
|
605
|
+
{fmtCurrency(entry.total)}
|
|
624
606
|
</span>
|
|
625
607
|
</div>
|
|
626
608
|
))}
|
|
@@ -846,11 +828,7 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
846
828
|
</Badge>
|
|
847
829
|
</div>
|
|
848
830
|
<span className="text-xs font-medium text-muted-foreground">
|
|
849
|
-
{
|
|
850
|
-
group.total_amount,
|
|
851
|
-
getSettingValue,
|
|
852
|
-
currentLocaleCode
|
|
853
|
-
)}
|
|
831
|
+
{fmtCurrency(group.total_amount)}
|
|
854
832
|
</span>
|
|
855
833
|
</div>
|
|
856
834
|
|
|
@@ -920,20 +898,12 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
920
898
|
<TableCell className="text-right tabular-nums">
|
|
921
899
|
<span className="text-xs text-muted-foreground">
|
|
922
900
|
{Number(cost.quantity ?? 1)} ×{' '}
|
|
923
|
-
{
|
|
924
|
-
Number(cost.amount),
|
|
925
|
-
getSettingValue,
|
|
926
|
-
currentLocaleCode
|
|
927
|
-
)}
|
|
901
|
+
{fmtCurrency(Number(cost.amount))}
|
|
928
902
|
</span>
|
|
929
903
|
</TableCell>
|
|
930
904
|
<TableCell className="hidden text-right tabular-nums sm:table-cell">
|
|
931
905
|
<span className="font-medium">
|
|
932
|
-
{
|
|
933
|
-
total,
|
|
934
|
-
getSettingValue,
|
|
935
|
-
currentLocaleCode
|
|
936
|
-
)}
|
|
906
|
+
{fmtCurrency(total)}
|
|
937
907
|
</span>
|
|
938
908
|
</TableCell>
|
|
939
909
|
<TableCell>
|
|
@@ -1026,25 +996,25 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
1026
996
|
placeholder: t('fields.costTypeCodePlaceholder'),
|
|
1027
997
|
},
|
|
1028
998
|
]}
|
|
1029
|
-
mapSearchToCreateValues={(search) => ({ name: search })}
|
|
1030
|
-
onCreate={async (values) => {
|
|
1031
|
-
const name = values.name?.trim() ?? '';
|
|
1032
|
-
const slug = name
|
|
1033
|
-
.toLowerCase()
|
|
1034
|
-
.replace(/\s+/g, '-')
|
|
1035
|
-
.replace(/[^a-z0-9-]/g, '');
|
|
1036
|
-
const code =
|
|
1037
|
-
values.code?.trim() ||
|
|
1038
|
-
name
|
|
1039
|
-
.toUpperCase()
|
|
1040
|
-
.replace(/\s+/g, '-')
|
|
1041
|
-
.replace(/[^A-Z0-9-]/g, '')
|
|
1042
|
-
.slice(0, 40);
|
|
1043
|
-
const created = await createProjectCostType(request, {
|
|
1044
|
-
name,
|
|
1045
|
-
code,
|
|
1046
|
-
slug,
|
|
1047
|
-
});
|
|
999
|
+
mapSearchToCreateValues={(search) => ({ name: search })}
|
|
1000
|
+
onCreate={async (values) => {
|
|
1001
|
+
const name = values.name?.trim() ?? '';
|
|
1002
|
+
const slug = name
|
|
1003
|
+
.toLowerCase()
|
|
1004
|
+
.replace(/\s+/g, '-')
|
|
1005
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
1006
|
+
const code =
|
|
1007
|
+
values.code?.trim() ||
|
|
1008
|
+
name
|
|
1009
|
+
.toUpperCase()
|
|
1010
|
+
.replace(/\s+/g, '-')
|
|
1011
|
+
.replace(/[^A-Z0-9-]/g, '')
|
|
1012
|
+
.slice(0, 40);
|
|
1013
|
+
const created = await createProjectCostType(request, {
|
|
1014
|
+
name,
|
|
1015
|
+
code,
|
|
1016
|
+
slug,
|
|
1017
|
+
});
|
|
1048
1018
|
return (created as ProjectCostType) ?? null;
|
|
1049
1019
|
}}
|
|
1050
1020
|
initialSelectedLabel={editingCost?.cost_type?.name}
|
|
@@ -1084,17 +1054,17 @@ export function ProjectCostsSection({ projectId }: Props) {
|
|
|
1084
1054
|
required: true,
|
|
1085
1055
|
},
|
|
1086
1056
|
]}
|
|
1087
|
-
mapSearchToCreateValues={(search) => ({ name: search })}
|
|
1088
|
-
onCreate={async (values) => {
|
|
1089
|
-
const name = values.name?.trim() ?? '';
|
|
1090
|
-
const slug = name
|
|
1091
|
-
.toLowerCase()
|
|
1092
|
-
.replace(/\s+/g, '-')
|
|
1093
|
-
.replace(/[^a-z0-9-]/g, '');
|
|
1094
|
-
const created = await createProjectCostCategory(request, {
|
|
1095
|
-
name,
|
|
1096
|
-
slug,
|
|
1097
|
-
});
|
|
1057
|
+
mapSearchToCreateValues={(search) => ({ name: search })}
|
|
1058
|
+
onCreate={async (values) => {
|
|
1059
|
+
const name = values.name?.trim() ?? '';
|
|
1060
|
+
const slug = name
|
|
1061
|
+
.toLowerCase()
|
|
1062
|
+
.replace(/\s+/g, '-')
|
|
1063
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
1064
|
+
const created = await createProjectCostCategory(request, {
|
|
1065
|
+
name,
|
|
1066
|
+
slug,
|
|
1067
|
+
});
|
|
1098
1068
|
return (created as ProjectCostCategory) ?? null;
|
|
1099
1069
|
}}
|
|
1100
1070
|
initialSelectedLabel={editingCost?.category?.name}
|