badge
parent
24e484e240
commit
11da71c2bf
|
|
@ -58,10 +58,10 @@ export class DataService {
|
|||
this.fetchContracts().then((res: any [])=>{
|
||||
this.contracts = res;
|
||||
});
|
||||
this.fetchPaketTypes().then((res: any [])=>{
|
||||
this.paketTypes = res;
|
||||
// console.log(res);
|
||||
});
|
||||
// this.fetchPaketTypes().then((res: any [])=>{
|
||||
// this.paketTypes = res;
|
||||
// // console.log(res);
|
||||
// });
|
||||
this.fetchUserSupportGroup().then((res: any)=>{
|
||||
this.userSupportGroup = res.name;
|
||||
console.log(this.userSupportGroup);
|
||||
|
|
@ -431,23 +431,23 @@ export class DataService {
|
|||
return promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* The function fetchPaketTypes fetches an array of all paketTypes
|
||||
* @returns promise for the fetched paketTypes array
|
||||
*/
|
||||
public async fetchPaketTypes(){
|
||||
const promise = new Promise(resolve=>{
|
||||
let res : any[] = [];
|
||||
this.http.get('http://localhost:8080/api/getPackageTypes')
|
||||
.subscribe((response: any)=>{
|
||||
response.forEach(paketType => {
|
||||
res.push(paketType)
|
||||
});
|
||||
resolve(res);
|
||||
})
|
||||
})
|
||||
return promise;
|
||||
}
|
||||
// /**
|
||||
// * The function fetchPaketTypes fetches an array of all paketTypes
|
||||
// * @returns promise for the fetched paketTypes array
|
||||
// */
|
||||
// public async fetchPaketTypes(){
|
||||
// const promise = new Promise(resolve=>{
|
||||
// let res : any[] = [];
|
||||
// this.http.get('http://localhost:8080/api/getPackageTypes')
|
||||
// .subscribe((response: any)=>{
|
||||
// response.forEach(paketType => {
|
||||
// res.push(paketType)
|
||||
// });
|
||||
// resolve(res);
|
||||
// })
|
||||
// })
|
||||
// return promise;
|
||||
// }
|
||||
|
||||
/**
|
||||
* The function fetchPaketTypes fetches the supportGroup of the current user
|
||||
|
|
|
|||
|
|
@ -18,3 +18,11 @@ font-family: Roboto;
|
|||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.dot-badge {
|
||||
background-color: #00a79d;
|
||||
color: #00a79d;
|
||||
width: 10px; /* Breite des Punkts */
|
||||
height: 10px; /* Höhe des Punkts */
|
||||
border-radius: 50%; /* Rundung des Punkts */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,19 @@
|
|||
<mat-accordion>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDialogShortDesc')}}</mat-panel-title>
|
||||
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDialogShortDesc')}} <mat-badge *ngIf="TextEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>{{this.languageService.lMap.get('filterDialogShortDescText')}}</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<mat-form-field appearance="fill" style="width: 100%;" >
|
||||
<mat-label>{{this.languageService.lMap.get('filterDilogSearchText')}}</mat-label>
|
||||
<input matInput type="text" [(ngModel)]="criteria" >
|
||||
<input matInput (input)="this.TextEnabled = this.criteria !== '';" type="text" [(ngModel)]="criteria" >
|
||||
</mat-form-field>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogSg')}}</mat-panel-title>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogSg')}}<mat-badge *ngIf="SgEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>{{this.languageService.lMap.get('filterDilogSgText')}}</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<multiselect-autocomplete
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogState')}}</mat-panel-title>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogState')}}<mat-badge *ngIf="StateEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>{{this.languageService.lMap.get('filterDilogStateText')}}</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<multiselect-autocomplete
|
||||
|
|
@ -43,7 +44,7 @@
|
|||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogContract')}}</mat-panel-title>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogContract')}}<mat-badge *ngIf="ContractEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>{{this.languageService.lMap.get('filterDilogContractText')}}</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<multiselect-autocomplete
|
||||
|
|
@ -71,12 +72,12 @@
|
|||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogDate')}}</mat-panel-title>
|
||||
<mat-panel-title>{{this.languageService.lMap.get('filterDilogDate')}}<mat-badge *ngIf="DateEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>{{this.languageService.lMap.get('filterDilogDateText')}}</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<mat-form-field appearance="fill" style="width: 48%;">
|
||||
<mat-label>{{this.languageService.lMap.get('filterDilogSearchFrom')}}</mat-label>
|
||||
<input matInput [matDatepicker]="picker1" [(ngModel)]="filterStartDate">
|
||||
<input (input)="this.onDateSelect()" matInput [matDatepicker]="picker1" [(ngModel)]="filterStartDate">
|
||||
<mat-hint>MM/DD/YYYY</mat-hint>
|
||||
<mat-datepicker-toggle matIconSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker1></mat-datepicker>
|
||||
|
|
@ -84,7 +85,7 @@
|
|||
-
|
||||
<mat-form-field appearance="fill" style="width: 48%;">
|
||||
<mat-label>{{this.languageService.lMap.get('filterDilogSearchTo')}}</mat-label>
|
||||
<input matInput [matDatepicker]="picker2" [(ngModel)]="filterEndDate">
|
||||
<input (input)="this.onDateSelect()" matInput [matDatepicker]="picker2" [(ngModel)]="filterEndDate">
|
||||
<mat-hint>MM/DD/YYYY</mat-hint>
|
||||
<mat-datepicker-toggle matIconSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker2></mat-datepicker>
|
||||
|
|
@ -93,11 +94,11 @@
|
|||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>Intervall</mat-panel-title>
|
||||
<mat-panel-title>Intervall<mat-badge *ngIf="IntervallEnabled" [matBadge]="''" class="dot-badge"></mat-badge></mat-panel-title>
|
||||
<mat-panel-description>Pakete mit Intervall > ein Jahr</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<mat-checkbox [(ngModel)]="intervallFilter">Zeige nur Pakete mit Intervall > 1 Jahr!</mat-checkbox>
|
||||
<mat-checkbox (input)="this.IntervallEnabled = intervallFilter;" [(ngModel)]="intervallFilter">Zeige nur Pakete mit Intervall > 1 Jahr!</mat-checkbox>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,19 @@ export class FilterDialogComponent implements OnInit {
|
|||
public prevFilterDateTo: Date;
|
||||
public prevIntervallFilter: boolean;
|
||||
|
||||
|
||||
public TextEnabled: boolean = false;
|
||||
public SgEnabled: boolean = false;
|
||||
public StateEnabled: boolean = false;
|
||||
public ContractEnabled: boolean = false;
|
||||
public FiltersSgEnabled: boolean = false;
|
||||
public PaketTypeEnabled: boolean = false;
|
||||
public DateEnabled: boolean = false;
|
||||
public IntervallEnabled: boolean = false;
|
||||
|
||||
public filterObj;
|
||||
|
||||
|
||||
/**
|
||||
* The constructor injects required Dependencies and sets default values for logic and ui
|
||||
* @param languageService representation of the LanguageService
|
||||
|
|
@ -102,9 +113,11 @@ export class FilterDialogComponent implements OnInit {
|
|||
console.log("\nPREVSUPPORTGROUPSFILTER")
|
||||
console.log(filter);
|
||||
this.prevFiltersSg = filter.criteria;
|
||||
this.FiltersSgEnabled = false;
|
||||
}
|
||||
|
||||
if(filter.column == "State"){
|
||||
this.StateEnabled = true;
|
||||
console.log("\nStatesfilter prev")
|
||||
console.log(filter);
|
||||
if(this.languageService.language == "DE"){
|
||||
|
|
@ -117,6 +130,7 @@ export class FilterDialogComponent implements OnInit {
|
|||
}
|
||||
|
||||
if(filter.column == "Contract"){
|
||||
this.ContractEnabled = true;
|
||||
//console.log(filter);
|
||||
for (const crit of filter.criteria) {
|
||||
this.prevFiltersContract.push(this.dataService.getContractName(crit));
|
||||
|
|
@ -124,27 +138,30 @@ export class FilterDialogComponent implements OnInit {
|
|||
//this.prevFiltersContract = filter.criteria;
|
||||
}
|
||||
|
||||
if(filter.column == "PackageType"){
|
||||
//console.log("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
|
||||
//console.log(this.dataService.getPaketTypes());
|
||||
for (const crit of filter.criteria) {
|
||||
//console.log(crit);
|
||||
this.prevFiltersPaketType.push(this.dataService.getPaketTypeNameByID(crit));
|
||||
}
|
||||
//console.log(this.prevFiltersPaketType);
|
||||
//this.prevFiltersPaketType = filter.criteria;
|
||||
}
|
||||
// if(filter.column == "PackageType"){
|
||||
// //console.log("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
|
||||
// //console.log(this.dataService.getPaketTypes());
|
||||
// for (const crit of filter.criteria) {
|
||||
// //console.log(crit);
|
||||
// this.prevFiltersPaketType.push(this.dataService.getPaketTypeNameByID(crit));
|
||||
// }
|
||||
// //console.log(this.prevFiltersPaketType);
|
||||
// //this.prevFiltersPaketType = filter.criteria;
|
||||
// }
|
||||
|
||||
if(filter.column == "D2"){
|
||||
this.DateEnabled = true;
|
||||
this.filterStartDate = filter.criteria[0];
|
||||
this.filterEndDate = filter.criteria[1];
|
||||
}
|
||||
|
||||
if(filter.column == "ResourceName"){
|
||||
this.TextEnabled = true;
|
||||
this.criteria = filter.criteria[0];
|
||||
}
|
||||
|
||||
if(filter.column == "ASF_WI_HighestIntervall"){
|
||||
this.IntervallEnabled = true;
|
||||
this.intervallFilter = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -194,8 +211,12 @@ export class FilterDialogComponent implements OnInit {
|
|||
this.supportGroupsFilter = [...new Set(this.supportGroupsFilter)];
|
||||
break;
|
||||
case 'state':
|
||||
// console.log("\nEvent DATA")
|
||||
// console.log(event);
|
||||
if(event.data[0]){
|
||||
this.StateEnabled = true;
|
||||
}else{
|
||||
this.StateEnabled = false;
|
||||
}
|
||||
|
||||
this.statesFilter = [];
|
||||
if(this.languageService.language == 'DE'){
|
||||
// console.log(event.data);
|
||||
|
|
@ -215,14 +236,17 @@ export class FilterDialogComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
this.statesFilter = [...new Set(this.statesFilter)];
|
||||
// if(event.data.length() == 0){
|
||||
// this.statesFilter = [];
|
||||
// }
|
||||
|
||||
// console.log("\nRESULT Statesfilter");
|
||||
// console.log(this.statesFilter);
|
||||
|
||||
break;
|
||||
case 'contract':
|
||||
if(event.data[0]){
|
||||
this.ContractEnabled = true;
|
||||
}else{
|
||||
this.ContractEnabled = false;
|
||||
}
|
||||
//this.contractsFilter = event.data;
|
||||
this.contractsFilter = [];
|
||||
//console.log(event.data);
|
||||
|
|
@ -235,24 +259,35 @@ export class FilterDialogComponent implements OnInit {
|
|||
//this.contractsFilter = [...new Set(this.contractsFilter)];
|
||||
//console.log(this.contractsFilter);
|
||||
break;
|
||||
case 'paketType':
|
||||
//this.paketTypesFilter = event.data;
|
||||
this.paketTypesFilter = [];
|
||||
//console.log(event.data);
|
||||
for (const paketType of event.data) {
|
||||
if(this.dataService.getPaketTypeIdByName(paketType)){
|
||||
this.paketTypesFilter.push(this.dataService.getPaketTypeIdByName(paketType));
|
||||
}
|
||||
// case 'paketType':
|
||||
// //this.paketTypesFilter = event.data;
|
||||
// this.paketTypesFilter = [];
|
||||
// //console.log(event.data);
|
||||
// for (const paketType of event.data) {
|
||||
// if(this.dataService.getPaketTypeIdByName(paketType)){
|
||||
// this.paketTypesFilter.push(this.dataService.getPaketTypeIdByName(paketType));
|
||||
// }
|
||||
|
||||
}
|
||||
// this.paketTypesFilter = [...new Set(this.paketTypesFilter)];
|
||||
//console.log(this.paketTypesFilter);
|
||||
break;
|
||||
// }
|
||||
// // this.paketTypesFilter = [...new Set(this.paketTypesFilter)];
|
||||
// //console.log(this.paketTypesFilter);
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public onDateSelect(){
|
||||
console.log("################################")
|
||||
if(this.filterStartDate && this.filterEndDate){
|
||||
this.DateEnabled = true;
|
||||
}else{
|
||||
this.DateEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The function mapFilter builds a filterElement out of all the selected filters, delivers it back and closes the dialog
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -136,6 +136,13 @@
|
|||
background-color: #ef6c00;
|
||||
|
||||
}
|
||||
.dot-badge {
|
||||
background-color: #00a79d;
|
||||
color: #00a79d;
|
||||
width: 15px; /* Breite des Punkts */
|
||||
height: 15px; /* Höhe des Punkts */
|
||||
border-radius: 50%; /* Rundung des Punkts */
|
||||
}
|
||||
|
||||
/* ::ng-deep .mat-calendar{
|
||||
background: white;
|
||||
|
|
|
|||
|
|
@ -61,9 +61,11 @@
|
|||
</div>
|
||||
|
||||
<div *ngIf="!errorService.rsso && !rssoInit" class="filterContainer">
|
||||
<button matBadge="1" matBadgeColor="warn" mat-raised-button class="filterButton" aria-label="Filtern" (click)="openFilterDialog()">
|
||||
<button mat-raised-button class="filterButton" aria-label="Filtern" (click)="openFilterDialog()">
|
||||
{{languageService.lMap.get('nttGanttFilterButton')}} <mat-icon style="color: #00a79d;">filter_alt</mat-icon>
|
||||
</button>
|
||||
<mat-badge *ngIf="filterBadge" [matBadge]="''" class="dot-badge"></mat-badge>
|
||||
|
||||
<button *ngIf="showSaveButton" mat-raised-button (click)="updatePreset()">Speichern</button>
|
||||
<button *ngIf="showSaveUnderButton" mat-raised-button (click)="openSaveUnderDialog()" >Speichern unter</button>
|
||||
<button [disabled]="!filterEnabled" mat-icon-button aria-label="clear Filters and Sort" class="clearFilter" (click)="clearFilter()">
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ export class NttGanttComponent implements OnInit {
|
|||
public rssoInit: boolean = true;
|
||||
|
||||
public showInitPresetsError: boolean = false;
|
||||
public filterBadge: boolean = false;
|
||||
|
||||
|
||||
/**###################################################################### Initial Loading functions ######################################################################*/
|
||||
|
|
@ -492,6 +493,7 @@ export class NttGanttComponent implements OnInit {
|
|||
this.filterEnabled = false;
|
||||
this.sort = null;
|
||||
this.sortEnabled = false;
|
||||
this.filterBadge = false;
|
||||
this.refreshData();
|
||||
if(this.filters !== this.selectedPreset.definition){
|
||||
if(this.isUserPreset){
|
||||
|
|
@ -589,7 +591,16 @@ export class NttGanttComponent implements OnInit {
|
|||
this.showSaveButton = false;
|
||||
this.showSaveUnderButton = true;
|
||||
}
|
||||
}
|
||||
if(this.filters){
|
||||
if(this.filters.filterElement){
|
||||
if(this.filters.filterElement[1]){
|
||||
this.filterBadge = true;
|
||||
}else{
|
||||
this.filterBadge = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.refreshData();
|
||||
}
|
||||
|
|
@ -826,46 +837,46 @@ export class NttGanttComponent implements OnInit {
|
|||
|
||||
|
||||
if(args.data.taskData.TaskID.includes("D2")){
|
||||
console.log(args.data.taskData.resources[0]);
|
||||
// console.log(args.data.taskData.resources[0]);
|
||||
if (args.data.taskData.resources[0].state == 0 ) {
|
||||
args.milestoneColor = "#f83200"; //red
|
||||
console.log("red");
|
||||
// console.log("red");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 1 ) {
|
||||
args.milestoneColor = "#f98700"; //orange
|
||||
console.log("orange");
|
||||
// console.log("orange");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 3 ) {
|
||||
args.milestoneColor = "#ff9248"; //light orange
|
||||
console.log("light orange");
|
||||
// console.log("light orange");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state >= 6 ) {
|
||||
args.milestoneColor = "#ffff00"; //yellow
|
||||
console.log("yellow");
|
||||
// console.log("yellow");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 7 ) {
|
||||
args.milestoneColor = "#ffff00"; //yellow
|
||||
console.log("yellow");
|
||||
// // console.log("yellow");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 10 && args.data.taskData.resources[0].statusReason != "") {
|
||||
args.milestoneColor = "#32CD32"; //lightgreen
|
||||
console.log("lightgreen");
|
||||
// console.log("lightgreen");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 10 ) {
|
||||
args.milestoneColor = "#008B45"; //lightgreen
|
||||
console.log("lightgreen");
|
||||
// console.log("lightgreen");
|
||||
}
|
||||
if (args.data.taskData.resources[0].state == 11 ) {
|
||||
args.milestoneColor = "#ffffff"; //white
|
||||
console.log("white");
|
||||
// console.log("white");
|
||||
}
|
||||
console.log("\n###############");
|
||||
console.log("\nisFixed:"+args.data.taskData.isFixed);
|
||||
console.log("\nArgs:", args);
|
||||
console.log("\nBorder",args.taskbarElement.children[1].classList)
|
||||
console.log("\nisRes: ", args.data.taskData.isRes);
|
||||
console.log("\nisD2", args.data.taskData.TaskID.includes("D2"));
|
||||
console.log("\nMilestone Color ready:",args.milestoneColor);
|
||||
// console.log("\n###############");
|
||||
// console.log("\nisFixed:"+args.data.taskData.isFixed);
|
||||
// console.log("\nArgs:", args);
|
||||
// console.log("\nBorder",args.taskbarElement.children[1].classList)
|
||||
// console.log("\nisRes: ", args.data.taskData.isRes);
|
||||
// console.log("\nisD2", args.data.taskData.TaskID.includes("D2"));
|
||||
// console.log("\nMilestone Color ready:",args.milestoneColor);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -907,7 +918,7 @@ export class NttGanttComponent implements OnInit {
|
|||
if(res.ok == false){
|
||||
this._snackBar.open("Änderung fehlegeschlagen, bitte erneut versuchen", 'Schließen', {duration: 10000,horizontalPosition: this.horizontalPosition, verticalPosition: this.verticalPosition, panelClass: ['red-snackbar']});
|
||||
}else{
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
this._snackBar.open("Änderung erfolgreich, Neues Datum: "+res.d2.slice(0,-14), 'Schließen', {duration: 3000, horizontalPosition: this.horizontalPosition, verticalPosition: this.verticalPosition, panelClass: ['green-snackbar']});
|
||||
this.plantimeComponent.fetchPlanTimes();
|
||||
let elem = document.querySelector(
|
||||
|
|
@ -958,7 +969,7 @@ export class NttGanttComponent implements OnInit {
|
|||
* @param args event arguments from the syncfusion gantt chart.
|
||||
*/
|
||||
public dataBound(args: any) {
|
||||
console.log(args);
|
||||
// console.log(args);
|
||||
this.spin = false;
|
||||
if(this.sortEnabled && this.sortSelectorName){
|
||||
this.selectSortedColumn(this.sortSelectorName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue