@hed-hog/operations 0.0.319 → 0.0.322
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/controllers/operations-tasks.controller.d.ts +22 -0
- package/dist/controllers/operations-tasks.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.js +37 -0
- package/dist/controllers/operations-tasks.controller.js.map +1 -1
- package/dist/dto/create-task.dto.d.ts.map +1 -1
- package/dist/dto/create-task.dto.js +0 -1
- package/dist/dto/create-task.dto.js.map +1 -1
- package/dist/dto/update-task.dto.d.ts.map +1 -1
- package/dist/dto/update-task.dto.js +0 -1
- package/dist/dto/update-task.dto.js.map +1 -1
- package/dist/operations.service.d.ts +22 -0
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +187 -132
- package/dist/operations.service.js.map +1 -1
- package/hedhog/data/operations_cost_type.yaml +95 -95
- package/hedhog/data/route.yaml +39 -0
- package/hedhog/frontend/app/_components/collaborator-costs-section.tsx.ejs +884 -884
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +23 -23
- package/hedhog/frontend/app/_components/person-select-with-create.tsx.ejs +49 -22
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +2968 -624
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +62 -68
- package/hedhog/frontend/app/_components/task-file-attachments.tsx.ejs +388 -0
- package/hedhog/frontend/app/_lib/types.ts.ejs +179 -178
- package/hedhog/frontend/app/my-tasks/page.tsx.ejs +121 -11
- package/hedhog/frontend/app/projects/page.tsx.ejs +105 -22
- package/hedhog/frontend/app/reports/collaborators/page.tsx.ejs +771 -771
- package/hedhog/frontend/app/reports/projects/page.tsx.ejs +809 -809
- package/hedhog/frontend/messages/en.json +143 -2
- package/hedhog/frontend/messages/pt.json +143 -2
- package/hedhog/table/operations_task_file.yaml +23 -0
- package/package.json +5 -5
- package/src/controllers/operations-reports.controller.ts +32 -32
- package/src/controllers/operations-tasks.controller.ts +43 -9
- package/src/dto/create-task.dto.ts +0 -1
- package/src/dto/list-reports.dto.ts +51 -51
- package/src/dto/update-task.dto.ts +0 -1
- package/src/operations.module.ts +5 -5
- package/src/operations.service.ts +754 -632
|
@@ -66,39 +66,39 @@ export function CollaboratorDetailsScreen({
|
|
|
66
66
|
createdAt: string;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
const { data: compensationHistory = [] } =
|
|
70
|
-
useQuery<CompensationHistoryEntry[]>({
|
|
71
|
-
queryKey: [
|
|
72
|
-
'operations-collaborator-compensation-history',
|
|
73
|
-
currentLocaleCode,
|
|
69
|
+
const { data: compensationHistory = [] } =
|
|
70
|
+
useQuery<CompensationHistoryEntry[]>({
|
|
71
|
+
queryKey: [
|
|
72
|
+
'operations-collaborator-compensation-history',
|
|
73
|
+
currentLocaleCode,
|
|
74
74
|
collaboratorId,
|
|
75
75
|
],
|
|
76
76
|
enabled: access.isDirector,
|
|
77
77
|
queryFn: () =>
|
|
78
78
|
fetchOperations<CompensationHistoryEntry[]>(
|
|
79
79
|
request,
|
|
80
|
-
`/operations/collaborators/${collaboratorId}/compensation-history`
|
|
81
|
-
),
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
if (!collaborator) {
|
|
85
|
-
return (
|
|
86
|
-
<Page>
|
|
87
|
-
<OperationsHeader
|
|
88
|
-
title={t('title')}
|
|
89
|
-
description={t('description')}
|
|
90
|
-
current={t('breadcrumb')}
|
|
91
|
-
/>
|
|
92
|
-
<EmptyState
|
|
93
|
-
icon={<UserRound className="size-12" />}
|
|
80
|
+
`/operations/collaborators/${collaboratorId}/compensation-history`
|
|
81
|
+
),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (!collaborator) {
|
|
85
|
+
return (
|
|
86
|
+
<Page>
|
|
87
|
+
<OperationsHeader
|
|
88
|
+
title={t('title')}
|
|
89
|
+
description={t('description')}
|
|
90
|
+
current={t('breadcrumb')}
|
|
91
|
+
/>
|
|
92
|
+
<EmptyState
|
|
93
|
+
icon={<UserRound className="size-12" />}
|
|
94
94
|
title={commonT('states.emptyTitle')}
|
|
95
95
|
description={t('notFound')}
|
|
96
96
|
actionLabel={commonT('actions.refresh')}
|
|
97
97
|
onAction={() => void refetch()}
|
|
98
|
-
/>
|
|
99
|
-
</Page>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
98
|
+
/>
|
|
99
|
+
</Page>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
102
|
|
|
103
103
|
const summaryCards = [
|
|
104
104
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
|
3
4
|
import { Button } from '@/components/ui/button';
|
|
4
5
|
import {
|
|
5
6
|
Command,
|
|
@@ -49,6 +50,8 @@ import { z } from 'zod';
|
|
|
49
50
|
type PersonOption = {
|
|
50
51
|
id: number | string;
|
|
51
52
|
name: string;
|
|
53
|
+
avatarId?: number | null;
|
|
54
|
+
avatar_id?: number | null;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
type CreatePersonValues = {
|
|
@@ -661,7 +664,10 @@ export function PersonSelectWithCreate({
|
|
|
661
664
|
}
|
|
662
665
|
|
|
663
666
|
if (payload && 'data' in payload && Array.isArray(payload.data)) {
|
|
664
|
-
return payload.data
|
|
667
|
+
return payload.data.map((p) => ({
|
|
668
|
+
...p,
|
|
669
|
+
avatarId: (p as any).avatar_id ?? p.avatarId ?? null,
|
|
670
|
+
})) as PersonOption[];
|
|
665
671
|
}
|
|
666
672
|
|
|
667
673
|
return [];
|
|
@@ -674,14 +680,12 @@ export function PersonSelectWithCreate({
|
|
|
674
680
|
? String(value)
|
|
675
681
|
: '';
|
|
676
682
|
const hasValue = normalizedValue.length > 0;
|
|
677
|
-
const displayLabel =
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
`ID #${normalizedValue}`)
|
|
684
|
-
: selectedPersonLabel || selectPlaceholder;
|
|
683
|
+
const displayLabel = hasValue
|
|
684
|
+
? (personOptionsData.find((person) => String(person.id) === normalizedValue)
|
|
685
|
+
?.name ??
|
|
686
|
+
selectedPersonLabel ??
|
|
687
|
+
`ID #${normalizedValue}`)
|
|
688
|
+
: selectedPersonLabel || selectPlaceholder;
|
|
685
689
|
const hasSelection = hasValue || Boolean(selectedPersonLabel);
|
|
686
690
|
|
|
687
691
|
return (
|
|
@@ -747,19 +751,42 @@ export function PersonSelectWithCreate({
|
|
|
747
751
|
)}
|
|
748
752
|
</CommandEmpty>
|
|
749
753
|
<CommandGroup>
|
|
750
|
-
{personOptionsData.map((person) =>
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
754
|
+
{personOptionsData.map((person) => {
|
|
755
|
+
const avatarId =
|
|
756
|
+
person.avatarId ?? person.avatar_id ?? null;
|
|
757
|
+
const avatarSrc =
|
|
758
|
+
typeof avatarId === 'number' && avatarId > 0
|
|
759
|
+
? `${process.env.NEXT_PUBLIC_API_BASE_URL}/person/avatar/${avatarId}`
|
|
760
|
+
: undefined;
|
|
761
|
+
const initials = person.name
|
|
762
|
+
.trim()
|
|
763
|
+
.split(' ')
|
|
764
|
+
.filter(Boolean)
|
|
765
|
+
.slice(0, 2)
|
|
766
|
+
.map((w) => w[0]!.toUpperCase())
|
|
767
|
+
.join('');
|
|
768
|
+
return (
|
|
769
|
+
<CommandItem
|
|
770
|
+
key={String(person.id)}
|
|
771
|
+
value={`${person.name}-${person.id}`}
|
|
772
|
+
onSelect={() => {
|
|
773
|
+
onChange(Number(person.id), person.name);
|
|
774
|
+
setSelectedPersonLabel(person.name);
|
|
775
|
+
setPersonOpen(false);
|
|
776
|
+
}}
|
|
777
|
+
>
|
|
778
|
+
<Avatar className="mr-2 h-6 w-6 shrink-0">
|
|
779
|
+
{avatarSrc ? (
|
|
780
|
+
<AvatarImage src={avatarSrc} alt={person.name} />
|
|
781
|
+
) : null}
|
|
782
|
+
<AvatarFallback className="text-[9px] font-medium">
|
|
783
|
+
{initials}
|
|
784
|
+
</AvatarFallback>
|
|
785
|
+
</Avatar>
|
|
786
|
+
{person.name}
|
|
787
|
+
</CommandItem>
|
|
788
|
+
);
|
|
789
|
+
})}
|
|
763
790
|
</CommandGroup>
|
|
764
791
|
</CommandList>
|
|
765
792
|
</Command>
|