Task lists WIP:

* some front end work.
This commit is contained in:
John Livingston
2024-05-06 00:13:20 +02:00
parent d91cbb9e25
commit 22617def5e
8 changed files with 110 additions and 19 deletions

View File

@ -1,9 +1,6 @@
import { Collection } from '@converse/skeletor/src/collection.js'
import { ChatRoomTaskList } from './task-list'
import { XMLNS_TASKLIST } from './constants'
import { initStorage } from '@converse/headless/utils/storage.js'
import { converse, api } from '@converse/headless/core'
const { $build } = converse.env
/**
* A list of {@link _converse.ChatRoomTaskList} instances, representing task lists associated to a MUC.
@ -37,9 +34,7 @@ class ChatRoomTaskLists extends Collection {
if (!name) { throw new Error('Missing name') }
console.log('Creating task list ' + name + '...')
const item = $build('item').c('tasklist', { xmlns: XMLNS_TASKLIST })
item.c('name').t(name)
await api.pubsub.publish(this.chatroom.get('jid'), 'livechat-tasks', item)
await this.chatroom.taskManager.createItem(this, { name })
console.log('Task list ' + name + ' created.')
}
}