Commit b6ee083d authored by Lukas Burgey's avatar Lukas Burgey

Change some types

parent 936e90fe
......@@ -89,12 +89,16 @@ export interface DeploymentState {
export interface Deployment {
id: number;
service: Service | undefined;
vo: number | undefined; // the vo id
services: Service[];
state_items: DeploymentState[];
state: string
state_target: string
// only for ServiceDeployment
service?: Service;
// only for VODeployment
vo?: VO; // the vo id
services?: Service[];
}
export interface UserInfo {
......
......@@ -335,7 +335,7 @@ export class UserService {
return this.subscribeDeployments().pipe(
map((deployments: Deployment[]) => {
return deployments.find(
(dep: Deployment) => dep.vo == vo.id
(dep: Deployment) => dep.vo.id == vo.id
);
}
),
......
......@@ -25,7 +25,7 @@ export class VoDataComponent implements OnInit {
private sites$ = new BehaviorSubject<Site[]>([]);
public sites$$: Observable<Site[]>;
private deployment$ = <BehaviorSubject<Deployment>> new BehaviorSubject(new Object);
private deployment$ = <BehaviorSubject<Deployment>> new BehaviorSubject(undefined);
public deployment$$: Observable<Deployment>;
constructor(
......@@ -89,9 +89,8 @@ export class VoDataComponent implements OnInit {
public subscribeStateItem(site: Site, service: Service): Observable<DeploymentState> {
return this.deployment$$.pipe(
map(
(dep: Deployment) => {
if (dep.state_items) {
map((dep: Deployment) => {
if (dep != undefined) {
return dep.state_items.find(
(dsi: DeploymentState) => dsi.site.id == site.id && dsi.service.id == service.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