Init poll applet (#9586)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-07-23 19:05:48 +07:00
committed by GitHub
parent fed9ef4e5a
commit 679a3df09f
56 changed files with 2500 additions and 307 deletions
@@ -12,28 +12,30 @@
<!-- limitations under the License. -->
<script lang="ts">
import { Message, MessageType } from '@hcengineering/communication-types'
import { Message } from '@hcengineering/communication-types'
import { Icon, Label, tooltip } from '@hcengineering/ui'
import communication from '@hcengineering/communication'
import { isBlobAttachment } from '@hcengineering/communication-shared'
import FilesTooltip from './FilesTooltip.svelte'
import AttachmentsTooltip from './AttachmentsTooltip.svelte'
export let message: Message
$: showFiles = message.blobs.length > 0
$: blobs = message.attachments.filter(isBlobAttachment) ?? []
$: showFiles = blobs.length > 0
</script>
{#if showFiles}
{#if message.content.trim().length > 0}
<span class="attachments" use:tooltip={{ component: FilesTooltip, props: { blobs: message.blobs } }}>
{message.blobs.length}
<span class="attachments" use:tooltip={{ component: AttachmentsTooltip, props: { attachments: blobs } }}>
{blobs.length}
<Icon icon={communication.icon.File} size="small" />
</span>
{:else}
<span class="attachments-text font-normal overflow-label">
<Label label={communication.string.Files} />:
<span class="ml-1 overflow-label" use:tooltip={{ component: FilesTooltip, props: { blobs: message.blobs } }}>
{message.blobs.map(({ fileName }) => fileName).join(', ')}
<span class="ml-1 overflow-label" use:tooltip={{ component: AttachmentsTooltip, props: { attachments: blobs } }}>
{blobs.map((it) => it.params.fileName).join(', ')}
</span>
</span>
{/if}
@@ -12,15 +12,18 @@
<!-- limitations under the License. -->
<script lang="ts">
import { AttachedBlob } from '@hcengineering/communication-types'
import { Attachment } from '@hcengineering/communication-types'
import { isBlobAttachment } from '@hcengineering/communication-shared'
export let blobs: AttachedBlob[] = []
export let attachments: Attachment[] = []
$: blobs = attachments.filter(isBlobAttachment)
</script>
<div class="tooltip">
{#each blobs as blob}
<div>
{blob.fileName}
{blob.params.fileName}
</div>
{/each}
</div>
@@ -23,7 +23,7 @@
import { jsonToMarkup, markupToText } from '@hcengineering/text'
import { ActivityMessageViewer, isActivityMessage } from '@hcengineering/communication-resources'
import FilesPreview from './FilesPreview.svelte'
import AttachmentPreview from './AttachmentPreview.svelte'
import PreviewTemplate from './PreviewTemplate.svelte'
export let card: Card
@@ -69,6 +69,6 @@
{/if}
<svelte:fragment slot="after">
<FilesPreview {message} />
<AttachmentPreview {message} />
</svelte:fragment>
</PreviewTemplate>