Skip to content

Commit b50d22c

Browse files
committed
Suppress empty sublist
1 parent 4bcb4d6 commit b50d22c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/login/login.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export function renderScopeHeadingRow (context, store, scope) {
286286
cell.setAttribute('colspan', '3')
287287
cell.style.backgoundColor = backgroundColor[scope.label] || 'white'
288288
const header = cell.appendChild(dom.createElement('h3'))
289-
header.textContent = name
289+
header.textContent = name + ' links'
290290
header.style.textAlign = 'left'
291291
return row
292292
}
@@ -318,17 +318,20 @@ export async function registrationList (context: AuthenticationContext, options:
318318
const tbody = table.firstChild as HTMLElement
319319

320320
for (const scope of scopes) { // need some predicate for listing/adding agents
321-
tbody.appendChild(renderScopeHeadingRow(context, store, scope))
321+
const headingRow = renderScopeHeadingRow(context, store, scope)
322+
tbody.appendChild(headingRow)
322323
const items = await getScopedAppsFromIndex(store, scope, options.type || null) // any class
323-
console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)
324+
if (items.length === 0) headingRow.style.display = 'none'
325+
// console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)
324326
for (const item of items) {
325327
const row = widgets.personTR(dom, ns.solid('instance'), item.instance, {
326328
deleteFunction: async () => {
327329
await deleteTypeIndexRegistration(store, item);
328330
tbody.removeChild(row)
329331
}
330332
})
331-
row.firstChild.style.marginLeft = '3em'
333+
row.children[0].style.paddingLeft = '3em'
334+
332335
tbody.appendChild(row)
333336
}
334337
}

0 commit comments

Comments
 (0)