show attachments in Table

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-23 17:09:56 +02:00
parent 3f3953de3a
commit 58649a7a7d
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
6 changed files with 1130 additions and 910 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,16 @@ export class TBacklink extends TComment implements Backlink {
export class TAttachment extends TDoc implements Attachment {
attachedTo!: Ref<Doc>
attachedToClass!: Ref<Class<Doc>>
@Prop(TypeString(), 'Name' as IntlString)
name!: string
@Prop(TypeString(), 'File' as IntlString)
file!: string
@Prop(TypeString(), 'Size' as IntlString)
size!: number
@Prop(TypeString(), 'Type' as IntlString)
type!: string
}

View File

@ -21,6 +21,7 @@
import { generateId } from '@anticrm/core'
import { createQuery, getClient, PDFViewer } from '@anticrm/presentation'
import type { Attachment } from '@anticrm/chunter'
import { Table } from '@anticrm/view-resources'
import { uploadFile } from '../utils'
@ -82,28 +83,12 @@
{/if}
<input bind:this={inputFile} type="file" name="file" id="file" style="display: none" on:change={fileSelected}/>
</div>
<table class="table-body">
<thead>
<tr class="tr-head">
<th>Attachments</th>
<th>Time</th>
</tr>
</thead>
<tbody>
{#each attachments as file}
<tr class="tr-body">
<td class="item flex-row-center">
<div class="flex-center file-icon">pdf</div>
<div class="flex-col flex-grow" style="cursor: pointer" on:click={ () => { showPopup(PDFViewer, { file: file.file }, 'right') } }>
<div class="overflow-label caption-color">{trimFilename(file.name)}</div>
<div class="overflow-label file-desc">{file.type}</div>
</div>
</td>
<td>10 / 8</td>
</tr>
{/each}
</tbody>
</table>
<Table
_class={chunter.class.Attachment}
config={['name', 'file', 'type']}
options={ {} }
search=""
/>
</div>
<style lang="scss">

File diff suppressed because it is too large Load Diff