attachment presenter

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-15 19:51:22 +02:00
parent bf9f479500
commit ce51ee8137
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
18 changed files with 694 additions and 683 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -115,3 +115,5 @@ export function createModel (builder: Builder): void {
presenter: chunter.component.AttachmentPresenter presenter: chunter.component.AttachmentPresenter
}) })
} }
export default chunter

View File

@ -28,6 +28,7 @@
"@anticrm/model-contact": "~0.6.0", "@anticrm/model-contact": "~0.6.0",
"@anticrm/recruit": "~0.6.0", "@anticrm/recruit": "~0.6.0",
"@anticrm/recruit-resources": "~0.6.0", "@anticrm/recruit-resources": "~0.6.0",
"@anticrm/chunter": "~0.6.0" "@anticrm/chunter": "~0.6.0",
"@anticrm/model-chunter": "~0.6.0"
} }
} }

View File

@ -25,6 +25,7 @@ import workbench from '@anticrm/model-workbench'
import view from '@anticrm/model-view' import view from '@anticrm/model-view'
import contact, { TPerson } from '@anticrm/model-contact' import contact, { TPerson } from '@anticrm/model-contact'
import recruit from './plugin' import recruit from './plugin'
import chunter from '@anticrm/model-chunter'
export const DOMAIN_RECRUIT = 'recruit' as Domain export const DOMAIN_RECRUIT = 'recruit' as Domain
@ -109,7 +110,7 @@ export function createModel (builder: Builder): void {
// resume: chunter.class.Attachment // resume: chunter.class.Attachment
// } // }
} as FindOptions<Doc>, // TODO: fix } as FindOptions<Doc>, // TODO: fix
config: ['', '#' + recruit.component.CreateApplicationPresenter + '/Action', 'city', 'channels'] config: ['', '#' + recruit.component.CreateApplicationPresenter + '/Action', 'city', '#' + chunter.component.AttachmentPresenter + '/Files', 'channels']
}) })
builder.createDoc(view.class.Viewlet, core.space.Model, { builder.createDoc(view.class.Viewlet, core.space.Model, {

View File

@ -24,6 +24,7 @@
"@anticrm/view": "~0.6.0", "@anticrm/view": "~0.6.0",
"svelte": "^3.37.0", "svelte": "^3.37.0",
"@anticrm/contact": "~0.6.0", "@anticrm/contact": "~0.6.0",
"@anticrm/chunter": "~0.6.0" "@anticrm/chunter": "~0.6.0",
"@anticrm/login": "~0.6.1"
} }
} }

View File

@ -17,7 +17,7 @@
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { Button, CircleButton, IconClose } from '@anticrm/ui' import { Button, CircleButton, IconClose } from '@anticrm/ui'
import { Avatar } from '@anticrm/presentation' import Avatar from './Avatar.svelte'
import ArrowLeft from './icons/ArrowLeft.svelte' import ArrowLeft from './icons/ArrowLeft.svelte'
import ExpandUp from './icons/ExpandUp.svelte' import ExpandUp from './icons/ExpandUp.svelte'
import ExpandDown from './icons/ExpandDown.svelte' import ExpandDown from './icons/ExpandDown.svelte'

View File

@ -24,3 +24,4 @@ export { default as AttributeEditor } from './components/AttributeEditor.svelte'
export { default as Card } from './components/Card.svelte' export { default as Card } from './components/Card.svelte'
export { default as Channels } from './components/Channels.svelte' export { default as Channels } from './components/Channels.svelte'
export { default as Backlink } from './components/Backlink.svelte' export { default as Backlink } from './components/Backlink.svelte'
export { default as PDFViewer } from './components/PDFViewer.svelte'

View File

@ -16,13 +16,19 @@
<script lang="ts"> <script lang="ts">
import type { Bag } from '@anticrm/core'
import type { Attachment } from '@anticrm/chunter' import type { Attachment } from '@anticrm/chunter'
import { IconFile } from '@anticrm/ui' import { IconFile, Link, showPopup } from '@anticrm/ui'
import { PDFViewer } from '@anticrm/presentation'
export let value: Attachment export let value: { attachments: Bag<Attachment> }
</script> </script>
{#if value} {#if value}
<IconFile size={'small'}/> {#if Object.keys(value.attachments).length === 1}
<Link label={Object.values(value.attachments)[0].name} href={'#'} icon={IconFile} on:click={ () => { showPopup(PDFViewer, { file: Object.values(value.attachments)[0].file }, 'right') } }/>
{:else if Object.keys(value.attachments).length > 1}
<IconFile size='small'/>Files
{/if}
{/if} {/if}

View File

@ -19,9 +19,8 @@
import type { Doc, Ref, Space, Class, Bag } from '@anticrm/core' import type { Doc, Ref, Space, Class, Bag } from '@anticrm/core'
import { setPlatformStatus, unknownError } from '@anticrm/platform' import { setPlatformStatus, unknownError } from '@anticrm/platform'
import { generateId } from '@anticrm/core' import { generateId } from '@anticrm/core'
import { createQuery, getClient } from '@anticrm/presentation' import { createQuery, getClient, PDFViewer } from '@anticrm/presentation'
import type { Attachment } from '@anticrm/chunter' import type { Attachment } from '@anticrm/chunter'
import PDFViewer from './PDFViewer.svelte'
import { uploadFile } from '../utils' import { uploadFile } from '../utils'

View File

@ -19,7 +19,7 @@
import { generateId } from '@anticrm/core' import { generateId } from '@anticrm/core'
import { setPlatformStatus, unknownError } from '@anticrm/platform' import { setPlatformStatus, unknownError } from '@anticrm/platform'
import { getClient, Card, Channels } from '@anticrm/presentation' import { getClient, Card, Channels, PDFViewer } from '@anticrm/presentation'
import { uploadFile } from '../utils' import { uploadFile } from '../utils'
import recruit from '../plugin' import recruit from '../plugin'
@ -32,7 +32,6 @@
import Avatar from './icons/Avatar.svelte' import Avatar from './icons/Avatar.svelte'
import Edit from './icons/Edit.svelte' import Edit from './icons/Edit.svelte'
import SocialEditor from './SocialEditor.svelte' import SocialEditor from './SocialEditor.svelte'
import PDFViewer from './PDFViewer.svelte'
import Girl from '../../img/girl.png' import Girl from '../../img/girl.png'
import Elon from '../../img/elon.png' import Elon from '../../img/elon.png'
import Bond from '../../img/bond.png' import Bond from '../../img/bond.png'

View File

@ -21,7 +21,7 @@
import { generateId } from '@anticrm/core' import { generateId } from '@anticrm/core'
import { EditBox, Button, CircleButton, Grid, Label, Link, showPopup, Component, IconFile as FileIcon } from '@anticrm/ui' import { EditBox, Button, CircleButton, Grid, Label, Link, showPopup, Component, IconFile as FileIcon } from '@anticrm/ui'
import type { AnyComponent } from '@anticrm/ui' import type { AnyComponent } from '@anticrm/ui'
import { getClient } from '@anticrm/presentation' import { getClient, PDFViewer } from '@anticrm/presentation'
import type { Attachment } from '@anticrm/chunter' import type { Attachment } from '@anticrm/chunter'
import AvatarEditor from './AvatarEditor.svelte' import AvatarEditor from './AvatarEditor.svelte'
@ -30,7 +30,6 @@
import Twitter from './icons/Twitter.svelte' import Twitter from './icons/Twitter.svelte'
import User from './icons/User.svelte' import User from './icons/User.svelte'
import SocialEditor from './SocialEditor.svelte' import SocialEditor from './SocialEditor.svelte'
import PDFViewer from './PDFViewer.svelte'
import { uploadFile } from '../utils' import { uploadFile } from '../utils'
import { Candidate } from '@anticrm/recruit' import { Candidate } from '@anticrm/recruit'

View File

@ -19,10 +19,9 @@
import { CircleButton, EditBox, Link, showPopup, IconFile as FileIcon } from '@anticrm/ui' import { CircleButton, EditBox, Link, showPopup, IconFile as FileIcon } from '@anticrm/ui'
import type { Attachment } from '@anticrm/chunter' import type { Attachment } from '@anticrm/chunter'
import FileUpload from './icons/FileUpload.svelte' import FileUpload from './icons/FileUpload.svelte'
import PDFViewer from './PDFViewer.svelte' import { getClient, createQuery, Channels, AttributeEditor, PDFViewer } from '@anticrm/presentation'
import { getClient, createQuery, Channels, AttributeEditor } from '@anticrm/presentation'
import { Panel } from '@anticrm/panel' import { Panel } from '@anticrm/panel'
import type { Candidate, Candidate } from '@anticrm/recruit' import type { Candidate } from '@anticrm/recruit'
import DialogHeader from './DialogHeader.svelte' import DialogHeader from './DialogHeader.svelte'
import Contact from './icons/Contact.svelte' import Contact from './icons/Contact.svelte'
import Avatar from './icons/Avatar.svelte' import Avatar from './icons/Avatar.svelte'

View File

@ -115,7 +115,7 @@
} }
.tr-body { .tr-body {
height: 3.75rem; height: 3rem;
color: var(--theme-caption-color); color: var(--theme-caption-color);
border-bottom: 1px solid var(--theme-button-border-hovered); border-bottom: 1px solid var(--theme-button-border-hovered);
&:last-child { border-bottom: none; } &:last-child { border-bottom: none; }

File diff suppressed because it is too large Load Diff