Task lists WIP:

* front-end fixes
This commit is contained in:
John Livingston 2024-05-06 18:34:57 +02:00
parent 1e876e60ee
commit 218f36c5c8
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 13 additions and 3 deletions

View File

@ -125,10 +125,15 @@ export default class MUCTaskListView extends CustomElement {
})
await this.model.createTask({
name
name,
description: ev.target.description.value.trim()
})
this.closeAddTaskForm()
// If the task list is collapsed, we must open it.
// Otherwise, the newly created task won't show up, and user could think that there is a bug.
if (this.collapsed) { this.collapsed = false }
} catch (err) {
console.error(err)
} finally {

View File

@ -109,10 +109,15 @@ export class PubSubManager {
const data = {}
for (const attr in (type.attributes ?? [])) {
data[attr] = item.get(attr)
const v = item.get(attr)
if (v === undefined) { continue }
if (type.attributes[attr] === Boolean && !v) { continue }
data[attr] = v
}
for (const field in (type.fields ?? [])) {
data[field] = item.get(field)
const v = item.get(field)
if (v === undefined) { continue }
data[field] = v
}
console.log('Saving item...')