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
e7930b9b
Commit
e7930b9b
authored
Aug 25, 2021
by
Hamza HRAMCHI
Browse files
FIX #17812 TIME 0:57 display delegation message in sendAvisParallel action + translate
parent
b420cdbe
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.scss
View file @
e7930b9b
...
...
@@ -120,7 +120,7 @@
.delegationMsg
{
color
:
var
(
--
maarch-color-danger
);;
font-size
:
1
2
px
;
font-size
:
1
4
px
;
margin-top
:
20px
;
display
:
flex
!
important
;
}
src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.ts
View file @
e7930b9b
...
...
@@ -91,9 +91,8 @@ export class GiveAvisParallelActionComponent implements OnInit {
}
executeAction
(
realResSelected
:
number
[])
{
const
delegateMsg
:
string
=
this
.
translate
.
instant
(
'
lang.insteadOf
'
).
replace
(
/^.
{1}
/g
,
this
.
translate
.
instant
(
'
lang.insteadOf
'
)[
0
].
toLowerCase
());
const
opinionUserState
:
string
=
this
.
delegation
.
isDelegated
?
`
${
this
.
translate
.
instant
(
'
lang.opinionUserState
'
).
toUpperCase
()}
${
delegateMsg
}
${
this
.
delegation
.
userDelegated
}
`
:
this
.
translate
.
instant
(
'
lang.opinionUserState
'
);
const
noteContent
:
string
=
`[
${
opinionUserState
}
]
${
this
.
noteEditor
.
getNoteContent
()}
`
;
const
opinionUserState
:
string
=
this
.
translate
.
instant
(
'
lang.delegatedOpinion
'
).
concat
(
'
'
,
this
.
delegation
.
userDelegated
);
const
noteContent
:
string
=
this
.
delegation
.
isDelegated
?
`[
${
this
.
translate
.
instant
(
'
lang.opinionUserState
'
)}
]
${
this
.
noteEditor
.
getNoteContent
()}
←
${
opinionUserState
}
`
:
`[
${
this
.
translate
.
instant
(
'
lang.opinionUserState
'
)}
]
${
this
.
noteEditor
.
getNoteContent
()}
`
;
this
.
noteEditor
.
setNoteContent
(
noteContent
);
this
.
http
.
put
(
this
.
data
.
processActionRoute
,
{
resources
:
realResSelected
,
note
:
this
.
noteEditor
.
getNote
()}).
pipe
(
tap
((
data
:
any
)
=>
{
...
...
src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.html
View file @
e7930b9b
...
...
@@ -14,6 +14,9 @@
<b
*ngIf=
"data.resIds.length > 1"
color=
"primary"
class=
"highlight"
>
{{data.resIds.length}}
{{'lang.elements' | translate}}
</b>
?
</div>
<app-maarch-message
*ngIf=
"delegation.isDelegated && !noResourceToProcess"
mode=
"danger"
>
{{'lang.signInsteadOf' | translate}}
<b
style=
"overflow: hidden;text-overflow: ellipsis;"
[title]=
"delegation.userDelegated"
>
{{ delegation.userDelegated }}
</b>
</app-maarch-message>
<div
*ngIf=
"resourcesError.length > 0"
class=
"alert-message alert-message-danger mailList"
role=
"alert"
>
<p>
{{'lang.canNotMakeAction' | translate}} :
...
...
src/frontend/app/actions/avis-parallel-send-action/send-avis-parallel-action.component.ts
View file @
e7930b9b
...
...
@@ -8,6 +8,7 @@ import { tap, finalize, catchError } from 'rxjs/operators';
import
{
of
}
from
'
rxjs
'
;
import
{
FunctionsService
}
from
'
@service/functions.service
'
;
import
{
AvisWorkflowComponent
}
from
'
../../avis/avis-workflow.component
'
;
import
{
HeaderService
}
from
'
@service/header.service
'
;
@
Component
({
templateUrl
:
'
send-avis-parallel-action.component.html
'
,
...
...
@@ -30,11 +31,17 @@ export class SendAvisParallelComponent implements AfterViewInit {
availableRoles
:
any
[]
=
[];
delegation
:
any
=
{
isDelegated
:
false
,
userDelegated
:
null
};
constructor
(
public
translate
:
TranslateService
,
public
http
:
HttpClient
,
private
notify
:
NotificationService
,
public
dialogRef
:
MatDialogRef
<
SendAvisParallelComponent
>
,
public
headerService
:
HeaderService
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
public
functions
:
FunctionsService
)
{
}
...
...
@@ -44,6 +51,15 @@ export class SendAvisParallelComponent implements AfterViewInit {
if
(
this
.
appAvisWorkflow
.
emptyWorkflow
())
{
this
.
appAvisWorkflow
.
loadDefaultWorkflow
(
this
.
data
.
resIds
[
0
]);
}
const
userId
:
number
=
parseInt
(
this
.
data
.
userId
,
10
);
this
.
delegation
.
isDelegated
=
userId
!==
this
.
headerService
.
user
.
id
?
true
:
false
;
if
(
this
.
delegation
.
isDelegated
&&
!
this
.
noResourceToProcess
)
{
this
.
http
.
get
(
'
../rest/users/
'
+
userId
).
pipe
(
tap
((
user
:
any
)
=>
{
this
.
delegation
.
userDelegated
=
`
${
user
.
firstname
}
${
user
.
lastname
}
`
;
})
).
subscribe
();
}
}
}
...
...
src/lang/lang-en.json
View file @
e7930b9b
...
...
@@ -2519,5 +2519,6 @@
"updateOtp"
:
"Edit external user"
,
"contactsParameters_sector"
:
"Sector"
,
"company"
:
"Company"
,
"noRecipient"
:
"No associated recipient."
"noRecipient"
:
"No associated recipient."
,
"delegatedOpinion"
:
"Opinion given instead of"
}
src/lang/lang-fr.json
View file @
e7930b9b
...
...
@@ -2517,5 +2517,6 @@
"otpVisaUser"
:
"L'utilisateur sera notifié par <b>courriel</b> au moment de son tour dans le circuit."
,
"mustSign"
:
"La position de signature pour les utilisateurs externes est obligatoire."
,
"company"
:
"Organisation"
,
"noRecipient"
:
"Aucun destinataire associé."
"noRecipient"
:
"Aucun destinataire associé."
,
"delegatedOpinion"
:
"Avis donné à la place de"
}
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