Skip to content

Commit

Permalink
Samstag 09:45
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hornburger committed Mar 2, 2024
1 parent 809a345 commit 9ff7c7d
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 589 deletions.
7 changes: 5 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ const appurl: string = environment.production === false ? 'htt
// !! Server URL auch in Pool service anpassen

const serverurl: string = environment.production === false ? 'http://localhost:8080' : 'bae-urlaubsplaner-server.azurewebsites.net';
const dockerurl: string = environment.production === false ? 'http://localhost:80' : 'bae-urlaubsplaner-docker.azurewebsites.net';

const MandantenID: string = '8870822d-b5ee-4a63-b4ea-7147f0ee753d';
const clientappregistration: string = 'e85e5489-e9fd-4d10-b6aa-37be3ce084b6'; // Login funktioniert mit peter.hornburger
const clientserverregistration: string = 'ca7568f7-4672-4348-843b-b80b210d692f'; // geht nicht da Web / Server Anwendung
const clientserverregistration: string = 'ca7568f7-4672-4348-843b-b80b210d692f';
const clientdockerregistration: string = '0caad6ac-8087-46ce-99ca-690c083121a8';

// GITHUB Account
// Benutzername: peter.hornburger@b-a-e.eu
Expand Down Expand Up @@ -95,7 +98,7 @@ export const MSALInstanceFactory = (): IPublicClientApplication => {
const MSALInterceptorConfigFactory = () : MsalInterceptorConfiguration => {
const protectedResourceMap = new Map<string, Array<string>>();
protectedResourceMap.set('https://graph.microsoft.com/v1.0/me', ['user.read']);
protectedResourceMap.set(serverurl, ['api://' + clientserverregistration + '/database_access']);
protectedResourceMap.set(dockerurl, ['api://' + clientdockerregistration + '/database_access']);

return {
interactionType: InteractionType.Redirect,
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/common-debug/common-debug.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<table>
<tr>
<td>
<ion-button (click)="TestButtonCLcicked()">Test</ion-button>
<ion-button (click)="TestButtonChlicked()">Test</ion-button>
</td>
<td>
<ion-button (click)="ClearMessagesButtonCLcicked()">Clear Messages</ion-button>
Expand Down
84 changes: 4 additions & 80 deletions src/app/pages/common-debug/common-debug.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import * as lodash from "lodash-es";
export class CommonDebugPage implements OnInit, OnDestroy {

public Title: string;
private ServerUrl: string;

constructor(public Basics: BasicsProvider,
public Debug: DebugProvider,
Expand All @@ -32,9 +31,8 @@ export class CommonDebugPage implements OnInit, OnDestroy {
) {
try
{
this.ServerUrl = this.Pool.CockpitserverURL + '/standorte/';

// Test

}
catch (error) {

Expand Down Expand Up @@ -78,66 +76,6 @@ export class CommonDebugPage implements OnInit, OnDestroy {
}
}

/*
ClearAccessToken() {
try {
// this.AuthService.AccessToken = null;
this.AuthService.ActiveUser = null;
this.AuthService.DeleteAccessToken();
} catch (error) {
this.Debug.ShowErrorMessage(error.message, 'Debug', 'ClearAccessToken', this.Debug.Typen.Page);
}
}
*/

public TestButtonCLcicked() {

try {

let Observer: Observable<any>;

let headers: HttpHeaders = new HttpHeaders({

'content-type': 'application/json',
// 'authorization': this.AuthService.AccessToken
});

Observer = this.http.get(this.ServerUrl, { headers: headers } ); // { headers: {'Authorization' : this.AuthService.SecurityToken} }

Observer.subscribe({

next: (result) => {

debugger;

// this.UpdateStandortliste(result.data);
},
complete: () => {

// this.Pool.StandortelisteChanged.emit();

debugger;
// resove(true);

},
error: (error: HttpErrorResponse) => {

debugger;
//reject(error);
}
});

} catch (error) {

this.Debug.ShowErrorMessage(error.message, 'Debug', 'TextButtonCLcicked', this.Debug.Typen.Page);
}
}

ClearMessagesButtonCLcicked() {

try {
Expand Down Expand Up @@ -174,28 +112,14 @@ export class CommonDebugPage implements OnInit, OnDestroy {
}
}

ProjektpunkteLoeschenClicked() {
TestButtonChlicked() {

try {

/*
this.DBProjektpunkte.RemoveProjektpunkteliste(this.Pool.DeletedProjektpunkteliste[this.DBProjekte.CurrentProjekt.Projektkey]).then(() => {
debugger;
this.Pool.DeletedProjektpunkteliste[this.DBProjekte.CurrentProjekt.Projektkey] = [];
}).catch((error) => {
debugger;
});
*/

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Debug', 'ProjektpunkteLoeschenClicked', this.Debug.Typen.Page);
this.Debug.ShowErrorMessage(error, 'Debug', 'TestButtonChlicked', this.Debug.Typen.Page);
}

}
}
120 changes: 0 additions & 120 deletions src/app/pages/common-home/common-home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,126 +449,6 @@ export class CommonHomePage implements OnInit, OnDestroy {
}
}

LoggoutClicked() {

try {

this.AuthService.Logout();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'LoggoutClicked', this.Debug.Typen.Page);
}
}

GetUsercalendarClicked() {

try {

this.GraphService.GetOwnCalendar();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'GetUsercalendarClicked', this.Debug.Typen.Page);
}
}

TestServerClicked() {

try {

this.Pool.TestServerconnection();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'TestServerClicked', this.Debug.Typen.Page);
}
}


TestGraphClicked() {

try {

this.GraphService.TestGraph();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'TestGraphClicked', this.Debug.Typen.Page);
}
}


SendMailClicked() {

try {

// this.GraphService.SendMail();



} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'SendMailClicked', this.Debug.Typen.Page);
}
}

TestSites() {

try {


let Test = this.Pool.Mitarbeiterdaten;

debugger;
// this.GraphService.TestSites();




} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'TestSites', this.Debug.Typen.Page);
}
}


PDFDownloadAvaiableHandler() {

try {

this.Tools.PushPage(this.Const.Pages.PDFViewerPage);

} catch (error) {

this.Debug.ShowErrorMessage(error, 'Home', 'PDFDownloadAvaiableHandler', this.Debug.Typen.Page);
}
}

async SaveProtokokllClicked() {

try {

// await this.DBProtokolle.SaveProtokollInTeams();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'file', 'function', this.Debug.Typen.Page);
}
}

async SendProtokokllClicked() {

try {

// await this.DBProtokolle.SendProtojollFromTeams();

} catch (error) {

this.Debug.ShowErrorMessage(error, 'file', 'function', this.Debug.Typen.Page);
}
}

CountMitarbeiter(): string {

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class DatabaseChangelogService {
private http: HttpClient) {
try {

this.ServerUrl = this.Pool.CockpitserverURL + '/changelog';
this.ServerUrl = this.Pool.CockpitdockerURL + '/changelog';
this.CurrentChangelog = null;

} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class DatabaseOutlookemailService {
try {

this.CurrentEmail = null;
this.ServerUrl = this.Pool.CockpitserverURL + '/email';
this.ServerUrl = this.Pool.CockpitdockerURL + '/email';
this.ShowUngelesenOnly = true;
this.Projektsortierung = true;

Expand Down Expand Up @@ -54,7 +54,7 @@ export class DatabaseOutlookemailService {

return new Promise((resolve, reject) => {

let EmailObservable = this.http.get(this.Pool.CockpitserverURL + '/email', { headers: headers, params: queryParams });
let EmailObservable = this.http.get(this.Pool.CockpitdockerURL + '/email', { headers: headers, params: queryParams });

EmailObservable.subscribe({

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@ export class DatabaseMitarbeiterService {
public CurrentMitarbeiter: Mitarbeiterstruktur;
public CurrentMeinewoche: Meinewochestruktur;
private ServerMitarbeiterUrl: string;
private ServerRegistrierungUrl: string;
private ServerSettingsUrl: string;

constructor(private Debug: DebugProvider,
private http: HttpClient,
private Const: ConstProvider,
private Pool: DatabasePoolService) {
try {

this.ServerMitarbeiterUrl = this.Pool.CockpitserverURL + '/mitarbeiter';
this.ServerSettingsUrl = this.Pool.CockpitserverURL + '/settings';
this.ServerRegistrierungUrl = this.Pool.CockpitserverURL + '/registrierung';
this.ServerMitarbeiterUrl = this.Pool.CockpitdockerURL + '/mitarbeiter';
this.CurrentMeinewoche = this.GetEmptyMeinewocheeintrag();

// Test
Expand Down Expand Up @@ -517,48 +513,6 @@ export class DatabaseMitarbeiterService {
}
}

public RegisterMitarbeiter() {

try {

let Observer: Observable<any>;
let Daten: any;
let headers: HttpHeaders = new HttpHeaders({

'content-type': 'application/json',
});

return new Promise((resolve, reject) => {

// POST für neue Registrierung

Observer = this.http.post(this.ServerRegistrierungUrl, this.CurrentMitarbeiter, { headers: headers } );

Observer.subscribe({

next: (result) => {

Daten = result;

},
complete: () => {

resolve(Daten);
},
error: (error: HttpErrorResponse) => {

reject(error);
}
});

});

} catch (error) {

this.Debug.ShowErrorMessage(error.message, 'Database Mitarbeiter', 'RegisterMitarbeiter', this.Debug.Typen.Page);
}
}

public CheckMitarbeiterExists(email: string): boolean {

try {
Expand Down
Loading

0 comments on commit 9ff7c7d

Please sign in to comment.