Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalWebpage
Commits
fea5dc32
Commit
fea5dc32
authored
Nov 29, 2018
by
Lukas Burgey
Browse files
Fix some types
parent
2fe82cdc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/types/types.module.ts
View file @
fea5dc32
...
...
@@ -66,66 +66,50 @@ interface JSONObject {
}
export
interface
CredentialState
{
state
:
string
;
state_target
:
string
;
credential
:
SSHKeyRef
;
is_pending
:
boolean
;
state
:
string
;
state_target
:
string
;
}
export
interface
DeploymentState
{
credential_states
:
CredentialState
[];
credentials
:
JSONObject
;
id
:
number
;
service
:
Service
|
undefined
;
vo
:
VO
|
undefined
;
services
:
Service
[];
is_credential_pending
:
boolean
;
is_pending
:
boolean
;
message
:
string
;
questionnaire
:
JSONObject
;
service
:
Service
;
site
:
Site
;
state
:
string
;
questionnaire
:
JSONObject
;
credentials
:
JSONObject
;
credential_states
:
CredentialState
[];
message
:
string
;
is_pending
:
boolean
;
is_credential_pending
:
boolean
;
state_target
:
string
;
}
export
interface
Deployment
{
id
:
number
;
states
:
DeploymentState
[];
service
?:
Service
;
// only for ServiceDeployment
services
?:
Service
[];
// only for VODeployment
state
:
string
state_target
:
string
// only for ServiceDeployment
service
?:
Service
;
// only for VODeployment
vo
?:
VO
;
// the vo id
services
?:
Service
[];
}
export
interface
UserInfo
{
vos
:
string
[];
states
:
DeploymentState
[];
vo
?:
VO
;
// only for VODeployment
}
export
interface
User
{
deployments
:
Deployment
[];
id
:
number
;
profile_name
:
string
;
u
ser
info
:
UserInfo
;
ser
vices
:
Service
[]
;
ssh_keys
:
SSHKey
[];
states
:
DeploymentState
[];
userinfo
:
JSONObject
;
vos
:
VO
[];
// these are additions here
services
:
Service
[];
deployments
:
Deployment
[];
error
?:
string
;
}
export
interface
UserState
{
deployments
:
Deployment
[];
//deployment_states: DeploymentState[];
}
export
interface
State
{
user
:
User
;
error
?:
string
;
user
:
User
;
}
export
interface
Update
{
...
...
src/app/user.service.ts
View file @
fea5dc32
...
...
@@ -10,7 +10,9 @@ import { Message } from '@stomp/stompjs';
import
{
SnackBarService
}
from
'
./snackbar.service
'
;
import
{
IdpService
}
from
'
./idp.service
'
;
import
{
VO
,
User
,
Update
,
State
,
Deployment
,
SSHKey
,
NewSSHKey
,
IdP
,
Service
}
from
'
./types/types.module
'
;
import
{
VO
,
User
,
Update
,
State
,
Deployment
,
DeploymentState
,
SSHKey
,
NewSSHKey
,
IdP
,
Service
}
from
'
./types/types.module
'
;
@
Injectable
()
...
...
@@ -341,4 +343,9 @@ export class UserService {
),
);
}
public
subscribeDeploymentStates
():
Observable
<
DeploymentState
[]
>
{
let
statesSelector
=
(
user
:
User
)
=>
user
?
user
.
states
:
[];
return
this
.
subscribeSpecific
<
DeploymentState
[]
>
(
statesSelector
);
}
}
src/app/vo-data/vo-data.component.ts
View file @
fea5dc32
...
...
@@ -88,15 +88,10 @@ export class VoDataComponent implements OnInit {
}
public
subscribeStateItem
(
site
:
Site
,
service
:
Service
):
Observable
<
DeploymentState
>
{
return
this
.
deployment$$
.
pipe
(
map
((
dep
:
Deployment
)
=>
{
if
(
dep
!=
undefined
)
{
return
dep
.
states
.
find
(
(
dsi
:
DeploymentState
)
=>
dsi
.
site
.
id
==
site
.
id
&&
dsi
.
service
.
id
==
service
.
id
,
)
}
},
),
return
this
.
userService
.
subscribeDeploymentStates
().
pipe
(
map
((
states
:
DeploymentState
[])
=>
states
.
find
(
(
dsi
:
DeploymentState
)
=>
dsi
.
site
.
id
==
site
.
id
&&
dsi
.
service
.
id
==
service
.
id
,
)),
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment