@masterteam/task-schedule 0.0.1 → 0.0.2
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
CHANGED
|
@@ -1,134 +1,142 @@
|
|
|
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
|
|
18
|
-
|
|
19
|
-
- `modelType`: `'default' | 'edit' | 'baseline' | 'criticalPath' | 'critical-path' | 'resources' | 'unscheduled' | 'phaseGate' | 'phase-gate' | 'custom'`
|
|
20
|
-
- `context`: object with required `levelId` and `levelDataId` for runtime tree loading, plus optional `customViewId`, etc.
|
|
21
|
-
- `dateFormat`: default `dd/MM/yyyy`
|
|
22
|
-
- `height`: default `760px`
|
|
23
|
-
- `langCode`: `'en' | 'ar' | null` (optional; auto-resolves from context/localStorage/document)
|
|
24
|
-
- `pdfFontData`: optional base64 TTF string for PDF export font
|
|
25
|
-
- `pdfRtlFontData`: optional base64 TTF string used in RTL/Arabic PDF export
|
|
26
|
-
- `pdfFontSize`: optional PDF font size (default `11`)
|
|
27
|
-
|
|
28
|
-
## Outputs
|
|
29
|
-
|
|
30
|
-
- `toolbarAction`
|
|
31
|
-
- `actionBegin`
|
|
32
|
-
- `actionCompleted`
|
|
33
|
-
- `loaded`
|
|
34
|
-
- `loadError`
|
|
35
|
-
|
|
36
|
-
`TaskScheduleDataAdapter` optional import methods:
|
|
37
|
-
|
|
38
|
-
- `importTasks(context, file)`
|
|
39
|
-
- `applyImportedTasks(context, payload)`
|
|
40
|
-
- `setBaseline(context, payload?)`
|
|
41
|
-
- `exportTasks(context)`
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
```ts
|
|
46
|
-
import { Component, signal } from '@angular/core';
|
|
47
|
-
import {
|
|
48
|
-
TASK_SCHEDULE_DATA_ADAPTER,
|
|
49
|
-
TaskSchedule,
|
|
50
|
-
TaskScheduleDataAdapter,
|
|
51
|
-
TaskScheduleModelType,
|
|
52
|
-
} from '@masterteam/task-schedule';
|
|
53
|
-
|
|
54
|
-
@Component({
|
|
55
|
-
standalone: true,
|
|
56
|
-
imports: [TaskSchedule],
|
|
57
|
-
selector: 'app-task-schedule-host',
|
|
58
|
-
template: `
|
|
59
|
-
<mt-task-schedule
|
|
60
|
-
[modelType]="modelType()"
|
|
61
|
-
[context]="{ levelId: 12, levelDataId: 18 }"
|
|
62
|
-
[langCode]="'en'"
|
|
63
|
-
/>
|
|
64
|
-
`,
|
|
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
|
-
|
|
77
|
-
The component uses `TaskScheduleBackendAdapter` by default.
|
|
78
|
-
|
|
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
|
|
18
|
+
|
|
19
|
+
- `modelType`: `'default' | 'edit' | 'baseline' | 'criticalPath' | 'critical-path' | 'resources' | 'unscheduled' | 'phaseGate' | 'phase-gate' | 'custom'`
|
|
20
|
+
- `context`: object with required `levelId` and `levelDataId` for runtime tree loading, plus optional `customViewId`, etc.
|
|
21
|
+
- `dateFormat`: default `dd/MM/yyyy`
|
|
22
|
+
- `height`: default `760px`
|
|
23
|
+
- `langCode`: `'en' | 'ar' | null` (optional; auto-resolves from context/localStorage/document)
|
|
24
|
+
- `pdfFontData`: optional base64 TTF string for PDF export font
|
|
25
|
+
- `pdfRtlFontData`: optional base64 TTF string used in RTL/Arabic PDF export
|
|
26
|
+
- `pdfFontSize`: optional PDF font size (default `11`)
|
|
27
|
+
|
|
28
|
+
## Outputs
|
|
29
|
+
|
|
30
|
+
- `toolbarAction`
|
|
31
|
+
- `actionBegin`
|
|
32
|
+
- `actionCompleted`
|
|
33
|
+
- `loaded`
|
|
34
|
+
- `loadError`
|
|
35
|
+
|
|
36
|
+
`TaskScheduleDataAdapter` optional import methods:
|
|
37
|
+
|
|
38
|
+
- `importTasks(context, file)`
|
|
39
|
+
- `applyImportedTasks(context, payload)`
|
|
40
|
+
- `setBaseline(context, payload?)`
|
|
41
|
+
- `exportTasks(context)`
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { Component, signal } from '@angular/core';
|
|
47
|
+
import {
|
|
48
|
+
TASK_SCHEDULE_DATA_ADAPTER,
|
|
49
|
+
TaskSchedule,
|
|
50
|
+
TaskScheduleDataAdapter,
|
|
51
|
+
TaskScheduleModelType,
|
|
52
|
+
} from '@masterteam/task-schedule';
|
|
53
|
+
|
|
54
|
+
@Component({
|
|
55
|
+
standalone: true,
|
|
56
|
+
imports: [TaskSchedule],
|
|
57
|
+
selector: 'app-task-schedule-host',
|
|
58
|
+
template: `
|
|
59
|
+
<mt-task-schedule
|
|
60
|
+
[modelType]="modelType()"
|
|
61
|
+
[context]="{ levelId: 12, levelDataId: 18 }"
|
|
62
|
+
[langCode]="'en'"
|
|
63
|
+
/>
|
|
64
|
+
`,
|
|
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
|
+
|
|
77
|
+
The component uses `TaskScheduleBackendAdapter` by default.
|
|
78
|
+
|
|
79
79
|
Backend routes used:
|
|
80
80
|
|
|
81
|
-
- Runtime tree: `GET /api/levels/{levelId}/{levelDataId}/schedule/tree`
|
|
81
|
+
- Runtime tree (default/edit/baseline/critical/custom): `GET /api/levels/{levelId}/{levelDataId}/schedule/tree`
|
|
82
|
+
- Runtime phase gate tree: `GET /api/levels/{levelId}/{levelDataId}/schedule/tree?renderMode=PhaseGate`
|
|
83
|
+
- Runtime unscheduled: `GET /api/levels/{levelId}/{levelDataId}/schedule/unscheduled`
|
|
84
|
+
- Runtime resource mode: `GET /api/levels/{levelId}/{levelDataId}/schedule/by-resource`
|
|
82
85
|
- Custom view config: `GET /api/schedulemanager/{levelId}/schedule/{customViewId}`
|
|
83
86
|
- Team members (edit/resources mode): `GET /api/levels/{levelId}/TeamMember`
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
Runtime mutations (when `levelDataId` exists):
|
|
89
|
+
|
|
90
|
+
- `POST /api/levels/{levelId}/{levelDataId}/schedule`
|
|
91
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/{taskId}`
|
|
92
|
+
- `DELETE /api/levels/{levelId}/{levelDataId}/schedule/{taskId}`
|
|
93
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/bulk-update`
|
|
94
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/reorder`
|
|
95
|
+
- `PUT /api/levels/{levelId}/{levelDataId}/schedule/{taskId}/progress`
|
|
96
|
+
- `POST /api/levels/{levelId}/{levelDataId}/schedule/baselines` (set baseline)
|
|
97
|
+
- `GET /api/levels/{levelId}/{levelDataId}/schedule/mpp` (export)
|
|
86
98
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `DELETE /api/tasks/{levelId}/delete/{taskId}`
|
|
90
|
-
- `PUT /api/tasks/{levelId}/bulkUpdate`
|
|
91
|
-
- `PUT /api/tasks/{levelId}/updateParent/{taskId}`
|
|
92
|
-
- `PUT /api/tasks/{levelId}/reorder`
|
|
93
|
-
- `PUT /api/tasks/{levelId}/updatePlanningModuleProgress`
|
|
99
|
+
Legacy `/api/tasks/...` routes are kept as fallback when `levelDataId` is not provided or when `context.endpoints` overrides are supplied.
|
|
100
|
+
Import modal keeps legacy preview/apply defaults (`POST /api/tasks/mmp/import`, then apply endpoint), unless `endpoints.importTasks` / `endpoints.applyImportedTasks` are overridden.
|
|
94
101
|
|
|
95
102
|
Context options for backend routing:
|
|
96
103
|
|
|
97
104
|
- `apiBaseUrl`: optional base URL prefix
|
|
98
|
-
- `schemaId`: optional legacy API schema id (used for
|
|
105
|
+
- `schemaId`: optional legacy API schema id (used only for legacy fallback routes)
|
|
99
106
|
- `customViewId`: used in `custom` mode to load schedule-manager view columns
|
|
100
107
|
- `resources`: optional static resource list override
|
|
101
108
|
- `endpoints`: optional endpoint template overrides (`scheduleTree`, `scheduleViewById`, `teamMembers`, `createTask`, etc.)
|
|
102
|
-
- `endpoints.
|
|
103
|
-
- `endpoints.
|
|
109
|
+
- `endpoints.importTasks` / `endpoints.applyImportedTasks`: optional overrides for runtime/legacy MPP import flow
|
|
110
|
+
- `endpoints.setBaseline`: optional override for baseline endpoint (runtime default: `/api/levels/{levelId}/{levelDataId}/schedule/baselines`)
|
|
111
|
+
- `endpoints.exportTasks`: optional override for export endpoint (runtime default: `/api/levels/{levelId}/{levelDataId}/schedule/mpp`)
|
|
104
112
|
- `requestHeaders`: optional additional headers
|
|
105
113
|
- `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
|
-
|
|
115
|
-
## Shell Component
|
|
116
|
-
|
|
117
|
-
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 inputs:
|
|
125
|
-
|
|
126
|
-
- `allowEditMode`
|
|
127
|
-
- `allowImport`
|
|
128
|
-
- `allowSetBaseline`
|
|
129
|
-
- `hasTasks`
|
|
130
|
-
- `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.
|
|
114
|
+
|
|
115
|
+
When no PDF font is provided, package fallback uses embedded `TASK_SCHEDULE_DEFAULT_PDF_FONT`.
|
|
116
|
+
|
|
117
|
+
## Import Modal
|
|
118
|
+
|
|
119
|
+
Use `mt-task-schedule-import-modal` to import `.mpp`/`.xer` files and apply tasks (replace or append).
|
|
120
|
+
The modal is Tailwind-based and uses `@masterteam/components` (`mt-button`, `mt-entity-preview`).
|
|
121
|
+
Imported rows support inline editing before apply (task name, planned/actual dates, assignee, progress) with per-row selection.
|
|
122
|
+
|
|
123
|
+
## Shell Component
|
|
124
|
+
|
|
125
|
+
Use `mt-task-schedule-shell` as the package-level host that combines:
|
|
126
|
+
|
|
127
|
+
- mode switcher
|
|
128
|
+
- Set Baseline action (adapter `setBaseline`)
|
|
129
|
+
- Import modal orchestration
|
|
130
|
+
- Export tasks action (adapter `exportTasks`)
|
|
131
|
+
|
|
132
|
+
Shell parity control inputs:
|
|
133
|
+
|
|
134
|
+
- `allowEditMode`
|
|
135
|
+
- `allowImport`
|
|
136
|
+
- `allowSetBaseline`
|
|
137
|
+
- `hasTasks`
|
|
138
|
+
- `baselinePending`
|
|
139
|
+
|
|
140
|
+
Use one adapter service per selector/source if needed. The component does not use NGXS.
|
|
141
|
+
|
|
142
|
+
See `PARITY_REPORT.md` for legacy-to-package migration coverage.
|