Bug Table Order Change changed Tabs Fixed

This commit is contained in:
Luis Fernando Molina committed 2021-07-15 17:53:43 +02:00
1 parent f30697f09b
commit 9270a2f0f3
5 files changed
+36 -11

No files matched your search

@@ -15,7 +15,7 @@ function newGovernanceReportsReferrals() {
}
function addHTML() {
function addHTML(tabIndex) {
let tableRecords = []
let table = 'referrals'
@@ -99,6 +99,12 @@ function newGovernanceReportsReferrals() {
}
sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
}
return UI.projects.governance.utilities.tables.addHTML(table, tableRecords, tableRecordDefinition, sortingOrder)
return UI.projects.governance.utilities.tables.addHTML(
table,
tableRecords,
tableRecordDefinition,
sortingOrder,
tabIndex
)
}
}
@@ -15,7 +15,7 @@ function newGovernanceReportsReportsPage() {
}
function render() {
function render(tabIndex) {
let resultsArary = []
let initialTime = new Date()
@@ -49,13 +49,13 @@ function newGovernanceReportsReportsPage() {
switch (tab) {
case 'Profiles': {
let response = UI.projects.governance.spaces.reportsSpace.userProfiles.addHTML()
let response = UI.projects.governance.spaces.reportsSpace.userProfiles.addHTML(1)
HTML = HTML + response.HTML
resultCounter = response.resultCounter
break
}
case 'Referrals': {
let response = UI.projects.governance.spaces.reportsSpace.referrals.addHTML()
let response = UI.projects.governance.spaces.reportsSpace.referrals.addHTML(2)
HTML = HTML + response.HTML
resultCounter = response.resultCounter
break
@@ -84,10 +84,17 @@ function newGovernanceReportsReportsPage() {
}
let docsContentDiv = document.getElementById('governance-content-div')
docsContentDiv.innerHTML = HTML + UI.projects.governance.spaces.reportsSpace.footer.addFooter()
UI.projects.education.spaces.docsSpace.mainSearchPage.detectEnterOnSearchBox()
UI.projects.education.spaces.docsSpace.mainSearchPage.setFocusOnSearchBox()
// If there is a tabIndex we will switch to that tab here.
if (tabIndex !== undefined) {
let tab = document.getElementById('governance-tab' + tabIndex)
tab.checked = true
}
}
}
}
@@ -149,10 +149,10 @@ function newGobernanceReportsSpace() {
}
}
function changeTableSortingOrder(table, property, order) {
function changeTableSortingOrder(table, property, order, tabIndex) {
thisObject.tablesSortingOrders[table].property = property
thisObject.tablesSortingOrders[table].order = order
thisObject.reportsPage.render()
thisObject.reportsPage.render(tabIndex)
}
function onOpening() {
@@ -15,7 +15,7 @@ function newGovernanceReportsUserProfiles() {
}
function addHTML() {
function addHTML(tabIndex) {
let tableRecords = []
let table = 'userProfiles'
@@ -80,6 +80,12 @@ function newGovernanceReportsUserProfiles() {
}
sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
}
return UI.projects.governance.utilities.tables.addHTML(table, tableRecords, tableRecordDefinition, sortingOrder)
return UI.projects.governance.utilities.tables.addHTML(
table,
tableRecords,
tableRecordDefinition,
sortingOrder,
tabIndex
)
}
}
+8 -2
View File
@@ -5,7 +5,13 @@ function newGovernanceUtilitiesTables() {
return thisObject
function addHTML(table, tableRecords, tableRecordDefinition, sortingOrder) {
function addHTML(
table,
tableRecords,
tableRecordDefinition,
sortingOrder,
tabIndex
) {
let HTML = ''
let resultCounter = 0
/*
@@ -92,7 +98,7 @@ function newGovernanceUtilitiesTables() {
}
}
}
HTML = HTML + '<th>' + '<a href="#" onClick="UI.projects.governance.spaces.reportsSpace.changeTableSortingOrder(\'' + table + '\',\'' + property.name + '\',\'' + newOrder + '\')">' + property.label + ' ' + orderArrow + '</a>' + '</th>'
HTML = HTML + '<th>' + '<a href="#" onClick="UI.projects.governance.spaces.reportsSpace.changeTableSortingOrder(\'' + table + '\',\'' + property.name + '\',\'' + newOrder + '\',\'' + tabIndex + '\')">' + property.label + ' ' + orderArrow + '</a>' + '</th>'
}
HTML = HTML + '</tr>'
HTML = HTML + '<thead>'