mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00:00
UBERF-5020: fix reply to thread (#4502)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
c89eecc833
commit
b114d142d8
@ -286,7 +286,6 @@ export function createModel (builder: Builder): void {
|
|||||||
hidden: false,
|
hidden: false,
|
||||||
// component: contact.component.ContactsTabs,
|
// component: contact.component.ContactsTabs,
|
||||||
locationResolver: contact.resolver.Location,
|
locationResolver: contact.resolver.Location,
|
||||||
aside: chunter.component.ThreadView,
|
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
spaces: [],
|
spaces: [],
|
||||||
specials: [
|
specials: [
|
||||||
|
@ -148,7 +148,6 @@ export function createModel (builder: Builder): void {
|
|||||||
icon: inventory.icon.InventoryApplication,
|
icon: inventory.icon.InventoryApplication,
|
||||||
alias: inventoryId,
|
alias: inventoryId,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
aside: chunter.component.ThreadView,
|
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
specials: [
|
specials: [
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,6 @@ export function createModel (builder: Builder): void {
|
|||||||
icon: lead.icon.LeadApplication,
|
icon: lead.icon.LeadApplication,
|
||||||
alias: leadId,
|
alias: leadId,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
aside: chunter.component.ThreadView,
|
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
specials: [
|
specials: [
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,6 @@ export function createModel (builder: Builder): void {
|
|||||||
locationResolver: recruit.resolver.Location,
|
locationResolver: recruit.resolver.Location,
|
||||||
alias: recruitId,
|
alias: recruitId,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
aside: chunter.component.ThreadView,
|
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
spaces: [],
|
spaces: [],
|
||||||
specials: [
|
specials: [
|
||||||
|
@ -274,7 +274,6 @@ function defineApplication (
|
|||||||
alias: trackerId,
|
alias: trackerId,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
locationResolver: tracker.resolver.Location,
|
locationResolver: tracker.resolver.Location,
|
||||||
aside: chunter.component.ThreadView,
|
|
||||||
navigatorModel: {
|
navigatorModel: {
|
||||||
specials: [
|
specials: [
|
||||||
{
|
{
|
||||||
|
@ -21,12 +21,19 @@ import chunter, {
|
|||||||
chunterId,
|
chunterId,
|
||||||
type DirectMessage
|
type DirectMessage
|
||||||
} from '@hcengineering/chunter'
|
} from '@hcengineering/chunter'
|
||||||
import { type Data, type Doc, type DocumentQuery, type Ref, type RelatedDocument } from '@hcengineering/core'
|
import {
|
||||||
|
type Data,
|
||||||
|
type Doc,
|
||||||
|
type DocumentQuery,
|
||||||
|
getCurrentAccount,
|
||||||
|
type Ref,
|
||||||
|
type RelatedDocument
|
||||||
|
} from '@hcengineering/core'
|
||||||
import { type IntlString, type Resources, translate } from '@hcengineering/platform'
|
import { type IntlString, type Resources, translate } from '@hcengineering/platform'
|
||||||
import { MessageBox, getClient } from '@hcengineering/presentation'
|
import { MessageBox, getClient } from '@hcengineering/presentation'
|
||||||
import { closePanel, getCurrentLocation, getLocation, navigate, showPopup } from '@hcengineering/ui'
|
import { closePanel, getCurrentLocation, getLocation, navigate, showPopup } from '@hcengineering/ui'
|
||||||
import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity'
|
import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity'
|
||||||
import { type DocNotifyContext, inboxId } from '@hcengineering/notification'
|
import notification, { type DocNotifyContext, inboxId } from '@hcengineering/notification'
|
||||||
|
|
||||||
import ChannelPresenter from './components/ChannelPresenter.svelte'
|
import ChannelPresenter from './components/ChannelPresenter.svelte'
|
||||||
import ChannelView from './components/ChannelView.svelte'
|
import ChannelView from './components/ChannelView.svelte'
|
||||||
@ -201,10 +208,23 @@ export async function deleteChatMessage (message: ChatMessage): Promise<void> {
|
|||||||
|
|
||||||
export async function replyToThread (message: ActivityMessage): Promise<void> {
|
export async function replyToThread (message: ActivityMessage): Promise<void> {
|
||||||
const loc = getCurrentLocation()
|
const loc = getCurrentLocation()
|
||||||
const inboxClient = InboxNotificationsClientImpl.getClient()
|
const client = getClient()
|
||||||
const context = get(inboxClient.docNotifyContextByDoc).get(message.attachedTo)
|
|
||||||
|
|
||||||
if (context === undefined) {
|
const inboxClient = InboxNotificationsClientImpl.getClient()
|
||||||
|
|
||||||
|
let contextId: Ref<DocNotifyContext> | undefined = get(inboxClient.docNotifyContextByDoc).get(message.attachedTo)?._id
|
||||||
|
|
||||||
|
if (contextId === undefined) {
|
||||||
|
contextId = await client.createDoc(notification.class.DocNotifyContext, message.space, {
|
||||||
|
attachedTo: message.attachedTo,
|
||||||
|
attachedToClass: message.attachedToClass,
|
||||||
|
user: getCurrentAccount()._id,
|
||||||
|
hidden: false,
|
||||||
|
lastViewedTimestamp: Date.now()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contextId === undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +232,7 @@ export async function replyToThread (message: ActivityMessage): Promise<void> {
|
|||||||
loc.path[2] = chunterId
|
loc.path[2] = chunterId
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToThread(loc, context._id, message._id)
|
navigateToThread(loc, contextId, message._id)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async (): Promise<Resources> => ({
|
export default async (): Promise<Resources> => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user