Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchParapheur
Commits
12a0b6be
Commit
12a0b6be
authored
May 27, 2021
by
Hamza HRAMCHI
Browse files
FEAT #17005 TIME 2:30 customize the message in the login page
parent
42827796
Changes
6
Hide whitespace changes
Inline
Side-by-side
lang/en.json
View file @
12a0b6be
...
...
@@ -511,6 +511,16 @@
"mergedVariablesMsg"
:
"Use tag"
,
"mergedVariablesMsg2"
:
"to display the generated security code."
,
"mergedVariablesMsgEmail"
:
"You can use the different tags below to enrich your email"
,
"updateOtp"
:
"Update external user"
"updateOtp"
:
"Update external user"
,
"smsCodeTagMandatory"
:
"The <b> code </b> tag is required to send security code by SMS"
,
"emailLinkTagMandatory"
:
"The <b> access link </b> tag is required for email notification"
,
"manage_customization"
:
"Customization"
,
"manage_customizationDesc"
:
"Customize the message on the login screen"
,
"loginMessage"
:
"Message on the login page:"
,
"customization"
:
"Customization"
,
"noConnector"
:
"The associated connector does not exist"
,
"otpVisaUser"
:
"The user will be notified by <b> email </b> at the time of his turn in the workflow."
,
"messageSaved"
:
"Message saved"
,
"manage_customizationAdmin"
:
"Customize the login page"
}
}
\ No newline at end of file
lang/fr.json
View file @
12a0b6be
...
...
@@ -517,6 +517,8 @@
"loginMessage"
:
"Message à l'écran de connexion :"
,
"customization"
:
"Personnalisation"
,
"noConnector"
:
"Le connecteur associé n'existe pas"
,
"otpVisaUser"
:
"L'utilisateur sera notifié par <b>courriel</b> au moment de son tour dans le circuit."
"otpVisaUser"
:
"L'utilisateur sera notifié par <b>courriel</b> au moment de son tour dans le circuit."
,
"messageSaved"
:
"Message enregistré"
,
"manage_customizationAdmin"
:
"Personnaliser la page de connexion"
}
}
src/frontend/app/administration/customization/customization.component.html
View file @
12a0b6be
...
...
@@ -15,7 +15,9 @@
</ion-label>
</ion-list-header>
<ion-item
lines=
"none"
>
<textarea
style=
"padding-top: 10px;width: 100%;"
name=
"login_message"
id=
"login_message"
[(ngModel)]=
"authService.loginMessage"
></textarea>
<textarea
style=
"padding-top: 10px;width: 100%;"
name=
"login_message"
id=
"login_message"
[value]=
"loginMessage"
[(ngModel)]=
"loginMessage"
>
</textarea>
</ion-item>
<ion-item
text-center
lines=
"none"
style=
"position: sticky;bottom:0px;z-index:1;"
>
<div
style=
"display: flex;align-items: center;justify-content: center;width: 100%;background: white;"
>
...
...
src/frontend/app/administration/customization/customization.component.ts
View file @
12a0b6be
...
...
@@ -20,7 +20,7 @@ export class CustomizationComponent implements OnInit {
@
ViewChild
(
'
customizationForm
'
,
{
static
:
false
})
customizationForm
:
NgForm
;
loading
:
boolean
=
true
;
loginMessage
:
string
=
'
<span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">Découvrez </span><strong style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">Maarch Parapheur 21.03</strong><span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;"> avec </span><a style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;" title="notre guide de visite" href="https://docs.maarch.org/" target="_blank" rel="noopener"><span style="color: #f99830;"><strong>notre guide de visite en ligne</strong></span></a><span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">.</span>
'
;
loginMessage
:
string
=
''
;
constructor
(
public
http
:
HttpClient
,
...
...
@@ -30,24 +30,48 @@ export class CustomizationComponent implements OnInit {
private
functions
:
FunctionsService
)
{
}
ngOnInit
(){
// await this.authService.getLoginMessage();
setTimeout
(()
=>
{
this
.
initMce
();
},
100
);
this
.
loading
=
false
;
async
ngOnInit
(){
await
this
.
getLginMessage
();
}
ngOnDestroy
():
void
{
tinymce
.
remove
();
}
getLginMessage
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
http
.
get
(
'
../rest/authenticationInformations
'
).
pipe
(
tap
((
data
:
any
)
=>
{
this
.
loginMessage
=
data
.
loginMessage
;
setTimeout
(()
=>
{
this
.
initMce
();
},
100
);
this
.
loading
=
false
;
resolve
(
true
);
}),
catchError
((
err
:
any
)
=>
{
this
.
notificationService
.
error
(
err
);
return
of
(
false
);
})
).
subscribe
();
})
}
onSubmit
()
{
this
.
loginMessage
=
tinymce
.
get
(
'
login_message
'
).
getContent
();
console
.
log
(
this
.
loginMessage
);
// this.http.post('../res/', this.loginMessage).pipe(
// tap(() => {}),
// catchError((err: any) => {
// this.notificationService.handleErrors(err);
// return of(false);
// })
// ).subscribe();
if
(
this
.
functions
.
empty
(
this
.
loginMessage
))
{
this
.
notificationService
.
error
(
this
.
translate
.
instant
(
'
lang.requiredField
'
));
}
else
{
this
.
http
.
put
(
'
../rest/customization
'
,
{
id
:
this
.
authService
.
user
.
id
,
loginMessage
:
this
.
loginMessage
}).
pipe
(
tap
(()
=>
{
this
.
notificationService
.
success
(
this
.
translate
.
instant
(
'
lang.messageSaved
'
));
}),
catchError
((
err
:
any
)
=>
{
this
.
notificationService
.
handleErrors
(
err
);
return
of
(
false
);
})
).
subscribe
();
}
}
initMce
()
{
...
...
src/frontend/app/service/auth.guard.ts
View file @
12a0b6be
...
...
@@ -36,6 +36,7 @@ export class AuthGuard implements CanActivate {
}
else
{
this
.
http
.
get
(
'
../rest/authenticationInformations
'
).
pipe
(
map
((
data
:
any
)
=>
{
this
.
authService
.
loginMessage
=
data
.
loginMessage
;
this
.
authService
.
authMode
=
data
.
connection
;
this
.
authService
.
changeKey
=
data
.
changeKey
;
this
.
authService
.
coreUrl
=
data
.
coreUrl
;
...
...
src/frontend/app/service/auth.service.ts
View file @
12a0b6be
...
...
@@ -19,7 +19,7 @@ export class AuthService {
user
:
any
=
{};
signatureRoles
:
any
[]
=
[];
mailServerOnline
=
false
;
loginMessage
:
string
=
'
<span style="color: #000000;"><span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">Découvrez </span><strong style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">Maarch Parapheur 21.03</strong></span><span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;"><span style="color: #000000;"> avec</span> </span><a style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;" title="notre guide de visite" href="https://docs.maarch.org/" target="_blank" rel="noopener"><span style="color: #f99830;"><strong>notre guide de visite en ligne</strong></span></a><span style="font-family: -apple-system, BlinkMacSystemFont,
\'
Segoe UI
\'
, Roboto, Oxygen, Ubuntu, Cantarell,
\'
Open Sans
\'
,
\'
Helvetica Neue
\'
, sans-serif;">.</span>
'
;
loginMessage
:
string
=
''
;
constructor
(
public
http
:
HttpClient
,
private
router
:
Router
,
...
...
@@ -159,18 +159,4 @@ export class AuthService {
cleanCachedUrl
()
{
return
this
.
localStorage
.
remove
(
'
MaarchParapheurCacheUrl
'
);
}
getLoginMessage
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
http
.
get
(
'
../rest/adminCustomization
'
).
pipe
(
tap
(()
=>
{
resolve
(
true
);
}),
catchError
((
err
:
any
)
=>
{
this
.
notificationService
.
handleErrors
(
err
);
return
of
(
false
);
})
).
subscribe
();
});
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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