Commit 6416eb9c authored by Iker Hurtado's avatar Iker Hurtado
Browse files

bugfixing and refactoring on Methodology Details page

- Bugfixing Issue 128
parent 455568bf
Pipeline #36372 passed with stages
in 6 seconds
......@@ -4059,7 +4059,7 @@
pointsXInPlotRange.push(dos_value_spin1);
//if (pSpin2 !== null) pointsXInPlotRange.push(pSpin2[i]);
pointsYInPlotRange.push(energy);
console.log('POINTS : ',dos_value_spin1, energy);
//console.log('POINTS : ',dos_value_spin1, energy);
this.pointsSpin1.push({x: dos_value_spin1, y: energy});
if (pSpin2 !== null){
let dos_value_spin2 = pSpin2[i]*dosValueDivisor;
......@@ -6684,20 +6684,19 @@
this.element.querySelector('.filter-placeholder').
appendChild(this.filterComponent.element);
this.filterComponent.setItemListener( propsSel/*ected*/ => {
let rows = this.tbody.querySelectorAll('tr');
for (let i = 0; i < rows.length; ++i){
let calcProps = rows[i].getAttribute('data-calc-props').split(',');
this.filterComponent.setItemListener( propsSel => {
// console.log('FILTERING propsSel: ',propsSel);
this.sortedCalcs.forEach( rowCalcData => { //leafId => {
let calcProps = rowCalcData.dataCalcProps.split(',');
//console.log('FILTERING calcProps: ',calcProps);
let propsPresent = true;
calcProps.forEach( e => {
if (propsSel.indexOf(e) < 0) propsPresent = false;
});
if (propsPresent) rows[i].style.display = 'table-row';
else rows[i].style.display = 'none';
}
if (propsPresent) rowCalcData.visible = true;
else rowCalcData.visible = false;
});
this._render();
});
// row sorting feature initialitation
......@@ -6734,13 +6733,14 @@
// For static ones
InfoSys.addToInfoSystem(this.element);
this._events();
//this._events();
}
/*
_events() {
//super._events();
this.dataTableWrapper.addEventListener('click', (e) => {
let rowElement = e.target.parentElement;
......@@ -6774,6 +6774,7 @@
});
function getHTMLCalcType(calcGroupType, calc){
let result = '';
......@@ -6820,7 +6821,7 @@
}
}
*/
updateSelection( leafIds/* Not used */ ){
......@@ -6841,7 +6842,10 @@
functional: c.functional_type,
code: c.code_name,
potential: c.core_electron_treatment,
basisSet: c.basis_set_type
basisSet: c.basis_set_type,
dataCalcProps: calcType+','+c.functional_type+','+c.code_name+
','+c.core_electron_treatment+','+c.basis_set_type,
visible: true
});
});
......@@ -6872,7 +6876,7 @@
let html = '';
this.sortedCalcs.forEach( rowCalcData => { //leafId => {
//html+= getRowHtml(leafId, calc, calcType);
html+= getRowHtml(rowCalcData);
if (rowCalcData.visible) html+= getRowHtml(rowCalcData);
});
this.tbody.innerHTML = html;
......@@ -6882,8 +6886,6 @@
let calc = DataStore.getCalc( /*DataStore.getCalcReprIntId(*/rowCalcData.id);
let calcType = rowCalcData.type;
let calcProps = calcType+','+calc.functional_type+','+calc.code_name+
','+calc.core_electron_treatment+','+calc.basis_set_type;
let repositoryLinkHtml = '';
if (calc.calculation_pid !== null && calc.calculation_pid !== undefined)
......@@ -6892,7 +6894,7 @@
+'<img src="img/download.svg" height="20px" /> </a>';
return `
<tr data-calc-id="${calc.id/*leafId*/}" data-calc-props="${calcProps}" class="data-row">
<tr data-calc-id="${calc.id/*leafId*/}" class="data-row">
<td>${calc.id/*leafId*/}</td>
<td>
<span info-sys-data="calculation-type.value:${calcType}">
......
......@@ -990,10 +990,11 @@ table#methodology-data{
background:white;
}
/*
tr.data-row, tr.data-row-marked {
cursor: pointer;
}
*/
/*
tr.data-row{
background-color: white;
......
......@@ -68,7 +68,7 @@ class DOSPlotter extends InteractivePlotterBase{
pointsXInPlotRange.push(dos_value_spin1);
//if (pSpin2 !== null) pointsXInPlotRange.push(pSpin2[i]);
pointsYInPlotRange.push(energy);
console.log('POINTS : ',dos_value_spin1, energy);
//console.log('POINTS : ',dos_value_spin1, energy);
this.pointsSpin1.push({x: dos_value_spin1, y: energy});
if (pSpin2 !== null){
let dos_value_spin2 = pSpin2[i]*dosValueDivisor;
......
......@@ -275,20 +275,19 @@ class MethodologyDetails extends DetailsViewBase {
this.element.querySelector('.filter-placeholder').
appendChild(this.filterComponent.element);
this.filterComponent.setItemListener( propsSel/*ected*/ => {
let rows = this.tbody.querySelectorAll('tr');
for (let i = 0; i < rows.length; ++i){
let calcProps = rows[i].getAttribute('data-calc-props').split(',');
this.filterComponent.setItemListener( propsSel => {
// console.log('FILTERING propsSel: ',propsSel);
this.sortedCalcs.forEach( rowCalcData => { //leafId => {
let calcProps = rowCalcData.dataCalcProps.split(',');
//console.log('FILTERING calcProps: ',calcProps);
let propsPresent = true;
calcProps.forEach( e => {
if (propsSel.indexOf(e) < 0) propsPresent = false;
});
if (propsPresent) rows[i].style.display = 'table-row';
else rows[i].style.display = 'none';
}
if (propsPresent) rowCalcData.visible = true;
else rowCalcData.visible = false;
});
this._render();
});
// row sorting feature initialitation
......@@ -325,13 +324,14 @@ class MethodologyDetails extends DetailsViewBase {
// For static ones
InfoSys.addToInfoSystem(this.element);
this._events();
//this._events();
}
/*
_events() {
//super._events();
this.dataTableWrapper.addEventListener('click', (e) => {
let rowElement = e.target.parentElement;
......@@ -365,6 +365,7 @@ class MethodologyDetails extends DetailsViewBase {
});
function getHTMLCalcType(calcGroupType, calc){
let result = '';
......@@ -411,7 +412,7 @@ class MethodologyDetails extends DetailsViewBase {
}
}
*/
updateSelection( leafIds/* Not used */ ){
......@@ -432,7 +433,10 @@ class MethodologyDetails extends DetailsViewBase {
functional: c.functional_type,
code: c.code_name,
potential: c.core_electron_treatment,
basisSet: c.basis_set_type
basisSet: c.basis_set_type,
dataCalcProps: calcType+','+c.functional_type+','+c.code_name+
','+c.core_electron_treatment+','+c.basis_set_type,
visible: true
});
});
......@@ -463,7 +467,7 @@ class MethodologyDetails extends DetailsViewBase {
let html = '';
this.sortedCalcs.forEach( rowCalcData => { //leafId => {
//html+= getRowHtml(leafId, calc, calcType);
html+= getRowHtml(rowCalcData);
if (rowCalcData.visible) html+= getRowHtml(rowCalcData);
});
this.tbody.innerHTML = html;
......@@ -473,8 +477,6 @@ class MethodologyDetails extends DetailsViewBase {
let calc = DataStore.getCalc( /*DataStore.getCalcReprIntId(*/rowCalcData.id);
let calcType = rowCalcData.type;
let calcProps = calcType+','+calc.functional_type+','+calc.code_name+
','+calc.core_electron_treatment+','+calc.basis_set_type;
let repositoryLinkHtml = '';
if (calc.calculation_pid !== null && calc.calculation_pid !== undefined)
......@@ -483,7 +485,7 @@ class MethodologyDetails extends DetailsViewBase {
+'<img src="img/download.svg" height="20px" /> </a>';
return `
<tr data-calc-id="${calc.id/*leafId*/}" data-calc-props="${calcProps}" class="data-row">
<tr data-calc-id="${calc.id/*leafId*/}" class="data-row">
<td>${calc.id/*leafId*/}</td>
<td>
<span info-sys-data="calculation-type.value:${calcType}">
......
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