@masterteam/task-schedule 0.0.1 → 0.0.3
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 +119 -101
- package/fesm2022/masterteam-task-schedule.mjs +621 -147
- package/fesm2022/masterteam-task-schedule.mjs.map +1 -1
- package/package.json +4 -4
- package/types/masterteam-task-schedule.d.ts +45 -32
package/README.md
CHANGED
|
@@ -1,134 +1,152 @@
|
|
|
1
|
-
# `@masterteam/task-schedule`
|
|
2
|
-
|
|
3
|
-
Syncfusion Gantt based task-schedule package with external model switching.
|
|
4
|
-
|
|
5
|
-
## Public API
|
|
1
|
+
# `@masterteam/task-schedule`
|
|
2
|
+
|
|
3
|
+
Syncfusion Gantt based task-schedule package with external model switching.
|
|
4
|
+
|
|
5
|
+
## Public API
|
|
6
|
+
|
|
7
|
+
- `TaskSchedule` component (`mt-task-schedule`)
|
|
8
|
+
- `TaskScheduleShell` component (`mt-task-schedule-shell`)
|
|
9
|
+
- `TaskScheduleImportModal` component (`mt-task-schedule-import-modal`)
|
|
10
|
+
- `TASK_SCHEDULE_DATA_ADAPTER` injection token
|
|
11
|
+
- `TaskScheduleDataAdapter` interface
|
|
12
|
+
- `TaskScheduleBackendAdapter` (default built-in adapter)
|
|
13
|
+
- `TaskScheduleModelType`
|
|
14
|
+
- `TaskScheduleContext`
|
|
15
|
+
- `TASK_SCHEDULE_DEFAULT_PDF_FONT`
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
6
18
|
|
|
7
|
-
- `
|
|
8
|
-
- `TaskScheduleShell` component (`mt-task-schedule-shell`)
|
|
9
|
-
- `TaskScheduleImportModal` component (`mt-task-schedule-import-modal`)
|
|
10
|
-
- `TASK_SCHEDULE_DATA_ADAPTER` injection token
|
|
11
|
-
- `TaskScheduleDataAdapter` interface
|
|
12
|
-
- `TaskScheduleBackendAdapter` (default built-in adapter)
|
|
13
|
-
- `TaskScheduleModelType`
|
|
14
|
-
- `TaskScheduleContext`
|
|
15
|
-
- `TASK_SCHEDULE_DEFAULT_PDF_FONT`
|
|
19
|
+
- `context`: object with required `levelId` and `levelDataId` for fetch-based schedule reads
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Main context fields:
|
|
18
22
|
|
|
19
|
-
- `modelType`: `'default' | 'edit' | 'baseline' | 'criticalPath' | 'critical-path' | 'resources' | 'unscheduled' | 'phaseGate' | '
|
|
20
|
-
- `
|
|
23
|
+
- `modelType`: `'default' | 'edit' | 'baseline' | 'criticalPath' | 'critical-path' | 'resources' | 'unscheduled' | 'phaseGate' | 'custom'`
|
|
24
|
+
- `langCode`: `'en' | 'ar' | null`
|
|
21
25
|
- `dateFormat`: default `dd/MM/yyyy`
|
|
22
26
|
- `height`: default `760px`
|
|
23
|
-
- `
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
standalone: true,
|
|
56
|
-
imports: [TaskSchedule],
|
|
57
|
-
selector: 'app-task-schedule-host',
|
|
27
|
+
- `pdfFonts`: optional `{ regular?: string; arabic?: string; size?: number }`
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
- `toolbarAction`
|
|
32
|
+
- `actionBegin`
|
|
33
|
+
- `actionCompleted`
|
|
34
|
+
- `loaded`
|
|
35
|
+
- `loadError`
|
|
36
|
+
|
|
37
|
+
`TaskScheduleDataAdapter` optional import methods:
|
|
38
|
+
|
|
39
|
+
- `importTasks(context, file)`
|
|
40
|
+
- `applyImportedTasks(context, payload)`
|
|
41
|
+
- `setBaseline(context, payload?)`
|
|
42
|
+
- `exportTasks(context)`
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { Component, signal } from '@angular/core';
|
|
48
|
+
import {
|
|
49
|
+
TASK_SCHEDULE_DATA_ADAPTER,
|
|
50
|
+
TaskSchedule,
|
|
51
|
+
TaskScheduleDataAdapter,
|
|
52
|
+
TaskScheduleModelType,
|
|
53
|
+
} from '@masterteam/task-schedule';
|
|
54
|
+
|
|
55
|
+
@Component({
|
|
56
|
+
standalone: true,
|
|
57
|
+
imports: [TaskSchedule],
|
|
58
|
+
selector: 'app-task-schedule-host',
|
|
58
59
|
template: `
|
|
59
60
|
<mt-task-schedule
|
|
60
|
-
[
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
[context]="{
|
|
62
|
+
levelId: 12,
|
|
63
|
+
modelType: modelType(),
|
|
64
|
+
levelDataId: 18,
|
|
65
|
+
langCode: 'en'
|
|
66
|
+
}"
|
|
63
67
|
/>
|
|
64
68
|
`,
|
|
65
|
-
providers: [
|
|
66
|
-
{
|
|
67
|
-
provide: TASK_SCHEDULE_DATA_ADAPTER,
|
|
68
|
-
useExisting: TaskScheduleApiAdapterService,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
})
|
|
72
|
-
export class TaskScheduleHostComponent {
|
|
73
|
-
readonly modelType = signal<TaskScheduleModelType>('default');
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
69
|
+
providers: [
|
|
70
|
+
{
|
|
71
|
+
provide: TASK_SCHEDULE_DATA_ADAPTER,
|
|
72
|
+
useExisting: TaskScheduleApiAdapterService,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
})
|
|
76
|
+
export class TaskScheduleHostComponent {
|
|
77
|
+
readonly modelType = signal<TaskScheduleModelType>('default');
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
77
81
|
The component uses `TaskScheduleBackendAdapter` by default.
|
|
78
82
|
|
|
79
83
|
Backend routes used:
|
|
80
84
|
|
|
81
|
-
-
|
|
85
|
+
- Mixed schedule reads (default/edit/critical/custom): `POST /api/levels/{levelId}/{levelDataId}/schedule/query`
|
|
86
|
+
- Runtime baseline snapshot view: `GET /api/levels/{levelId}/{levelDataId}/schedule/baselines/latest`
|
|
87
|
+
- Runtime unscheduled: `GET /api/levels/{levelId}/{levelDataId}/schedule/unscheduled`
|
|
88
|
+
- Runtime resource mode: `GET /api/levels/{levelId}/{levelDataId}/schedule/by-resource`
|
|
82
89
|
- Custom view config: `GET /api/schedulemanager/{levelId}/schedule/{customViewId}`
|
|
83
90
|
- Team members (edit/resources mode): `GET /api/levels/{levelId}/TeamMember`
|
|
84
91
|
|
|
85
|
-
|
|
92
|
+
Phase-gate runtime reads are handled separately in the app-client phase-gate flow and are not part of this package migration.
|
|
86
93
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `
|
|
90
|
-
- `PUT /api/
|
|
91
|
-
- `
|
|
92
|
-
- `PUT /api/
|
|
93
|
-
- `PUT /api/
|
|
94
|
+
Runtime mutations (when `levelDataId` exists):
|
|
95
|
+
|
|
96
|
+
- `POST /api/levels/{levelId}/{levelDataId}/schedule`
|
|
97
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/{taskId}`
|
|
98
|
+
- `DELETE /api/levels/{levelId}/{levelDataId}/schedule/{taskId}`
|
|
99
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/bulk-update`
|
|
100
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/reorder`
|
|
101
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/{taskId}/progress`
|
|
102
|
+
- `POST /api/levels/{levelId}/{levelDataId}/schedule/baselines` (set baseline)
|
|
103
|
+
- `GET /api/levels/{levelId}/{levelDataId}/schedule/mpp` (export)
|
|
104
|
+
|
|
105
|
+
Plain schedule reads no longer use legacy `/api/tasks/...` read routes.
|
|
106
|
+
Import modal keeps its current MPP preview/apply flow unless `endpoints.importTasks` / `endpoints.applyImportedTasks` are overridden.
|
|
94
107
|
|
|
95
108
|
Context options for backend routing:
|
|
96
109
|
|
|
97
110
|
- `apiBaseUrl`: optional base URL prefix
|
|
98
|
-
- `
|
|
111
|
+
- `modelType`: selected schedule mode
|
|
112
|
+
- `langCode`: optional language override
|
|
113
|
+
- `dateFormat`: optional gantt date format
|
|
114
|
+
- `height`: optional gantt height
|
|
99
115
|
- `customViewId`: used in `custom` mode to load schedule-manager view columns
|
|
100
116
|
- `resources`: optional static resource list override
|
|
101
|
-
- `endpoints`: optional endpoint template overrides (`
|
|
102
|
-
- `endpoints.
|
|
103
|
-
- `endpoints.
|
|
117
|
+
- `endpoints`: optional endpoint template overrides (`scheduleTreePhaseGate`, `scheduleViewById`, `teamMembers`, `createTask`, etc.)
|
|
118
|
+
- `endpoints.importTasks` / `endpoints.applyImportedTasks`: optional overrides for runtime/legacy MPP import flow
|
|
119
|
+
- `endpoints.setBaseline`: optional override for baseline endpoint (runtime default: `/api/levels/{levelId}/{levelDataId}/schedule/baselines`)
|
|
120
|
+
- `endpoints.exportTasks`: optional override for export endpoint (runtime default: `/api/levels/{levelId}/{levelDataId}/schedule/mpp`)
|
|
104
121
|
- `requestHeaders`: optional additional headers
|
|
105
122
|
- `pdfFonts`: optional `{ regular?: string; arabic?: string; size?: number }` base64 font config for PDF export
|
|
106
|
-
|
|
107
|
-
When no PDF font is provided, package fallback uses embedded `TASK_SCHEDULE_DEFAULT_PDF_FONT`.
|
|
108
|
-
|
|
109
|
-
## Import Modal
|
|
110
|
-
|
|
111
|
-
Use `mt-task-schedule-import-modal` to import `.mpp`/`.xer` files and apply tasks (replace or append).
|
|
112
|
-
The modal is Tailwind-based and uses `@masterteam/components` (`mt-button`, `mt-entity-preview`).
|
|
113
|
-
Imported rows support inline editing before apply (task name, planned/actual dates, assignee, progress) with per-row selection.
|
|
114
|
-
|
|
123
|
+
|
|
124
|
+
When no PDF font is provided, package fallback uses embedded `TASK_SCHEDULE_DEFAULT_PDF_FONT`.
|
|
125
|
+
|
|
126
|
+
## Import Modal
|
|
127
|
+
|
|
128
|
+
Use `mt-task-schedule-import-modal` to import `.mpp`/`.xer` files and apply tasks (replace or append).
|
|
129
|
+
The modal is Tailwind-based and uses `@masterteam/components` (`mt-button`, `mt-entity-preview`).
|
|
130
|
+
Imported rows support inline editing before apply (task name, planned/actual dates, assignee, progress) with per-row selection.
|
|
131
|
+
|
|
115
132
|
## Shell Component
|
|
116
133
|
|
|
117
134
|
Use `mt-task-schedule-shell` as the package-level host that combines:
|
|
118
|
-
|
|
119
|
-
- mode switcher
|
|
120
|
-
- Set Baseline action (adapter `setBaseline`)
|
|
121
|
-
- Import modal orchestration
|
|
122
|
-
- Export tasks action (adapter `exportTasks`)
|
|
123
|
-
|
|
124
|
-
Shell parity control
|
|
125
|
-
|
|
135
|
+
|
|
136
|
+
- mode switcher
|
|
137
|
+
- Set Baseline action (adapter `setBaseline`)
|
|
138
|
+
- Import modal orchestration
|
|
139
|
+
- Export tasks action (adapter `exportTasks`)
|
|
140
|
+
|
|
141
|
+
Shell parity control fields also live on `context`:
|
|
142
|
+
|
|
143
|
+
- `modeOptions`
|
|
126
144
|
- `allowEditMode`
|
|
127
145
|
- `allowImport`
|
|
128
146
|
- `allowSetBaseline`
|
|
129
147
|
- `hasTasks`
|
|
130
148
|
- `baselinePending`
|
|
131
|
-
|
|
132
|
-
Use one adapter service per selector/source if needed. The component does not use NGXS.
|
|
133
|
-
|
|
134
|
-
See `PARITY_REPORT.md` for legacy-to-package migration coverage.
|
|
149
|
+
|
|
150
|
+
Use one adapter service per selector/source if needed. The component does not use NGXS.
|
|
151
|
+
|
|
152
|
+
See `PARITY_REPORT.md` for legacy-to-package migration coverage.
|