platform/models/chat/src/index.ts
Kristina 19ea34f260
Use createSystemType for thread, channel (#8423)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
2025-04-01 23:23:37 +07:00

60 lines
1.9 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 { AccountRole } from '@hcengineering/core'
import { type Builder } from '@hcengineering/model'
import core from '@hcengineering/model-core'
import workbench from '@hcengineering/model-workbench'
import { chatId } from '@hcengineering/chat'
import { WidgetType } from '@hcengineering/workbench'
import { createSystemType } from '@hcengineering/model-card'
import chat from './plugin'
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,
accessLevel: AccountRole.User,
hidden: true,
component: chat.component.ChatApplication
},
chat.app.Chat
)
builder.createDoc(
workbench.class.Widget,
core.space.Model,
{
label: chat.string.Chat,
type: WidgetType.Flexible,
icon: chat.icon.ChatBubble,
component: chat.component.ChatWidget
},
chat.ids.ChatWidget
)
createSystemType(builder, chat.masterTag.Thread, chat.icon.Thread, chat.string.Thread, chat.string.Threads)
createSystemType(builder, chat.masterTag.Channel, chat.icon.Channel, chat.string.Channel, chat.string.Channels)
}