Skip to content

Commit

Permalink
"#791 Fixes evidencetable filter bug."
Browse files Browse the repository at this point in the history
  • Loading branch information
lawal-olaotan committed Sep 15, 2023
1 parent af45cf8 commit 268b970
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 12 additions & 12 deletions client-base/src/main/webapp/html/GeneView/summary-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ let conceptFilter = {
},
setConceptKeys(keys){
this.selectedKeys = keys
}
},




}
Expand Down Expand Up @@ -119,14 +121,15 @@ let geneViewConceptFilter = {

},
filterbySelectedConcept(tableData){
if ($('#'+this.tableId).css('display') !== 'block') return
const selectedConcepts = this.getConceptKeys();
// Select what required, using the helper
const filteredTable = tableData.filter ( row => this.rowFilterPred ( selectedConcepts, row ) );

// checks if filteredTable length is less than 0 to show no filter found message
geneTableFilterMgr.toggleTableState(filteredTable.length )
if ($('#'+this.tableId).css('display') !== 'block') return
const selectedConcepts = this.getConceptKeys();

// Select what required, using the helper
const filteredTable = tableData.filter ( row => this.rowFilterPred ( selectedConcepts, row ) );

// Checks if filteredTable length is less than 0 to show no filter found message
geneTableFilterMgr.toggleTableState(filteredTable.length )
if (filteredTable.length > 0 ){
genesTableScroller.setTableData (filteredTable);
createGeneTableBody(filteredTable)
Expand All @@ -146,15 +149,12 @@ let evidenceViewConceptFilter = {

async createFilteredEvidenceTable ( filteredTable )
{
conceptFilter.toggleKnetTablesDisplay ( true )

if ( filteredTable && filteredTable.length > 0)
evidenceTableScroller.setTableData ( filteredTable )

createEvidenceTableBody ( filteredTable )
},

filterEvidenceTableByType ( event, conceptType )
filterEvidenceTableByType ( event, conceptType )
{

this.filterTable(
Expand All @@ -169,7 +169,7 @@ let evidenceViewConceptFilter = {
},
resetTable(){
document.getElementById("revertEvidenceView").click();
}
},

}

Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ const geneTableFilterMgr = {
},
toggleTableState(dataLength){

console.log(dataLength);

if(dataLength === 0)$('#filterMessage').text('Your filter is returning no results');

$('#filterMessage').toggleClass('show-block',dataLength <= 0);
Expand Down

0 comments on commit 268b970

Please sign in to comment.