Skip to content

Commit a98b83d

Browse files
UBERF-10408: New gmail integration (#8869)
* UBERF-10375: Fix full message sync Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10375: Clean up Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Init new gmail integration Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Rename package Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Add mail channel and thread master tags Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Rename Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Create messages in cards Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Use new messages Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Use mail tags and add mail-common Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Use tags for mails Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Clean up tests Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Fix tests Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Clean up Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Clean up Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Apply client fixes Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Fix communication version Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Use adapter for message manager Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Remove gmail-next and improve performance Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Fix dep mismatch Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Add prefix for new history Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Fix failed tests Signed-off-by: Artem Savchenko <[email protected]> * UBERF-10408: Fix composite emails and add channel cache Signed-off-by: Artem Savchenko <[email protected]> --------- Signed-off-by: Artem Savchenko <[email protected]>
1 parent 6807c9e commit a98b83d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3480
-461
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 51 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/all/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ export default function buildModel (): Builder {
455455
],
456456
[surveyModel, surveyId],
457457
[presenceModel, presenceId],
458-
[mailModel, mailId],
459458
[chatModel, chatId],
460459
[inboxModel, inboxId],
461460
[achievementModel, achievementId],
462461
[communicationModel, communicationId],
462+
[mailModel, mailId],
463463

464464
[serverCoreModel, serverCoreId],
465465
[serverAttachmentModel, serverAttachmentId],

models/mail/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
"dependencies": {
3131
"@hcengineering/activity": "^0.6.0",
3232
"@hcengineering/card": "^0.6.0",
33+
"@hcengineering/chat": "^0.6.0",
3334
"@hcengineering/chunter": "^0.6.20",
3435
"@hcengineering/model": "^0.6.11",
36+
"@hcengineering/model-card": "^0.6.0",
3537
"@hcengineering/model-core": "^0.6.0",
3638
"@hcengineering/core": "^0.6.32",
3739
"@hcengineering/platform": "^0.6.11",

models/mail/src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import core, { ClassifierKind, type Domain, IndexKind } from '@hcengineering/core'
1717
import { type Builder, Index, Model, Prop, TypeString } from '@hcengineering/model'
1818
import { TDoc } from '@hcengineering/model-core'
19+
import chat from '@hcengineering/chat'
1920

2021
import view, { type Viewlet } from '@hcengineering/model-view'
2122
import card from '@hcengineering/card'
@@ -31,6 +32,7 @@ const mailTag = 'Mail'
3132
export { mailId } from '@hcengineering/mail'
3233
export { default } from './plugin'
3334

35+
// TODO: UBERF-10525 Remove mail route, use KVS, remove createMailTag
3436
@Model(mail.class.MailRoute, core.class.Doc, DOMAIN_MAIL)
3537
export class TMailRoute extends TDoc implements MailRoute {
3638
@Prop(TypeString(), mail.string.MailId)
@@ -46,6 +48,29 @@ export function createModel (builder: Builder): void {
4648
builder.createModel(TMailRoute)
4749

4850
createMailTag(builder)
51+
52+
builder.createDoc(
53+
card.class.Tag,
54+
core.space.Model,
55+
{
56+
extends: chat.masterTag.Thread,
57+
label: mail.string.MailTag,
58+
kind: ClassifierKind.MIXIN,
59+
icon: mail.icon.Mail
60+
},
61+
mail.tag.MailThread
62+
)
63+
builder.createDoc(
64+
card.class.Tag,
65+
core.space.Model,
66+
{
67+
extends: chat.masterTag.Channel,
68+
label: mail.string.MailTag,
69+
kind: ClassifierKind.MIXIN,
70+
icon: mail.icon.Mail
71+
},
72+
mail.tag.MailChannel
73+
)
4974
createMailViewlet(builder)
5075
}
5176

plugins/mail-assets/assets/icons.svg

Lines changed: 3 additions & 0 deletions
Loading

plugins/mail-assets/lang/cs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Odpovědět",
99
"Date": "Datum",
1010
"MailMessage": "Zpráva",
11-
"MailMessages": "Zprávy"
11+
"MailMessages": "Zprávy",
12+
"MailTag": "Zpráva"
1213
}
1314
}

plugins/mail-assets/lang/de.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Antworten",
99
"Date": "Datum",
1010
"MailMessage": "Nachricht",
11-
"MailMessages": "Nachrichten"
11+
"MailMessages": "Nachrichten",
12+
"MailTag": "E-Mail"
1213
}
1314
}

plugins/mail-assets/lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Reply",
99
"Date": "Date",
1010
"MailMessage": "Message",
11-
"MailMessages": "Messages"
11+
"MailMessages": "Messages",
12+
"MailTag": "Mail"
1213
}
1314
}

plugins/mail-assets/lang/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Responder",
99
"Date": "Fecha",
1010
"MailMessage": "Mensaje",
11-
"MailMessages": "Mensajes"
11+
"MailMessages": "Mensajes",
12+
"MailTag": "Correo"
1213
}
1314
}

plugins/mail-assets/lang/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Répondre",
99
"Date": "Date",
1010
"MailMessage": "Message",
11-
"MailMessages": "Messages"
11+
"MailMessages": "Messages",
12+
"MailTag": "Courrier"
1213
}
1314
}

plugins/mail-assets/lang/it.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Rispondi",
99
"Date": "Data",
1010
"MailMessage": "Messaggio",
11-
"MailMessages": "Messaggi"
11+
"MailMessages": "Messaggi",
12+
"MailTag": "E-mail"
1213
}
1314
}

plugins/mail-assets/lang/ja.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "返信",
99
"Date": "日付",
1010
"MailMessage": "メッセージ",
11-
"MailMessages": "メッセージ"
11+
"MailMessages": "メッセージ",
12+
"MailTag": "メール"
1213
}
1314
}

plugins/mail-assets/lang/pt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Responder",
99
"Date": "Data",
1010
"MailMessage": "Mensagem",
11-
"MailMessages": "Mensagens"
11+
"MailMessages": "Mensagens",
12+
"MailTag": "Correio"
1213
}
1314
}

plugins/mail-assets/lang/ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "Ответить",
99
"Date": "Дата",
1010
"MailMessage": "Сообщение",
11-
"MailMessages": "Сообщения"
11+
"MailMessages": "Сообщения",
12+
"MailTag": "Почта"
1213
}
1314
}

plugins/mail-assets/lang/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Reply": "回复",
99
"Date": "日期",
1010
"MailMessage": "邮件",
11-
"MailMessages": "邮件"
11+
"MailMessages": "邮件",
12+
"MailTag": "邮件"
1213
}
1314
}

plugins/mail-assets/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ loadMetadata(mail.icon, {
2121
NewMail: `${icons}#new-mail`,
2222
Inbox: `${icons}#inbox`,
2323
Done: `${icons}#done`,
24-
Sent: `${icons}#sent`
24+
Sent: `${icons}#sent`,
25+
Mail: `${icons}#mail`
2526
})

plugins/mail/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import type { Class, Doc, Ref } from '@hcengineering/core'
1717
import { Asset, IntlString, type Plugin, plugin } from '@hcengineering/platform'
1818
import type { AnyComponent } from '@hcengineering/ui'
19-
import type { MasterTag } from '@hcengineering/card'
19+
import type { MasterTag, Tag } from '@hcengineering/card'
2020

2121
export interface MailRoute extends Doc {
2222
mailId: string
@@ -33,6 +33,10 @@ export default plugin(mailId, {
3333
MailThread: '' as Ref<MasterTag>,
3434
MailRoute: '' as Ref<Class<MailRoute>>
3535
},
36+
tag: {
37+
MailChannel: '' as Ref<Tag>,
38+
MailThread: '' as Ref<Tag>
39+
},
3640
component: {
3741
CreateMail: '' as AnyComponent,
3842
MailThreadPresenter: '' as AnyComponent,
@@ -50,12 +54,14 @@ export default plugin(mailId, {
5054
From: '' as IntlString,
5155
CreateMail: '' as IntlString,
5256
Reply: '' as IntlString,
53-
Date: '' as IntlString
57+
Date: '' as IntlString,
58+
MailTag: '' as IntlString
5459
},
5560
icon: {
5661
NewMail: '' as Asset,
5762
Inbox: '' as Asset,
5863
Done: '' as Asset,
59-
Sent: '' as Asset
64+
Sent: '' as Asset,
65+
Mail: '' as Asset
6066
}
6167
})

rush.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,6 +2497,11 @@
24972497
"packageName": "@hcengineering/model-communication",
24982498
"projectFolder": "models/communication",
24992499
"shouldPublish": false
2500+
},
2501+
{
2502+
"packageName": "@hcengineering/mail-common",
2503+
"projectFolder": "services/mail/mail-common",
2504+
"shouldPublish": false
25002505
}
25012506
]
25022507
}

0 commit comments

Comments
 (0)