attachments cleanup

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-24 12:33:17 +02:00
parent b416925573
commit c41a3222bd
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
8 changed files with 990 additions and 932 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
// //
import type { IntlString } from '@anticrm/platform' import type { IntlString } from '@anticrm/platform'
import { Builder, Model, Prop, UX, TypeString, Index } from '@anticrm/model' import { Builder, Model, Prop, UX, TypeString, Index, TypeTimestamp } from '@anticrm/model'
import type { Ref, Doc, Class, Domain } from '@anticrm/core' import type { Ref, Doc, Class, Domain } from '@anticrm/core'
import { IndexKind } from '@anticrm/core' import { IndexKind } from '@anticrm/core'
import core, { TSpace, TDoc } from '@anticrm/model-core' import core, { TSpace, TDoc } from '@anticrm/model-core'
@ -71,6 +71,9 @@ export class TAttachment extends TDoc implements Attachment {
@Prop(TypeString(), 'Type' as IntlString) @Prop(TypeString(), 'Type' as IntlString)
type!: string type!: string
@Prop(TypeTimestamp(), 'Date' as IntlString)
lastModified!: number
} }
export function createModel (builder: Builder): void { export function createModel (builder: Builder): void {

View File

@ -45,4 +45,4 @@
</script> </script>
{time} <span style="white-space: nowrap;">{time}</span>

View File

@ -27,7 +27,7 @@
<Table <Table
_class={chunter.class.Attachment} _class={chunter.class.Attachment}
config={['', 'file', 'type']} config={['', 'lastModified']}
options={ {} } options={ {} }
search="" search=""
/> />

View File

@ -52,6 +52,7 @@ export interface Attachment extends AttachedDoc {
file: string file: string
size: number size: number
type: string type: string
lastModified: number
} }
/** /**

View File

@ -53,6 +53,7 @@
file: uuid, file: uuid,
type: file.type, type: file.type,
size: file.size, size: file.size,
lastModified: file.lastModified
}) })
} catch (err: any) { } catch (err: any) {
setPlatformStatus(unknownError(err)) setPlatformStatus(unknownError(err))
@ -67,10 +68,6 @@
if (file !== undefined) { createAttachment(file) } if (file !== undefined) { createAttachment(file) }
} }
const maxLenght: number = 52
const trimFilename = (fname: string): string => (fname.length > maxLenght)
? fname.substr(0, (maxLenght - 1) / 2) + '...' + fname.substr(-(maxLenght - 1) / 2)
: fname
</script> </script>
<div class="attachments-container"> <div class="attachments-container">
@ -85,7 +82,7 @@
</div> </div>
<Table <Table
_class={chunter.class.Attachment} _class={chunter.class.Attachment}
config={['', 'modifiedOn']} config={['', 'lastModified']}
options={ {} } options={ {} }
search="" search=""
/> />

File diff suppressed because it is too large Load Diff