From cc997900c8ec17119825b8ccda9afe579df1f09f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 9 Jul 2021 15:42:59 +0200 Subject: [PATCH] Profiles Showing Up --- .../UI/Spaces/Reports-Space/ReportsPage.js | 71 ++----------------- .../UI/Spaces/Reports-Space/ReportsSpace.js | 8 ++- .../UI/Spaces/Reports-Space/UserProfiles.js | 39 ++++++++++ 3 files changed, 53 insertions(+), 65 deletions(-) create mode 100644 Projects/Governance/UI/Spaces/Reports-Space/UserProfiles.js diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js index c22c6069c..cb7ce9b8e 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsPage.js @@ -46,73 +46,16 @@ function newGovernanceReportsReportsPage() { HTML = HTML + '

' + tab.toUpperCase() + '_TOTAL_RESULTS results (' + tab.toUpperCase() + '_TOTAL_SECONDS seconds)

' let resultCounter = 0 - for (let j = 0; j < resultsArary.length; j++) { - let result = resultsArary[j] - if (tab !== 'All') { - if (tab.indexOf(result.documentIndex.category) < 0) { - continue - } + switch (tab) { + case 'Profiles': { + HTML = HTML + UI.projects.governance.spaces.reportsSpace.userProfiles.addHTML() + resultCounter = UI.projects.governance.spaces.reportsSpace.userProfiles.resultCounter + + break } - resultCounter++ - - /* Lets see if we can show a path */ - let path = '' - if (result.documentIndex.docsSchemaDocument.nodeNameTypePath !== undefined) { - let linkLabel - for (let i = 0; i < result.documentIndex.docsSchemaDocument.nodeNameTypePath.length; i++) { - let pathStep = result.documentIndex.docsSchemaDocument.nodeNameTypePath[i] - let nodeName = pathStep[0] - let nodeType = pathStep[1] - let nodeProject = pathStep[2] - let nodeId = pathStep[3] - let link = ' > ' - if (nodeName === 'New ' + nodeType || nodeName === 'My ' + nodeType || nodeName === undefined) { - nodeName = '' - } - if (nodeName === '') { - linkLabel = nodeType - } else { - linkLabel = nodeType + ' (' + nodeName + ')' - } - path = path + link + linkLabel + '' - } - } - - HTML = HTML + '
' - HTML = HTML + '

' + result.documentIndex.project + ' > ' + result.documentIndex.category + path + '

' - - let mainLink = '' - - switch (result.documentIndex.category) { - case 'Topic': { - HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.topic + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' - mainLink = result.documentIndex.docsSchemaDocument.type - break - } - case 'Tutorial': { - HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.tutorial + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' - mainLink = result.documentIndex.docsSchemaDocument.type - break - } - case 'Review': { - HTML = HTML + '

' + result.documentIndex.docsSchemaDocument.review + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '

' - mainLink = result.documentIndex.docsSchemaDocument.type - break - } - default: { - mainLink = result.documentIndex.docsSchemaDocument.type - } - } - HTML = HTML + '

' + mainLink + '

' - - if (result.documentIndex.docsSchemaDocument.definition !== undefined) { - HTML = HTML + '

' + UI.projects.education.utilities.docs.getTextBasedOnLanguage(result.documentIndex.docsSchemaDocument.definition) + '

' - } else { - HTML = HTML + '

' + 'No definition available.' + '

' - } - HTML = HTML + '
' } + HTML = HTML + '' totalResults.set(tab, resultCounter) } diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js index 9ca3f4655..aaaf1f788 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js @@ -6,6 +6,7 @@ function newGobernanceReportsSpace() { sidePanelTab: undefined, reportsPage: undefined, footer: undefined, + userProfiles: undefined, physics: physics, draw: draw, getContainer: getContainer, @@ -45,6 +46,9 @@ function newGobernanceReportsSpace() { thisObject.footer.finalize() thisObject.footer = undefined + thisObject.userProfiles.finalize() + thisObject.userProfiles = undefined + let isInitialized = false } @@ -53,9 +57,11 @@ function newGobernanceReportsSpace() { thisObject.reportsPage = newGovernanceReportsReportsPage() thisObject.footer = newGovernanceReportsFooter() + thisObject.userProfiles = newGovernanceReportsUserProfiles() thisObject.reportsPage.initialize() thisObject.footer.initialize() + thisObject.userProfiles.initialize() setupSidePanelTab() @@ -63,7 +69,7 @@ function newGobernanceReportsSpace() { function setupSidePanelTab() { - thisObject.sidePanelTab = UI.projects.foundations.spaces.sideSpace.createSidePanelTab(thisObject.container, 'Governance', 'governance-tab', 'Governance', 'right') + thisObject.sidePanelTab = UI.projects.foundations.spaces.sideSpace.createSidePanelTab(thisObject.container, 'Governance', 'governance-tab', 'Gov', 'right') openingEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('opening', onOpening) closingEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('closing', onClosing) diff --git a/Projects/Governance/UI/Spaces/Reports-Space/UserProfiles.js b/Projects/Governance/UI/Spaces/Reports-Space/UserProfiles.js new file mode 100644 index 000000000..4c50d9ec2 --- /dev/null +++ b/Projects/Governance/UI/Spaces/Reports-Space/UserProfiles.js @@ -0,0 +1,39 @@ +function newGovernanceReportsUserProfiles() { + let thisObject = { + resultCounter: undefined, + addHTML: addHTML, + initialize: initialize, + finalize: finalize + } + + return thisObject + + function initialize() { + + } + + function finalize() { + + } + + function addHTML() { + + thisObject.resultCounter = 0 + let HTML = '' + + let resultsArary = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') + + for (let j = 0; j < resultsArary.length; j++) { + let userProfile = resultsArary[j] + + thisObject.resultCounter++ + + HTML = HTML + '
' + HTML = HTML + '

' + userProfile.name + '

' + + HTML = HTML + '
' + } + + return HTML + } +} \ No newline at end of file