diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Assets.js b/Projects/Governance/UI/Spaces/Reports-Space/Assets.js index 7e2ab44d1..8898162c6 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Assets.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Assets.js @@ -15,12 +15,13 @@ function newGovernanceReportsAssets() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.commonTables.addHTML( 'assets', 'Asset', 'Assets', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Features.js b/Projects/Governance/UI/Spaces/Reports-Space/Features.js index 080b2e12c..c79e5a6d4 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Features.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Features.js @@ -15,12 +15,13 @@ function newGovernanceReportsFeatures() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.commonTables.addHTML( 'features', 'Feature', 'Features', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Mentors.js b/Projects/Governance/UI/Spaces/Reports-Space/Mentors.js index 597fac80c..3574d46db 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Mentors.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Mentors.js @@ -15,12 +15,13 @@ function newGovernanceReportsMentors() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.decendentTables.addHTML( 'mentors', 'Mentorship Program', 'mentorshipProgram', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Pools.js b/Projects/Governance/UI/Spaces/Reports-Space/Pools.js index 3a5e09306..1d1fc7683 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Pools.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Pools.js @@ -15,12 +15,13 @@ function newGovernanceReportsPools() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.commonTables.addHTML( 'pools', 'Pool', 'Pools', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Positions.js b/Projects/Governance/UI/Spaces/Reports-Space/Positions.js index bf9f50262..d85df0e4f 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Positions.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Positions.js @@ -15,12 +15,13 @@ function newGovernanceReportsPositions() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.commonTables.addHTML( 'positions', 'Position', 'Positions', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Referrals.js b/Projects/Governance/UI/Spaces/Reports-Space/Referrals.js index f54e6ff2a..324f1282c 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Referrals.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Referrals.js @@ -15,12 +15,13 @@ function newGovernanceReportsReferrals() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.decendentTables.addHTML( 'referrals', 'Referral Program', 'referralProgram', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/Supports.js b/Projects/Governance/UI/Spaces/Reports-Space/Supports.js index 423450322..338460c99 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/Supports.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/Supports.js @@ -15,12 +15,13 @@ function newGovernanceReportsSupports() { } - function addHTML(tabIndex) { + function addHTML(tabIndex, filters) { return UI.projects.governance.utilities.decendentTables.addHTML( 'supports', 'Support Program', 'supportProgram', - tabIndex + tabIndex, + filters ) } } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/CommonTables.js b/Projects/Governance/UI/Utilities/CommonTables.js index 964372103..652d795ef 100644 --- a/Projects/Governance/UI/Utilities/CommonTables.js +++ b/Projects/Governance/UI/Utilities/CommonTables.js @@ -9,8 +9,18 @@ function newGovernanceUtilitiesCommonTables() { table, nodeType, hierarchyHeadsType, - tabIndex + tabIndex, + filters ) { + /* + Setup Filters + */ + let filtersObject + if (filters !== undefined) { + try { + filtersObject = JSON.parse(filters) + } catch (err) { } + } let tableRecords = [] let tableRecordDefinition = { "properties": [ @@ -60,11 +70,13 @@ function newGovernanceUtilitiesCommonTables() { let tableRecord = { "name": node.name, "tokensReward": node.payload.tokens | 0, - "weight": node.payload.weight , - "weightPower": node.payload.votingProgram.votes + "weight": node.payload.weight, + "weightPower": node.payload.votingProgram.votes } - tableRecords.push(tableRecord) + if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) { + tableRecords.push(tableRecord) + } } /* Get the sorting order for this table. diff --git a/Projects/Governance/UI/Utilities/DescendentTables.js b/Projects/Governance/UI/Utilities/DescendentTables.js index 48aeb0efe..e98379a84 100644 --- a/Projects/Governance/UI/Utilities/DescendentTables.js +++ b/Projects/Governance/UI/Utilities/DescendentTables.js @@ -9,8 +9,21 @@ function newGovernanceUtilitiesDecendentTables() { table, programName, programPropertyName, - tabIndex + tabIndex, + filters ) { + /* + Setup Filters + */ + let filtersObject + if (filters !== undefined) { + try { + filtersObject = JSON.parse(filters) + } catch (err) { } + } + /* + Other Variables + */ let tableRecords = [] let tableRecordDefinition = { "properties": [ @@ -87,7 +100,9 @@ function newGovernanceUtilitiesDecendentTables() { "tokensBonus": program.payload[programPropertyName].bonus.tokens | 0 } - tableRecords.push(tableRecord) + if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) { + tableRecords.push(tableRecord) + } } /* Get the sorting order for this table.