Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions models/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@hcengineering/converter": "workspace:^0.7.0",
"@hcengineering/core": "workspace:^0.7.24",
"@hcengineering/model": "workspace:^0.7.17",
"@hcengineering/notification": "workspace:^0.7.0",
"@hcengineering/model-notification": "workspace:^0.7.0",
"@hcengineering/chunter": "workspace:^0.7.0",
"@hcengineering/model-setting": "workspace:^0.7.0",
"@hcengineering/model-view": "workspace:^0.7.0",
Expand Down
45 changes: 45 additions & 0 deletions models/card/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import { type BuildModelKey } from '@hcengineering/view'
import { createActions } from './actions'
import { definePermissions } from './permissions'
import card from './plugin'
import notification from '@hcengineering/notification'

export { cardId } from '@hcengineering/card'

Expand Down Expand Up @@ -149,6 +150,9 @@ export class TCard extends TDoc implements Card {
@Hidden()
@ReadOnly()
peerId?: string

@Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number
}

@Model(card.class.CardSpace, core.class.TypedSpace, DOMAIN_SPACE)
Expand Down Expand Up @@ -445,6 +449,47 @@ export function createModel (builder: Builder): void {
PaletteColorIndexes.Arctic
)

builder.createDoc(
notification.class.NotificationGroup,
core.space.Model,
{
label: card.string.Card,
icon: card.icon.Card
},
card.ids.CardNotificationGroup
)

builder.createDoc(
notification.class.NotificationType,
core.space.Model,
{
hidden: false,
generated: false,
label: card.string.CardUpdated,
group: card.ids.CardNotificationGroup,
txClasses: [core.class.TxUpdateDoc, core.class.TxMixin],
objectClass: card.class.Card,
defaultEnabled: false
},
card.ids.CardNotification
)

builder.createDoc(
notification.class.NotificationType,
core.space.Model,
{
hidden: false,
generated: false,
label: chunter.string.Comments,
group: card.ids.CardNotificationGroup,
txClasses: [core.class.TxCreateDoc],
objectClass: chunter.class.ChatMessage,
attachedToClass: card.class.Card,
defaultEnabled: true
},
card.ids.CardMessageNotification
)

builder.createDoc(view.class.Viewlet, core.space.Model, {
attachTo: card.class.CardSpace,
descriptor: view.viewlet.Table,
Expand Down
6 changes: 5 additions & 1 deletion models/card/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { type TagCategory } from '@hcengineering/tags'
import { type Location, type ResolvedLocation } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type LocationData } from '@hcengineering/workbench'
import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'

export default mergeIds(cardId, card, {
app: {
Expand All @@ -46,7 +47,10 @@ export default mergeIds(cardId, card, {
ids: {
MasterTags: '' as Ref<Doc>,
ManageMasterTags: '' as Ref<Doc>,
TagRelations: '' as Ref<Doc>
TagRelations: '' as Ref<Doc>,
CardNotificationGroup: '' as Ref<NotificationGroup>,
CardNotification: '' as Ref<NotificationType>,
CardMessageNotification: '' as Ref<NotificationType>
},
resolver: {
Location: '' as Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>,
Expand Down
1 change: 1 addition & 0 deletions models/server-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@hcengineering/platform": "workspace:^0.7.19",
"@hcengineering/card": "workspace:^0.7.0",
"@hcengineering/communication": "workspace:^0.7.0",
"@hcengineering/server-notification": "workspace:^0.7.0",
"@hcengineering/server-card": "workspace:^0.7.0",
"@hcengineering/server-core": "workspace:^0.7.18"
}
Expand Down
5 changes: 5 additions & 0 deletions models/server-card/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import serverCore from '@hcengineering/server-core'
import serverCard from '@hcengineering/server-card'
import card from '@hcengineering/card'
import communication from '@hcengineering/communication'
import serverNotification from '@hcengineering/server-notification'

export { serverCardId } from '@hcengineering/server-card'

Expand Down Expand Up @@ -129,4 +130,8 @@ export function createModel (builder: Builder): void {
},
title: [['title']]
})

builder.mixin(card.class.Card, core.class.Class, serverNotification.mixin.TextPresenter, {
presenter: serverCard.function.CardTextPresenter
})
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Chcete vytvořit novou verzi?",
"RelationCopyDescr": "Které vztahy chcete zkopírovat?",
"Import": "Importovat",
"Export": "Exportovat"
"Export": "Exportovat",
"CardUpdated": "Karta aktualizována"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Möchten Sie eine neue Version erstellen?",
"RelationCopyDescr": "Welche Beziehungen möchten Sie kopieren?",
"Import": "Importieren",
"Export": "Exportieren"
"Export": "Exportieren",
"CardUpdated": "Karte aktualisiert"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Do you want to create a new version?",
"RelationCopyDescr": "Which relations do you want to copy?",
"Import": "Import",
"Export": "Export"
"Export": "Export",
"CardUpdated": "Card updated"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "¿Desea crear una nueva versión?",
"RelationCopyDescr": "¿Qué relaciones quieres copiar?",
"Import": "Importar",
"Export": "Exportar"
"Export": "Exportar",
"CardUpdated": "Tarjeta actualizada"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Voulez-vous créer une nouvelle version ?",
"RelationCopyDescr": "Quelles relations souhaitez-vous copier ?",
"Import": "Importer",
"Export": "Exporter"
"Export": "Exporter",
"CardUpdated": "Carte mise à jour"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Vuoi creare una nuova versione?",
"RelationCopyDescr": "Quali relazioni vuoi copiare?",
"Import": "Importa",
"Export": "Esporta"
"Export": "Esporta",
"CardUpdated": "Scheda aggiornata"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "新しいバージョンを作成しますか?",
"RelationCopyDescr": "どの関連をコピーしますか?",
"Import": "インポート",
"Export": "エクスポート"
"Export": "エクスポート",
"CardUpdated": "カードが更新されました"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Deseja criar uma nova versão?",
"RelationCopyDescr": "Quais relações você deseja copiar?",
"Import": "Importar",
"Export": "Exportar"
"Export": "Exportar",
"CardUpdated": "Cartão atualizado"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Deseja criar uma nova versão?",
"RelationCopyDescr": "Quais relações você deseja copiar?",
"Import": "Importar",
"Export": "Exportar"
"Export": "Exportar",
"CardUpdated": "Cartão atualizado"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Вы хотите создать новую версию?",
"RelationCopyDescr": "Какие связи вы хотите скопировать?",
"Import": "Импортировать",
"Export": "Экспортировать"
"Export": "Экспортировать",
"CardUpdated": "Карточка обновлена"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "Yeni bir sürüm oluşturmak istiyor musunuz?",
"RelationCopyDescr": "Hangi ilişkileri kopyalamak istiyorsunuz?",
"Import": "İçe aktar",
"Export": "Dışa aktar"
"Export": "Dışa aktar",
"CardUpdated": "Kart güncellendi"
}
}
3 changes: 2 additions & 1 deletion plugins/card-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"NewVersionConfirmation": "您想创建一个新版本吗?",
"RelationCopyDescr": "您想复制哪些关系?",
"Import": "导入",
"Export": "导出"
"Export": "导出",
"CardUpdated": "卡片已更新"
}
}
3 changes: 2 additions & 1 deletion plugins/card-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default mergeIds(cardId, card, {
ForbidUpdateCard: '' as IntlString,
ForbidCreateCardPermission: '' as IntlString,
ForbidAddTagPermission: '' as IntlString,
ForbidRemoveTag: '' as IntlString
ForbidRemoveTag: '' as IntlString,
CardUpdated: '' as IntlString
}
})
9 changes: 9 additions & 0 deletions server-plugins/card-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,17 @@ export async function OnCardTag (ctx: TxMixin<Card, Card>[], control: TriggerCon
return res
}

export async function CardTextPresenter (doc: Doc): Promise<string> {
const card = doc as Card

return card.title
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default async () => ({
function: {
CardTextPresenter
},
trigger: {
OnAttribute,
OnAttributeRemove,
Expand Down
1 change: 1 addition & 0 deletions server-plugins/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"dependencies": {
"@hcengineering/core": "workspace:^0.7.24",
"@hcengineering/server-notification": "workspace:^0.7.0",
"@hcengineering/server-core": "workspace:^0.7.18",
"@hcengineering/platform": "workspace:^0.7.19"
}
Expand Down
4 changes: 4 additions & 0 deletions server-plugins/card/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import type { Metadata, Plugin, Resource } from '@hcengineering/platform'
import { plugin } from '@hcengineering/platform'
import type { TriggerFunc } from '@hcengineering/server-core'
import { type Presenter } from '@hcengineering/server-notification'

/**
* @public
Expand All @@ -29,6 +30,9 @@ export default plugin(serverCardId, {
metadata: {
CommunicationEnabled: '' as Metadata<boolean>
},
function: {
CardTextPresenter: '' as Resource<Presenter>
},
trigger: {
OnAttribute: '' as Resource<TriggerFunc>,
OnAttributeRemove: '' as Resource<TriggerFunc>,
Expand Down
9 changes: 6 additions & 3 deletions server-plugins/notification-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,13 @@ function getMatchedTypes (
isSpace: boolean,
field?: string
): NotificationType[] {
const allTypes = control.modelDb
.findAllSync(notification.class.NotificationType, { ...(field !== undefined ? { field } : {}) })
.filter((p) => (isSpace ? p.spaceSubscribe === true : p.spaceSubscribe !== true))
const filtered: NotificationType[] = []
let allTypes: NotificationType[] = control.modelDb.findAllSync(notification.class.NotificationType, {})
allTypes = allTypes.filter(
(p) =>
(isSpace ? p.spaceSubscribe === true : p.spaceSubscribe !== true) &&
(field === undefined || p.field === field || p.field === undefined)
)
for (const type of allTypes) {
if (isTypeMatched(control, type, tx, isOwn)) {
filtered.push(type)
Expand Down
Loading