Commit 4730181e authored by Lukas Burgey's avatar Lukas Burgey

Service have only one site

parent 8815e244
<div class="mat-typography">
<h2>Credentials</h2>
<p>
For access to the service {{ service.name }} at {{ service.site[0].name }} additional credentials are needed.
For access to the service {{ service.name }} at {{ service.site.name }} additional credentials are needed.
The additional credentials are listed below.
</p>
<div *ngIf="credentialCount > 0" style="margin-bottom: 50px;">
......
......@@ -56,7 +56,7 @@ export interface SSHKeyRef {
export interface Service {
id: number;
name: string;
site: Site[];
site: Site;
description: string;
vos: VO[];
}
......@@ -91,7 +91,6 @@ export interface Deployment {
service: Service | undefined;
vo: number | undefined; // the vo id
services: Service[];
sites: Site[];
state_items: DeploymentStateItem[];
state: string
state_target: string
......
import {throwError as observableThrowError, Observable, BehaviorSubject, of, EMPTY } from 'rxjs';
import { Injectable } from '@angular/core';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { throwError as observableThrowError, Observable, BehaviorSubject, of, EMPTY } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { CookieService } from 'ngx-cookie-service';
......
......@@ -46,9 +46,7 @@ export class VoDataComponent implements OnInit {
// generate the sites from the services
this.services.map(
(s: Service) => s.site.forEach(
(site: Site) => this.sites.set(site.id, site)
)
(s: Service) => this.sites.set(s.site.id, s.site)
);
let uniqueSites = []
......@@ -81,10 +79,8 @@ export class VoDataComponent implements OnInit {
return this.services$$.pipe(
map(
(services: Service[]) => services.filter(
(service: Service) => service.site.some(
(s: Site) => s.id === site.id
)
)
(service: Service) => service.site.id === site.id
),
),
);
}
......
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