UBER-609: Fix inbox notification/view for telegram and gmail messages (#3518)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-07-23 08:40:21 +05:00 committed by GitHub
parent a6dcbf8f2a
commit e46f67b210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 50 additions and 3 deletions

View File

@ -242,6 +242,24 @@ export function createModel (builder: Builder): void {
gmail.ids.EmailNotification
)
builder.createDoc(
activity.class.TxViewlet,
core.space.Model,
{
objectClass: gmail.class.Message,
icon: contact.icon.Email,
txClass: core.class.TxCreateDoc,
match: {
'attributes.incoming': true
},
label: gmail.string.NewIncomingMessage,
display: 'inline',
editable: false,
hideOnRemove: true
},
gmail.ids.NewMessageNotification
)
builder.mixin(gmail.class.Message, core.class.Class, core.mixin.FullTextSearchContext, {
parentPropagate: false
})

View File

@ -44,6 +44,7 @@ export default mergeIds(gmailId, gmail, {
},
ids: {
TxSharedCreate: '' as Ref<TxViewlet>,
NewMessageNotification: '' as Ref<TxViewlet>,
EmailNotificationGroup: '' as Ref<NotificationGroup>
},
activity: {

View File

@ -204,6 +204,24 @@ export function createModel (builder: Builder): void {
telegram.ids.NewMessageNotification
)
builder.createDoc(
activity.class.TxViewlet,
core.space.Model,
{
objectClass: telegram.class.Message,
icon: contact.icon.Telegram,
txClass: core.class.TxCreateDoc,
match: {
'attributes.incoming': true
},
label: telegram.string.NewIncomingMessage,
display: 'inline',
editable: false,
hideOnRemove: true
},
telegram.ids.NewMessageNotificationViewlet
)
builder.mixin(telegram.class.Message, core.class.Class, core.mixin.FullTextSearchContext, {
parentPropagate: false
})

View File

@ -35,11 +35,13 @@ export default mergeIds(telegramId, telegram, {
Status: '' as IntlString,
ConfigLabel: '' as IntlString,
ConfigDescription: '' as IntlString,
NewMessage: '' as IntlString
NewMessage: '' as IntlString,
NewIncomingMessage: '' as IntlString
},
ids: {
TxMessage: '' as Ref<TxViewlet>,
TxSharedCreate: '' as Ref<TxViewlet>,
NewMessageNotificationViewlet: '' as Ref<TxViewlet>,
NotificationGroup: '' as Ref<NotificationGroup>
},
function: {

View File

@ -43,6 +43,9 @@
{#await getPresenter(channel) then presenter}
{#if presenter}
<Component is={presenter} props={{ embedded, _id: channel?.attachedTo, _class: channel?.attachedToClass }} />
<Component
is={presenter}
props={{ embedded, _id: channel?.attachedTo, _class: channel?.attachedToClass, channel }}
/>
{/if}
{/await}

View File

@ -34,6 +34,7 @@
"Shared": "Shared",
"AvailableTo": "Available to",
"HaveWrittenEmail": "have written an email",
"NewIncomingMessage": "Sent you a new email",
"ConfigLabel": "Email",
"ConfigDescription": "Extension for Gmail email integration"
}

View File

@ -34,6 +34,7 @@
"Shared": "Публичный",
"AvailableTo": "Доступен для",
"HaveWrittenEmail": "написал(а) сообщение",
"NewIncomingMessage": "Прислал вам новое сообщение",
"ConfigLabel": "Электронная почта",
"ConfigDescription": "Расширение по работе с Gmail электронной почтой"
}

View File

@ -43,6 +43,7 @@ export default mergeIds(gmailId, gmail, {
Shared: '' as IntlString,
AvailableTo: '' as IntlString,
Email: '' as IntlString,
HaveWrittenEmail: '' as IntlString
HaveWrittenEmail: '' as IntlString,
NewIncomingMessage: '' as IntlString
}
})

View File

@ -20,6 +20,7 @@
"Incoming": "Incoming",
"Messages": "Messages",
"NewMessage": "New message",
"NewIncomingMessage": "Sent you a new message",
"Telegram": "Telegram",
"TelegramIntegrationDesc": "Use telegram integration",
"Status": "Status",

View File

@ -20,6 +20,7 @@
"Incoming": "Входящее",
"Messages": "Сообщения",
"NewMessage": "Новое сообщение",
"NewIncomingMessage": "Прислал новое сообщение",
"Telegram": "Telegram",
"TelegramIntegrationDesc": "Подключить Telegram",
"Status": "Статус",