Commit 786d67c5 authored by Javi Corvi's avatar Javi Corvi
Browse files

new draft version ready

parent 27bce497
Pipeline #25791 passed with stage
in 1 minute and 3 seconds
......@@ -164,11 +164,11 @@ export class DocumentDetailComponent implements OnInit {
label: 'Relevant Sentences',
link: './first',
index: 0
}/*, {
}, /*{
label: 'Findings Level',
link: './second',
index: 1
}*/, {
}, */{
label: 'Findings',
link: './third',
index: 1
......@@ -218,9 +218,34 @@ export class DocumentDetailComponent implements OnInit {
this.activeLinkIndex = this.navLinks.indexOf(this.navLinks.find(tab => tab.link === '.' + this.router.url));
});
this.getDocument();
//this.getEvidence();
}
getEvidence() {
//alert('getAllEvidence');
const id = +this.route.snapshot.paramMap.get('id');
//this.documentService.getAllEvidence(this.document.documentId)
this.documentService.getEvidence(id)
.subscribe(text => {
this.docData = text;
//console.log(this.docData);
// console.log(JSON.parse(this.docData));
document.getElementById('data2').className = 'collapse show';
document.getElementById('data1').innerHTML = '';
document.getElementById('data1').className = '';
//document.getElementById('loadingDiv').className = 'loader';
var j = JSON.parse(this.docData);
//this.loadBratVisualizer();
head.ready( function() {
const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
//dispatcher.on('displaySpanComment', displaySpanComment);
//dispatcher.on('hideComment', hideComment);
// setTimeout(() => {
// document.getElementById('loadingDiv').className = '';
// }, 4000);
});
});
}
save(): void {
this.documentService.updateDocument(this.document)
......@@ -380,16 +405,16 @@ export class DocumentDetailComponent implements OnInit {
document.getElementById('data2').className = 'collapse show';
document.getElementById('data1').innerHTML = '';
document.getElementById('data1').className = '';
document.getElementById('loadingDiv').className = 'loader';
//document.getElementById('loadingDiv').className = 'loader';
var j = JSON.parse(this.docData);
this.loadBratVisualizer();
//this.loadBratVisualizer();
head.ready( function() {
const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
dispatcher.on('displaySpanComment', displaySpanComment);
dispatcher.on('hideComment', hideComment);
setTimeout(() => {
document.getElementById('loadingDiv').className = '';
}, 4000);
//dispatcher.on('displaySpanComment', displaySpanComment);
//dispatcher.on('hideComment', hideComment);
// setTimeout(() => {
// document.getElementById('loadingDiv').className = '';
// }, 4000);
});
});
......@@ -405,9 +430,9 @@ export class DocumentDetailComponent implements OnInit {
document.getElementById('data2').className = 'collapse show';
document.getElementById('data1').innerHTML = '';
document.getElementById('data1').className = '';
document.getElementById('loadingDiv').className = 'loader';
//document.getElementById('loadingDiv').className = 'loader';
var j = JSON.parse(this.docData);
this.loadBratVisualizer();
//this.loadBratVisualizer();
head.ready( function() {
const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
......@@ -416,9 +441,9 @@ export class DocumentDetailComponent implements OnInit {
//dispatcher.post('triggerRender');
dispatcher.on('displaySpanComment', displaySpanComment);
dispatcher.on('hideComment', hideComment);
setTimeout(() => {
document.getElementById('loadingDiv').className = '';
}, 4000);
// setTimeout(() => {
// document.getElementById('loadingDiv').className = '';
// }, 4000);
});
});
}
......@@ -431,17 +456,17 @@ export class DocumentDetailComponent implements OnInit {
document.getElementById('data2').className = 'collapse show';
document.getElementById('data1').innerHTML = '';
document.getElementById('data1').className = '';
document.getElementById('loadingDiv').className = 'loader';
//document.getElementById('loadingDiv').className = 'loader';
var j = JSON.parse(this.docData);
this.loadBratVisualizer();
//this.loadBratVisualizer();
head.ready( function() {
const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
dispatcher.on('displaySpanComment', displaySpanComment);
dispatcher.on('hideComment', hideComment);
setTimeout(() => {
document.getElementById('loadingDiv').className = '';
}, 4000);
//dispatcher.on('displaySpanComment', displaySpanComment);
//dispatcher.on('hideComment', hideComment);
// setTimeout(() => {
// document.getElementById('loadingDiv').className = '';
// }, 4000);
});
});
}
......@@ -458,16 +483,16 @@ export class DocumentDetailComponent implements OnInit {
document.getElementById('data2').className = 'collapse show';
document.getElementById('data1').innerHTML = '';
document.getElementById('data1').className = '';
document.getElementById('loadingDiv').className = 'loader';
//document.getElementById('loadingDiv').className = 'loader';
var j = JSON.parse(this.docData);
this.loadBratVisualizer();
//this.loadBratVisualizer();
head.ready( function() {
const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
dispatcher.on('displaySpanComment', displaySpanComment);
dispatcher.on('hideComment', hideComment);
setTimeout(() => {
document.getElementById('loadingDiv').className = '';
}, 4000);
//dispatcher.on('displaySpanComment', displaySpanComment);
//dispatcher.on('hideComment', hideComment);
// setTimeout(() => {
// document.getElementById('loadingDiv').className = '';
// }, 4000);
});
});
}
......
......@@ -150,13 +150,22 @@ export class DocumentService {
/** GET Snipped of all finding evidence */
getAllEvidence(id: number): Observable<string> {
const url = `${this.documentsUrl}${id}/evidence/all`;
const url = `${this.documentsUrl}${id}/evidence/findings`;
return this.http.get(url , {responseType: 'text'}).pipe(
tap(_ => this.log(`fetched all evidence id=${id}`)),
catchError(this.handleError<string>(`getFindings id=${id}`))
);
}
/** GET Snipped of all finding evidence */
getEvidence(id: number): Observable<string> {
const url = `${this.documentsUrl}${id}/evidence/all`;
return this.http.get(url , {responseType: 'text'}).pipe(
tap(_ => this.log(`fetched all evidence id=${id}`)),
catchError(this.handleError<string>(`getFindings id=${id}`))
);
}
/** GET Snipped of sentences evidence */
getSentencesEvidence(id: number): Observable<string> {
const url = `${this.documentsUrl}${id}/evidence/sentences`;
......
......@@ -196,14 +196,18 @@ export class PretoxsentencesTabulatorComponent implements OnInit {
var holderEl = document.createElement("div");
var tableEl = document.createElement("div");
const id = row.getData().id;
holderEl.style.boxSizing = "border-box";
//holderEl.style.boxSizing = "border-box";
holderEl.style.padding = "10px 30px 10px";
//holderEl.style.borderTop = "1px solid #333";
//holderEl.style.borderBottom = "1px solid #333";
//holderEl.style.background = "#ddd";
holderEl.setAttribute('class', "subTable" + id + "");
holderEl.style.display='none';
tableEl.style.border = "1px solid #333";
//tableEl.style.border = "1px solid #333";
//tableEl.style.height="100%";
tableEl.setAttribute('class', "subTable" + id + "");
holderEl.appendChild(tableEl);
......@@ -217,7 +221,7 @@ export class PretoxsentencesTabulatorComponent implements OnInit {
columns:[
{title: 'Validate', width: 5, hozAlign: 'center', headerSort: false,
{ width: 5, hozAlign: 'center', headerSort: false,
cellClick: function(e, cell){
//cell.getRow().getElement().style.backgroundColor = "#e2fcad"; //apply css change to row element
var data = cell.getRow().getData();
......@@ -244,7 +248,7 @@ export class PretoxsentencesTabulatorComponent implements OnInit {
return '<i class="fa fa-square" style="color:grey" aria-hidden="true" title="This finding will not be exported"> </i>';
}
}},
{title: 'Export', hozAlign: 'center', headerSort: false,
{ hozAlign: 'center', width: 5, headerSort: false,
cellClick: function(e, cell){
//alert(1);
var data = cell.getRow().getData();
......@@ -283,7 +287,7 @@ export class PretoxsentencesTabulatorComponent implements OnInit {
return '<i class="fa fa-eye" style="color:blue" aria-hidden="true" title="Show Evidence"> </i>';
}},
{title: 'Finding', field: 'srfndg', headerSort: true , headerFilter: false},//SRFNDG
{title: 'Finding (Free Text)', field: 'srores', headerSort: true , headerFilter: false},//SRORES
//{title: 'Finding (Free Text)', field: 'srores', headerSort: true , headerFilter: false},//SRORES
{title: 'Test Name', field: 'srtstcd', headerSort: true , headerFilter: false},//SRTSTCD
{title: 'Manifestation', field: 'srobsv', headerSort: true , headerFilter: false, editor: 'select', editable:false, editorParams:[
'I',
......
......@@ -164,7 +164,7 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
// return '<i class="fa fa-edit" style="color:blue" aria-hidden="true"> </i>';
// }},
//{ formatter: 'responsiveCollapse'},
{title: 'Validate', width: 5, hozAlign: 'center', headerSort: false,
{width: 5, hozAlign: 'center', headerSort: false,
cellClick: function(e, cell){
//cell.getRow().getElement().style.backgroundColor = "#e2fcad"; //apply css change to row element
var data = cell.getRow().getData();
......@@ -191,7 +191,7 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
return '<i class="fa fa-square" style="color:grey" aria-hidden="true" title="This finding will not be exported"> </i>';
}
}},
{title: 'Export', hozAlign: 'center', headerSort: false,
{width: 5, hozAlign: 'center', headerSort: false,
cellClick: function(e, cell){
//alert(1);
var data = cell.getRow().getData();
......@@ -230,7 +230,7 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
return '<i class="fa fa-eye" style="color:blue" aria-hidden="true" title="Show Evidence"> </i>';
}},
{title: 'Finding', field: 'srfndg', headerSort: true , headerFilter: false},//SRFNDG
{title: 'Finding (Free Text)', field: 'srores', headerSort: true , headerFilter: false},//SRORES
//{title: 'Finding (Free Text)', field: 'srores', headerSort: true , headerFilter: false},//SRORES
{title: 'Test Name', field: 'srtstcd', headerSort: true , headerFilter: false},//SRTSTCD
{title: 'Manifestation', field: 'srobsv', headerSort: true , headerFilter: false, editor: 'select', editable:false, editorParams:[
'I',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment