Skip to content

Commit 0a7bfbd

Browse files
committed
show orgs even when portal screen has none
1 parent 960b9fb commit 0a7bfbd

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

html/scale/src/Dashboard.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ function DashboardContent() {
332332

333333

334334
if (!dataConfig.showPortalOrgs) {
335+
// load the URLS, but still need the orgs
335336
fetch(configData.SERVER_URL + "main/urls")
336337
.then(
337338
response => {
@@ -345,8 +346,31 @@ function DashboardContent() {
345346
setShowDialog(false);
346347
}
347348
)
348-
} else {
349349

350+
// even if the portal screen doesn't have orgs, still need to load them
351+
fetch(configData.SERVER_URL + "main/orgs")
352+
.then(response => {
353+
return response.json()
354+
})
355+
.then(dataOrgs => {
356+
if (config.enableApprovals) {
357+
function loadLeaf(root, llocalOrgsById) {
358+
llocalOrgsById[root.id] = root;
359+
for (var i = 0; i < root.subOrgs.length; i++) {
360+
loadLeaf(root.subOrgs[i], llocalOrgsById);
361+
}
362+
}
363+
364+
365+
var localOrgsById = {};
366+
367+
loadLeaf(dataOrgs, localOrgsById);
368+
369+
setOrgsById(localOrgsById);
370+
setOrgs(dataOrgs);
371+
}});
372+
} else {
373+
// load the orgs and links per org
350374

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

0 commit comments

Comments
 (0)