Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion communication
8 changes: 4 additions & 4 deletions packages/presentation/src/communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ import core, {
SocialIdType,
type Tx,
type TxDomainEvent,
AccountRole,
generateUuid
AccountRole
} from '@hcengineering/core'
import { onDestroy } from 'svelte'
import { addNotification, NotificationSeverity, languageStore } from '@hcengineering/ui'
import { getMetadata, translate } from '@hcengineering/platform'
import view from '@hcengineering/view'
import { get } from 'svelte/store'
import { getClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import { v4 as uuid } from 'uuid'

import { getCurrentWorkspaceUuid } from './file'
import { addTxListener, removeTxListener, type TxListener } from './utils'
Expand Down Expand Up @@ -255,7 +255,7 @@ class Client {
opcode: 'add',
attachments: ops.add.map((it) => ({
...it,
id: it.id ?? (generateUuid() as AttachmentID)
id: it.id ?? (uuid() as AttachmentID)
}))
})
}
Expand All @@ -272,7 +272,7 @@ class Client {
opcode: 'set',
attachments: ops.set.map((it) => ({
...it,
id: it.id ?? (generateUuid() as AttachmentID)
id: it.id ?? (uuid() as AttachmentID)
}))
})
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/communication-resources/src/poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
type Timestamp
} from '@hcengineering/core'
import { type Poll, type PollAnswer } from '@hcengineering/communication'
import { getClient } from '@hcengineering/presentation'
import { getClient, getCommunicationClient } from '@hcengineering/presentation'
import card, { type Card } from '@hcengineering/card'
import { makeRank } from '@hcengineering/rank'
import { type AppletAttachment, type MessageID } from '@hcengineering/communication-types'
Expand Down Expand Up @@ -69,6 +69,7 @@ export function getEmptyPollConfig (): PollConfig {

export async function createPoll (parent: Card, message: MessageID, params: PollConfig): Promise<void> {
const client = getClient()
const communicationClient = getCommunicationClient()
const hierarchy = client.getHierarchy()
const lastOne = await client.findOne(card.class.Card, {}, { sort: { rank: SortingOrder.Descending } })

Expand All @@ -85,6 +86,7 @@ export async function createPoll (parent: Card, message: MessageID, params: Poll
const filledData = fillDefaults(hierarchy, data, communication.type.Poll)

await client.createDoc(communication.type.Poll, parent.space, filledData, params.id)
await communicationClient.attachThread(parent._id, message, params.id, communication.type.Poll)
}

export function getPollTitle (attachment: AppletAttachment): string {
Expand Down
Loading