diff --git a/plugins/attachment-assets/lang/en.json b/plugins/attachment-assets/lang/en.json index 97645894f8..894156da05 100644 --- a/plugins/attachment-assets/lang/en.json +++ b/plugins/attachment-assets/lang/en.json @@ -7,6 +7,8 @@ "Photos": "Photos", "File": "File", "Files": "Files", + "NoFiles": "There are no files", + "ShowMoreAttachments": "Show more", "Type": "Type", "Size": "Size", "Photo": "Photo", diff --git a/plugins/attachment-assets/lang/ru.json b/plugins/attachment-assets/lang/ru.json index c66304b7ee..f88b0f99a8 100644 --- a/plugins/attachment-assets/lang/ru.json +++ b/plugins/attachment-assets/lang/ru.json @@ -7,6 +7,8 @@ "Photos": "Фотографии", "File": "Файл", "Files": "Файлы", + "NoFiles": "Файлы отсутствуют", + "ShowMoreAttachments": "Показать больше файлов", "Type": "Тип", "Size": "Размер", "Photo": "Фотография", diff --git a/plugins/attachment/src/index.ts b/plugins/attachment/src/index.ts index 46a862e8c2..4dd30df544 100644 --- a/plugins/attachment/src/index.ts +++ b/plugins/attachment/src/index.ts @@ -58,6 +58,8 @@ export default plugin(attachmentId, { DeleteFile: '' as Resource<(id: string) => Promise> }, string: { - Files: '' as IntlString + Files: '' as IntlString, + NoFiles: '' as IntlString, + ShowMoreAttachments: '' as IntlString } }) diff --git a/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte b/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte new file mode 100644 index 0000000000..5620169d23 --- /dev/null +++ b/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte @@ -0,0 +1,154 @@ + + + +
+
+ {#if attachments?.length} +
+ {#each attachments as attachment, i} +
+
+ +
+
+
showMenu(event, attachment, i)}> + +
+
+
+ {/each} + {#if attachmentsLimit && attachments.length === attachmentsLimit} +
{ + // TODO: replace this with an external attachments page + attachmentsLimit = undefined + }} + > +
+ {/if} +
+ {:else} +
+
+ {/if} +
+ + diff --git a/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte b/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte index 7e201fe7e3..718a2e4412 100644 --- a/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte +++ b/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte @@ -20,11 +20,12 @@ import { EditBox } from '@anticrm/ui' import chunter from '../plugin' + import EditChannelDescriptionAttachments from './EditChannelDescriptionAttachments.svelte' export let _id: Ref export let _class: Ref> - export let channel: Channel + export let channel: Channel | undefined const client = getClient() const clazz = client.getHierarchy().getClass(_class) @@ -34,7 +35,7 @@ function onNameChange (ev: Event) { const value = (ev.target as HTMLInputElement).value if (value.trim().length > 0) { - client.updateDoc(_class, channel.space, channel._id, { name: value }) + client.updateDoc(_class, channel!.space, channel!._id, { name: value }) } else { // Just refresh value query.query(chunter.class.Channel, { _id }, (result) => { @@ -45,12 +46,12 @@ function onTopicChange (ev: Event) { const newTopic = (ev.target as HTMLInputElement).value - client.update(channel, { topic: newTopic }) + client.update(channel!, { topic: newTopic }) } function onDescriptionChange (ev: Event) { const newDescription = (ev.target as HTMLInputElement).value - client.update(channel, { description: newDescription }) + client.update(channel!, { description: newDescription }) } @@ -81,6 +82,6 @@ focus on:change={onDescriptionChange} /> - + {/if}