Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
feudal
feudalWebpage
Commits
cd4c9614
Commit
cd4c9614
authored
Jun 18, 2018
by
Lukas Burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some bugs concerning the initialization of the user service
parent
889f3187
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
src/app/user.service.ts
src/app/user.service.ts
+13
-15
No files found.
src/app/user.service.ts
View file @
cd4c9614
...
...
@@ -23,7 +23,7 @@ export class UserService {
public
sshKeyData
:
MatTableDataSource
<
any
>
;
public
userInfoData
:
MatTableDataSource
<
any
>
;
public
services
:
Service
[];
public
messages
:
string
[];
public
messages
:
string
[]
=
[]
;
constructor
(
...
...
@@ -32,8 +32,7 @@ export class UserService {
public
snackBar
:
SnackBarService
,
private
_stompService
:
StompRService
,
)
{
this
.
update
();
this
.
messages
=
[];
this
.
updateState
();
}
public
setIdPPreference
(
idp
:
IdP
)
{
...
...
@@ -74,8 +73,6 @@ export class UserService {
);
}
private
_handleValueChange
(
newData
:
any
)
{
}
private
_updateUserValues
(
newUser
:
any
)
{
this
.
user
=
newUser
;
...
...
@@ -119,6 +116,7 @@ export class UserService {
if
(
!
this
.
services
)
{
this
.
services
=
newData
.
services
;
}
this
.
_updateUserValues
(
newData
.
user
);
if
(
login
)
{
...
...
@@ -142,15 +140,15 @@ export class UserService {
this
.
updateData
(
data
);
},
(
err
:
HttpErrorResponse
)
=>
{
if
(
!
this
.
services
)
{
this
.
services
=
[];
}
console
.
log
(
'
Error
'
,
err
);
this
.
snackBar
.
open
(
'
Error receiving data from the server
'
);
}
);
}
public
update
()
{
this
.
updateState
();
}
public
login
(
idp
:
IdP
)
{
this
.
setIdPPreference
(
idp
);
...
...
@@ -177,7 +175,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error uploading key
'
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -194,7 +192,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error deleting key
'
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -213,7 +211,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error deploying key
'
+
key
.
name
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -233,7 +231,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error withdrawing key
'
+
key
.
name
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -249,7 +247,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error uploading questionnaire
'
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -263,7 +261,7 @@ export class UserService {
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error deleting user from server
'
);
console
.
log
(
err
);
this
.
update
();
this
.
update
State
();
}
);
}
...
...
@@ -321,7 +319,7 @@ export class UserService {
}
public
taskItem
(
site
,
service
):
any
{
if
(
site
&&
service
)
{
if
(
this
.
user
.
deployment_task_items
&&
site
&&
service
)
{
for
(
const
item
of
this
.
user
.
deployment_task_items
){
if
(
item
.
site
.
id
==
site
.
id
&&
item
.
service
.
id
==
service
.
id
)
{
return
item
;
...
...
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