Skip to content

Commit cb5230e

Browse files
kristina-fefelovaaonnikov
authored andcommitted
Merge inbox (#10057)
1 parent 2c36930 commit cb5230e

File tree

131 files changed

+3835
-1091
lines changed

Some content is hidden

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

131 files changed

+3835
-1091
lines changed

common/config/rush/pnpm-lock.yaml

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

common/scripts/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"0.7.269"
1+
"0.7.278"

desktop/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@
266266
"@hcengineering/ai-assistant": "^0.7.0",
267267
"@hcengineering/ai-assistant-assets": "^0.7.0",
268268
"@hcengineering/ai-assistant-resources": "^0.7.0",
269+
"@hcengineering/inbox": "^0.7.0",
270+
"@hcengineering/inbox-assets": "^0.7.0",
271+
"@hcengineering/inbox-resources": "^0.7.0",
269272
"electron-squirrel-startup": "~1.0.0",
270273
"dotenv": "~16.0.0",
271274
"electron-context-menu": "^4.0.4",

desktop/src/ui/index.ts

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@ import {
3434
} from '@hcengineering/ui'
3535
import { handleDownloadItem } from '@hcengineering/desktop-downloads'
3636
import notification, { notificationId } from '@hcengineering/notification'
37-
import { chatId } from '@hcengineering/chat'
37+
import { inboxId } from '@hcengineering/inbox'
3838
import workbench, { workbenchId, logOut } from '@hcengineering/workbench'
3939
import view, { Action, encodeObjectURI } from '@hcengineering/view'
4040
import { resolveLocation } from '@hcengineering/notification-resources'
41+
import { themeStore, ThemeVariant } from '@hcengineering/theme'
42+
import type { Application } from '@hcengineering/workbench'
43+
import { isAllowedToRole } from '@hcengineering/workbench-resources'
44+
import card from '@hcengineering/card'
45+
import communication from '@hcengineering/communication'
4146

4247
import { isOwnerOrMaintainer, getCurrentAccount, Ref } from '@hcengineering/core'
4348
import { configurePlatform } from './platform'
4449
import { setupTitleBarMenu } from './titleBarMenu'
4550
import { defineScreenShare, defineGetDisplayMedia } from './screenShare'
4651
import { CommandLogout, CommandSelectWorkspace, CommandOpenSettings, CommandOpenInbox, CommandOpenPlanner, CommandOpenOffice, CommandOpenApplication, LaunchApplication, NotificationParams, CommandCloseTab } from './types'
4752
import { ipcMainExposed } from './typesUtils'
48-
import { themeStore, ThemeVariant } from '@hcengineering/theme'
49-
import type { Application } from '@hcengineering/workbench'
50-
import { isAllowedToRole } from '@hcengineering/workbench-resources'
5153
import { IpcMessage } from './ipcMessages'
5254

5355
function currentOsIsWindows (): boolean {
@@ -197,39 +199,44 @@ window.addEventListener('DOMContentLoaded', () => {
197199
navigate(parseLocation(urlObject))
198200
}
199201

200-
function getBasicNotificationPath (notificationParams: NotificationParams): string {
201-
return `${workbenchId}/${notificationParams.application ?? notificationId}/${notificationId}`
202+
function getBasicNotificationPath (worksapce: string, app: string): string {
203+
return `${workbenchId}/${worksapce}/${app}`
202204
}
203205

204206
ipcMain.handleNotificationNavigation((notificationParams: NotificationParams) => {
207+
const currentLocation = getCurrentResolvedLocation()
208+
const workspace = currentLocation.path[1]
205209
// Support for new inbox with cardId (card-based)
206210
if (notificationParams.cardId != null) {
207-
const currentLocation = getCurrentResolvedLocation()
208-
navigateToUrl(`${workbenchId}/${currentLocation.path[1]}/${chatId}/${notificationParams.cardId}`)
211+
const objectUri = encodeObjectURI(notificationParams.cardId, card.class.Card)
212+
navigateToUrl(`${workbenchId}/${workspace}/${inboxId}/${objectUri}`)
209213
return
210214
}
211215

216+
const isCommunicationEnabled = getMetadata(communication.metadata.Enabled) ?? false
217+
const app = isCommunicationEnabled ? inboxId : notificationParams.application
218+
212219
// Support for old inbox with objectId + objectClass (legacy)
213220
if (notificationParams.objectId != null && notificationParams.objectClass != null) {
214221
const encodedObjectURI = encodeObjectURI(notificationParams.objectId, notificationParams.objectClass)
215222
const notificationLocation = {
216-
path: [workbenchId, notificationParams.application, notificationId, encodedObjectURI],
223+
path: [workbenchId, workspace, app, encodedObjectURI],
217224
fragment: undefined,
218-
query: {}
225+
query: undefined
219226
}
220227

221228
void resolveLocation(notificationLocation).then((resolvedLocation) => {
222229
if (resolvedLocation?.loc != null) {
223230
navigate(resolvedLocation.loc)
224231
} else {
225-
navigateToUrl(`${workbenchId}/${notificationParams.application}/${notificationId}/${encodedObjectURI}`)
232+
navigateToUrl(`${workbenchId}/${workspace}/${app}/${encodedObjectURI}`)
226233
}
227234
}).catch(() => {
228-
navigateToUrl(getBasicNotificationPath(notificationParams))
235+
navigateToUrl(getBasicNotificationPath(workspace, app))
229236
})
230237
} else {
231238
// Fallback to basic notification navigation
232-
navigateToUrl(getBasicNotificationPath(notificationParams))
239+
navigateToUrl(getBasicNotificationPath(workspace, app))
233240
}
234241
})
235242

desktop/src/ui/notifications.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import workbench, { workbenchId } from '@hcengineering/workbench'
2929
import desktopPreferences, { defaultNotificationPreference } from '@hcengineering/desktop-preferences'
3030
import { activePreferences } from '@hcengineering/desktop-preferences-resources'
3131
import { getDisplayInboxData, InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
32-
import { chatId } from '@hcengineering/chat'
32+
import { inboxId } from '@hcengineering/inbox'
3333
import communication from '@hcengineering/communication'
3434
import { ipcMainExposed } from './typesUtils'
3535

@@ -179,7 +179,7 @@ export function configureNotifications (): void {
179179
notificationHistory.set(notification.id, notification.created.getTime())
180180
electronAPI.sendNotification({
181181
silent: !preferences.playSound,
182-
application: chatId,
182+
application: inboxId,
183183
title: notification.content.title,
184184
body: `${notification.content.senderName}: ${notification.content.shortText}`,
185185
cardId: notification.cardId,

desktop/src/ui/platform.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { viewId } from '@hcengineering/view'
7676
import workbench, { workbenchId } from '@hcengineering/workbench'
7777
import { mailId } from '@hcengineering/mail'
7878
import { chatId } from '@hcengineering/chat'
79+
import { inboxId } from '@hcengineering/inbox'
7980
import { achievementId } from '@hcengineering/achievement'
8081
import communication, { communicationId } from '@hcengineering/communication'
8182
import { emojiId } from '@hcengineering/emoji'
@@ -133,6 +134,7 @@ import '@hcengineering/view-assets'
133134
import '@hcengineering/workbench-assets'
134135
import '@hcengineering/mail-assets'
135136
import '@hcengineering/chat-assets'
137+
import '@hcengineering/inbox-assets'
136138
import '@hcengineering/achievement-assets'
137139
import '@hcengineering/emoji-assets'
138140
import '@hcengineering/media-assets'
@@ -256,6 +258,7 @@ function configureI18n (): void {
256258
addStringsLoader(cardId, async (lang: string) => await import(`@hcengineering/card-assets/lang/${lang}.json`))
257259
addStringsLoader(mailId, async (lang: string) => await import(`@hcengineering/mail-assets/lang/${lang}.json`))
258260
addStringsLoader(chatId, async (lang: string) => await import(`@hcengineering/chat-assets/lang/${lang}.json`))
261+
addStringsLoader(inboxId, async (lang: string) => await import(`@hcengineering/inbox-assets/lang/${lang}.json`))
259262
addStringsLoader(processId, async (lang: string) => await import(`@hcengineering/process-assets/lang/${lang}.json`))
260263
addStringsLoader(achievementId, async (lang: string) => await import(`@hcengineering/achievement-assets/lang/${lang}.json`))
261264
addStringsLoader(communicationId, async (lang: string) => await import(`@hcengineering/communication-assets/lang/${lang}.json`))
@@ -433,6 +436,7 @@ export async function configurePlatform (onWorkbenchConnect?: () => Promise<void
433436
addLocation(surveyId, () => import(/* webpackChunkName: "survey" */ '@hcengineering/survey-resources'))
434437
addLocation(cardId, () => import(/* webpackChunkName: "card" */ '@hcengineering/card-resources'))
435438
addLocation(chatId, () => import(/* webpackChunkName: "chat" */ '@hcengineering/chat-resources'))
439+
addLocation(inboxId, () => import(/* webpackChunkName: "inbox" */ '@hcengineering/inbox-resources'))
436440
addLocation(processId, () => import(/* webpackChunkName: "process" */ '@hcengineering/process-resources'))
437441
addLocation(achievementId, () => import(/* webpackChunkName: "achievement" */ '@hcengineering/achievement-resources'))
438442
addLocation(communicationId, () => import(/* webpackChunkName: "communication" */ '@hcengineering/communication-resources'))

dev/prod/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@
286286
"@hcengineering/ai-assistant": "^0.7.0",
287287
"@hcengineering/ai-assistant-assets": "^0.7.0",
288288
"@hcengineering/ai-assistant-resources": "^0.7.0",
289+
"@hcengineering/inbox": "^0.7.0",
290+
"@hcengineering/inbox-assets": "^0.7.0",
291+
"@hcengineering/inbox-resources": "^0.7.0",
289292
"readable-stream": "^4.7.0",
290293
"svelte": "^4.2.20"
291294
}

dev/prod/src/platform.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ import { mailId } from '@hcengineering/mail'
7373
import { chatId } from '@hcengineering/chat'
7474
import github, { githubId } from '@hcengineering/github'
7575
import { bitrixId } from '@hcengineering/bitrix'
76-
import { achievementId } from '@hcengineering/achievement'
76+
import {inboxId} from '@hcengineering/inbox'
77+
import {achievementId} from '@hcengineering/achievement'
7778
import communication, { communicationId } from '@hcengineering/communication'
7879
import { emojiId } from '@hcengineering/emoji'
7980
import billingPlugin, { billingId } from '@hcengineering/billing'
@@ -129,6 +130,7 @@ import '@hcengineering/media-assets'
129130
import '@hcengineering/view-assets'
130131
import '@hcengineering/workbench-assets'
131132
import '@hcengineering/chat-assets'
133+
import '@hcengineering/inbox-assets'
132134
import '@hcengineering/mail-assets'
133135
import '@hcengineering/github-assets'
134136
import '@hcengineering/achievement-assets'
@@ -387,6 +389,7 @@ function configureI18n (): void {
387389
communicationId,
388390
async (lang: string) => await import(`@hcengineering/communication-assets/lang/${lang}.json`)
389391
)
392+
addStringsLoader(inboxId, async (lang: string) => await import(`@hcengineering/inbox-assets/lang/${lang}.json`))
390393
addStringsLoader(emojiId, async (lang: string) => await import(`@hcengineering/emoji-assets/lang/${lang}.json`))
391394
addStringsLoader(billingId, async (lang: string) => await import(`@hcengineering/billing-assets/lang/${lang}.json`))
392395
addStringsLoader(

models/activity/src/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
type ViewAction,
2424
type ViewActionAvailabilityFunction
2525
} from '@hcengineering/view'
26-
import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'
26+
import { type NotificationGroup } from '@hcengineering/notification'
2727

2828
export default mergeIds(activityId, activity, {
2929
string: {
@@ -44,7 +44,6 @@ export default mergeIds(activityId, activity, {
4444
ids: {
4545
ReactionAddedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
4646
ActivityNotificationGroup: '' as Ref<NotificationGroup>,
47-
AddReactionNotification: '' as Ref<NotificationType>,
4847
AddReactionAction: '' as Ref<Action>,
4948
SaveForLaterAction: '' as Ref<Action>,
5049
RemoveFromLaterAction: '' as Ref<Action>,

models/all/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"@hcengineering/model-emoji": "^0.7.0",
134134
"@hcengineering/model-billing": "^0.7.0",
135135
"@hcengineering/model-huly-mail": "^0.7.0",
136-
"@hcengineering/model-ai-assistant": "^0.7.0"
136+
"@hcengineering/model-ai-assistant": "^0.7.0",
137+
"@hcengineering/model-inbox": "^0.7.0"
137138
}
138139
}

0 commit comments

Comments
 (0)