Commit f76a09c7 authored by Lukas Burgey's avatar Lukas Burgey

Make state and state_target 'enums'

parent 43083d30
......@@ -2,6 +2,26 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
// STATE ENUMS
const states = [
'deployment_pending',
'removal_pending',
'deployed',
'not_deployed',
'questionnaire',
'failed',
'rejected',
] as const;
export type StateID = typeof states[number];
const stateTargets = [
'deployed',
'not_deployed',
] as const;
export type StateTargetID = typeof stateTargets[number];
// auth stuff
export interface IdP {
id: number;
......@@ -68,8 +88,8 @@ export interface JSONObject {
export interface CredentialState {
credential: SSHKeyRef;
is_pending: boolean;
state: string;
state_target: string;
state: StateID;
state_target: StateTargetID;
}
export interface DeploymentState {
......@@ -83,16 +103,16 @@ export interface DeploymentState {
questionnaire: JSONObject | undefined;
service: Service;
site: Site;
state: string;
state_target: string;
state: StateID;
state_target: StateTargetID;
}
export interface Deployment {
id: number;
service?: Service; // only for ServiceDeployment
services?: Service[]; // only for VODeployment
state: string;
state_target: string;
state: StateID;
state_target: StateTargetID;
states: DeploymentState[];
vo?: VO; // only for VODeployment
}
......
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