|
|
|
@ -1,10 +1,12 @@
|
|
|
|
import { JsonPipe } from '@angular/common';
|
|
|
|
import { JsonPipe } from '@angular/common';
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { Inject, Injectable } from '@angular/core';
|
|
|
|
import { ResourceFields } from '@syncfusion/ej2-angular-gantt';
|
|
|
|
import { ResourceFields } from '@syncfusion/ej2-angular-gantt';
|
|
|
|
import { LanguageService } from './language.service';
|
|
|
|
import { LanguageService } from './language.service';
|
|
|
|
import { ErrorService } from './error.service';
|
|
|
|
import { ErrorService } from './error.service';
|
|
|
|
import { Location } from '@angular/common';
|
|
|
|
import { Location } from '@angular/common';
|
|
|
|
|
|
|
|
import { AppConfig } from 'src/environments/models/environment.model';
|
|
|
|
|
|
|
|
import { APP_CONFIG } from './app.config';
|
|
|
|
|
|
|
|
|
|
|
|
interface Preset {
|
|
|
|
interface Preset {
|
|
|
|
id: string;
|
|
|
|
id: string;
|
|
|
|
@ -36,7 +38,8 @@ export class DataService {
|
|
|
|
private totalSize: number = null;
|
|
|
|
private totalSize: number = null;
|
|
|
|
private user: string = null;
|
|
|
|
private user: string = null;
|
|
|
|
public userSupportGroup: string;
|
|
|
|
public userSupportGroup: string;
|
|
|
|
public authUrl = 'https://itsm-dev-neu-rsso.asfinag.at/rsso/start?bypass-auth=true&tenant=itsm-dev-neu&goto=https://itsm-dev-neu.asfinag.at/arsys/calendar';
|
|
|
|
//public authUrl = 'https://itsm-dev-neu-rsso.asfinag.at/rsso/start?bypass-auth=true&tenant=itsm-dev-neu&goto=https://itsm-dev-neu.asfinag.at/arsys/calendar';
|
|
|
|
|
|
|
|
private config: AppConfig;
|
|
|
|
|
|
|
|
|
|
|
|
//public selectedLanguage: string = 'DE';
|
|
|
|
//public selectedLanguage: string = 'DE';
|
|
|
|
|
|
|
|
|
|
|
|
@ -45,7 +48,7 @@ export class DataService {
|
|
|
|
* @param languageService injection of the languageService
|
|
|
|
* @param languageService injection of the languageService
|
|
|
|
* @param http representation of the HttpClient
|
|
|
|
* @param http representation of the HttpClient
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
constructor(public languageService: LanguageService, private http: HttpClient, public errorService: ErrorService, private location: Location) {
|
|
|
|
constructor(@Inject(APP_CONFIG) config: AppConfig, public languageService: LanguageService, private http: HttpClient, public errorService: ErrorService, private location: Location) {
|
|
|
|
this.getUser().then((res: any )=>{
|
|
|
|
this.getUser().then((res: any )=>{
|
|
|
|
this.user = res.userId;
|
|
|
|
this.user = res.userId;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -66,10 +69,12 @@ export class DataService {
|
|
|
|
this.userSupportGroup = res.name;
|
|
|
|
this.userSupportGroup = res.name;
|
|
|
|
console.log(this.userSupportGroup);
|
|
|
|
console.log(this.userSupportGroup);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.config=config;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public redirectToAuthUrl() {
|
|
|
|
public redirectToAuthUrl() {
|
|
|
|
window.location.href = this.authUrl;
|
|
|
|
window.location.href = this.config.rssoUrl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -164,7 +169,7 @@ export class DataService {
|
|
|
|
public async getUser(){
|
|
|
|
public async getUser(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res : any;
|
|
|
|
let res : any;
|
|
|
|
this.http.get('http://localhost:8080/api/getUser')
|
|
|
|
this.http.get(this.config.backendUrl+'/getUser')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
res = response;
|
|
|
|
res = response;
|
|
|
|
resolve(res);
|
|
|
|
resolve(res);
|
|
|
|
@ -184,7 +189,7 @@ export class DataService {
|
|
|
|
public async initPresets(){
|
|
|
|
public async initPresets(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res = {presets: [], selectedPreset: '', userPreferences: {}, presetGroups: []};
|
|
|
|
let res = {presets: [], selectedPreset: '', userPreferences: {}, presetGroups: []};
|
|
|
|
this.http.get('http://localhost:8080/api/initPresets')
|
|
|
|
this.http.get(this.config.backendUrl+'/initPresets')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
console.log(response);
|
|
|
|
console.log(response);
|
|
|
|
if(response.status == 500){
|
|
|
|
if(response.status == 500){
|
|
|
|
@ -276,7 +281,7 @@ export class DataService {
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
console.log(resJson);
|
|
|
|
console.log(resJson);
|
|
|
|
this.http.post('http://localhost:8080/api/selectPreset', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/selectPreset', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
console.log(response);
|
|
|
|
console.log(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
@ -296,7 +301,7 @@ export class DataService {
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
console.log(resJson);
|
|
|
|
console.log(resJson);
|
|
|
|
this.http.post('http://localhost:8080/api/savePreset', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/savePreset', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
console.log(response);
|
|
|
|
console.log(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
@ -316,7 +321,7 @@ export class DataService {
|
|
|
|
let serializableResource = {id: preset.id, definition: JSON.stringify(preset.definition)};
|
|
|
|
let serializableResource = {id: preset.id, definition: JSON.stringify(preset.definition)};
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
this.http.post('http://localhost:8080/api/updatePreset', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/updatePreset', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -334,7 +339,7 @@ export class DataService {
|
|
|
|
let serializableResource = {id: preset.id, newName: preset.name};
|
|
|
|
let serializableResource = {id: preset.id, newName: preset.name};
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
this.http.post('http://localhost:8080/api/renamePreset', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/renamePreset', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -352,7 +357,7 @@ export class DataService {
|
|
|
|
let serializableResource = {id: preset.id};
|
|
|
|
let serializableResource = {id: preset.id};
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
this.http.post('http://localhost:8080/api/deletePreset', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/deletePreset', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -371,7 +376,7 @@ export class DataService {
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
console.log(resJson);
|
|
|
|
console.log(resJson);
|
|
|
|
this.http.post('http://localhost:8080/api/editUserPreferences', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/editUserPreferences', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -387,7 +392,7 @@ export class DataService {
|
|
|
|
public async fetchStates(){
|
|
|
|
public async fetchStates(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
this.http.get('http://localhost:8080/api/getStates')
|
|
|
|
this.http.get(this.config.backendUrl+'/getStates')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
console.log("###\n");
|
|
|
|
console.log("###\n");
|
|
|
|
console.log(response);
|
|
|
|
console.log(response);
|
|
|
|
@ -411,7 +416,7 @@ export class DataService {
|
|
|
|
public async fetchSupportGroups(){
|
|
|
|
public async fetchSupportGroups(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
this.http.get('http://localhost:8080/api/getSupportGroups')
|
|
|
|
this.http.get(this.config.backendUrl+'/getSupportGroups')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
response.forEach(supportGroup => {
|
|
|
|
response.forEach(supportGroup => {
|
|
|
|
res.push(supportGroup)
|
|
|
|
res.push(supportGroup)
|
|
|
|
@ -433,7 +438,7 @@ export class DataService {
|
|
|
|
public async fetchContracts(){
|
|
|
|
public async fetchContracts(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
this.http.get('http://localhost:8080/api/getContracts')
|
|
|
|
this.http.get(this.config.backendUrl+'/getContracts')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
response.forEach(contract => {
|
|
|
|
response.forEach(contract => {
|
|
|
|
res.push(contract)
|
|
|
|
res.push(contract)
|
|
|
|
@ -451,7 +456,7 @@ export class DataService {
|
|
|
|
// public async fetchPaketTypes(){
|
|
|
|
// public async fetchPaketTypes(){
|
|
|
|
// const promise = new Promise(resolve=>{
|
|
|
|
// const promise = new Promise(resolve=>{
|
|
|
|
// let res : any[] = [];
|
|
|
|
// let res : any[] = [];
|
|
|
|
// this.http.get('http://localhost:8080/api/getPackageTypes')
|
|
|
|
// this.http.get(this.config.backendUrl+'/getPackageTypes')
|
|
|
|
// .subscribe((response: any)=>{
|
|
|
|
// .subscribe((response: any)=>{
|
|
|
|
// response.forEach(paketType => {
|
|
|
|
// response.forEach(paketType => {
|
|
|
|
// res.push(paketType)
|
|
|
|
// res.push(paketType)
|
|
|
|
@ -469,7 +474,7 @@ export class DataService {
|
|
|
|
public async fetchUserSupportGroup(){
|
|
|
|
public async fetchUserSupportGroup(){
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
const promise = new Promise(resolve=>{
|
|
|
|
let res : any = {};
|
|
|
|
let res : any = {};
|
|
|
|
this.http.get('http://localhost:8080/api/getUserSupportGroup')
|
|
|
|
this.http.get(this.config.backendUrl+'/getUserSupportGroup')
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
this.userSupportGroup = res.name;
|
|
|
|
this.userSupportGroup = res.name;
|
|
|
|
res = response;
|
|
|
|
res = response;
|
|
|
|
@ -495,7 +500,7 @@ export class DataService {
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
this.http.post('http://localhost:8080/api/fetchPlanTimes', dataJson)
|
|
|
|
this.http.post(this.config.backendUrl+'/fetchPlanTimes', dataJson)
|
|
|
|
.subscribe((response: any[])=>{
|
|
|
|
.subscribe((response: any[])=>{
|
|
|
|
response.forEach(week => {
|
|
|
|
response.forEach(week => {
|
|
|
|
res.push(week);
|
|
|
|
res.push(week);
|
|
|
|
@ -518,7 +523,7 @@ export class DataService {
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
// console.log(dataJson);
|
|
|
|
// console.log(dataJson);
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
this.http.post('http://localhost:8080/api/getImplementer', dataJson)
|
|
|
|
this.http.post(this.config.backendUrl+'/getImplementer', dataJson)
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
.subscribe((response: any)=>{
|
|
|
|
response.members.forEach(implementer => {
|
|
|
|
response.members.forEach(implementer => {
|
|
|
|
res.push(implementer)
|
|
|
|
res.push(implementer)
|
|
|
|
@ -538,7 +543,7 @@ export class DataService {
|
|
|
|
let serializableResource = { resourceId: change.resourceId, d2: change.tasks[1].StartDate, changeNr: change.changeNr, state: change.state};
|
|
|
|
let serializableResource = { resourceId: change.resourceId, d2: change.tasks[1].StartDate, changeNr: change.changeNr, state: change.state};
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let strigifiedResource = JSON.stringify(serializableResource);
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
let resJson = JSON.parse(strigifiedResource) as typeof strigifiedResource;
|
|
|
|
this.http.post('http://localhost:8080/api/updateChange', resJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/updateChange', resJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -558,7 +563,7 @@ export class DataService {
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
// console.log(dataJson);
|
|
|
|
// console.log(dataJson);
|
|
|
|
this.http.post('http://localhost:8080/api/updateState', dataJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/updateState', dataJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -580,7 +585,7 @@ export class DataService {
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
// console.log(dataJson);
|
|
|
|
// console.log(dataJson);
|
|
|
|
this.http.post('http://localhost:8080/api/updateImplementer', dataJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/updateImplementer', dataJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
@ -602,7 +607,7 @@ export class DataService {
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let stringyfiedData = JSON.stringify(obj);
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
|
|
|
|
console.log(dataJson);
|
|
|
|
console.log(dataJson);
|
|
|
|
this.http.post('http://localhost:8080/api/updateApproval', dataJson).subscribe((response:any)=>{
|
|
|
|
this.http.post(this.config.backendUrl+'/updateApproval', dataJson).subscribe((response:any)=>{
|
|
|
|
resolve(response);
|
|
|
|
resolve(response);
|
|
|
|
},(error:any)=>{
|
|
|
|
},(error:any)=>{
|
|
|
|
resolve(error);
|
|
|
|
resolve(error);
|
|
|
|
@ -627,7 +632,7 @@ export class DataService {
|
|
|
|
let first : boolean = true;
|
|
|
|
let first : boolean = true;
|
|
|
|
let res : any[] = [];
|
|
|
|
let res : any[] = [];
|
|
|
|
console.log(dataJson);
|
|
|
|
console.log(dataJson);
|
|
|
|
this.http.post('http://localhost:8080/api/getChanges', dataJson)
|
|
|
|
this.http.post(this.config.backendUrl+'/getChanges', dataJson)
|
|
|
|
.subscribe((response:any)=>{
|
|
|
|
.subscribe((response:any)=>{
|
|
|
|
console.log("ALL CHANGES ##############\n",response);
|
|
|
|
console.log("ALL CHANGES ##############\n",response);
|
|
|
|
this.totalSize = response.totalSize;
|
|
|
|
this.totalSize = response.totalSize;
|
|
|
|
|