mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
show attachments in Table
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
3f3953de3a
commit
58649a7a7d
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user