@hed-hog/operations 0.0.294 → 0.0.296
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/dist/operations.controller.d.ts +415 -0
- package/dist/operations.controller.d.ts.map +1 -0
- package/dist/operations.controller.js +333 -0
- package/dist/operations.controller.js.map +1 -0
- package/dist/operations.module.d.ts.map +1 -1
- package/dist/operations.module.js +4 -3
- package/dist/operations.module.js.map +1 -1
- package/dist/operations.service.d.ts +589 -153
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +2229 -100
- package/dist/operations.service.js.map +1 -1
- package/hedhog/data/menu.yaml +198 -251
- package/hedhog/data/role.yaml +23 -14
- package/hedhog/data/route.yaml +317 -143
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +310 -0
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +631 -0
- package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +132 -0
- package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +558 -0
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +291 -0
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +689 -0
- package/hedhog/frontend/app/_lib/api.ts.ejs +32 -0
- package/hedhog/frontend/app/_lib/hooks/use-operations-access.ts.ejs +44 -0
- package/hedhog/frontend/app/_lib/types.ts.ejs +360 -0
- package/hedhog/frontend/app/_lib/utils/format.ts.ejs +129 -25
- package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +14 -0
- package/hedhog/frontend/app/approvals/page.tsx.ejs +386 -147
- package/hedhog/frontend/app/collaborators/[id]/edit/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/collaborators/[id]/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/collaborators/new/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/collaborators/page.tsx.ejs +261 -0
- package/hedhog/frontend/app/contracts/[id]/edit/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +11 -108
- package/hedhog/frontend/app/contracts/new/page.tsx.ejs +17 -0
- package/hedhog/frontend/app/contracts/page.tsx.ejs +262 -181
- package/hedhog/frontend/app/page.tsx.ejs +319 -177
- package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/projects/[id]/page.tsx.ejs +11 -936
- package/hedhog/frontend/app/projects/new/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/projects/page.tsx.ejs +236 -1074
- package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +418 -0
- package/hedhog/frontend/app/team/page.tsx.ejs +339 -0
- package/hedhog/frontend/app/time-off/page.tsx.ejs +328 -0
- package/hedhog/frontend/app/timesheets/page.tsx.ejs +636 -126
- package/hedhog/frontend/messages/en.json +648 -454
- package/hedhog/frontend/messages/pt.json +647 -454
- package/hedhog/table/operations_approval.yaml +49 -0
- package/hedhog/table/operations_approval_history.yaml +29 -0
- package/hedhog/table/{operations_employee.yaml → operations_collaborator.yaml} +67 -64
- package/hedhog/table/operations_collaborator_schedule_day.yaml +34 -0
- package/hedhog/table/operations_contract.yaml +100 -48
- package/hedhog/table/operations_contract_document.yaml +39 -0
- package/hedhog/table/operations_contract_financial_term.yaml +40 -0
- package/hedhog/table/operations_contract_history.yaml +27 -0
- package/hedhog/table/operations_contract_party.yaml +46 -0
- package/hedhog/table/operations_contract_revision.yaml +38 -0
- package/hedhog/table/operations_contract_signature.yaml +38 -0
- package/hedhog/table/operations_project.yaml +54 -50
- package/hedhog/table/{operations_allocation.yaml → operations_project_assignment.yaml} +55 -52
- package/hedhog/table/operations_schedule_adjustment_day.yaml +34 -0
- package/hedhog/table/operations_schedule_adjustment_request.yaml +53 -0
- package/hedhog/table/operations_time_off_request.yaml +57 -0
- package/hedhog/table/operations_timesheet.yaml +41 -36
- package/hedhog/table/operations_timesheet_entry.yaml +40 -50
- package/package.json +7 -6
- package/src/operations.controller.ts +182 -0
- package/src/operations.module.ts +22 -21
- package/src/operations.service.ts +3595 -137
- package/hedhog/data/operations_career_level.yaml +0 -102
- package/hedhog/data/operations_career_track.yaml +0 -8
- package/hedhog/data/operations_certification.yaml +0 -38
- package/hedhog/data/operations_evaluation_cycle.yaml +0 -18
- package/hedhog/data/operations_performance_criterion.yaml +0 -48
- package/hedhog/frontend/app/_components/allocation-calendar.tsx.ejs +0 -56
- package/hedhog/frontend/app/_components/kanban-board.tsx.ejs +0 -626
- package/hedhog/frontend/app/_components/timesheet-entry-dialog.tsx.ejs +0 -142
- package/hedhog/frontend/app/_lib/hooks/use-operations-data.ts.ejs +0 -41
- package/hedhog/frontend/app/_lib/hooks/use-operations-growth-data.ts.ejs +0 -63
- package/hedhog/frontend/app/_lib/mocks/allocations.mock.ts.ejs +0 -74
- package/hedhog/frontend/app/_lib/mocks/contracts.mock.ts.ejs +0 -74
- package/hedhog/frontend/app/_lib/mocks/operations-growth.mock.ts.ejs +0 -824
- package/hedhog/frontend/app/_lib/mocks/projects.mock.ts.ejs +0 -455
- package/hedhog/frontend/app/_lib/mocks/tasks.mock.ts.ejs +0 -117
- package/hedhog/frontend/app/_lib/mocks/timesheets.mock.ts.ejs +0 -84
- package/hedhog/frontend/app/_lib/mocks/users.mock.ts.ejs +0 -67
- package/hedhog/frontend/app/_lib/services/contracts.service.ts.ejs +0 -10
- package/hedhog/frontend/app/_lib/services/operations-growth.service.ts.ejs +0 -31
- package/hedhog/frontend/app/_lib/services/projects.service.ts.ejs +0 -10
- package/hedhog/frontend/app/_lib/services/tasks.service.ts.ejs +0 -10
- package/hedhog/frontend/app/_lib/services/timesheets.service.ts.ejs +0 -10
- package/hedhog/frontend/app/_lib/types/operations-growth.ts.ejs +0 -209
- package/hedhog/frontend/app/_lib/types/operations.ts.ejs +0 -156
- package/hedhog/frontend/app/_lib/utils/growth.ts.ejs +0 -62
- package/hedhog/frontend/app/_lib/utils/metrics.ts.ejs +0 -103
- package/hedhog/frontend/app/_lib/utils/status.ts.ejs +0 -80
- package/hedhog/frontend/app/allocations/page.tsx.ejs +0 -155
- package/hedhog/frontend/app/career/page.tsx.ejs +0 -143
- package/hedhog/frontend/app/certifications/page.tsx.ejs +0 -202
- package/hedhog/frontend/app/evaluations/page.tsx.ejs +0 -278
- package/hedhog/frontend/app/goals/page.tsx.ejs +0 -171
- package/hedhog/frontend/app/growth/page.tsx.ejs +0 -288
- package/hedhog/frontend/app/manager/page.tsx.ejs +0 -175
- package/hedhog/frontend/app/rewards/page.tsx.ejs +0 -196
- package/hedhog/frontend/app/tasks/page.tsx.ejs +0 -999
- package/hedhog/table/operations_calibration_item.yaml +0 -61
- package/hedhog/table/operations_calibration_session.yaml +0 -25
- package/hedhog/table/operations_career_level.yaml +0 -75
- package/hedhog/table/operations_career_track.yaml +0 -21
- package/hedhog/table/operations_certification.yaml +0 -48
- package/hedhog/table/operations_employee_certification.yaml +0 -43
- package/hedhog/table/operations_employee_connect.yaml +0 -61
- package/hedhog/table/operations_employee_evaluation.yaml +0 -113
- package/hedhog/table/operations_employee_evaluation_item.yaml +0 -39
- package/hedhog/table/operations_employee_profile.yaml +0 -80
- package/hedhog/table/operations_employee_skill_matrix.yaml +0 -30
- package/hedhog/table/operations_evaluation_cycle.yaml +0 -31
- package/hedhog/table/operations_goal.yaml +0 -67
- package/hedhog/table/operations_goal_progress.yaml +0 -31
- package/hedhog/table/operations_performance_criterion.yaml +0 -29
- package/hedhog/table/operations_promotion_readiness.yaml +0 -49
- package/hedhog/table/operations_promotion_recommendation.yaml +0 -63
- package/hedhog/table/operations_public_recognition.yaml +0 -46
- package/hedhog/table/operations_reward.yaml +0 -100
- package/hedhog/table/operations_score_event.yaml +0 -81
- package/hedhog/table/operations_task.yaml +0 -60
- package/src/operations-data.controller.ts +0 -54
- package/src/operations-growth.controller.ts +0 -44
|
@@ -1,177 +1,319 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Page } from '@/components/entity-list';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
title
|
|
76
|
-
value
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
</
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { EmptyState, Page } from '@/components/entity-list';
|
|
4
|
+
import { Button } from '@/components/ui/button';
|
|
5
|
+
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
6
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
7
|
+
import {
|
|
8
|
+
Table,
|
|
9
|
+
TableBody,
|
|
10
|
+
TableCell,
|
|
11
|
+
TableHead,
|
|
12
|
+
TableHeader,
|
|
13
|
+
TableRow,
|
|
14
|
+
} from '@/components/ui/table';
|
|
15
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
16
|
+
import {
|
|
17
|
+
CheckCircle2,
|
|
18
|
+
ClipboardList,
|
|
19
|
+
FolderKanban,
|
|
20
|
+
Hourglass,
|
|
21
|
+
PlaneTakeoff,
|
|
22
|
+
RefreshCcw,
|
|
23
|
+
Users,
|
|
24
|
+
} from 'lucide-react';
|
|
25
|
+
import Link from 'next/link';
|
|
26
|
+
import { useTranslations } from 'next-intl';
|
|
27
|
+
import { OperationsHeader } from './_components/operations-header';
|
|
28
|
+
import { SectionCard } from './_components/section-card';
|
|
29
|
+
import { StatusBadge } from './_components/status-badge';
|
|
30
|
+
import { fetchOperations } from './_lib/api';
|
|
31
|
+
import { useOperationsAccess } from './_lib/hooks/use-operations-access';
|
|
32
|
+
import type { OperationsDashboard, OperationsTeamOverview } from './_lib/types';
|
|
33
|
+
import {
|
|
34
|
+
formatDate,
|
|
35
|
+
formatDateRange,
|
|
36
|
+
formatEnumLabel,
|
|
37
|
+
formatHours,
|
|
38
|
+
getStatusBadgeClass,
|
|
39
|
+
} from './_lib/utils/format';
|
|
40
|
+
|
|
41
|
+
export default function OperationsDashboardPage() {
|
|
42
|
+
const t = useTranslations('operations.DashboardPage');
|
|
43
|
+
const commonT = useTranslations('operations.Common');
|
|
44
|
+
const { request, currentLocaleCode } = useApp();
|
|
45
|
+
const access = useOperationsAccess();
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
data: dashboard,
|
|
49
|
+
isLoading,
|
|
50
|
+
refetch,
|
|
51
|
+
} = useQuery<OperationsDashboard>({
|
|
52
|
+
queryKey: ['operations-dashboard', currentLocaleCode],
|
|
53
|
+
queryFn: () => fetchOperations<OperationsDashboard>(request, '/operations/dashboard'),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const { data: team } = useQuery<OperationsTeamOverview>({
|
|
57
|
+
queryKey: ['operations-team-overview', currentLocaleCode],
|
|
58
|
+
enabled: access.isSupervisor,
|
|
59
|
+
queryFn: () => fetchOperations<OperationsTeamOverview>(request, '/operations/team'),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const cards = dashboard
|
|
63
|
+
? [
|
|
64
|
+
{
|
|
65
|
+
key: 'projects',
|
|
66
|
+
title: t('cards.projects'),
|
|
67
|
+
value: dashboard.cards.projectsTotal,
|
|
68
|
+
description: t('cards.projectsDescription', {
|
|
69
|
+
active: dashboard.cards.activeProjects,
|
|
70
|
+
}),
|
|
71
|
+
icon: FolderKanban,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'timesheets',
|
|
75
|
+
title: t('cards.timesheets'),
|
|
76
|
+
value: dashboard.cards.visibleTimesheets,
|
|
77
|
+
description: t('cards.timesheetsDescription', {
|
|
78
|
+
pending: dashboard.cards.pendingTimesheets,
|
|
79
|
+
}),
|
|
80
|
+
icon: ClipboardList,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'timeOff',
|
|
84
|
+
title: t('cards.timeOff'),
|
|
85
|
+
value: dashboard.cards.timeOffRequests,
|
|
86
|
+
description: t('cards.timeOffDescription'),
|
|
87
|
+
icon: PlaneTakeoff,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: 'approvals',
|
|
91
|
+
title: t('cards.approvals'),
|
|
92
|
+
value: dashboard.cards.pendingApprovals,
|
|
93
|
+
description: t('cards.approvalsDescription'),
|
|
94
|
+
icon: Hourglass,
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
: [];
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Page>
|
|
101
|
+
<OperationsHeader
|
|
102
|
+
title={t('title')}
|
|
103
|
+
description={t('description')}
|
|
104
|
+
current={t('breadcrumb')}
|
|
105
|
+
actions={
|
|
106
|
+
<div className="flex gap-2">
|
|
107
|
+
<Button variant="outline" size="sm" onClick={() => void refetch()}>
|
|
108
|
+
<RefreshCcw className="size-4" />
|
|
109
|
+
{commonT('actions.refresh')}
|
|
110
|
+
</Button>
|
|
111
|
+
<Button asChild size="sm">
|
|
112
|
+
<Link href="/operations/timesheets">{t('actions.openTimesheets')}</Link>
|
|
113
|
+
</Button>
|
|
114
|
+
</div>
|
|
115
|
+
}
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
{isLoading || access.isLoading ? (
|
|
119
|
+
<div className="space-y-4">
|
|
120
|
+
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
|
121
|
+
{Array.from({ length: 4 }).map((_, index) => (
|
|
122
|
+
<Skeleton key={index} className="h-32 w-full" />
|
|
123
|
+
))}
|
|
124
|
+
</div>
|
|
125
|
+
<div className="grid gap-4 xl:grid-cols-3">
|
|
126
|
+
<Skeleton className="h-64 w-full xl:col-span-2" />
|
|
127
|
+
<Skeleton className="h-64 w-full" />
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
) : dashboard ? (
|
|
131
|
+
<>
|
|
132
|
+
<KpiCardsGrid items={cards} />
|
|
133
|
+
|
|
134
|
+
<div className="grid gap-4 xl:grid-cols-3">
|
|
135
|
+
<SectionCard
|
|
136
|
+
title={t('scope.title')}
|
|
137
|
+
description={t('scope.description')}
|
|
138
|
+
className="xl:col-span-1"
|
|
139
|
+
>
|
|
140
|
+
<dl className="space-y-3 text-sm">
|
|
141
|
+
<div className="flex items-center justify-between gap-4">
|
|
142
|
+
<dt className="text-muted-foreground">{t('scope.roleScope')}</dt>
|
|
143
|
+
<dd className="font-medium">
|
|
144
|
+
{formatEnumLabel(dashboard.actor.roleScope)}
|
|
145
|
+
</dd>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="flex items-center justify-between gap-4">
|
|
148
|
+
<dt className="text-muted-foreground">{t('scope.collaborator')}</dt>
|
|
149
|
+
<dd className="font-medium">
|
|
150
|
+
{dashboard.actor.collaboratorName ?? commonT('labels.notAvailable')}
|
|
151
|
+
</dd>
|
|
152
|
+
</div>
|
|
153
|
+
<div className="flex items-center justify-between gap-4">
|
|
154
|
+
<dt className="text-muted-foreground">{t('scope.teamSize')}</dt>
|
|
155
|
+
<dd className="font-medium">{dashboard.actor.teamSize}</dd>
|
|
156
|
+
</div>
|
|
157
|
+
</dl>
|
|
158
|
+
</SectionCard>
|
|
159
|
+
|
|
160
|
+
<SectionCard
|
|
161
|
+
title={t('recentTimesheets.title')}
|
|
162
|
+
description={t('recentTimesheets.description')}
|
|
163
|
+
className="xl:col-span-2"
|
|
164
|
+
>
|
|
165
|
+
{dashboard.recentTimesheets.length === 0 ? (
|
|
166
|
+
<EmptyState
|
|
167
|
+
icon={<ClipboardList className="size-12" />}
|
|
168
|
+
title={commonT('states.emptyTitle')}
|
|
169
|
+
description={t('recentTimesheets.empty')}
|
|
170
|
+
actionLabel={t('actions.openTimesheets')}
|
|
171
|
+
onAction={() => {
|
|
172
|
+
window.location.href = '/operations/timesheets';
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
175
|
+
) : (
|
|
176
|
+
<div className="overflow-x-auto rounded-md border">
|
|
177
|
+
<Table>
|
|
178
|
+
<TableHeader>
|
|
179
|
+
<TableRow>
|
|
180
|
+
<TableHead>{commonT('labels.collaborator')}</TableHead>
|
|
181
|
+
<TableHead>{commonT('labels.week')}</TableHead>
|
|
182
|
+
<TableHead>{commonT('labels.totalHours')}</TableHead>
|
|
183
|
+
<TableHead>{commonT('labels.status')}</TableHead>
|
|
184
|
+
</TableRow>
|
|
185
|
+
</TableHeader>
|
|
186
|
+
<TableBody>
|
|
187
|
+
{dashboard.recentTimesheets.map((item) => (
|
|
188
|
+
<TableRow key={item.id}>
|
|
189
|
+
<TableCell className="font-medium">
|
|
190
|
+
{item.collaboratorName}
|
|
191
|
+
</TableCell>
|
|
192
|
+
<TableCell>
|
|
193
|
+
{formatDateRange(item.weekStartDate, item.weekEndDate)}
|
|
194
|
+
</TableCell>
|
|
195
|
+
<TableCell>{formatHours(item.totalHours)}</TableCell>
|
|
196
|
+
<TableCell>
|
|
197
|
+
<StatusBadge
|
|
198
|
+
label={formatEnumLabel(item.status)}
|
|
199
|
+
className={getStatusBadgeClass(item.status)}
|
|
200
|
+
/>
|
|
201
|
+
</TableCell>
|
|
202
|
+
</TableRow>
|
|
203
|
+
))}
|
|
204
|
+
</TableBody>
|
|
205
|
+
</Table>
|
|
206
|
+
</div>
|
|
207
|
+
)}
|
|
208
|
+
</SectionCard>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div className="grid gap-4 xl:grid-cols-2">
|
|
212
|
+
<SectionCard
|
|
213
|
+
title={t('nextSteps.title')}
|
|
214
|
+
description={t('nextSteps.description')}
|
|
215
|
+
>
|
|
216
|
+
<div className="space-y-3 text-sm">
|
|
217
|
+
<div className="flex items-start gap-3">
|
|
218
|
+
<CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
|
|
219
|
+
<p>{t('nextSteps.submitTimesheet')}</p>
|
|
220
|
+
</div>
|
|
221
|
+
<div className="flex items-start gap-3">
|
|
222
|
+
<CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
|
|
223
|
+
<p>{t('nextSteps.requestTimeOff')}</p>
|
|
224
|
+
</div>
|
|
225
|
+
<div className="flex items-start gap-3">
|
|
226
|
+
<CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
|
|
227
|
+
<p>{t('nextSteps.adjustSchedule')}</p>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</SectionCard>
|
|
231
|
+
|
|
232
|
+
<SectionCard
|
|
233
|
+
title={t('team.title')}
|
|
234
|
+
description={t('team.description')}
|
|
235
|
+
>
|
|
236
|
+
{access.isSupervisor && team ? (
|
|
237
|
+
<>
|
|
238
|
+
<div className="mb-4 grid gap-3 md:grid-cols-3">
|
|
239
|
+
<div className="rounded-lg border p-4">
|
|
240
|
+
<div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
|
|
241
|
+
{t('team.members')}
|
|
242
|
+
</div>
|
|
243
|
+
<div className="mt-2 text-2xl font-semibold">
|
|
244
|
+
{team.teamMembers.length}
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
<div className="rounded-lg border p-4">
|
|
248
|
+
<div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
|
|
249
|
+
{t('team.projects')}
|
|
250
|
+
</div>
|
|
251
|
+
<div className="mt-2 text-2xl font-semibold">
|
|
252
|
+
{team.projectCount}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
<div className="rounded-lg border p-4">
|
|
256
|
+
<div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
|
|
257
|
+
{t('team.pendingApprovals')}
|
|
258
|
+
</div>
|
|
259
|
+
<div className="mt-2 text-2xl font-semibold">
|
|
260
|
+
{team.pendingApprovals}
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
{team.teamMembers.length > 0 ? (
|
|
266
|
+
<div className="space-y-3">
|
|
267
|
+
{team.teamMembers.slice(0, 4).map((member) => (
|
|
268
|
+
<div
|
|
269
|
+
key={member.id}
|
|
270
|
+
className="flex items-center justify-between rounded-lg border px-4 py-3 text-sm"
|
|
271
|
+
>
|
|
272
|
+
<div>
|
|
273
|
+
<div className="font-medium">{member.displayName}</div>
|
|
274
|
+
<div className="text-muted-foreground">
|
|
275
|
+
{[member.department, member.title]
|
|
276
|
+
.filter(Boolean)
|
|
277
|
+
.join(' • ') || commonT('labels.notAvailable')}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
<div className="text-right">
|
|
281
|
+
<div className="font-medium">
|
|
282
|
+
{member.activeAssignments ?? 0}{' '}
|
|
283
|
+
{t('team.assignments')}
|
|
284
|
+
</div>
|
|
285
|
+
<div className="text-muted-foreground">
|
|
286
|
+
{member.pendingApprovals ?? 0}{' '}
|
|
287
|
+
{t('team.awaitingReview')}
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
))}
|
|
292
|
+
</div>
|
|
293
|
+
) : (
|
|
294
|
+
<p className="text-sm text-muted-foreground">
|
|
295
|
+
{t('team.empty')}
|
|
296
|
+
</p>
|
|
297
|
+
)}
|
|
298
|
+
</>
|
|
299
|
+
) : (
|
|
300
|
+
<div className="flex items-start gap-3 rounded-lg border border-dashed p-4 text-sm text-muted-foreground">
|
|
301
|
+
<Users className="mt-0.5 size-4" />
|
|
302
|
+
<p>{t('team.collaboratorMessage')}</p>
|
|
303
|
+
</div>
|
|
304
|
+
)}
|
|
305
|
+
</SectionCard>
|
|
306
|
+
</div>
|
|
307
|
+
</>
|
|
308
|
+
) : (
|
|
309
|
+
<EmptyState
|
|
310
|
+
icon={<FolderKanban className="size-12" />}
|
|
311
|
+
title={commonT('states.emptyTitle')}
|
|
312
|
+
description={commonT('states.emptyDescription')}
|
|
313
|
+
actionLabel={commonT('actions.refresh')}
|
|
314
|
+
onAction={() => void refetch()}
|
|
315
|
+
/>
|
|
316
|
+
)}
|
|
317
|
+
</Page>
|
|
318
|
+
);
|
|
319
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProjectFormScreen } from '../../../_components/project-form-screen';
|
|
2
|
+
|
|
3
|
+
export default async function OperationsProjectEditPage({
|
|
4
|
+
params,
|
|
5
|
+
}: {
|
|
6
|
+
params: Promise<{ id: string }>;
|
|
7
|
+
}) {
|
|
8
|
+
const { id } = await params;
|
|
9
|
+
|
|
10
|
+
return <ProjectFormScreen projectId={Number(id)} />;
|
|
11
|
+
}
|