Files
huly-platform/models/chat/src/index.ts
T
Artyom SavchenkoandGitHub 34ef726724 UBERF-13433: Migrate channels to threads (#9761)
* UBERF-13433: Migrate from channels to threads

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-13433: Migrate parent info

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-13433: Use client traverse

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-13433: Add tests

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* UBERF-13433: Support Jest in model packages

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* Revert "UBERF-13433: Support Jest in model packages"

This reverts commit 415f5916c9.

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* Revert "UBERF-13433: Add tests"

This reverts commit 38d7fcd794.

Signed-off-by: Artem Savchenko <armisav@gmail.com>

---------

Signed-off-by: Artem Savchenko <armisav@gmail.com>
2025-09-03 12:44:45 +07:00

68 lines
2.1 KiB
TypeScript

//
// Copyright © 2025 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { type Builder } from '@hcengineering/model'
import core from '@hcengineering/model-core'
import workbench from '@hcengineering/model-workbench'
import { chatId } from '@hcengineering/chat'
import { createSystemType } from '@hcengineering/model-card'
import communication, { MessagesNavigationAnchors } from '@hcengineering/communication'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
import chat from './plugin'
import { AccountRole } from '@hcengineering/core'
export { chatId } from '@hcengineering/chat'
export { chatOperation } from './migration'
export default chat
export function createModel (builder: Builder): void {
builder.createDoc(
workbench.class.Application,
core.space.Model,
{
label: chat.string.Chat,
icon: chat.icon.ChatBubble,
alias: chatId,
hidden: false,
component: chat.component.ChatApplication,
locationResolver: chat.resolver.Location,
locationDataResolver: chat.resolver.LocationData,
type: 'cards',
position: 'top',
order: 200
},
chat.app.Chat
)
// TODO: move types to communication-plugin
createSystemType(
builder,
chat.masterTag.Thread,
chat.icon.Thread,
chat.string.Thread,
chat.string.Threads,
{
defaultSection: communication.ids.CardMessagesSection,
defaultNavigation: MessagesNavigationAnchors.LatestMessages
},
PaletteColorIndexes.Houseplant
)
builder.mixin(chat.masterTag.Thread, core.class.Class, core.mixin.TxAccessLevel, {
updateAccessLevel: AccountRole.Guest
})
}