Skip to content

Commit 620455b

Browse files
committed
getting somewhere
1 parent a74dc4a commit 620455b

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

src/login/login.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,20 @@ export async function registrationControl (
274274
const row = tbody.appendChild(dom.createElement('tr'))
275275
row.appendChild(renderScopeCheckbox(scope)) // @@ index
276276
}
277-
278277
return context
279278
}
280279

281280
export function renderScopeHeadingRow (context, store, scope) {
282-
const backgroundColor = { private: '#ff8', public: 'white' }
281+
const backgroundColor = { private: '#fee', public: '#efe' }
283282
const { dom } = context
284283
const name = scopeLabel(context, scope)
285284
const row = dom.createElement('tr')
286285
const cell = row.appendChild(dom.createElement('td'))
287-
cell.colspan = 3 // @@ check
286+
cell.setAttribute('colspan', '3')
287+
cell.style.backgoundColor = backgroundColor[scope.label] || 'white'
288288
const header = cell.appendChild(dom.createElement('h3'))
289289
header.textContent = name
290-
row.style.backgroundColor = backgroundColor[scope.label] || 'white'
290+
header.style.textAlign = 'left'
291291
return row
292292
}
293293
/**
@@ -322,15 +322,13 @@ export async function registrationList (context: AuthenticationContext, options:
322322
const items = await getScopedAppsFromIndex(store, scope, options.type || null) // any class
323323
console.log('@@ instance items', items)
324324
for (const item of items) {
325-
/*
326-
async function deleteRegistration () {
327-
await deleteTypeIndexRegistration(store, item)
328-
} */
329-
// if (!options.type || options.type.sameTerm(item.scope.class)) {
330-
// tbody.appendChild(widgets.personTR(item.scope.instance))
331-
tbody.appendChild(widgets.personTR(dom, ns.solid('instance'), item.instance, {
332-
deleteFunction: async () => await deleteTypeIndexRegistration(store, item) // deleteRegistration
333-
}))
325+
const row = widgets.personTR(dom, ns.solid('instance'), item.instance, {
326+
deleteFunction: async () => {
327+
await deleteTypeIndexRegistration(store, item);
328+
tbody.removeChild(row)
329+
}
330+
})
331+
tbody.appendChild(row)
334332
}
335333
}
336334
return context

src/widgets/error.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* where it happened!
1212
*/
1313
/* eslint-disable no-console */
14+
import { cancelButton } from '../widgets'
1415

1516
export function errorMessageBlock (dom: HTMLDocument, err: string | Error, backgroundColor?: string, err2?: Error): HTMLDivElement {
1617
const div = dom.createElement('div')
@@ -25,6 +26,10 @@ export function errorMessageBlock (dom: HTMLDocument, err: string | Error, backg
2526
} else {
2627
div.textContent = err as string
2728
}
29+
30+
div.appendChild(cancelButton(dom, () => { div.parentNode.removeChild(div) }))
31+
.style = 'width: 2em; height: 2em; align: right;'
32+
2833
div.setAttribute(
2934
'style',
3035
'margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: ' +

0 commit comments

Comments
 (0)