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
3a9f9bb0
Commit
3a9f9bb0
authored
Aug 24, 2021
by
Hamza HRAMCHI
Browse files
FEAT #17812 TIME 2:30 delegated user can give parallel opinion
parent
07c6daaa
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
dist/index.html
View file @
3a9f9bb0
...
...
@@ -15,6 +15,6 @@
<img
src=
"assets/spinner.gif"
/>
</div>
</app-root>
<script
src=
"runtime-es2015.497d8eb67297abf47895.js"
type=
"module"
></script><script
src=
"runtime-es5.497d8eb67297abf47895.js"
nomodule
defer
></script><script
src=
"polyfills-es5.c174c1516561194600a5.js"
nomodule
defer
></script><script
src=
"polyfills-es2015.b86be9c6fde12488a69f.js"
type=
"module"
></script><script
src=
"scripts.b9f328a06b6423d59d32.js"
defer
></script><script
src=
"main-es2015.
e9859ecbc8311c451d20
.js"
type=
"module"
></script><script
src=
"main-es5.
e9859ecbc8311c451d20
.js"
nomodule
defer
></script></body>
<script
src=
"runtime-es2015.497d8eb67297abf47895.js"
type=
"module"
></script><script
src=
"runtime-es5.497d8eb67297abf47895.js"
nomodule
defer
></script><script
src=
"polyfills-es5.c174c1516561194600a5.js"
nomodule
defer
></script><script
src=
"polyfills-es2015.b86be9c6fde12488a69f.js"
type=
"module"
></script><script
src=
"scripts.b9f328a06b6423d59d32.js"
defer
></script><script
src=
"main-es2015.
3ace5fe55e5de2a105b2
.js"
type=
"module"
></script><script
src=
"main-es5.
3ace5fe55e5de2a105b2
.js"
nomodule
defer
></script></body>
</html>
\ No newline at end of file
dist/main-es2015.
e9859ecbc8311c451d20
.js
→
dist/main-es2015.
3ace5fe55e5de2a105b2
.js
View file @
3a9f9bb0
This diff is collapsed.
Click to expand it.
dist/main-es5.
e9859ecbc8311c451d20
.js
→
dist/main-es5.
3ace5fe55e5de2a105b2
.js
View file @
3a9f9bb0
This diff is collapsed.
Click to expand it.
src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.html
View file @
3a9f9bb0
...
...
@@ -14,6 +14,9 @@
<b
*ngIf=
"data.resIds.length > 1"
color=
"primary"
class=
"highlight"
>
{{data.resIds.length}}
{{'lang.elements' | translate}}
</b>
?
</div>
<div
mat-line
*ngIf=
"delegation.isDelegated && !noResourceToProcess"
class=
"delegationMsg"
>
{{'lang.signInsteadOf' | translate}}
<b
style=
"overflow: hidden;text-overflow: ellipsis;"
[title]=
"delegation.userDelegated"
>
{{ delegation.userDelegated }}
</b>
</div>
<div
class=
"alert-message alert-message-info"
*ngIf=
"data.resIds.length == 1 && !noResourceToProcess"
role=
"alert"
style=
"margin-top: 30px;"
[innerHTML]=
"'<b>' + ownerOpinion + '</b> '+ ('lang.askOpinionUser' | translate) + ' :<br/><br/>' + opinionContent"
>
...
...
src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.scss
View file @
3a9f9bb0
...
...
@@ -116,4 +116,11 @@
img
{
margin
:
10px
;
}
}
.delegationMsg
{
color
:
var
(
--
maarch-color-danger
);;
font-size
:
12px
;
margin-top
:
20px
;
display
:
flex
!
important
;
}
\ No newline at end of file
src/frontend/app/actions/avis-give-parallel-action/give-avis-parallel-action.component.ts
View file @
3a9f9bb0
...
...
@@ -16,7 +16,6 @@ export class GiveAvisParallelActionComponent implements OnInit {
loading
:
boolean
=
false
;
resourcesWarnings
:
any
[]
=
[];
resourcesErrors
:
any
[]
=
[];
...
...
@@ -27,6 +26,12 @@ export class GiveAvisParallelActionComponent implements OnInit {
ownerOpinion
:
string
=
''
;
opinionContent
:
string
=
''
;
delegation
:
any
=
{
isDelegated
:
false
,
userDelegated
:
null
};
@
ViewChild
(
'
noteEditor
'
,
{
static
:
true
})
noteEditor
:
NoteEditorComponent
;
constructor
(
...
...
@@ -37,7 +42,8 @@ export class GiveAvisParallelActionComponent implements OnInit {
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
public
functions
:
FunctionsService
)
{
}
ngOnInit
()
{
async
ngOnInit
()
{
await
this
.
isRedirected
();
this
.
checkAvisParallel
();
}
...
...
@@ -45,7 +51,6 @@ export class GiveAvisParallelActionComponent implements OnInit {
this
.
loading
=
true
;
this
.
resourcesErrors
=
[];
this
.
resourcesWarnings
=
[];
this
.
http
.
post
(
'
../rest/resourcesList/users/
'
+
this
.
data
.
userId
+
'
/groups/
'
+
this
.
data
.
groupId
+
'
/baskets/
'
+
this
.
data
.
basketId
+
'
/actions/
'
+
this
.
data
.
action
.
id
+
'
/checkGiveParallelOpinion
'
,
{
resources
:
this
.
data
.
resIds
}).
pipe
(
tap
((
data
:
any
)
=>
{
if
(
!
this
.
functions
.
empty
(
data
.
resourcesInformations
.
warning
))
{
...
...
@@ -79,7 +84,9 @@ export class GiveAvisParallelActionComponent implements OnInit {
}
executeAction
(
realResSelected
:
number
[])
{
const
noteContent
:
string
=
`[
${
this
.
translate
.
instant
(
'
lang.avisUserState
'
)}
]
${
this
.
noteEditor
.
getNoteContent
()}
`
;
const
delegateMsg
:
string
=
this
.
translate
.
instant
(
'
lang.insteadOf
'
).
replace
(
/^.
{1}
/g
,
this
.
translate
.
instant
(
'
lang.insteadOf
'
)[
0
].
toLowerCase
());
const
avisUserState
:
string
=
this
.
delegation
.
isDelegated
?
`
${
this
.
translate
.
instant
(
'
lang.avisUserState
'
).
toUpperCase
()}
${
delegateMsg
}
${
this
.
delegation
.
userDelegated
}
`
:
this
.
translate
.
instant
(
'
lang.avisUserState
'
);
const
noteContent
:
string
=
`[
${
avisUserState
}
]
${
this
.
noteEditor
.
getNoteContent
()}
`
;
this
.
noteEditor
.
setNoteContent
(
noteContent
);
this
.
http
.
put
(
this
.
data
.
processActionRoute
,
{
resources
:
realResSelected
,
note
:
this
.
noteEditor
.
getNote
()}).
pipe
(
tap
((
data
:
any
)
=>
{
...
...
@@ -101,4 +108,27 @@ export class GiveAvisParallelActionComponent implements OnInit {
isValidAction
()
{
return
!
this
.
noResourceToProcess
&&
!
this
.
functions
.
empty
(
this
.
noteEditor
.
getNoteContent
());
}
isRedirected
()
{
return
new
Promise
((
resolve
)
=>
{
this
.
http
.
get
(
'
../rest/currentUser/profile
'
).
pipe
(
tap
((
data
:
any
)
=>
{
const
userId
:
number
=
parseInt
(
this
.
data
.
userId
,
10
);
this
.
delegation
.
isDelegated
=
userId
!==
data
.
id
?
true
:
false
;
if
(
this
.
delegation
.
isDelegated
)
{
this
.
http
.
get
(
'
../rest/users/
'
+
userId
).
pipe
(
tap
((
user
:
any
)
=>
{
this
.
delegation
.
userDelegated
=
`
${
user
.
firstname
}
${
user
.
lastname
}
`
;
})
).
subscribe
();
}
resolve
(
true
);
}),
catchError
((
err
:
any
)
=>
{
this
.
notify
.
handleErrors
(
err
);
return
of
(
false
);
})
).
subscribe
();
});
}
}
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