@hed-hog/operations 0.0.332 → 0.0.347
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-collaborators.controller.d.ts +55 -36
- package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
- package/dist/controllers/operations-projects.controller.d.ts +3 -0
- package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
- package/dist/operations.service.d.ts +58 -36
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +34 -34
- package/dist/operations.service.js.map +1 -1
- package/dist/operations.service.spec.js +6 -0
- package/dist/operations.service.spec.js.map +1 -1
- package/hedhog/data/menu.yaml +5 -3
- package/hedhog/data/route.yaml +7 -7
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +476 -0
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +3 -1
- package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +261 -0
- package/hedhog/frontend/app/_components/collaborator-tasks-tab.tsx.ejs +358 -358
- package/hedhog/frontend/app/_components/collaborator-timesheets-tab.tsx.ejs +6 -6
- package/hedhog/frontend/app/_components/contract-content-editor.tsx.ejs +258 -0
- package/hedhog/frontend/app/_components/my-project-summary-screen.tsx.ejs +5 -4
- package/hedhog/frontend/app/_components/person-select-with-create.tsx.ejs +1 -0
- package/hedhog/frontend/app/_components/project-assignments-tab.tsx.ejs +0 -6
- package/hedhog/frontend/app/_components/project-cost-report-screen.tsx.ejs +23 -23
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +23 -50
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +62 -28
- package/hedhog/frontend/app/_components/task-detail-sheet.tsx.ejs +23 -6
- package/hedhog/frontend/app/_components/task-form-sheet.tsx.ejs +629 -629
- package/hedhog/frontend/app/_lib/api.ts.ejs +2 -2
- package/hedhog/frontend/app/_lib/utils/task-ui.ts.ejs +1 -1
- package/hedhog/frontend/app/my-projects/page.tsx.ejs +2 -16
- package/hedhog/frontend/app/my-tasks/page.tsx.ejs +86 -24
- package/hedhog/frontend/app/projects/page.tsx.ejs +6 -42
- package/hedhog/frontend/messages/operations/operations/en.json +2100 -0
- package/hedhog/frontend/messages/operations/operations/pt.json +2111 -0
- package/hedhog/frontend/widgets/capacity-distribution.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/effort-by-project.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/headcount-by-area.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/index.ts.ejs +25 -25
- package/hedhog/frontend/widgets/managed-projects-status.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-hours-period-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-open-requests-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-pending-requests-list.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-project-allocations-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-quick-actions.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-relevant-deadlines.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-timesheet-status-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-weekly-journey.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-costs-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-effort-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-projects-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-risk-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/project-status-overview.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/shared-operations-widget.tsx.ejs +169 -169
- package/hedhog/frontend/widgets/strategic-deadlines.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-approval-queue.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-capacity-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-headcount-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-hours-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-pending-approvals-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-utilization-overview.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-workload-alerts.tsx.ejs +16 -16
- package/hedhog/table/operations_collaborator.yaml +8 -8
- package/hedhog/table/operations_task.yaml +76 -76
- package/hedhog/table/operations_task_activity.yaml +51 -51
- package/package.json +6 -6
- package/src/controllers/operations-collaborators.controller.ts +9 -9
- package/src/controllers/operations-tasks.controller.ts +156 -156
- package/src/dashboard/widgets/MyQuickActions.tsx +22 -22
- package/src/dto/create-collaborator.dto.ts +4 -4
- package/src/operations.service.spec.ts +1006 -988
- package/src/operations.service.ts +40 -42
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: project_id
|
|
4
|
-
type: fk
|
|
5
|
-
isNullable: true
|
|
6
|
-
references:
|
|
7
|
-
table: operations_project
|
|
8
|
-
column: id
|
|
9
|
-
onDelete: CASCADE
|
|
10
|
-
onUpdate: CASCADE
|
|
11
|
-
- name: project_assignment_id
|
|
12
|
-
type: fk
|
|
13
|
-
isNullable: true
|
|
14
|
-
references:
|
|
15
|
-
table: operations_project_assignment
|
|
16
|
-
column: id
|
|
17
|
-
onDelete: SET NULL
|
|
18
|
-
onUpdate: CASCADE
|
|
19
|
-
- name: assignee_collaborator_id
|
|
20
|
-
type: fk
|
|
21
|
-
isNullable: true
|
|
22
|
-
references:
|
|
23
|
-
table: operations_collaborator
|
|
24
|
-
column: id
|
|
25
|
-
onDelete: SET NULL
|
|
26
|
-
onUpdate: CASCADE
|
|
27
|
-
- name: name
|
|
28
|
-
type: varchar
|
|
29
|
-
length: 180
|
|
30
|
-
- name: description
|
|
31
|
-
type: text
|
|
32
|
-
isNullable: true
|
|
33
|
-
- name: priority
|
|
34
|
-
type: enum
|
|
35
|
-
values: [low, medium, high]
|
|
36
|
-
default: medium
|
|
37
|
-
- name: status
|
|
38
|
-
type: enum
|
|
39
|
-
values: [todo, doing, review, done]
|
|
40
|
-
default: todo
|
|
41
|
-
- name: due_date
|
|
42
|
-
type: date
|
|
43
|
-
isNullable: true
|
|
44
|
-
- name: estimate_hours
|
|
45
|
-
type: decimal
|
|
46
|
-
precision: 6
|
|
47
|
-
scale: 2
|
|
48
|
-
isNullable: true
|
|
49
|
-
- name: position
|
|
50
|
-
type: int
|
|
51
|
-
default: 0
|
|
52
|
-
- name: tags
|
|
53
|
-
type: text
|
|
54
|
-
isNullable: true
|
|
55
|
-
- name: doing_started_at
|
|
56
|
-
type: datetime
|
|
57
|
-
isNullable: true
|
|
58
|
-
- name: total_doing_minutes
|
|
59
|
-
type: int
|
|
60
|
-
default: 0
|
|
61
|
-
- name: deleted_at
|
|
62
|
-
type: datetime
|
|
63
|
-
isNullable: true
|
|
64
|
-
- type: created_at
|
|
65
|
-
- type: updated_at
|
|
66
|
-
|
|
67
|
-
indices:
|
|
68
|
-
- columns: [project_id]
|
|
69
|
-
- columns: [project_assignment_id]
|
|
70
|
-
- columns: [assignee_collaborator_id]
|
|
71
|
-
- columns: [status]
|
|
72
|
-
- columns: [priority]
|
|
73
|
-
- columns: [due_date]
|
|
74
|
-
- columns: [project_id, status]
|
|
75
|
-
- columns: [doing_started_at]
|
|
76
|
-
- columns: [deleted_at]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: project_id
|
|
4
|
+
type: fk
|
|
5
|
+
isNullable: true
|
|
6
|
+
references:
|
|
7
|
+
table: operations_project
|
|
8
|
+
column: id
|
|
9
|
+
onDelete: CASCADE
|
|
10
|
+
onUpdate: CASCADE
|
|
11
|
+
- name: project_assignment_id
|
|
12
|
+
type: fk
|
|
13
|
+
isNullable: true
|
|
14
|
+
references:
|
|
15
|
+
table: operations_project_assignment
|
|
16
|
+
column: id
|
|
17
|
+
onDelete: SET NULL
|
|
18
|
+
onUpdate: CASCADE
|
|
19
|
+
- name: assignee_collaborator_id
|
|
20
|
+
type: fk
|
|
21
|
+
isNullable: true
|
|
22
|
+
references:
|
|
23
|
+
table: operations_collaborator
|
|
24
|
+
column: id
|
|
25
|
+
onDelete: SET NULL
|
|
26
|
+
onUpdate: CASCADE
|
|
27
|
+
- name: name
|
|
28
|
+
type: varchar
|
|
29
|
+
length: 180
|
|
30
|
+
- name: description
|
|
31
|
+
type: text
|
|
32
|
+
isNullable: true
|
|
33
|
+
- name: priority
|
|
34
|
+
type: enum
|
|
35
|
+
values: [low, medium, high]
|
|
36
|
+
default: medium
|
|
37
|
+
- name: status
|
|
38
|
+
type: enum
|
|
39
|
+
values: [todo, doing, review, done]
|
|
40
|
+
default: todo
|
|
41
|
+
- name: due_date
|
|
42
|
+
type: date
|
|
43
|
+
isNullable: true
|
|
44
|
+
- name: estimate_hours
|
|
45
|
+
type: decimal
|
|
46
|
+
precision: 6
|
|
47
|
+
scale: 2
|
|
48
|
+
isNullable: true
|
|
49
|
+
- name: position
|
|
50
|
+
type: int
|
|
51
|
+
default: 0
|
|
52
|
+
- name: tags
|
|
53
|
+
type: text
|
|
54
|
+
isNullable: true
|
|
55
|
+
- name: doing_started_at
|
|
56
|
+
type: datetime
|
|
57
|
+
isNullable: true
|
|
58
|
+
- name: total_doing_minutes
|
|
59
|
+
type: int
|
|
60
|
+
default: 0
|
|
61
|
+
- name: deleted_at
|
|
62
|
+
type: datetime
|
|
63
|
+
isNullable: true
|
|
64
|
+
- type: created_at
|
|
65
|
+
- type: updated_at
|
|
66
|
+
|
|
67
|
+
indices:
|
|
68
|
+
- columns: [project_id]
|
|
69
|
+
- columns: [project_assignment_id]
|
|
70
|
+
- columns: [assignee_collaborator_id]
|
|
71
|
+
- columns: [status]
|
|
72
|
+
- columns: [priority]
|
|
73
|
+
- columns: [due_date]
|
|
74
|
+
- columns: [project_id, status]
|
|
75
|
+
- columns: [doing_started_at]
|
|
76
|
+
- columns: [deleted_at]
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: task_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: operations_task
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
onUpdate: CASCADE
|
|
10
|
-
- name: actor_collaborator_id
|
|
11
|
-
type: fk
|
|
12
|
-
isNullable: true
|
|
13
|
-
references:
|
|
14
|
-
table: operations_collaborator
|
|
15
|
-
column: id
|
|
16
|
-
onDelete: SET NULL
|
|
17
|
-
onUpdate: CASCADE
|
|
18
|
-
- name: action
|
|
19
|
-
type: enum
|
|
20
|
-
values:
|
|
21
|
-
[
|
|
22
|
-
status_changed,
|
|
23
|
-
task_created,
|
|
24
|
-
task_deleted,
|
|
25
|
-
task_restored,
|
|
26
|
-
assignee_changed,
|
|
27
|
-
priority_changed,
|
|
28
|
-
due_date_changed,
|
|
29
|
-
name_changed,
|
|
30
|
-
description_changed,
|
|
31
|
-
comment_added,
|
|
32
|
-
comment_updated,
|
|
33
|
-
comment_removed,
|
|
34
|
-
file_added,
|
|
35
|
-
file_removed,
|
|
36
|
-
]
|
|
37
|
-
default: status_changed
|
|
38
|
-
- name: from_status
|
|
39
|
-
type: enum
|
|
40
|
-
values: [todo, doing, review, done]
|
|
41
|
-
isNullable: true
|
|
42
|
-
- name: to_status
|
|
43
|
-
type: enum
|
|
44
|
-
values: [todo, doing, review, done]
|
|
45
|
-
isNullable: true
|
|
46
|
-
- type: created_at
|
|
47
|
-
|
|
48
|
-
indices:
|
|
49
|
-
- columns: [task_id]
|
|
50
|
-
- columns: [actor_collaborator_id]
|
|
51
|
-
- columns: [created_at]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: task_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: operations_task
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
onUpdate: CASCADE
|
|
10
|
+
- name: actor_collaborator_id
|
|
11
|
+
type: fk
|
|
12
|
+
isNullable: true
|
|
13
|
+
references:
|
|
14
|
+
table: operations_collaborator
|
|
15
|
+
column: id
|
|
16
|
+
onDelete: SET NULL
|
|
17
|
+
onUpdate: CASCADE
|
|
18
|
+
- name: action
|
|
19
|
+
type: enum
|
|
20
|
+
values:
|
|
21
|
+
[
|
|
22
|
+
status_changed,
|
|
23
|
+
task_created,
|
|
24
|
+
task_deleted,
|
|
25
|
+
task_restored,
|
|
26
|
+
assignee_changed,
|
|
27
|
+
priority_changed,
|
|
28
|
+
due_date_changed,
|
|
29
|
+
name_changed,
|
|
30
|
+
description_changed,
|
|
31
|
+
comment_added,
|
|
32
|
+
comment_updated,
|
|
33
|
+
comment_removed,
|
|
34
|
+
file_added,
|
|
35
|
+
file_removed,
|
|
36
|
+
]
|
|
37
|
+
default: status_changed
|
|
38
|
+
- name: from_status
|
|
39
|
+
type: enum
|
|
40
|
+
values: [todo, doing, review, done]
|
|
41
|
+
isNullable: true
|
|
42
|
+
- name: to_status
|
|
43
|
+
type: enum
|
|
44
|
+
values: [todo, doing, review, done]
|
|
45
|
+
isNullable: true
|
|
46
|
+
- type: created_at
|
|
47
|
+
|
|
48
|
+
indices:
|
|
49
|
+
- columns: [task_id]
|
|
50
|
+
- columns: [actor_collaborator_id]
|
|
51
|
+
- columns: [created_at]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/operations",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.347",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"@nestjs/jwt": "^11",
|
|
11
11
|
"@nestjs/mapped-types": "*",
|
|
12
12
|
"lucide-react": "^0.562.0",
|
|
13
|
-
"@hed-hog/api-pagination": "0.0.7",
|
|
14
|
-
"@hed-hog/api": "0.0.8",
|
|
15
|
-
"@hed-hog/api-prisma": "0.0.6",
|
|
16
13
|
"@hed-hog/api-types": "0.0.1",
|
|
17
14
|
"@hed-hog/api-locale": "0.0.14",
|
|
18
|
-
"@hed-hog/
|
|
19
|
-
"@hed-hog/
|
|
15
|
+
"@hed-hog/api": "0.0.8",
|
|
16
|
+
"@hed-hog/core": "0.0.347",
|
|
17
|
+
"@hed-hog/contact": "0.0.347",
|
|
18
|
+
"@hed-hog/api-pagination": "0.0.7",
|
|
19
|
+
"@hed-hog/api-prisma": "0.0.6"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Role, User } from '@hed-hog/api';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
Body,
|
|
4
|
+
Controller,
|
|
5
|
+
Delete,
|
|
6
|
+
Get,
|
|
7
|
+
Param,
|
|
8
|
+
ParseIntPipe,
|
|
9
|
+
Patch,
|
|
10
|
+
Post,
|
|
11
|
+
Query,
|
|
12
12
|
} from '@nestjs/common';
|
|
13
13
|
import { CreateCollaboratorInvoiceDto } from '../dto/create-collaborator-invoice.dto';
|
|
14
14
|
import { CreateCollaboratorPaymentDto } from '../dto/create-collaborator-payment.dto';
|
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
import { Role, User } from "@hed-hog/api";
|
|
2
|
-
import {
|
|
3
|
-
Body,
|
|
4
|
-
Controller,
|
|
5
|
-
Delete,
|
|
6
|
-
Get,
|
|
7
|
-
Param,
|
|
8
|
-
ParseIntPipe,
|
|
9
|
-
Patch,
|
|
10
|
-
Post,
|
|
11
|
-
Query,
|
|
12
|
-
UploadedFile,
|
|
13
|
-
UseInterceptors,
|
|
14
|
-
} from "@nestjs/common";
|
|
15
|
-
import { FileInterceptor } from "@nestjs/platform-express";
|
|
16
|
-
import { CreateOperationsTaskDto } from "../dto/create-task.dto";
|
|
17
|
-
import { ListMyTasksDto } from "../dto/list-my-tasks.dto";
|
|
18
|
-
import { ListOperationsTasksDto } from "../dto/list-tasks.dto";
|
|
19
|
-
import { UpdateOperationsTaskDto } from "../dto/update-task.dto";
|
|
20
|
-
import { OperationsService } from "../operations.service";
|
|
21
|
-
|
|
22
|
-
@Role()
|
|
23
|
-
@Controller("operations")
|
|
24
|
-
export class OperationsTasksController {
|
|
25
|
-
constructor(private readonly operationsService: OperationsService) {}
|
|
26
|
-
|
|
27
|
-
@Get("tasks")
|
|
28
|
-
listTasks(@User() user, @Query() paginationParams: ListOperationsTasksDto) {
|
|
29
|
-
return this.operationsService.listTasks(
|
|
30
|
-
Number(user?.id || 0),
|
|
31
|
-
paginationParams,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@Get("my-tasks")
|
|
36
|
-
listMyTasks(@User() user, @Query() paginationParams: ListMyTasksDto) {
|
|
37
|
-
return this.operationsService.listMyTasks(
|
|
38
|
-
Number(user?.id || 0),
|
|
39
|
-
paginationParams,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@Get("projects/:id/tasks")
|
|
44
|
-
listProjectBoardTasks(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
45
|
-
return this.operationsService.listProjectBoardTasks(
|
|
46
|
-
Number(user?.id || 0),
|
|
47
|
-
id,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@Post("tasks")
|
|
52
|
-
createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
|
|
53
|
-
return this.operationsService.createTask(Number(user?.id || 0), data);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@Patch("tasks/:id")
|
|
57
|
-
updateTask(
|
|
58
|
-
@User() user,
|
|
59
|
-
@Param("id", ParseIntPipe) id: number,
|
|
60
|
-
@Body() data: UpdateOperationsTaskDto,
|
|
61
|
-
) {
|
|
62
|
-
return this.operationsService.updateTask(Number(user?.id || 0), id, data);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@Delete("tasks/:id")
|
|
66
|
-
removeTask(
|
|
67
|
-
@User() user,
|
|
68
|
-
@Param("id", ParseIntPipe) id: number,
|
|
69
|
-
@Query("permanent") permanent?: string,
|
|
70
|
-
) {
|
|
71
|
-
return this.operationsService.removeTask(
|
|
72
|
-
Number(user?.id || 0),
|
|
73
|
-
id,
|
|
74
|
-
permanent === "true",
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@Get("tasks/:id/files")
|
|
79
|
-
listTaskFiles(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
80
|
-
return this.operationsService.listTaskFiles(Number(user?.id || 0), id);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@Post("tasks/:id/files")
|
|
84
|
-
@UseInterceptors(FileInterceptor("file"))
|
|
85
|
-
addTaskFile(
|
|
86
|
-
@User() user,
|
|
87
|
-
@Param("id", ParseIntPipe) id: number,
|
|
88
|
-
@UploadedFile() file: MulterFile,
|
|
89
|
-
) {
|
|
90
|
-
return this.operationsService.addTaskFile(Number(user?.id || 0), id, file);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@Delete("tasks/:id/files/:fileRelationId")
|
|
94
|
-
removeTaskFile(
|
|
95
|
-
@User() user,
|
|
96
|
-
@Param("id", ParseIntPipe) id: number,
|
|
97
|
-
@Param("fileRelationId", ParseIntPipe) fileRelationId: number,
|
|
98
|
-
) {
|
|
99
|
-
return this.operationsService.removeTaskFile(
|
|
100
|
-
Number(user?.id || 0),
|
|
101
|
-
id,
|
|
102
|
-
fileRelationId,
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@Get("tasks/:id/comments")
|
|
107
|
-
listTaskComments(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
108
|
-
return this.operationsService.listTaskComments(Number(user?.id || 0), id);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@Get("tasks/:id/activities")
|
|
112
|
-
listTaskActivities(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
113
|
-
return this.operationsService.listTaskActivities(Number(user?.id || 0), id);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@Post("tasks/:id/comments")
|
|
117
|
-
addTaskComment(
|
|
118
|
-
@User() user,
|
|
119
|
-
@Param("id", ParseIntPipe) id: number,
|
|
120
|
-
@Body("content") content: string,
|
|
121
|
-
) {
|
|
122
|
-
return this.operationsService.addTaskComment(
|
|
123
|
-
Number(user?.id || 0),
|
|
124
|
-
id,
|
|
125
|
-
content,
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@Patch("tasks/:taskId/comments/:commentId")
|
|
130
|
-
updateTaskComment(
|
|
131
|
-
@User() user,
|
|
132
|
-
@Param("taskId", ParseIntPipe) taskId: number,
|
|
133
|
-
@Param("commentId", ParseIntPipe) commentId: number,
|
|
134
|
-
@Body("content") content: string,
|
|
135
|
-
) {
|
|
136
|
-
return this.operationsService.updateTaskComment(
|
|
137
|
-
Number(user?.id || 0),
|
|
138
|
-
taskId,
|
|
139
|
-
commentId,
|
|
140
|
-
content,
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
@Delete("tasks/:taskId/comments/:commentId")
|
|
145
|
-
removeTaskComment(
|
|
146
|
-
@User() user,
|
|
147
|
-
@Param("taskId", ParseIntPipe) taskId: number,
|
|
148
|
-
@Param("commentId", ParseIntPipe) commentId: number,
|
|
149
|
-
) {
|
|
150
|
-
return this.operationsService.removeTaskComment(
|
|
151
|
-
Number(user?.id || 0),
|
|
152
|
-
taskId,
|
|
153
|
-
commentId,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
1
|
+
import { Role, User } from "@hed-hog/api";
|
|
2
|
+
import {
|
|
3
|
+
Body,
|
|
4
|
+
Controller,
|
|
5
|
+
Delete,
|
|
6
|
+
Get,
|
|
7
|
+
Param,
|
|
8
|
+
ParseIntPipe,
|
|
9
|
+
Patch,
|
|
10
|
+
Post,
|
|
11
|
+
Query,
|
|
12
|
+
UploadedFile,
|
|
13
|
+
UseInterceptors,
|
|
14
|
+
} from "@nestjs/common";
|
|
15
|
+
import { FileInterceptor } from "@nestjs/platform-express";
|
|
16
|
+
import { CreateOperationsTaskDto } from "../dto/create-task.dto";
|
|
17
|
+
import { ListMyTasksDto } from "../dto/list-my-tasks.dto";
|
|
18
|
+
import { ListOperationsTasksDto } from "../dto/list-tasks.dto";
|
|
19
|
+
import { UpdateOperationsTaskDto } from "../dto/update-task.dto";
|
|
20
|
+
import { OperationsService } from "../operations.service";
|
|
21
|
+
|
|
22
|
+
@Role()
|
|
23
|
+
@Controller("operations")
|
|
24
|
+
export class OperationsTasksController {
|
|
25
|
+
constructor(private readonly operationsService: OperationsService) {}
|
|
26
|
+
|
|
27
|
+
@Get("tasks")
|
|
28
|
+
listTasks(@User() user, @Query() paginationParams: ListOperationsTasksDto) {
|
|
29
|
+
return this.operationsService.listTasks(
|
|
30
|
+
Number(user?.id || 0),
|
|
31
|
+
paginationParams,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@Get("my-tasks")
|
|
36
|
+
listMyTasks(@User() user, @Query() paginationParams: ListMyTasksDto) {
|
|
37
|
+
return this.operationsService.listMyTasks(
|
|
38
|
+
Number(user?.id || 0),
|
|
39
|
+
paginationParams,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Get("projects/:id/tasks")
|
|
44
|
+
listProjectBoardTasks(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
45
|
+
return this.operationsService.listProjectBoardTasks(
|
|
46
|
+
Number(user?.id || 0),
|
|
47
|
+
id,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@Post("tasks")
|
|
52
|
+
createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
|
|
53
|
+
return this.operationsService.createTask(Number(user?.id || 0), data);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@Patch("tasks/:id")
|
|
57
|
+
updateTask(
|
|
58
|
+
@User() user,
|
|
59
|
+
@Param("id", ParseIntPipe) id: number,
|
|
60
|
+
@Body() data: UpdateOperationsTaskDto,
|
|
61
|
+
) {
|
|
62
|
+
return this.operationsService.updateTask(Number(user?.id || 0), id, data);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@Delete("tasks/:id")
|
|
66
|
+
removeTask(
|
|
67
|
+
@User() user,
|
|
68
|
+
@Param("id", ParseIntPipe) id: number,
|
|
69
|
+
@Query("permanent") permanent?: string,
|
|
70
|
+
) {
|
|
71
|
+
return this.operationsService.removeTask(
|
|
72
|
+
Number(user?.id || 0),
|
|
73
|
+
id,
|
|
74
|
+
permanent === "true",
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@Get("tasks/:id/files")
|
|
79
|
+
listTaskFiles(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
80
|
+
return this.operationsService.listTaskFiles(Number(user?.id || 0), id);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@Post("tasks/:id/files")
|
|
84
|
+
@UseInterceptors(FileInterceptor("file"))
|
|
85
|
+
addTaskFile(
|
|
86
|
+
@User() user,
|
|
87
|
+
@Param("id", ParseIntPipe) id: number,
|
|
88
|
+
@UploadedFile() file: MulterFile,
|
|
89
|
+
) {
|
|
90
|
+
return this.operationsService.addTaskFile(Number(user?.id || 0), id, file);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@Delete("tasks/:id/files/:fileRelationId")
|
|
94
|
+
removeTaskFile(
|
|
95
|
+
@User() user,
|
|
96
|
+
@Param("id", ParseIntPipe) id: number,
|
|
97
|
+
@Param("fileRelationId", ParseIntPipe) fileRelationId: number,
|
|
98
|
+
) {
|
|
99
|
+
return this.operationsService.removeTaskFile(
|
|
100
|
+
Number(user?.id || 0),
|
|
101
|
+
id,
|
|
102
|
+
fileRelationId,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@Get("tasks/:id/comments")
|
|
107
|
+
listTaskComments(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
108
|
+
return this.operationsService.listTaskComments(Number(user?.id || 0), id);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@Get("tasks/:id/activities")
|
|
112
|
+
listTaskActivities(@User() user, @Param("id", ParseIntPipe) id: number) {
|
|
113
|
+
return this.operationsService.listTaskActivities(Number(user?.id || 0), id);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@Post("tasks/:id/comments")
|
|
117
|
+
addTaskComment(
|
|
118
|
+
@User() user,
|
|
119
|
+
@Param("id", ParseIntPipe) id: number,
|
|
120
|
+
@Body("content") content: string,
|
|
121
|
+
) {
|
|
122
|
+
return this.operationsService.addTaskComment(
|
|
123
|
+
Number(user?.id || 0),
|
|
124
|
+
id,
|
|
125
|
+
content,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@Patch("tasks/:taskId/comments/:commentId")
|
|
130
|
+
updateTaskComment(
|
|
131
|
+
@User() user,
|
|
132
|
+
@Param("taskId", ParseIntPipe) taskId: number,
|
|
133
|
+
@Param("commentId", ParseIntPipe) commentId: number,
|
|
134
|
+
@Body("content") content: string,
|
|
135
|
+
) {
|
|
136
|
+
return this.operationsService.updateTaskComment(
|
|
137
|
+
Number(user?.id || 0),
|
|
138
|
+
taskId,
|
|
139
|
+
commentId,
|
|
140
|
+
content,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@Delete("tasks/:taskId/comments/:commentId")
|
|
145
|
+
removeTaskComment(
|
|
146
|
+
@User() user,
|
|
147
|
+
@Param("taskId", ParseIntPipe) taskId: number,
|
|
148
|
+
@Param("commentId", ParseIntPipe) commentId: number,
|
|
149
|
+
) {
|
|
150
|
+
return this.operationsService.removeTaskComment(
|
|
151
|
+
Number(user?.id || 0),
|
|
152
|
+
taskId,
|
|
153
|
+
commentId,
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -12,35 +12,35 @@ interface QuickAction {
|
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
interface MyQuickActionsProps {
|
|
16
|
-
slug: string;
|
|
17
|
-
title: string;
|
|
15
|
+
interface MyQuickActionsProps {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
18
|
roleSlug: string;
|
|
19
19
|
width?: number;
|
|
20
20
|
height?: number;
|
|
21
21
|
data?: { actions?: QuickAction[] };
|
|
22
|
-
style?: React.CSSProperties;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const defaultActions: QuickAction[] = [
|
|
26
|
-
{ id: 'timesheet', label: 'Registrar Timesheet', icon: <Clock className="w-5 h-5" />, color: 'text-blue-600', bgColor: 'bg-blue-50 hover:bg-blue-100 border-blue-200' },
|
|
27
|
-
{ id: 'request', label: 'Nova Solicitação', icon: <Plus className="w-5 h-5" />, color: 'text-green-600', bgColor: 'bg-green-50 hover:bg-green-100 border-green-200' },
|
|
28
|
-
{ id: 'vacation', label: 'Solicitar Férias', icon: <Send className="w-5 h-5" />, color: 'text-purple-600', bgColor: 'bg-purple-50 hover:bg-purple-100 border-purple-200' },
|
|
29
|
-
{ id: 'expense', label: 'Lançar Despesa', icon: <FileText className="w-5 h-5" />, color: 'text-orange-600', bgColor: 'bg-orange-50 hover:bg-orange-100 border-orange-200' },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
const MyQuickActions: React.FC<MyQuickActionsProps> = ({
|
|
33
|
-
title,
|
|
34
|
-
data,
|
|
35
|
-
style,
|
|
36
|
-
}) => {
|
|
37
|
-
const actions = data?.actions ?? defaultActions;
|
|
38
|
-
|
|
39
|
-
return (
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const defaultActions: QuickAction[] = [
|
|
26
|
+
{ id: 'timesheet', label: 'Registrar Timesheet', icon: <Clock className="w-5 h-5" />, color: 'text-blue-600', bgColor: 'bg-blue-50 hover:bg-blue-100 border-blue-200' },
|
|
27
|
+
{ id: 'request', label: 'Nova Solicitação', icon: <Plus className="w-5 h-5" />, color: 'text-green-600', bgColor: 'bg-green-50 hover:bg-green-100 border-green-200' },
|
|
28
|
+
{ id: 'vacation', label: 'Solicitar Férias', icon: <Send className="w-5 h-5" />, color: 'text-purple-600', bgColor: 'bg-purple-50 hover:bg-purple-100 border-purple-200' },
|
|
29
|
+
{ id: 'expense', label: 'Lançar Despesa', icon: <FileText className="w-5 h-5" />, color: 'text-orange-600', bgColor: 'bg-orange-50 hover:bg-orange-100 border-orange-200' },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const MyQuickActions: React.FC<MyQuickActionsProps> = ({
|
|
33
|
+
title,
|
|
34
|
+
data,
|
|
35
|
+
style,
|
|
36
|
+
}) => {
|
|
37
|
+
const actions = data?.actions ?? defaultActions;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
40
|
<div className="bg-linear-to-br from-white to-emerald-50 rounded-lg shadow-sm p-4 border border-emerald-100" style={style}>
|
|
41
41
|
<h3 className="text-sm font-medium text-gray-700 mb-4">{title}</h3>
|
|
42
42
|
<div className="grid grid-cols-2 gap-2">
|
|
43
|
-
{actions.map((action) => (
|
|
43
|
+
{actions.map((action) => (
|
|
44
44
|
<button key={action.id} onClick={action.onClick} className={`${action.bgColor} border rounded-lg p-3 transition-all transform hover:scale-105 hover:shadow-md active:scale-95`}>
|
|
45
45
|
<div className={`${action.color} mb-2 transition-transform hover:scale-110`}>{action.icon}</div>
|
|
46
46
|
<p className="text-xs font-medium text-gray-900 text-left">{action.label}</p>
|