Profiles Showing Up

This commit is contained in:
Luis Fernando Molina committed 2021-07-09 15:42:59 +02:00
1 parent 9e4a179899
commit cc997900c8
3 files changed
+53 -65

No files matched your search

@@ -46,73 +46,16 @@ function newGovernanceReportsReportsPage() {
HTML = HTML + '<p> ' + tab.toUpperCase() + '_TOTAL_RESULTS results (' + tab.toUpperCase() + '_TOTAL_SECONDS seconds)</p>'
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 = ' > <a onClick="UI.projects.education.spaces.docsSpace.navigateTo(\'' + nodeProject + '\', \'' + result.documentIndex.category + '\', \'' + nodeType.replace(/'/g, 'AMPERSAND') + '\', ' + undefined + ' ,\'' + nodeId + '\')" class="governance-search-result-content-record-project-category-link">'
if (nodeName === 'New ' + nodeType || nodeName === 'My ' + nodeType || nodeName === undefined) {
nodeName = ''
}
if (nodeName === '') {
linkLabel = nodeType
} else {
linkLabel = nodeType + ' (' + nodeName + ')'
}
path = path + link + linkLabel + '</a>'
}
}
HTML = HTML + '<div class="governance-search-result-content-record-container">'
HTML = HTML + '<p class="governance-search-result-content-record-project-category">' + result.documentIndex.project + ' > ' + result.documentIndex.category + path + '</p>'
let mainLink = ''
switch (result.documentIndex.category) {
case 'Topic': {
HTML = HTML + '<p class="governance-search-result-content-record-topic">' + result.documentIndex.docsSchemaDocument.topic + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '</p>'
mainLink = result.documentIndex.docsSchemaDocument.type
break
}
case 'Tutorial': {
HTML = HTML + '<p class="governance-search-result-content-record-tutorial">' + result.documentIndex.docsSchemaDocument.tutorial + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '</p>'
mainLink = result.documentIndex.docsSchemaDocument.type
break
}
case 'Review': {
HTML = HTML + '<p class="governance-search-result-content-record-review">' + result.documentIndex.docsSchemaDocument.review + ' - Page ' + result.documentIndex.docsSchemaDocument.pageNumber + '</p>'
mainLink = result.documentIndex.docsSchemaDocument.type
break
}
default: {
mainLink = result.documentIndex.docsSchemaDocument.type
}
}
HTML = HTML + '<p><a onClick="UI.projects.education.spaces.docsSpace.navigateTo(\'' + result.documentIndex.project + '\', \'' + result.documentIndex.category + '\', \'' + result.documentIndex.docsSchemaDocument.type.replace(/'/g, 'AMPERSAND') + '\', ' + undefined + ' ,\'' + result.documentIndex.docsSchemaDocument.nodeId + '\')" class="governance-search-result-content-record-title">' + mainLink + '</a></p>'
if (result.documentIndex.docsSchemaDocument.definition !== undefined) {
HTML = HTML + '<p class="governance-search-result-content-record-extract">' + UI.projects.education.utilities.docs.getTextBasedOnLanguage(result.documentIndex.docsSchemaDocument.definition) + '</p>'
} else {
HTML = HTML + '<p class="governance-search-result-content-record-extract">' + 'No definition available.' + '</p>'
}
HTML = HTML + '</div>'
}
HTML = HTML + '</div>'
totalResults.set(tab, resultCounter)
}
@@ -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)
@@ -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 + '<div class="governance-search-result-content-record-container">'
HTML = HTML + '<p class="governance-search-result-content-record-project-category">' + userProfile.name + '</p>'
HTML = HTML + '</div>'
}
return HTML
}
}