mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
fix: make todos and commands working in meeting minutes (#7244)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
+15
-12
@@ -41,10 +41,11 @@
|
||||
editor.off('selectionUpdate', handleSelectionUpdate)
|
||||
})
|
||||
|
||||
$: todoable = objectId !== undefined && objectClass !== undefined
|
||||
$: todoId = node.attrs.todoid as Ref<ToDo>
|
||||
$: userId = node.attrs.userid as Ref<Person>
|
||||
$: checked = node.attrs.checked ?? false
|
||||
$: readonly = !editor.isEditable || objectId === undefined
|
||||
$: readonly = !editor.isEditable || (!todoable && todoId != null)
|
||||
|
||||
let todo: ToDo | undefined = undefined
|
||||
$: query.query(
|
||||
@@ -59,7 +60,7 @@
|
||||
)
|
||||
|
||||
async function syncTodo (todo: ToDo | undefined): Promise<void> {
|
||||
if (todo !== undefined) {
|
||||
if (todo !== undefined && todo.attachedTo === objectId && todo.attachedToClass === objectClass) {
|
||||
const todoChecked = todo.doneOn != null
|
||||
if (todo._id !== todoId || todo.user !== userId || todoChecked !== checked) {
|
||||
updateAttributes({
|
||||
@@ -212,16 +213,18 @@
|
||||
class:hovered
|
||||
class:focused
|
||||
>
|
||||
<div class="flex-center assignee" contenteditable="false">
|
||||
<EmployeePresenter
|
||||
value={userId}
|
||||
disabled={readonly}
|
||||
avatarSize={'card'}
|
||||
shouldShowName={false}
|
||||
shouldShowPlaceholder
|
||||
onEmployeeEdit={handleAssigneeEdit}
|
||||
/>
|
||||
</div>
|
||||
{#if todoable}
|
||||
<div class="flex-center assignee" contenteditable="false">
|
||||
<EmployeePresenter
|
||||
value={userId}
|
||||
disabled={readonly}
|
||||
avatarSize={'card'}
|
||||
shouldShowName={false}
|
||||
shouldShowPlaceholder
|
||||
onEmployeeEdit={handleAssigneeEdit}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="flex-center todo-check" contenteditable="false">
|
||||
<CheckBox {readonly} {checked} on:value={markDone} kind={'positive'} size={'medium'} />
|
||||
|
||||
Reference in New Issue
Block a user