@memberjunction/ng-tasks 2.105.0
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +10 -0
- package/README.md +233 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/components/gantt-task-viewer.component.d.ts +44 -0
- package/dist/lib/components/gantt-task-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/gantt-task-viewer.component.js +461 -0
- package/dist/lib/components/gantt-task-viewer.component.js.map +1 -0
- package/dist/lib/components/simple-task-viewer.component.d.ts +36 -0
- package/dist/lib/components/simple-task-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/simple-task-viewer.component.js +275 -0
- package/dist/lib/components/simple-task-viewer.component.js.map +1 -0
- package/dist/lib/components/task-detail-panel.component.d.ts +26 -0
- package/dist/lib/components/task-detail-panel.component.d.ts.map +1 -0
- package/dist/lib/components/task-detail-panel.component.js +294 -0
- package/dist/lib/components/task-detail-panel.component.js.map +1 -0
- package/dist/lib/components/task.component.d.ts +34 -0
- package/dist/lib/components/task.component.d.ts.map +1 -0
- package/dist/lib/components/task.component.js +201 -0
- package/dist/lib/components/task.component.js.map +1 -0
- package/dist/lib/models/task-view.models.d.ts +17 -0
- package/dist/lib/models/task-view.models.d.ts.map +1 -0
- package/dist/lib/models/task-view.models.js +2 -0
- package/dist/lib/models/task-view.models.js.map +1 -0
- package/dist/lib/ng-tasks.module.d.ts +14 -0
- package/dist/lib/ng-tasks.module.d.ts.map +1 -0
- package/dist/lib/ng-tasks.module.js +37 -0
- package/dist/lib/ng-tasks.module.js.map +1 -0
- package/dist/public-api.d.ts +9 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +12 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +31 -0
- package/src/index.ts +1 -0
- package/src/lib/components/gantt-task-viewer.component.ts +524 -0
- package/src/lib/components/simple-task-viewer.component.ts +356 -0
- package/src/lib/components/task-detail-panel.component.ts +304 -0
- package/src/lib/components/task.component.ts +175 -0
- package/src/lib/models/task-view.models.ts +19 -0
- package/src/lib/ng-tasks.module.ts +22 -0
- package/src/lib/types/frappe-gantt.d.ts +32 -0
- package/src/public-api.ts +14 -0
- package/tsconfig.json +24 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# @memberjunction/ng-tasks
|
|
2
|
+
|
|
3
|
+
Angular components for task visualization and management with Gantt chart support.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📋 **Simple List View** - Clean hierarchical task list with indentation for subtasks
|
|
8
|
+
- 📊 **Gantt Chart View** - Timeline visualization using Frappe Gantt
|
|
9
|
+
- 🔄 **View Toggle** - Easy switching between list and Gantt views
|
|
10
|
+
- 🎨 **Clean Design** - Modern, minimal UI that matches MemberJunction aesthetics
|
|
11
|
+
- 📦 **Standalone Components** - Can be used independently or together
|
|
12
|
+
- 🔗 **Dependency Support** - Visualizes task dependencies and relationships
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
This package is part of the MemberJunction monorepo. Install from the repository root:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Components
|
|
23
|
+
|
|
24
|
+
### TaskComponent
|
|
25
|
+
|
|
26
|
+
Main component that composes SimpleTaskViewer and GanttTaskViewer with view toggle.
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { TaskComponent } from '@memberjunction/ng-tasks';
|
|
30
|
+
|
|
31
|
+
@Component({
|
|
32
|
+
template: `
|
|
33
|
+
<mj-task
|
|
34
|
+
[tasks]="myTasks"
|
|
35
|
+
[title]="'Project Tasks'"
|
|
36
|
+
[description]="'Tasks for the current project'"
|
|
37
|
+
[viewMode]="'simple'"
|
|
38
|
+
(taskClicked)="onTaskClick($event)"
|
|
39
|
+
(viewModeChanged)="onViewModeChange($event)">
|
|
40
|
+
</mj-task>
|
|
41
|
+
`
|
|
42
|
+
})
|
|
43
|
+
export class MyComponent {
|
|
44
|
+
myTasks: TaskEntity[] = [...];
|
|
45
|
+
|
|
46
|
+
onTaskClick(task: TaskEntity) {
|
|
47
|
+
console.log('Task clicked:', task);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onViewModeChange(mode: TaskViewMode) {
|
|
51
|
+
console.log('View mode changed to:', mode);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Inputs:**
|
|
57
|
+
- `tasks: TaskEntity[]` - Array of tasks to display
|
|
58
|
+
- `title?: string` - Optional header title
|
|
59
|
+
- `description?: string` - Optional header description
|
|
60
|
+
- `showHeader: boolean` - Whether to show the header (default: true)
|
|
61
|
+
- `viewMode: TaskViewMode` - Initial view mode: 'simple' or 'gantt' (default: 'simple')
|
|
62
|
+
|
|
63
|
+
**Outputs:**
|
|
64
|
+
- `taskClicked: EventEmitter<TaskEntity>` - Emitted when a task is clicked
|
|
65
|
+
- `viewModeChanged: EventEmitter<TaskViewMode>` - Emitted when view mode changes
|
|
66
|
+
|
|
67
|
+
### SimpleTaskViewerComponent
|
|
68
|
+
|
|
69
|
+
Displays tasks in a clean, hierarchical list format.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { SimpleTaskViewerComponent } from '@memberjunction/ng-tasks';
|
|
73
|
+
|
|
74
|
+
@Component({
|
|
75
|
+
template: `
|
|
76
|
+
<mj-simple-task-viewer
|
|
77
|
+
[tasks]="myTasks"
|
|
78
|
+
(taskClicked)="onTaskClick($event)">
|
|
79
|
+
</mj-simple-task-viewer>
|
|
80
|
+
`
|
|
81
|
+
})
|
|
82
|
+
export class MyComponent {
|
|
83
|
+
myTasks: TaskEntity[] = [...];
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Features:**
|
|
88
|
+
- Hierarchical display with indentation
|
|
89
|
+
- Expand/collapse for tasks with subtasks
|
|
90
|
+
- Status icons with color coding
|
|
91
|
+
- Due dates and assignee information
|
|
92
|
+
- Click to interact with tasks
|
|
93
|
+
|
|
94
|
+
### GanttTaskViewerComponent
|
|
95
|
+
|
|
96
|
+
Displays tasks in a Gantt chart timeline using Frappe Gantt.
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { GanttTaskViewerComponent } from '@memberjunction/ng-tasks';
|
|
100
|
+
|
|
101
|
+
@Component({
|
|
102
|
+
template: `
|
|
103
|
+
<mj-gantt-task-viewer
|
|
104
|
+
[tasks]="myTasks"
|
|
105
|
+
(taskClicked)="onTaskClick($event)">
|
|
106
|
+
</mj-gantt-task-viewer>
|
|
107
|
+
`
|
|
108
|
+
})
|
|
109
|
+
export class MyComponent {
|
|
110
|
+
myTasks: TaskEntity[] = [...];
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Features:**
|
|
115
|
+
- Timeline-based visualization
|
|
116
|
+
- Task dependencies with arrows
|
|
117
|
+
- Progress indicators
|
|
118
|
+
- Interactive task bars
|
|
119
|
+
- Hover tooltips with task details
|
|
120
|
+
- Multiple view modes (Day, Week, Month)
|
|
121
|
+
|
|
122
|
+
## Task Data Structure
|
|
123
|
+
|
|
124
|
+
Tasks must be `TaskEntity` objects from `@memberjunction/core-entities`. Key fields:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
interface TaskEntity {
|
|
128
|
+
ID: string;
|
|
129
|
+
Title: string;
|
|
130
|
+
Description?: string;
|
|
131
|
+
Status: 'Pending' | 'In Progress' | 'Complete';
|
|
132
|
+
StartDate?: Date;
|
|
133
|
+
DueDate?: Date;
|
|
134
|
+
DependsOnTaskID?: string; // For task dependencies
|
|
135
|
+
AssignedTo?: string;
|
|
136
|
+
// ... other MJ entity fields
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Task Dependencies
|
|
141
|
+
|
|
142
|
+
Tasks can have dependencies using the `DependsOnTaskID` field:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
const tasks = [
|
|
146
|
+
{
|
|
147
|
+
ID: 'task-1',
|
|
148
|
+
Title: 'Design Database Schema',
|
|
149
|
+
Status: 'Complete',
|
|
150
|
+
StartDate: new Date('2025-01-01'),
|
|
151
|
+
DueDate: new Date('2025-01-05')
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
ID: 'task-2',
|
|
155
|
+
Title: 'Implement Backend API',
|
|
156
|
+
Status: 'In Progress',
|
|
157
|
+
StartDate: new Date('2025-01-06'),
|
|
158
|
+
DueDate: new Date('2025-01-15'),
|
|
159
|
+
DependsOnTaskID: 'task-1' // Depends on task-1
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
ID: 'task-3',
|
|
163
|
+
Title: 'Build Frontend UI',
|
|
164
|
+
Status: 'Pending',
|
|
165
|
+
StartDate: new Date('2025-01-16'),
|
|
166
|
+
DueDate: new Date('2025-01-25'),
|
|
167
|
+
DependsOnTaskID: 'task-2' // Depends on task-2
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
In **Simple View**, dependent tasks are indented under their parent tasks.
|
|
173
|
+
In **Gantt View**, dependency arrows connect the tasks.
|
|
174
|
+
|
|
175
|
+
## Styling
|
|
176
|
+
|
|
177
|
+
The components use a clean, modern design that matches MemberJunction's aesthetic:
|
|
178
|
+
|
|
179
|
+
- **Colors:** Blue (#3B82F6) for primary actions, gray scale for text
|
|
180
|
+
- **Typography:** System fonts with consistent sizing
|
|
181
|
+
- **Spacing:** Comfortable padding and margins
|
|
182
|
+
- **Icons:** Font Awesome icons throughout
|
|
183
|
+
|
|
184
|
+
You can customize styles by targeting the component classes or using Angular's view encapsulation.
|
|
185
|
+
|
|
186
|
+
## Integration with Conversations
|
|
187
|
+
|
|
188
|
+
The ng-tasks package is designed to work seamlessly with the conversations package:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import { TaskComponent } from '@memberjunction/ng-tasks';
|
|
192
|
+
|
|
193
|
+
@Component({
|
|
194
|
+
selector: 'mj-tasks-full-view',
|
|
195
|
+
imports: [TaskComponent],
|
|
196
|
+
template: `
|
|
197
|
+
<mj-task
|
|
198
|
+
[tasks]="allTasks"
|
|
199
|
+
[title]="'All Tasks'"
|
|
200
|
+
[viewMode]="'simple'"
|
|
201
|
+
(taskClicked)="navigateToTask($event)">
|
|
202
|
+
</mj-task>
|
|
203
|
+
`
|
|
204
|
+
})
|
|
205
|
+
export class TasksFullViewComponent {
|
|
206
|
+
// ... component implementation
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Browser Support
|
|
211
|
+
|
|
212
|
+
- Chrome/Edge (latest)
|
|
213
|
+
- Firefox (latest)
|
|
214
|
+
- Safari (latest)
|
|
215
|
+
|
|
216
|
+
## Dependencies
|
|
217
|
+
|
|
218
|
+
- **Angular:** ^18.0.0
|
|
219
|
+
- **Frappe Gantt:** ^0.6.1 (for Gantt view)
|
|
220
|
+
- **@memberjunction/core:** ^2.104.0
|
|
221
|
+
- **@memberjunction/core-entities:** ^2.104.0
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
MIT
|
|
226
|
+
|
|
227
|
+
## Contributing
|
|
228
|
+
|
|
229
|
+
This package is part of the MemberJunction open-source project. Contributions are welcome!
|
|
230
|
+
|
|
231
|
+
## Support
|
|
232
|
+
|
|
233
|
+
For issues or questions, please file an issue on the [MemberJunction GitHub repository](https://github.com/MemberJunction/MJ).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { TaskEntity, TaskDependencyEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Gantt chart view for tasks using DHTMLX Gantt
|
|
6
|
+
*/
|
|
7
|
+
export declare class GanttTaskViewerComponent implements OnChanges, AfterViewInit, OnDestroy {
|
|
8
|
+
tasks: TaskEntity[];
|
|
9
|
+
taskDependencies: TaskDependencyEntity[];
|
|
10
|
+
agentRunMap?: Map<string, string>;
|
|
11
|
+
taskClicked: EventEmitter<TaskEntity>;
|
|
12
|
+
openEntityRecord: EventEmitter<{
|
|
13
|
+
entityName: string;
|
|
14
|
+
recordId: string;
|
|
15
|
+
}>;
|
|
16
|
+
ganttContainer: ElementRef<HTMLDivElement>;
|
|
17
|
+
selectedTask: TaskEntity | null;
|
|
18
|
+
detailPanelWidth: number;
|
|
19
|
+
private ganttInitialized;
|
|
20
|
+
private isResizing;
|
|
21
|
+
private resizeStartX;
|
|
22
|
+
private resizeStartWidth;
|
|
23
|
+
ngAfterViewInit(): void;
|
|
24
|
+
ngOnChanges(): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
private initGantt;
|
|
27
|
+
private updateGanttData;
|
|
28
|
+
private convertToGanttFormat;
|
|
29
|
+
private calculateDuration;
|
|
30
|
+
private formatDateForDHTMLX;
|
|
31
|
+
getAgentRunId(task: TaskEntity): string | null;
|
|
32
|
+
closeDetailPanel(): void;
|
|
33
|
+
onOpenEntityRecord(event: {
|
|
34
|
+
entityName: string;
|
|
35
|
+
recordId: string;
|
|
36
|
+
}): void;
|
|
37
|
+
startResize(event: MouseEvent): void;
|
|
38
|
+
handleResize(event: MouseEvent): void;
|
|
39
|
+
stopResize(): void;
|
|
40
|
+
private expandAllAndSelectRoot;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttTaskViewerComponent, never>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttTaskViewerComponent, "mj-gantt-task-viewer", never, { "tasks": { "alias": "tasks"; "required": false; }; "taskDependencies": { "alias": "taskDependencies"; "required": false; }; "agentRunMap": { "alias": "agentRunMap"; "required": false; }; }, { "taskClicked": "taskClicked"; "openEntityRecord": "openEntityRecord"; }, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=gantt-task-viewer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gantt-task-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/gantt-task-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAa,SAAS,EAAgB,MAAM,eAAe,CAAC;AAEjJ,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAIjF;;GAEG;AACH,qBAwGa,wBAAyB,YAAW,SAAS,EAAE,aAAa,EAAE,SAAS;IACzE,KAAK,EAAE,UAAU,EAAE,CAAM;IACzB,gBAAgB,EAAE,oBAAoB,EAAE,CAAM;IAC9C,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,2BAAkC;IAC7C,gBAAgB;oBAAkC,MAAM;kBAAY,MAAM;OAAM;IAE1C,cAAc,EAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAErF,YAAY,EAAE,UAAU,GAAG,IAAI,CAAQ;IACvC,gBAAgB,EAAE,MAAM,CAAO;IAEtC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,gBAAgB,CAAK;IAE7B,eAAe;IAWf,WAAW;IAgBX,WAAW;IAOX,OAAO,CAAC,SAAS;IAgFjB,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,oBAAoB;IA6J5B,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,mBAAmB;IAOpB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAI9C,gBAAgB,IAAI,IAAI;IAIxB,kBAAkB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIzE,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAQ3C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAWrC,UAAU,IAAI,IAAI;IAYlB,OAAO,CAAC,sBAAsB;yCA3XnB,wBAAwB;2CAAxB,wBAAwB;CA0ZpC"}
|