diff --git a/frontend/src/app/plan-time-bar/plan-time-bar.component.html b/frontend/src/app/plan-time-bar/plan-time-bar.component.html
index b0ce311..8532adf 100644
--- a/frontend/src/app/plan-time-bar/plan-time-bar.component.html
+++ b/frontend/src/app/plan-time-bar/plan-time-bar.component.html
@@ -1,5 +1,5 @@
-
+
TESTSS
diff --git a/frontend/src/app/plan-time-bar/plan-time-bar.component.ts b/frontend/src/app/plan-time-bar/plan-time-bar.component.ts
index 7a6d1f9..8fe4ed9 100644
--- a/frontend/src/app/plan-time-bar/plan-time-bar.component.ts
+++ b/frontend/src/app/plan-time-bar/plan-time-bar.component.ts
@@ -1,3 +1,4 @@
+import { DataService } from 'src/app/data.service';
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { GanttComponent } from '@syncfusion/ej2-angular-gantt';
import { MAT_DATE_FORMATS } from '@angular/material/core';
@@ -24,9 +25,10 @@ export class PlanTimeBarComponent implements OnInit {
@Input() inputData: Array = [];
@Input() splitterSettings: object;
@Input() parentResources: Array = [];
+ @Input() filters: Array = [];
@ViewChild('ganttObjectSum')
public ganttObjectSum!: GanttComponent;
- public data: any[] = [];
+ public data: any[];
public resources: any[] = [];
public userSupportGroup: string;
public taskSettings: object = {};
@@ -39,13 +41,15 @@ export class PlanTimeBarComponent implements OnInit {
public columns: object[] = [];
public toolbar: any[] = [];
public timelineSettings: object = {};
+ public renderTimeGantt: boolean = false;
- constructor() {
+ public filterObj: any;
+ constructor(public dataService: DataService) {
}
ngOnInit(): void {
-
+ //this.renderTimeGantt = false;
this.splitterSettings = this.inputData[0];
this.projectStartDate = this.inputData[1];
this.projectEndDate = this.inputData[2];
@@ -53,21 +57,58 @@ export class PlanTimeBarComponent implements OnInit {
taskLabel: '${taskData.planzeit}'
}
this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
+ // this.data.push({
+ // TaskID: '' + 0 , TaskName: "Woche " , StartDate: new Date(), EndDate: new Date() , planzeit: 0,
+ // resources: [{resourceId: 1}], Progress: 0, work: 0, isRes: false
+ // });
- let calendarWeeks = this.getCalendarWeeks(this.projectStartDate , this.projectEndDate);
+ if(!this.filters){
+ this.filterObj ={
+ filter: {
+ filterElement: [{column: "SupportGroup", filter: "equals", criteria: [this.userSupportGroup]}]
+ }
+ }
+ }else{
+ this.filterObj ={
+ filter: {
+ filterElement: [this.filters]
+ }
+ }
+ }
+ // let calendarWeeks = this.getCalendarWeeks(this.projectStartDate , this.projectEndDate);
+
+ this.dataService.fetchPlanTimes( this.filterObj, this.projectStartDate, this.projectEndDate).then((res:any[])=>{
+ console.log(res);
+ let arr = [];
+ res.forEach((week)=>{
+ arr.push(
+ {
+ TaskID: '' + week.week , TaskName: "Woche " + week, StartDate: week.startDate, EndDate: week.endDate , planzeit: week.planTime,
+ resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
+ });
+ this.data = arr;
+ });
+
+ // this.data = [];
+ //this.data = arr;
+ // let ress = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
+ // this.resources = ress;
+ console.log(this.data);
+ this.renderTimeGantt = true;
+ });
// Ausgabe der Kalenderwochen
- calendarWeeks.forEach((week, index) => {
- let weekNr = this.getWeekNumber(new Date(calendarWeeks[index].start.toISOString()));
- let planzeit = this.getPlantimeFromResources(this.parentResources, weekNr);
- // console.log(`Kalenderwoche ${index + 1}: ${week.start} - ${week.end}`);
- // console.log(week);
- this.data.push(
- {
- TaskID: '' + weekNr, index , TaskName: "Woche " + weekNr, StartDate: calendarWeeks[index].start.toISOString(), EndDate: calendarWeeks[index].end.toISOString() , planzeit: planzeit.toFixed(0),
- resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
- });
- });
+ // calendarWeeks.forEach((week, index) => {
+ // let weekNr = this.getWeekNumber(new Date(calendarWeeks[index].start.toISOString()));
+ // let planzeit = this.getPlantimeFromResources(this.parentResources, weekNr);
+ // // console.log(`Kalenderwoche ${index + 1}: ${week.start} - ${week.end}`);
+ // // console.log(week);
+ // this.data.push(
+ // {
+ // TaskID: '' + weekNr, index , TaskName: "Woche " + weekNr, StartDate: calendarWeeks[index].start.toISOString(), EndDate: calendarWeeks[index].end.toISOString() , planzeit: planzeit.toFixed(0),
+ // resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
+ // });
+ // });
this.timelineSettings = {
diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.html b/frontend/src/ntt-gantt/ntt-gantt.component.html
index 8e2dc0e..64257f3 100644
--- a/frontend/src/ntt-gantt/ntt-gantt.component.html
+++ b/frontend/src/ntt-gantt/ntt-gantt.component.html
@@ -143,6 +143,7 @@
[inputData]="inputForTimeline"
[splitterSettings]="splitterSettings"
[parentResources]="allResources"
+[filters]="filters"
>
Die Suche lieferte keine Ergebnisse