Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
INB
eTRANSAFE
pretox-app
Commits
a6052ec7
Commit
a6052ec7
authored
Oct 19, 2021
by
Javi Corvi
Browse files
workflow buttons
parent
779b3a87
Pipeline
#25207
passed with stage
in 2 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/document-detail/document-detail.component.html
View file @
a6052ec7
...
...
@@ -36,12 +36,20 @@
<div
class=
"card-header"
>
<div
style=
"float:left;width:90%"
>
<h4>
{{document.name}}
</h4></div>
<div
class=
"btn-group"
style=
"float:left;width:10%;"
>
<button
type=
"button"
class=
"btn btn-warning dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
style=
"position: absolute; bottom: 100; left: 0;"
>
<button
type=
"button"
[ngClass]=
"{'btn-warning': document.status === 'DRAFT',
'btn-primary' : document.status === 'IN_PROGRESS',
'btn-success' : document.status === 'FINISHED'}"
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
style=
"position: absolute; bottom: 100; left: 0;"
>
{{document.status}}
</button>
<div
class=
"dropdown-menu"
>
<a
class=
"dropdown-item btn bg-primary"
aria-haspopup=
"true"
aria-expanded=
"false"
(click)=
"moveDocument('IN_PROGRESS')"
>
Start Working
</a>
<a
class=
"dropdown-item btn bg-success"
aria-haspopup=
"true"
aria-expanded=
"false"
(click)=
"moveDocument('FINISHED')"
>
Finish Document
</a>
<a
*ngFor=
"let status of nextStatus"
class=
'dropdown-item btn'
[ngClass]=
"{'bg-warning': status === 'DRAFT',
'bg-success' : status === 'FINISHED',
'bg-primary' : status === 'IN_PROGRESS'
}"
aria-haspopup=
"true"
aria-expanded=
"true"
(click)=
"moveDocument(status)"
>
{{status}}
</a>
</div>
</div>
...
...
src/app/document-detail/document-detail.component.ts
View file @
a6052ec7
...
...
@@ -49,6 +49,7 @@ export class DocumentDetailComponent implements OnInit {
navLinks
:
any
[];
activeLinkIndex
=
-
1
;
nextStatus
:
any
[];
static
collData
:
any
;
...
...
@@ -170,12 +171,10 @@ export class DocumentDetailComponent implements OnInit {
link
:
'
./third
'
,
index
:
2
}
//, {
// label: 'Tracking Changes',
// link: './tracking',
// index: 3
// }
];
];
this
.
nextStatus
=
[
'
DRAFT
'
,
'
IN_PROGRESS
'
,
'
FINISHED
'
];
;
}
...
...
@@ -187,6 +186,7 @@ export class DocumentDetailComponent implements OnInit {
this
.
activeLinkIndex
=
this
.
navLinks
.
indexOf
(
this
.
navLinks
.
find
(
tab
=>
tab
.
link
===
'
.
'
+
this
.
router
.
url
));
});
this
.
getDocument
();
}
save
():
void
{
...
...
@@ -200,6 +200,7 @@ export class DocumentDetailComponent implements OnInit {
this
.
documentService
.
getDocument
(
id
)
.
subscribe
(
document
=>
{
this
.
document
=
document
;
this
.
setNextStatus
(
this
.
document
.
status
);
var
data
=
[];
var
data_relevant_sentences
=
[];
document
.
findings
.
forEach
(
find
=>
{
...
...
@@ -389,13 +390,24 @@ export class DocumentDetailComponent implements OnInit {
//alert(text);
});
}
setNextStatus
(
status
){
if
(
status
==
'
DRAFT
'
){
this
.
nextStatus
=
[
'
IN_PROGRESS
'
,
'
FINISHED
'
];
}
else
if
(
status
==
'
IN_PROGRESS
'
){
this
.
nextStatus
=
[
'
DRAFT
'
,
'
FINISHED
'
];
}
else
{
this
.
nextStatus
=
[
'
DRAFT
'
,
'
IN_PROGRESS
'
];
}
}
moveDocument
(
status
)
{
const
id
=
+
this
.
route
.
snapshot
.
paramMap
.
get
(
'
id
'
);
//alert(data.status);
this
.
documentService
.
moveDocument
(
id
,
status
)
.
subscribe
(
text
=>
{
this
.
document
.
status
=
status
;
this
.
setNextStatus
(
status
);
});
}
...
...
Write
Preview
Markdown
is supported
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