Merge branch 'main' of https://dev.azure.com/asfinag/Tech-Supporting.ITSM/_git/Tech-Supporting.ITSM.ChangeKalender
commit
185f66a8a1
|
|
@ -95,6 +95,23 @@ public class KalenderRestController {
|
|||
return state.get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handles GET request to retrieve all the states and their actual and possible
|
||||
* states and results a JSON array.
|
||||
*
|
||||
* @return JSON Array of states with actualState, possibleStates, stateNameEN,
|
||||
* stateNameDE
|
||||
* @throws JsonProcessingException if an exception occurs during JSON processing
|
||||
*/
|
||||
@CrossOrigin("*")
|
||||
@GetMapping("/api/getUser")
|
||||
@ResponseBody
|
||||
public String getUserId() {
|
||||
String jsonString = "{\"userId\": \""+this.javaAPI.getUser()+"\"}";
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles GET request to retrieve all support groups.
|
||||
*
|
||||
|
|
@ -304,6 +321,8 @@ public class KalenderRestController {
|
|||
return implementer.get(request);
|
||||
}
|
||||
|
||||
|
||||
// Preset HANDLERS
|
||||
@CrossOrigin("*")
|
||||
@PostMapping("/api/savePreset")
|
||||
@ResponseBody
|
||||
|
|
|
|||
|
|
@ -133,6 +133,22 @@ export class DataService {
|
|||
}
|
||||
|
||||
/**
|
||||
* The function fetchStates fetches an array from the possible statuses per state
|
||||
* @returns promise for the fetched Status Array
|
||||
*/
|
||||
public async getUser(){
|
||||
const promise = new Promise(resolve=>{
|
||||
let res : any;
|
||||
this.http.get('http://localhost:8080/api/getUser')
|
||||
.subscribe((response: any)=>{
|
||||
res = response;
|
||||
resolve(res);
|
||||
})
|
||||
})
|
||||
return promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* The function initPresets fetches an array of all presets
|
||||
* @returns promise for the fetched presets array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@
|
|||
</mat-optgroup>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<h3 *ngIf="userId" style="font-family: Arial, Helvetica, sans-serif;"><mat-icon style="color: green;">verified_user</mat-icon> RSSO User: {{this.userId}}</h3>
|
||||
<h3 *ngIf="!userId && !rssoInit" style="font-family: Arial, Helvetica, sans-serif;"><mat-icon style="color: red;">verified_user</mat-icon> RSSO Auth Failed</h3>
|
||||
<h3 *ngIf="rssoInit" style="font-family: Arial, Helvetica, sans-serif;"><mat-icon style="color: orange;">verified_user</mat-icon> RSSO: initializing</h3>
|
||||
<button mat-basic-button *ngIf="isUserPreset" class="editButton" (click)="openRenameDialog()" color="" style="" ><mat-icon>edit</mat-icon></button>
|
||||
<button mat-basic-button *ngIf="isUserPreset" class="deleteButton" (click)="openDeleteDialog()" color="" style="" ><mat-icon>delete_forever</mat-icon></button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -164,6 +164,9 @@ export class NttGanttComponent implements OnInit {
|
|||
public showSaveUnderButton: boolean = false;
|
||||
public isUserPreset: boolean = false;
|
||||
|
||||
public userId : string = null;
|
||||
public rssoInit: boolean = true;
|
||||
|
||||
|
||||
/**###################################################################### Initial Loading functions ######################################################################*/
|
||||
|
||||
|
|
@ -188,6 +191,14 @@ export class NttGanttComponent implements OnInit {
|
|||
this.sliceStart = 0;
|
||||
this.sliceEnd = 20;
|
||||
|
||||
this.dataService.getUser().then((res: any)=>{
|
||||
console.log("##################");
|
||||
console.log(res);
|
||||
this.rssoInit = false;
|
||||
this.userId = res.userId;
|
||||
|
||||
});
|
||||
|
||||
// this.dataService.initPresets().then((res: any)=>{
|
||||
// this.presets = res.presets;
|
||||
// this.selectedPreset = res.selectedPreset;
|
||||
|
|
|
|||
Loading…
Reference in New Issue