diff --git a/frontend/src/app/data.service.ts b/frontend/src/app/data.service.ts index ea4e254..7b06e8b 100644 --- a/frontend/src/app/data.service.ts +++ b/frontend/src/app/data.service.ts @@ -249,12 +249,15 @@ export class DataService { const promise = new Promise(resolve=>{ let first : boolean = true; let res : any[] = []; - console.log(dataJson); + //console.log(dataJson); this.http.post('http://localhost:8080/api/getChanges', dataJson) .subscribe((response:any)=>{ - console.log(response); + //console.log(response); this.totalSize = response.totalSize; response.changes.forEach(resp=>{ + + //console.log(resp.resourceId+" "+resp.approvalStatus) + let tasks : any[] = []; if(resp.d1!=null){ tasks.push( @@ -331,10 +334,10 @@ export class DataService { } validateImplementerEdit(state):boolean{ - if(state == 1){ + if(state == 1 || state == 3 || state == 6){ return true }else{ - return false + return true } } @@ -354,7 +357,7 @@ export class DataService { } validateApproval(approval):boolean{ - if(approval!==""){ + if(approval!=""){ return true; }else{ return false; diff --git a/frontend/src/app/implementer-dialog/implementer-dialog.component.ts b/frontend/src/app/implementer-dialog/implementer-dialog.component.ts index 4a6832b..f22a4f8 100644 --- a/frontend/src/app/implementer-dialog/implementer-dialog.component.ts +++ b/frontend/src/app/implementer-dialog/implementer-dialog.component.ts @@ -121,11 +121,13 @@ export class ImplementerDialogComponent implements OnInit { msg = 'Implementer Update failed'; action ='close'; } - this._snackBar.open(msg, action, { + this._snackBar.open(msg+" : "+res.error.message, action, { horizontalPosition: this.horizontalPosition, verticalPosition: this.verticalPosition, panelClass: ['mat-primary'] - }); + }).onAction().subscribe(() => { + console.log('The snackbar action was triggered!'); + }); this.dialogRef.close(); //this.dialogRef.close(); //counter++; @@ -141,7 +143,7 @@ export class ImplementerDialogComponent implements OnInit { msg = 'Implementer Eintragung erfolgreich'; action ='Schließen'; }else{ - msg = 'Implementer Update sucessful'; + msg = 'Implementer Update successful'; action ='close'; } this._snackBar.open(msg, action, { diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.html b/frontend/src/ntt-gantt/ntt-gantt.component.html index 34ca64a..29038bd 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.html +++ b/frontend/src/ntt-gantt/ntt-gantt.component.html @@ -94,6 +94,7 @@ (taskbarEditing)="taskbarEditing($event)" (taskbarEdited)="taskbarEdited($event)" (toolbarClick)="toolbarBtnClicked($event)" + (rowSelecting) = "rowSelecting($event)" (rowSelected) = "rowSelected($event)" (rowDeselected) = "rowDeselected($event)" (created)="created($event)" diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.ts b/frontend/src/ntt-gantt/ntt-gantt.component.ts index 538f980..266ea39 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.ts +++ b/frontend/src/ntt-gantt/ntt-gantt.component.ts @@ -527,6 +527,8 @@ public logg(args){ this.data.push(task); } } + console.log(this.resources[this.resources.length-1]); + this.resources.push({resourceId: 'Timeline', resourceName: 'Planzeit Summen pro Woche'}) } /** @@ -598,12 +600,36 @@ public logg(args){ this.projectEndDate = new Date(this.range.controls.end.value); } } + public rowSelecting(args: any){ + console.log(args) + if(args.data.length){ + // if((args.data.length == this.resources.length+1)){ + // console.log("all") + // }else{ + // if(args.data[args.data.length-1].TaskID == 'Timeline'){ + // args.cancel = true; + // } + // } + if(args.data[args.data.length-1].TaskID == 'Timeline'){ + let data = args.data; + data.pop(); + args.data = data; + } + + }else{ + if(args.data.TaskID == 'Timeline'){ + args.cancel = true; + } + } + + } /** * The function rowSelected catches the corresponding syncfsuions event and checks if all selected resources (changes) have the same status, then it displays the corresponding buttons * @param args event arguments from the syncfusion gantt chart */ public rowSelected(args: any) { + this.approvalPending = false; this.selectedrowindex = this.ganttDefault.selectionModule.getSelectedRowIndexes(); // get the selected row indexes. this.selectedrecords = this.ganttDefault.selectionModule.getSelectedRecords(); // get the selected records. @@ -700,7 +726,6 @@ public logg(args){ this.selRecs = []; this.selectedrecords = []; this.selectedrowindex = []; - } /**