Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
bf76689c
Commit
bf76689c
authored
May 19, 2021
by
Florian Azizian
Browse files
FIX #17117 TIME 0:45 Cannot create user in administration
parent
418f1346
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/frontend/app/administration/user/user-administration.component.ts
View file @
bf76689c
...
...
@@ -926,27 +926,26 @@ export class UserAdministrationComponent implements OnInit {
if
(
this
.
creationMode
)
{
this
.
http
.
get
(
'
../rest/users/
'
+
this
.
user
.
userId
+
'
/status
'
)
.
subscribe
((
data
:
any
)
=>
{
let
deletedUser
=
false
;
if
(
data
.
status
&&
data
.
status
===
'
DEL
'
)
{
const
dialogRef
=
this
.
dialog
.
open
(
ConfirmComponent
,
{
panelClass
:
'
maarch-modal
'
,
autoFocus
:
false
,
disableClose
:
true
,
data
:
{
title
:
`
${
this
.
translate
.
instant
(
'
lang.reactivateUserDeleted
'
)}
`
,
msg
:
this
.
translate
.
instant
(
'
lang.confirmAction
'
)
}
});
dialogRef
.
afterClosed
().
pipe
(
filter
((
response
:
string
)
=>
response
===
'
ok
'
),
exhaustMap
(()
=>
this
.
http
.
post
(
'
../rest/users
'
,
this
.
user
)),
tap
((
result
:
any
)
=>
{
if
(
deletedUser
)
{
this
.
notify
.
success
(
this
.
translate
.
instant
(
'
lang.userUpdated
'
));
}
else
{
this
.
notify
.
success
(
this
.
translate
.
instant
(
'
lang.userAdded
'
));
}
this
.
appInputCorrespondentGroup
.
linkGrpAfterCreation
(
result
.
id
,
'
user
'
);
this
.
router
.
navigate
([
'
/administration/users/
'
+
result
.
id
]);
this
.
subscribeUserCreation
(
true
,
result
.
id
);
}),
catchError
((
err
:
any
)
=>
{
this
.
notify
.
error
(
err
.
error
.
errors
);
return
of
(
false
);
})
).
subscribe
();
deletedUser
=
true
;
}
else
{
this
.
http
.
post
(
'
../rest/users
'
,
this
.
user
)
.
subscribe
((
result
:
any
)
=>
{
this
.
subscribeUserCreation
(
false
,
result
.
id
);
},
(
err
:
any
)
=>
{
this
.
notify
.
handleSoftErrors
(
err
);
});
}
},
(
err
:
any
)
=>
{
this
.
notify
.
error
(
err
.
error
.
errors
);
...
...
@@ -970,6 +969,16 @@ export class UserAdministrationComponent implements OnInit {
}
}
subscribeUserCreation
(
deletedUser
:
boolean
,
userId
:
any
)
{
if
(
deletedUser
)
{
this
.
notify
.
success
(
this
.
translate
.
instant
(
'
lang.userUpdated
'
));
}
else
{
this
.
notify
.
success
(
this
.
translate
.
instant
(
'
lang.userAdded
'
));
}
this
.
appInputCorrespondentGroup
.
linkGrpAfterCreation
(
userId
,
'
user
'
);
this
.
router
.
navigate
([
'
/administration/users/
'
+
userId
]);
}
setUserModeLogin
(
event
:
any
)
{
if
(
event
.
checked
)
{
this
.
user
.
mode
=
'
rest
'
;
...
...
Write
Preview
Supports
Markdown
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