Commit e5ea83b6 authored by Lukas Burgey's avatar Lukas Burgey

Adapt to an API change

parent 497c54e5
<div *ngIf="userService.loggedIn"> <div *ngIf="userService.loggedIn">
<h4>Services</h4> <h4>Services</h4>
<div *ngIf="userService.state.services.length > 0"> <div *ngIf="userService.services.length > 0">
<mat-accordion> <mat-accordion>
<app-service *ngFor="let service of userService.state.services" <app-service *ngFor="let service of userService.services"
[serviceData]="service"></app-service> [serviceData]="service"></app-service>
</mat-accordion> </mat-accordion>
</div> </div>
<p *ngIf="userService.state.services?.length == 0"> <p *ngIf="userService.services?.length == 0">
You have no available services.<br/> You have no available services.<br/>
This is due services requiring users to be member of a certain group. This is due services requiring users to be member of a certain group.
</p> </p>
......
...@@ -39,17 +39,13 @@ interface User { ...@@ -39,17 +39,13 @@ interface User {
deployments: Deployment[]; deployments: Deployment[];
} }
interface State {
services: Service[];
}
interface StateAPI { interface StateAPI {
state: State; services: Service[];
logged_in: boolean; logged_in: boolean;
} }
interface StateAPIUser { interface StateAPIUser {
state: State; services: Service[];
logged_in: boolean; logged_in: boolean;
user: User; user: User;
} }
...@@ -68,7 +64,6 @@ interface AuthInfo { ...@@ -68,7 +64,6 @@ interface AuthInfo {
@Injectable() @Injectable()
export class UserService { export class UserService {
public loggedIn = false; public loggedIn = false;
public state: State;
public user: User; public user: User;
public sshKeyData: MatTableDataSource<any>; public sshKeyData: MatTableDataSource<any>;
public userInfoData: MatTableDataSource<any>; public userInfoData: MatTableDataSource<any>;
...@@ -85,9 +80,6 @@ export class UserService { ...@@ -85,9 +80,6 @@ export class UserService {
} }
public logState() { public logState() {
console.log(
this.state,
);
console.log( console.log(
this.user, this.user,
); );
...@@ -112,8 +104,8 @@ export class UserService { ...@@ -112,8 +104,8 @@ export class UserService {
} }
this.loggedIn = data.logged_in; this.loggedIn = data.logged_in;
if (!this.state) { if (!this.services) {
this.state = data.state; this.services = data.services;
} }
this.user = data.user; this.user = data.user;
...@@ -137,7 +129,8 @@ export class UserService { ...@@ -137,7 +129,8 @@ export class UserService {
this.sshKeyData = null; this.sshKeyData = null;
this.userInfoData = null; this.userInfoData = null;
} }
this.logState();
// this.logState();
} }
public getAuthInfo() { public getAuthInfo() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment