Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
c3cd2921
Commit
c3cd2921
authored
4 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #14565 TIME 2:15 add move / add user control
parent
9814fd5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lang/fr.json
+2
-1
2 additions, 1 deletion
lang/fr.json
src/frontend/app/document/visa-workflow/visa-workflow.component.ts
+37
-4
37 additions, 4 deletions
...end/app/document/visa-workflow/visa-workflow.component.ts
with
39 additions
and
5 deletions
lang/fr.json
+
2
−
1
View file @
c3cd2921
...
@@ -401,6 +401,7 @@
...
@@ -401,6 +401,7 @@
"loadingMoreData"
:
"Charger plus de données ..."
,
"loadingMoreData"
:
"Charger plus de données ..."
,
"validateDocumentWarning"
:
"Vous êtes sur le point de valider ce document !"
,
"validateDocumentWarning"
:
"Vous êtes sur le point de valider ce document !"
,
"certifiedDocument"
:
"Document certifié"
,
"certifiedDocument"
:
"Document certifié"
,
"certifiedDocumentMsg"
:
"Le document a été signé par certificat numérique, vous ne pouvez pas apposer de griffe."
"certifiedDocumentMsg"
:
"Le document a été signé par certificat numérique, vous ne pouvez pas apposer de griffe."
,
"errorUserSignType"
:
"Les signataires sans certificat doivent être présent avant les signataires avec certificat."
}
}
}
}
This diff is collapsed.
Click to expand it.
src/frontend/app/document/visa-workflow/visa-workflow.component.ts
+
37
−
4
View file @
c3cd2921
...
@@ -7,7 +7,6 @@ import { of } from 'rxjs';
...
@@ -7,7 +7,6 @@ import { of } from 'rxjs';
import
{
NotificationService
}
from
'
../../service/notification.service
'
;
import
{
NotificationService
}
from
'
../../service/notification.service
'
;
import
{
IonReorderGroup
,
PopoverController
}
from
'
@ionic/angular
'
;
import
{
IonReorderGroup
,
PopoverController
}
from
'
@ionic/angular
'
;
import
{
VisaWorkflowModelsComponent
}
from
'
./models/visa-workflow-models.component
'
;
import
{
VisaWorkflowModelsComponent
}
from
'
./models/visa-workflow-models.component
'
;
import
{
CdkDragDrop
,
moveItemInArray
}
from
'
@angular/cdk/drag-drop
'
;
import
{
ItemReorderEventDetail
}
from
'
@ionic/core
'
;
import
{
ItemReorderEventDetail
}
from
'
@ionic/core
'
;
@
Component
({
@
Component
({
...
@@ -46,11 +45,42 @@ export class VisaWorkflowComponent implements OnInit {
...
@@ -46,11 +45,42 @@ export class VisaWorkflowComponent implements OnInit {
}
}
doReorder
(
ev
:
CustomEvent
<
ItemReorderEventDetail
>
)
{
doReorder
(
ev
:
CustomEvent
<
ItemReorderEventDetail
>
)
{
this
.
visaWorkflow
=
ev
.
detail
.
complete
(
this
.
visaWorkflow
);
if
(
this
.
canMoveUser
(
ev
))
{
this
.
visaWorkflow
=
ev
.
detail
.
complete
(
this
.
visaWorkflow
);
}
else
{
this
.
notificationService
.
error
(
'
lang.errorUserSignType
'
);
ev
.
detail
.
complete
(
false
);
}
}
canMoveUser
(
ev
:
CustomEvent
<
ItemReorderEventDetail
>
)
{
const
newWorkflow
=
this
.
array_move
(
this
.
visaWorkflow
.
slice
(),
ev
.
detail
.
from
,
ev
.
detail
.
to
);
const
res
=
this
.
isValidWorkflow
(
newWorkflow
);
return
res
;
}
isValidWorkflow
(
workflow
:
any
=
this
.
visaWorkflow
)
{
let
res
:
boolean
=
true
;
workflow
.
forEach
((
item
:
any
,
indexUserRgs
:
number
)
=>
{
if
([
'
visa
'
,
'
stamp
'
].
indexOf
(
item
.
role
)
===
-
1
)
{
if
(
workflow
.
filter
((
itemUserStamp
:
any
,
indexUserStamp
:
number
)
=>
indexUserStamp
>
indexUserRgs
&&
itemUserStamp
.
role
===
'
stamp
'
).
length
>
0
)
{
console
.
log
(
'
false!
'
);
res
=
false
;
}
}
});
return
res
;
}
}
drop
(
event
:
CdkDragDrop
<
string
[]
>
)
{
array_move
(
arr
:
any
,
old_index
:
number
,
new_index
:
number
)
{
moveItemInArray
(
this
.
visaWorkflow
,
event
.
previousIndex
,
event
.
currentIndex
);
if
(
new_index
>=
arr
.
length
)
{
let
k
=
new_index
-
arr
.
length
+
1
;
while
(
k
--
)
{
arr
.
push
(
undefined
);
}
}
arr
.
splice
(
new_index
,
0
,
arr
.
splice
(
old_index
,
1
)[
0
]);
return
arr
;
// for testing
}
}
getVisaUsers
(
ev
:
any
)
{
getVisaUsers
(
ev
:
any
)
{
...
@@ -84,6 +114,9 @@ export class VisaWorkflowComponent implements OnInit {
...
@@ -84,6 +114,9 @@ export class VisaWorkflowComponent implements OnInit {
'
modes
'
:
user
.
signatureModes
'
modes
'
:
user
.
signatureModes
};
};
this
.
visaWorkflow
.
push
(
userObj
);
this
.
visaWorkflow
.
push
(
userObj
);
if
(
!
this
.
isValidWorkflow
())
{
this
.
visaWorkflow
[
this
.
visaWorkflow
.
length
-
1
].
role
=
'
visa
'
;
}
this
.
getAvatarUser
(
this
.
visaWorkflow
.
length
-
1
);
this
.
getAvatarUser
(
this
.
visaWorkflow
.
length
-
1
);
this
.
visaUsersSearchVal
=
''
;
this
.
visaUsersSearchVal
=
''
;
searchInput
.
setFocus
();
searchInput
.
setFocus
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment