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 8532adf..4d6cf46 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 8fe4ed9..cd16563 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 @@ -10,9 +10,9 @@ export const MY_DATE_FORMATS = { }, display: { dateInput: 'DD.MM.YYYY', - monthYearLabel: 'MMMM YYYY', + monthYearLabel: 'MM YYYY', dateA11yLabel: 'LL', - monthYearA11yLabel: 'MMMM YYYY' + monthYearA11yLabel: 'MM YYYY' }, }; @@ -26,9 +26,10 @@ export class PlanTimeBarComponent implements OnInit { @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 = {}; @@ -58,44 +59,42 @@ export class PlanTimeBarComponent implements OnInit { } this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}]; // this.data.push({ - // TaskID: '' + 0 , TaskName: "Woche " , StartDate: new Date(), EndDate: new Date() , planzeit: 0, + + // TaskID: '' + 0 , TaskName: "Woche " , StartDate: '28.11.2022', EndDate: '30.11.2022' , planzeit: 0, // resources: [{resourceId: 1}], Progress: 0, work: 0, isRes: false // }); + this.dataService.fetchUserSupportGroup().then((res: any)=>{ + this.userSupportGroup = res.name; + if(!this.filters){ + this.filterObj ={ + filter: { + filterElement: [{column: "SupportGroup", filter: "equals", criteria: [this.userSupportGroup]}] + } + } + }else{ + this.filterObj ={ + filter: { + filterElement: [this.filters] + } + } + } + this.dataService.fetchPlanTimes( this.filterObj, this.projectStartDate, this.projectEndDate).then((res:any[])=>{ + res.forEach((week)=>{ + this.data.push( + { + TaskID: '' + week.week , TaskName: "Woche " + week.week, StartDate: new Date(week.startDate.substring(6,11)+'-'+week.startDate.substring(3,5)+'-'+week.startDate.substring(0,2)), EndDate: new Date(week.endDate.substring(6,11)+'-'+week.endDate.substring(3,5)+'-'+week.endDate.substring(0,2)) , planzeit: week.planTime, + resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false + }); + }); + this.renderTimeGantt = true; + }); + + }); + - 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) => { @@ -138,9 +137,7 @@ export class PlanTimeBarComponent implements OnInit { }; this.columns = [ - { field: 'TaskName', headerText: 'Planzeit pro Woche', width: 250 }, - { field: 'StartDate', headerText: 'Beginn', width: 250 }, - { field: 'EndDate', headerText: 'Ende', width: 250 }, + { field: 'TaskName', headerText: 'Planzeit pro Woche', width: 250 } ] } diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.html b/frontend/src/ntt-gantt/ntt-gantt.component.html index 64257f3..7df7708 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.html +++ b/frontend/src/ntt-gantt/ntt-gantt.component.html @@ -144,6 +144,7 @@ [splitterSettings]="splitterSettings" [parentResources]="allResources" [filters]="filters" + >

Die Suche lieferte keine Ergebnisse

diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.ts b/frontend/src/ntt-gantt/ntt-gantt.component.ts index 49f5041..abe1720 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.ts +++ b/frontend/src/ntt-gantt/ntt-gantt.component.ts @@ -124,7 +124,7 @@ export class NttGanttComponent implements OnInit { public showCriterea: boolean = false; public criteria: string = ''; public filterEnabled: boolean = false; - public filters:any = null; + public filters: any = null; public sortEnabled: boolean = false; public sortedData: any[] = []; @@ -136,6 +136,7 @@ export class NttGanttComponent implements OnInit { private approvalPending: boolean; public sort = null; public oldSort = null; + public planTimes : any[] = []; /** @@ -274,9 +275,7 @@ public logg(args){ this.inputForTimeline = [this.splitterSettings, this.projectStartDate, this.projectEndDate]; }); }); - this.dataService.fetchPlanTimes({filter: this.filterEnabled ? this.filters : {filterElement: [{column: "SupportGroup", filter: "equals", criteria: [this.userSupportGroup]}]}}, this.projectStartDate, this.projectEndDate).then((res:any[])=>{ - console.log(res); - }); +