Commit 572e1933 authored by Lukas Burgey's avatar Lukas Burgey

Rename model types

parent 4730181e
......@@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatTableDataSource } from '@angular/material';
import { UserService } from '../../user.service';
import { DeploymentStateItem, Service, CredentialState } from '../../types/types.module';
import { DeploymentState, Service, CredentialState } from '../../types/types.module';
@Component({
selector: 'app-credentials',
......@@ -12,7 +12,7 @@ import { DeploymentStateItem, Service, CredentialState } from '../../types/types
export class CredentialsComponent implements OnInit {
public columns = ["name", "value"];
public stateItem: DeploymentStateItem;
public stateItem: DeploymentState;
public service: Service;
public credentialCount: number = 0;
public table: MatTableDataSource<any>;
......
......@@ -54,7 +54,7 @@ export class DialogService {
);
}
public openQuestionnaire(stateItem: t.DeploymentStateItem) {
public openQuestionnaire(stateItem: t.DeploymentState) {
this.questionnaireDialog = this.dialog.open(
QuestionnaireComponent,
this.settingsData({
......@@ -63,7 +63,7 @@ export class DialogService {
);
}
public openCredentials(stateItem: t.DeploymentStateItem) {
public openCredentials(stateItem: t.DeploymentState) {
this.credentialsDialog = this.dialog.open(
CredentialsComponent,
this.settingsData({
......@@ -72,7 +72,7 @@ export class DialogService {
);
}
public openMessage(stateItem: t.DeploymentStateItem) {
public openMessage(stateItem: t.DeploymentState) {
this.messageDialog = this.dialog.open(
MessageComponent,
this.settingsData({
......
......@@ -10,7 +10,7 @@ import * as t from '../../types/types.module';
styleUrls: ['./message.component.css']
})
export class MessageComponent implements OnInit {
public stateItem: t.DeploymentStateItem;
public stateItem: t.DeploymentState;
constructor(
public userService: UserService,
......
......@@ -11,7 +11,7 @@ import * as t from '../../types/types.module';
})
export class QuestionnaireComponent implements OnInit {
public answers: Object = {};
public stateItem: t.DeploymentStateItem;
public stateItem: t.DeploymentState;
constructor(
public userService: UserService,
......
......@@ -27,7 +27,7 @@ export class ServiceComponent implements OnInit {
ngOnInit() {
}
public stateItem(site: t.Site): t.DeploymentStateItem | undefined {
public stateItem(site: t.Site): t.DeploymentState | undefined {
if (this.deployment) {
return this.deployment.state_items.find(
item => {
......
......@@ -71,8 +71,7 @@ export interface CredentialState {
credential: SSHKeyRef;
}
// corresponds to NewDeploymentStateItem in the backend
export interface DeploymentStateItem {
export interface DeploymentState {
id: number;
service: Service | undefined;
vo: VO | undefined;
......@@ -85,13 +84,12 @@ export interface DeploymentStateItem {
message: string;
}
// corresponds to NewDeployment in the backend
export interface Deployment {
id: number;
service: Service | undefined;
vo: number | undefined; // the vo id
services: Service[];
state_items: DeploymentStateItem[];
state_items: DeploymentState[];
state: string
state_target: string
}
......@@ -115,7 +113,7 @@ export interface User {
export interface UserState {
deployments: Deployment[];
//deployment_state_items: DeploymentStateItem[];
//deployment_state_items: DeploymentState[];
}
export interface State {
......
......@@ -5,7 +5,7 @@ import { map } from 'rxjs/operators';
import { UserService } from '../user.service';
import { DialogService } from '../dialogues/dialog.service';
import { VO, Site, Service, Deployment, DeploymentStateItem } from '../types/types.module';
import { VO, Site, Service, Deployment, DeploymentState } from '../types/types.module';
@Component({
selector: 'app-vo-data',
......@@ -85,13 +85,13 @@ export class VoDataComponent implements OnInit {
);
}
public subscribeStateItem(site: Site, service: Service): Observable<DeploymentStateItem> {
public subscribeStateItem(site: Site, service: Service): Observable<DeploymentState> {
return this.deployment$$.pipe(
map(
(dep: Deployment) => {
if (dep.state_items) {
return dep.state_items.find(
(dsi: DeploymentStateItem) => dsi.site.id == site.id && dsi.service.id == service.id,
(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