Skip to content

Commit

Permalink
show orgs even when portal screen has none
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbiam committed Dec 31, 2024
1 parent 960b9fb commit 0a7bfbd
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion html/scale/src/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ function DashboardContent() {


if (!dataConfig.showPortalOrgs) {
// load the URLS, but still need the orgs
fetch(configData.SERVER_URL + "main/urls")
.then(
response => {
Expand All @@ -345,8 +346,31 @@ function DashboardContent() {
setShowDialog(false);
}
)
} else {

// even if the portal screen doesn't have orgs, still need to load them
fetch(configData.SERVER_URL + "main/orgs")
.then(response => {
return response.json()
})
.then(dataOrgs => {
if (config.enableApprovals) {
function loadLeaf(root, llocalOrgsById) {
llocalOrgsById[root.id] = root;
for (var i = 0; i < root.subOrgs.length; i++) {
loadLeaf(root.subOrgs[i], llocalOrgsById);
}
}


var localOrgsById = {};

loadLeaf(dataOrgs, localOrgsById);

setOrgsById(localOrgsById);
setOrgs(dataOrgs);
}});
} else {
// load the orgs and links per org

fetch(configData.SERVER_URL + "main/orgs")
.then(response => {
Expand Down

0 comments on commit 0a7bfbd

Please sign in to comment.