From 5c17a05c7aa88952830c03cb0f7fa28520981b7c Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Mon, 2 May 2022 10:23:57 +0600 Subject: [PATCH] File browser style fix (#1618) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- plugins/attachment-assets/lang/en.json | 4 ++-- plugins/attachment-assets/lang/ru.json | 4 ++-- .../components/AttachmentGalleryPresenter.svelte | 8 +++++--- .../src/components/AttachmentsGalleryView.svelte | 7 ++++--- .../src/components/AttachmentsListView.svelte | 9 ++++----- .../src/components/FileBrowser.svelte | 7 ++++--- .../src/components/ChannelView.svelte | 13 +++---------- .../src/components/ThreadView.svelte | 10 +++------- plugins/view-assets/src/index.ts | 1 + plugins/view/src/index.ts | 1 + 10 files changed, 29 insertions(+), 35 deletions(-) diff --git a/plugins/attachment-assets/lang/en.json b/plugins/attachment-assets/lang/en.json index 76fee8aff4..5b09aac325 100644 --- a/plugins/attachment-assets/lang/en.json +++ b/plugins/attachment-assets/lang/en.json @@ -17,8 +17,8 @@ "Name": "Name", "FileBrowser": "File browser", "FileBrowserFileCounter": "{results, plural, =1 {# result} other {# results}}", - "FileBrowserListView": "View as list", - "FileBrowserGridView": "View as grid", + "FileBrowserListView": "List", + "FileBrowserGridView": "Grid", "FileBrowserFilterFrom": "From", "FileBrowserFilterIn": "In", "FileBrowserFilterDate": "Date", diff --git a/plugins/attachment-assets/lang/ru.json b/plugins/attachment-assets/lang/ru.json index 61b976f6a1..abba0344f0 100644 --- a/plugins/attachment-assets/lang/ru.json +++ b/plugins/attachment-assets/lang/ru.json @@ -17,8 +17,8 @@ "Name": "Название", "FileBrowser": "Браузер файлов", "FileBrowserFileCounter": "{results, plural, =1 {# результат} =2 {# результата} =3 {# результата} =4 {# результата} other {# результатов}}", - "FileBrowserListView": "Показать в виде списка", - "FileBrowserGridView": "Показать в виде таблицы", + "FileBrowserListView": "Список", + "FileBrowserGridView": "Таблица", "FileBrowserFilterFrom": "От", "FileBrowserFilterIn": "В", "FileBrowserFilterDate": "Дата", diff --git a/plugins/attachment-resources/src/components/AttachmentGalleryPresenter.svelte b/plugins/attachment-resources/src/components/AttachmentGalleryPresenter.svelte index e34912ee34..e0965640d4 100644 --- a/plugins/attachment-resources/src/components/AttachmentGalleryPresenter.svelte +++ b/plugins/attachment-resources/src/components/AttachmentGalleryPresenter.svelte @@ -107,7 +107,7 @@ border-radius: 0.75rem; justify-content: space-between; overflow: hidden; - box-shadow: 0 0 0 1px var(--theme-bg-focused-border); + border: 1px solid var(--theme-button-border-hovered); } .cellImagePreview { @@ -115,8 +115,6 @@ justify-content: center; height: 10rem; overflow: hidden; - margin: 0 1.5rem; - border-radius: 0.5rem; background-color: var(--theme-menu-color); cursor: pointer; } @@ -137,6 +135,7 @@ .cellInfo { display: flex; flex-direction: row; + border: 1px solid var(--theme-button-border-hovered); padding: 0.75rem; height: 4rem; align-items: center; @@ -149,6 +148,9 @@ .eCellInfoMenu { margin-left: auto; + position: absolute; + bottom: 1rem; + right: 0.5rem; } .eCellInfoFilename { diff --git a/plugins/attachment-resources/src/components/AttachmentsGalleryView.svelte b/plugins/attachment-resources/src/components/AttachmentsGalleryView.svelte index 6216c5b07a..c4cda9e973 100644 --- a/plugins/attachment-resources/src/components/AttachmentsGalleryView.svelte +++ b/plugins/attachment-resources/src/components/AttachmentsGalleryView.svelte @@ -79,9 +79,10 @@ .eAttachmentCellActions { display: flex; visibility: hidden; - border: 1px solid var(--theme-bg-focused-border); - padding: 0.2rem; - border-radius: 0.375rem; + padding: 0.5rem; + border: 1px solid var(--theme-button-border-hovered); + border-radius: 0.25rem; + background-color: var(--board-bg-color); } .eAttachmentCellMenu { diff --git a/plugins/attachment-resources/src/components/AttachmentsListView.svelte b/plugins/attachment-resources/src/components/AttachmentsListView.svelte index 2607cd4d67..d786d202bf 100644 --- a/plugins/attachment-resources/src/components/AttachmentsListView.svelte +++ b/plugins/attachment-resources/src/components/AttachmentsListView.svelte @@ -71,15 +71,14 @@ .attachmentRow { display: flex; align-items: center; - margin: 0 1.5rem; - padding: 0.25rem 0; + margin: 0.5rem 1.5rem; + padding: 0.5rem; + border: 1px solid var(--theme-button-border-hovered); + border-radius: 0.5rem; .eAttachmentRowActions { display: flex; visibility: hidden; - border: 1px solid var(--theme-bg-focused-border); - padding: 0.2rem; - border-radius: 0.375rem; } .eAttachmentRowMenu { diff --git a/plugins/attachment-resources/src/components/FileBrowser.svelte b/plugins/attachment-resources/src/components/FileBrowser.svelte index 3836662146..fa742c8f1e 100644 --- a/plugins/attachment-resources/src/components/FileBrowser.svelte +++ b/plugins/attachment-resources/src/components/FileBrowser.svelte @@ -17,6 +17,7 @@ import contact, { Employee } from '@anticrm/contact' import { EmployeeAccount } from '@anticrm/contact' import core, { Class, getCurrentAccount, Ref, Space } from '@anticrm/core' + import view from '@anticrm/view' import { getClient } from '@anticrm/presentation' import ui, { getCurrentLocation, @@ -135,7 +136,7 @@ isListDisplayMode = true }} > - + @@ -146,7 +147,7 @@ isListDisplayMode = false }} > - + @@ -169,7 +170,7 @@ {/if} {:else} -
+
{/if} diff --git a/plugins/chunter-resources/src/components/ChannelView.svelte b/plugins/chunter-resources/src/components/ChannelView.svelte index 9f26e8d9c6..7edf823ba3 100644 --- a/plugins/chunter-resources/src/components/ChannelView.svelte +++ b/plugins/chunter-resources/src/components/ChannelView.svelte @@ -16,8 +16,7 @@ import attachment, { Attachment } from '@anticrm/attachment' import { AttachmentRefInput } from '@anticrm/attachment-resources' import { ChunterMessage, Message, ChunterSpace } from '@anticrm/chunter' - import { generateId, getCurrentAccount, Ref, Space, TxFactory } from '@anticrm/core' - import { NotificationClientImpl } from '@anticrm/notification-resources' + import { generateId, getCurrentAccount, Ref, Space } from '@anticrm/core' import notification from '@anticrm/notification' import { createQuery, getClient } from '@anticrm/presentation' import { getCurrentLocation, navigate } from '@anticrm/ui' @@ -33,13 +32,11 @@ const client = getClient() const _class = chunter.class.Message let _id = generateId() as Ref - const notificationClient = NotificationClientImpl.getClient() async function onMessage (event: CustomEvent) { const { message, attachments } = event.detail const me = getCurrentAccount()._id - const txFactory = new TxFactory(me) - const tx = txFactory.createTxCreateDoc( + await client.createDoc( _class, space, { @@ -47,14 +44,12 @@ attachedToClass: chunter.class.ChunterSpace, collection: 'messages', content: message, - createOn: 0, + createOn: Date.now(), createBy: me, attachments }, _id ) - tx.attributes.createOn = tx.modifiedOn - if ( chunterSpace._class === chunter.class.DirectMessage && !chunterSpace.lastMessage && @@ -74,8 +69,6 @@ ) ) } - await notificationClient.updateLastView(space, chunter.class.ChunterSpace, tx.modifiedOn, true) - await client.tx(tx) // Create an backlink to document await createBacklinks(client, space, chunter.class.ChunterSpace, _id, message) diff --git a/plugins/chunter-resources/src/components/ThreadView.svelte b/plugins/chunter-resources/src/components/ThreadView.svelte index 7b3ab31a01..7352ca9b37 100644 --- a/plugins/chunter-resources/src/components/ThreadView.svelte +++ b/plugins/chunter-resources/src/components/ThreadView.svelte @@ -17,7 +17,7 @@ import { AttachmentRefInput } from '@anticrm/attachment-resources' import type { ThreadMessage, Message, ChunterMessage } from '@anticrm/chunter' import contact, { Employee } from '@anticrm/contact' - import core, { Doc, generateId, getCurrentAccount, Ref, Space, TxFactory } from '@anticrm/core' + import core, { Doc, generateId, getCurrentAccount, Ref, Space } from '@anticrm/core' import { NotificationClientImpl } from '@anticrm/notification-resources' import { createQuery, getClient } from '@anticrm/presentation' import { IconClose, Label, getCurrentLocation, navigate } from '@anticrm/ui' @@ -143,8 +143,7 @@ async function onMessage (event: CustomEvent) { const { message, attachments } = event.detail const me = getCurrentAccount()._id - const txFactory = new TxFactory(me) - const tx = txFactory.createTxCreateDoc( + await client.createDoc( chunter.class.ThreadMessage, currentSpace, { @@ -153,14 +152,11 @@ collection: 'replies', content: message, createBy: me, - createOn: 0, + createOn: Date.now(), attachments }, commentId ) - tx.attributes.createOn = tx.modifiedOn - await notificationClient.updateLastView(_id, chunter.class.Message, tx.modifiedOn, true) - await client.tx(tx) // Create an backlink to document await createBacklinks(client, currentSpace, chunter.class.ChunterSpace, commentId, message) diff --git a/plugins/view-assets/src/index.ts b/plugins/view-assets/src/index.ts index 2382536953..1c9ad379ce 100644 --- a/plugins/view-assets/src/index.ts +++ b/plugins/view-assets/src/index.ts @@ -19,6 +19,7 @@ import view, { viewId } from '@anticrm/view' const icons = require('../assets/icons.svg') as string // eslint-disable-line loadMetadata(view.icon, { Table: `${icons}#table`, + Card: `${icons}#card`, Delete: `${icons}#delete`, Move: `${icons}#move`, MoreH: `${icons}#more-h`, diff --git a/plugins/view/src/index.ts b/plugins/view/src/index.ts index 0116864399..6731481e60 100644 --- a/plugins/view/src/index.ts +++ b/plugins/view/src/index.ts @@ -285,6 +285,7 @@ const view = plugin(viewId, { }, icon: { Table: '' as Asset, + Card: '' as Asset, Delete: '' as Asset, MoreH: '' as Asset, Move: '' as Asset,