Commit 6e87dc8c authored by Lukas Burgey's avatar Lukas Burgey

WIP: Rename stuff

parent 8e571c0e
<div *ngIf="(userService.subscribeUser() | async) as user" class="mat-typography" style="margin-bottom: 50px;"> <div *ngIf="(userService.userSrc() | async) as user" class="mat-typography" style="margin-bottom: 50px;">
<h2>User Info</h2> <h2>User Info</h2>
<p> <p>
You can inspect the user information we received about you. You can inspect the user information we received about you.
......
<header feudal-header></header> <header feudal-header></header>
<div class="mat-typography" class="body" > <div class="mat-typography" class="body" >
<div *ngIf="(userService.subscribeUser() | async) as user" style="max-width: 800px;" class="centered"> <div *ngIf="(userService.userSrc() | async) as user" style="max-width: 800px;" class="centered">
<div *ngIf="(userService.subscribeSSHKeys() | async)?.length > 0; else noCredentials"> <div *ngIf="(userService.sshKeysSrc() | async)?.length > 0; else noCredentials">
<div style="margin-bottom: 50px;"> <div style="margin-bottom: 50px;">
<h3>Your services</h3> <h3>Your services</h3>
<mat-accordion *ngIf="(userService.subscribeServices() | async) as services; else noServices"> <mat-accordion *ngIf="(userService.servicesSrc() | async) as services; else noServices">
<app-service *ngFor="let service of services" [service]="service"></app-service> <app-service *ngFor="let service of services" [service]="service"></app-service>
</mat-accordion> </mat-accordion>
<ng-template #noServices> <ng-template #noServices>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div> <div>
<h3>Your Virtual Organisations</h3> <h3>Your Virtual Organisations</h3>
<mat-accordion *ngIf="(userService.subscribeVOs() | async) as vos; else noVOs"> <mat-accordion *ngIf="(userService.vosSrc() | async) as vos; else noVOs">
<app-vo-data *ngFor="let vo of vos" [vo]="vo"></app-vo-data> <app-vo-data *ngFor="let vo of vos" [vo]="vo"></app-vo-data>
</mat-accordion> </mat-accordion>
<ng-template #noVOs> <ng-template #noVOs>
......
<div *ngIf="(userService.subscribeUser() | async) as user" class="mat-typography" style="margin-bottom: 50px;"> <div *ngIf="(userService.userSrc() | async) as user" class="mat-typography" style="margin-bottom: 50px;">
<h2>User Info</h2> <h2>User Info</h2>
<p> <p>
You can inspect the user information we received about you. You can inspect the user information we received about you.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Federated User Credential Deployment Portal Federated User Credential Deployment Portal
</h1> </h1>
<div class="header-bar"> <div class="header-bar">
<span *ngIf="(userService.subscribeUser() | async) as user; else notLoggedIn"> <span *ngIf="(userService.userSrc() | async) as user; else notLoggedIn">
<button mat-button mat-icon-button (click)="dialog.openAccount()"> <button mat-button mat-icon-button (click)="dialog.openAccount()">
<mat-icon>settings</mat-icon> <mat-icon>settings</mat-icon>
</button> </button>
......
...@@ -12,7 +12,7 @@ export class SSHKeysDataSource implements DataSource<SSHKey> { ...@@ -12,7 +12,7 @@ export class SSHKeysDataSource implements DataSource<SSHKey> {
) {} ) {}
connect(collectionViewer: CollectionViewer): Observable<SSHKey[]> { connect(collectionViewer: CollectionViewer): Observable<SSHKey[]> {
return this.userService.subscribeSSHKeys(); return this.userService.sshKeysSrc();
} }
disconnect(collectionViewer: CollectionViewer): void { disconnect(collectionViewer: CollectionViewer): void {
......
...@@ -56,7 +56,7 @@ export class UserService { ...@@ -56,7 +56,7 @@ export class UserService {
private connect(): void { private connect(): void {
this.fetch(); this.fetch();
this.subscribeUser().subscribe( this.userSrc().subscribe(
(newUser: User) => { (newUser: User) => {
console.log('user$:', newUser); console.log('user$:', newUser);
...@@ -343,22 +343,22 @@ export class UserService { ...@@ -343,22 +343,22 @@ export class UserService {
// DATA SERVICE API // DATA SERVICE API
// //
public subscribeSpecific<T>(selector: (user: User) => T): Observable<T> { public subscribeSpecific<T>(selector: (user: User) => T): Observable<T> {
return this.subscribeUser().pipe(map(selector)); return this.userSrc().pipe(map(selector));
} }
public subscribeSSHKeys(): Observable<SSHKey[]> { public sshKeysSrc(): Observable<SSHKey[]> {
return this.sshKeys$.asObservable(); return this.sshKeys$.asObservable();
} }
public subscribeUser(): Observable<User> { public userSrc(): Observable<User> {
return this.user$.asObservable(); return this.user$.asObservable();
} }
public subscribeDeployments(): Observable<Deployment[]> { public deploymentsSrc(): Observable<Deployment[]> {
return this.deployments$.asObservable(); return this.deployments$.asObservable();
} }
public subscribeDeploymentStates(): Observable<DeploymentState[]> { public depStatesSrc(): Observable<DeploymentState[]> {
return this.deploymentStates$.asObservable(); return this.deploymentStates$.asObservable();
} }
...@@ -371,7 +371,7 @@ export class UserService { ...@@ -371,7 +371,7 @@ export class UserService {
} }
public subscribeDeployment(selector: (dep: Deployment) => boolean): Observable<Deployment> { public subscribeDeployment(selector: (dep: Deployment) => boolean): Observable<Deployment> {
return this.subscribeDeployments().pipe( return this.deploymentsSrc().pipe(
map((deployments: Deployment[]) => { map((deployments: Deployment[]) => {
return deployments.find( return deployments.find(
(dep: Deployment) => selector(dep), (dep: Deployment) => selector(dep),
...@@ -381,11 +381,11 @@ export class UserService { ...@@ -381,11 +381,11 @@ export class UserService {
); );
} }
public subscribeServices(): Observable<Service[]> { public servicesSrc(): Observable<Service[]> {
return this.subscribeSpecific(this.serviceSelector); return this.subscribeSpecific(this.serviceSelector);
} }
public subscribeVOs(): Observable<VO[]> { public vosSrc(): Observable<VO[]> {
return this.prefs.connect().pipe( return this.prefs.connect().pipe(
combineLatest( combineLatest(
this.user$.asObservable(), this.user$.asObservable(),
......
...@@ -44,7 +44,7 @@ export class VoDataComponent implements OnInit { ...@@ -44,7 +44,7 @@ export class VoDataComponent implements OnInit {
); );
// this is just used when no deployment exists // this is just used when no deployment exists
this.userService.subscribeServices().subscribe( this.userService.servicesSrc().subscribe(
(services: Service[]) => { (services: Service[]) => {
this.services = services; this.services = services;
this.services$.next(this.services); this.services$.next(this.services);
......
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