@hed-hog/operations 0.0.304 → 0.0.305
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-projects.controller.d.ts +15 -0
- package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.d.ts +41 -10
- package/dist/controllers/operations-tasks.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.js +11 -0
- package/dist/controllers/operations-tasks.controller.js.map +1 -1
- package/dist/dto/create-task.dto.d.ts +7 -1
- package/dist/dto/create-task.dto.d.ts.map +1 -1
- package/dist/dto/create-task.dto.js +38 -5
- package/dist/dto/create-task.dto.js.map +1 -1
- package/dist/dto/list-tasks.dto.d.ts +1 -1
- package/dist/dto/list-tasks.dto.d.ts.map +1 -1
- package/dist/dto/list-tasks.dto.js +2 -2
- package/dist/dto/list-tasks.dto.js.map +1 -1
- package/dist/dto/update-task.dto.d.ts +7 -1
- package/dist/dto/update-task.dto.d.ts.map +1 -1
- package/dist/dto/update-task.dto.js +38 -5
- package/dist/dto/update-task.dto.js.map +1 -1
- package/dist/operations.service.d.ts +68 -12
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +380 -101
- package/dist/operations.service.js.map +1 -1
- package/hedhog/data/route.yaml +13 -0
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +44 -44
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +168 -213
- package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +256 -256
- package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +7 -7
- package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +306 -306
- package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +247 -247
- package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +3520 -3520
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +1504 -52
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +528 -403
- package/hedhog/frontend/app/_components/section-card.tsx.ejs +25 -18
- package/hedhog/frontend/app/_components/system-user-select-with-create.tsx.ejs +609 -0
- package/hedhog/frontend/app/_lib/types.ts.ejs +5 -0
- package/hedhog/frontend/app/_lib/utils/format.ts.ejs +7 -7
- package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +48 -1
- package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +502 -502
- package/hedhog/frontend/app/collaborators/page.tsx.ejs +10 -7
- package/hedhog/frontend/app/contracts/page.tsx.ejs +938 -938
- package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +1 -1
- package/hedhog/frontend/app/projects/page.tsx.ejs +360 -133
- package/hedhog/frontend/messages/en.json +27 -4
- package/hedhog/frontend/messages/pt.json +27 -4
- package/hedhog/table/operations_project.yaml +9 -0
- package/hedhog/table/operations_task.yaml +43 -4
- package/package.json +5 -5
- package/src/controllers/operations-tasks.controller.ts +11 -0
- package/src/dto/create-task.dto.ts +47 -7
- package/src/dto/list-tasks.dto.ts +3 -3
- package/src/dto/update-task.dto.ts +47 -7
- package/src/operations.service.ts +556 -88
|
@@ -20,7 +20,7 @@ function resolveLocale(currentLocaleCode: string) {
|
|
|
20
20
|
export function formatDate(
|
|
21
21
|
value?: string | null,
|
|
22
22
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
23
|
-
currentLocaleCode = '
|
|
23
|
+
currentLocaleCode = 'pt-BR'
|
|
24
24
|
) {
|
|
25
25
|
if (!value) {
|
|
26
26
|
return '-';
|
|
@@ -47,8 +47,8 @@ export function formatDate(
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return parsedDate.toLocaleDateString(resolveLocale(currentLocaleCode), {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
day: '2-digit',
|
|
51
|
+
month: '2-digit',
|
|
52
52
|
year: 'numeric',
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -56,7 +56,7 @@ export function formatDate(
|
|
|
56
56
|
export function formatDateTime(
|
|
57
57
|
value?: string | null,
|
|
58
58
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
59
|
-
currentLocaleCode = '
|
|
59
|
+
currentLocaleCode = 'pt-BR'
|
|
60
60
|
) {
|
|
61
61
|
if (!value) {
|
|
62
62
|
return '-';
|
|
@@ -81,8 +81,8 @@ export function formatDateTime(
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
return parsedDate.toLocaleString(resolveLocale(currentLocaleCode), {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
day: '2-digit',
|
|
85
|
+
month: '2-digit',
|
|
86
86
|
year: 'numeric',
|
|
87
87
|
hour: '2-digit',
|
|
88
88
|
minute: '2-digit',
|
|
@@ -169,7 +169,7 @@ export function formatDateRange(
|
|
|
169
169
|
startDate?: string | null,
|
|
170
170
|
endDate?: string | null,
|
|
171
171
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
172
|
-
currentLocaleCode = '
|
|
172
|
+
currentLocaleCode = 'pt-BR'
|
|
173
173
|
) {
|
|
174
174
|
if (!startDate && !endDate) {
|
|
175
175
|
return '-';
|
|
@@ -4,10 +4,57 @@ export function parseNumberInput(value: string) {
|
|
|
4
4
|
return null;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const normalized = /[.,]/.test(trimmed)
|
|
8
|
+
? trimmed.replace(/\./g, '').replace(',', '.')
|
|
9
|
+
: trimmed;
|
|
10
|
+
|
|
11
|
+
const parsed = Number(normalized);
|
|
8
12
|
return Number.isFinite(parsed) ? parsed : null;
|
|
9
13
|
}
|
|
10
14
|
|
|
15
|
+
export function normalizePercentInput(value: string) {
|
|
16
|
+
const trimmed = value.trim();
|
|
17
|
+
|
|
18
|
+
if (!trimmed) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const withNormalizedSeparator = trimmed.replace(/,/g, '.');
|
|
23
|
+
const digitsAndSeparatorsOnly = withNormalizedSeparator.replace(
|
|
24
|
+
/[^0-9.]/g,
|
|
25
|
+
''
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (!digitsAndSeparatorsOnly) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const separatorIndex = digitsAndSeparatorsOnly.indexOf('.');
|
|
33
|
+
const normalized =
|
|
34
|
+
separatorIndex === -1
|
|
35
|
+
? digitsAndSeparatorsOnly
|
|
36
|
+
: `${digitsAndSeparatorsOnly.slice(0, separatorIndex + 1)}${digitsAndSeparatorsOnly
|
|
37
|
+
.slice(separatorIndex + 1)
|
|
38
|
+
.replace(/\./g, '')}`;
|
|
39
|
+
|
|
40
|
+
const prefixedValue = normalized.startsWith('.') ? `0${normalized}` : normalized;
|
|
41
|
+
const parsed = Number(prefixedValue);
|
|
42
|
+
|
|
43
|
+
if (!Number.isFinite(parsed)) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (parsed <= 0) {
|
|
48
|
+
return prefixedValue === '0.' ? prefixedValue : '0';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (parsed >= 100) {
|
|
52
|
+
return '100';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return prefixedValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
11
58
|
export function trimToNull(value?: string | null) {
|
|
12
59
|
const trimmed = value?.trim() ?? '';
|
|
13
60
|
return trimmed ? trimmed : null;
|