From a226f9aa0eebf69caf8020c2aa5098d42f039d91 Mon Sep 17 00:00:00 2001 From: Chunosov Date: Tue, 1 Apr 2025 11:41:24 +0700 Subject: [PATCH] Mailbox fixes (#8406) Signed-off-by: Nikolay Chunosov --- desktop/package.json | 4 +- desktop/src/ui/platform.ts | 2 + dev/prod/src/platform.ts | 1 + packages/account-client/src/client.ts | 6 +- .../src/components/MailboxEditorModal.svelte | 38 +++++++- .../src/components/MailboxItem.svelte | 91 +++++++++++++------ .../src/components/Mailboxes.svelte | 9 +- server/account/src/operations.ts | 33 ++++++- services/mail/pod-inbound-mail/src/config.ts | 4 +- .../mail/pod-inbound-mail/src/handlerMta.ts | 35 ++++++- services/mail/pod-inbound-mail/src/index.ts | 2 +- services/mail/pod-inbound-mail/src/message.ts | 31 ++++++- services/mail/pod-inbound-mail/src/person.ts | 50 ++++++---- 13 files changed, 243 insertions(+), 63 deletions(-) diff --git a/desktop/package.json b/desktop/package.json index 51507a2db0..2136c29bdb 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -12,8 +12,8 @@ "webpack": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development webpack --stats-error-details --progress -w", "devp": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production CLIENT_TYPE=dev webpack --progress -w", "dev": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development webpack --progress -w", - "start": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production electron .", - "start-dev": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development electron .", + "start": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production electron --no-sandbox .", + "start-dev": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development electron --no-sandbox .", "format": "format", "bump": "bump-package-version" }, diff --git a/desktop/src/ui/platform.ts b/desktop/src/ui/platform.ts index 907477a274..80a1f4deec 100644 --- a/desktop/src/ui/platform.ts +++ b/desktop/src/ui/platform.ts @@ -89,6 +89,7 @@ import '@hcengineering/lead-assets' import '@hcengineering/login-assets' import '@hcengineering/love-assets' import '@hcengineering/notification-assets' +import '@hcengineering/my-space-assets' import '@hcengineering/preference-assets' import '@hcengineering/print-assets' import '@hcengineering/process-assets' @@ -361,6 +362,7 @@ export async function configurePlatform (): Promise { addLocation(mySpaceId, () => import(/* webpackChunkName: "card" */ '@hcengineering/my-space-resources')) addLocation(chatId, () => import(/* webpackChunkName: "chat" */ '@hcengineering/chat-resources')) addLocation(inboxId, () => import(/* webpackChunkName: "inbox" */ '@hcengineering/inbox-resources')) + addLocation(mailId, () => import(/* webpackChunkName: "card" */ '@hcengineering/mail-resources')) addLocation(processId, () => import(/* webpackChunkName: "process" */ '@hcengineering/process-resources')) setMetadata(client.metadata.FilterModel, 'ui') diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 5b7e9175b7..b2832c1617 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -124,6 +124,7 @@ import '@hcengineering/view-assets' import '@hcengineering/workbench-assets' import '@hcengineering/chat-assets' import '@hcengineering/inbox-assets' +import '@hcengineering/mail-assets' import '@hcengineering/github-assets' import { coreId } from '@hcengineering/core' diff --git a/packages/account-client/src/client.ts b/packages/account-client/src/client.ts index e12767b480..52df046c62 100644 --- a/packages/account-client/src/client.ts +++ b/packages/account-client/src/client.ts @@ -93,7 +93,7 @@ export interface AccountClient { findPersonBySocialId: (socialId: PersonId, requireAccount?: boolean) => Promise findSocialIdBySocialKey: (socialKey: string) => Promise getMailboxOptions: () => Promise - createMailbox: (name: string, domain: string) => Promise + createMailbox: (name: string, domain: string) => Promise<{ mailbox: string, socialId: PersonId }> getMailboxes: () => Promise deleteMailbox: (mailbox: string) => Promise @@ -653,13 +653,13 @@ class AccountClientImpl implements AccountClient { return await this.rpc(request) } - async createMailbox (name: string, domain: string): Promise { + async createMailbox (name: string, domain: string): Promise<{ mailbox: string, socialId: PersonId }> { const request = { method: 'createMailbox' as const, params: { name, domain } } - await this.rpc(request) + return await this.rpc(request) } async getMailboxes (): Promise { diff --git a/plugins/setting-resources/src/components/MailboxEditorModal.svelte b/plugins/setting-resources/src/components/MailboxEditorModal.svelte index 464d526771..b00be1de53 100644 --- a/plugins/setting-resources/src/components/MailboxEditorModal.svelte +++ b/plugins/setting-resources/src/components/MailboxEditorModal.svelte @@ -14,12 +14,14 @@ -->