Commit e5ea83b6 authored by Lukas Burgey's avatar Lukas Burgey

Adapt to an API change

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