Skip to content

Commit

Permalink
Fix meeting minutes (#7181)
Browse files Browse the repository at this point in the history
Signed-off-by: Kristina Fefelova <[email protected]>
  • Loading branch information
kristina-fefelova authored Nov 16, 2024
1 parent 430be8c commit bcdfed6
Show file tree
Hide file tree
Showing 62 changed files with 744 additions and 254 deletions.
7 changes: 2 additions & 5 deletions models/activity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,8 @@ export class TDocUpdateMessageViewlet extends TDoc implements DocUpdateMessageVi

@Model(activity.class.ActivityExtension, core.class.Doc, DOMAIN_MODEL)
export class TActivityExtension extends TDoc implements ActivityExtension {
@Prop(TypeRef(core.class.Class), core.string.Class)
@Index(IndexKind.Indexed)
ofClass!: Ref<Class<Doc>>

components!: Record<ActivityExtensionKind, AnyComponent>
ofClass!: Ref<Class<Doc>>
components!: Record<ActivityExtensionKind, { component: AnyComponent, props?: Record<string, any> }>
}

@Model(activity.class.ActivityMessagesFilter, core.class.Doc, DOMAIN_MODEL)
Expand Down
2 changes: 1 addition & 1 deletion models/analytics-collector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: analyticsCollector.class.OnboardingChannel,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc<ActivityMessageControl<OnboardingChannel>>(
Expand Down
10 changes: 5 additions & 5 deletions models/chunter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,27 +273,27 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: chunter.class.Channel,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: chunter.class.DirectMessage,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: activity.class.DocUpdateMessage,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: chunter.class.ChatMessage,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: activity.class.ActivityReference,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

// Indexing
Expand Down
8 changes: 4 additions & 4 deletions models/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,22 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Contact,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Person,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Organization,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Member,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(contact.mixin.Employee, core.class.Class, view.mixin.ObjectFactory, {
Expand Down
4 changes: 2 additions & 2 deletions models/controlled-documents/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: documents.class.DocumentCategory,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(documents.class.DocumentCategory, core.class.Class, view.mixin.ObjectPresenter, {
Expand Down Expand Up @@ -768,7 +768,7 @@ export function defineNotifications (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: documents.class.DocumentComment,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(documents.class.ControlledDocument, core.class.Class, notification.mixin.ClassCollaborators, {
Expand Down
2 changes: 1 addition & 1 deletion models/document/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function defineDocument (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: document.class.Document,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

// Search
Expand Down
2 changes: 1 addition & 1 deletion models/drive/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function defineFile (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: drive.class.File,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

// Search
Expand Down
6 changes: 3 additions & 3 deletions models/inventory/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Product,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Category,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Variant,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(inventory.class.Category, core.class.Class, view.mixin.ObjectPresenter, {
Expand Down
4 changes: 2 additions & 2 deletions models/lead/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: lead.class.Lead,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: lead.class.Funnel,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(lead.class.Funnel, core.class.Class, workbench.mixin.SpaceView, {
Expand Down
3 changes: 2 additions & 1 deletion models/love/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@hcengineering/attachment": "^0.6.14",
"@hcengineering/activity": "^0.6.0",
"@hcengineering/attachment": "^0.6.14",
"@hcengineering/chunter": "^0.6.20",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/core": "^0.6.32",
Expand All @@ -46,6 +46,7 @@
"@hcengineering/notification": "^0.6.23",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/setting": "^0.6.17",
"@hcengineering/time": "^0.6.0",
"@hcengineering/ui": "^0.6.15",
"@hcengineering/view": "^0.6.13",
"@hcengineering/workbench": "^0.6.16"
Expand Down
84 changes: 73 additions & 11 deletions models/love/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import {
DOMAIN_TRANSIENT,
IndexKind,
type Ref,
type CollaborativeDoc
type CollaborativeDoc,
type Doc,
type Timestamp,
type CollectionSize
} from '@hcengineering/core'
import {
type DevicesPreference,
Expand All @@ -37,7 +40,8 @@ import {
type RoomInfo,
type RoomType,
type RoomLanguage,
type MeetingMinutes
type MeetingMinutes,
type MeetingStatus
} from '@hcengineering/love'
import {
type Builder,
Expand All @@ -52,7 +56,9 @@ import {
TypeCollaborativeDoc,
TypeRef,
TypeString,
UX
TypeTimestamp,
UX,
TypeAny
} from '@hcengineering/model'
import calendar, { TEvent } from '@hcengineering/model-calendar'
import core, { TAttachedDoc, TDoc } from '@hcengineering/model-core'
Expand All @@ -66,6 +72,7 @@ import workbench, { WidgetType } from '@hcengineering/workbench'
import activity from '@hcengineering/activity'
import chunter from '@hcengineering/chunter'
import attachment from '@hcengineering/attachment'
import time, { type ToDo, type Todoable } from '@hcengineering/time'

import love from './plugin'

Expand Down Expand Up @@ -107,6 +114,9 @@ export class TRoom extends TDoc implements Room {

@Prop(PropCollection(love.class.MeetingMinutes), love.string.MeetingMinutes)
meetings?: number

@Prop(PropCollection(chunter.class.ChatMessage), activity.string.Messages)
messages?: number
}

@Model(love.class.Office, love.class.Room)
Expand Down Expand Up @@ -184,8 +194,13 @@ export class TMeeting extends TEvent implements Meeting {
}

@Model(love.class.MeetingMinutes, core.class.Doc, DOMAIN_MEETING_MINUTES)
@UX(love.string.MeetingMinutes, love.icon.Cam)
export class TMeetingMinutes extends TAttachedDoc implements MeetingMinutes {
@UX(love.string.MeetingMinutes, love.icon.Cam, undefined, 'createdOn', undefined, love.string.MeetingsMinutes)
export class TMeetingMinutes extends TAttachedDoc implements MeetingMinutes, Todoable {
@Prop(TypeRef(core.class.Doc), love.string.Room, { editor: love.component.MeetingMinutesDocEditor })
@Index(IndexKind.Indexed)
@ReadOnly()
declare attachedTo: Ref<Doc>

@Hidden()
sid!: string

Expand All @@ -197,6 +212,12 @@ export class TMeetingMinutes extends TAttachedDoc implements MeetingMinutes {
@Index(IndexKind.FullText)
description!: CollaborativeDoc

@Prop(TypeAny(love.component.MeetingMinutesStatusPresenter, love.string.Status), love.string.Status, {
editor: love.component.MeetingMinutesStatusPresenter
})
@ReadOnly()
status!: MeetingStatus

@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number

Expand All @@ -205,6 +226,18 @@ export class TMeetingMinutes extends TAttachedDoc implements MeetingMinutes {

@Prop(PropCollection(chunter.class.ChatMessage), activity.string.Messages)
messages?: number

@Prop(TypeTimestamp(), love.string.MeetingStart, { editor: view.component.TimestampPresenter })
@ReadOnly()
@Index(IndexKind.IndexedDsc)
declare createdOn: Timestamp

@Prop(TypeTimestamp(), love.string.MeetingEnd)
@ReadOnly()
meetingEnd?: Timestamp

@Prop(Collection(time.class.ToDo), getEmbeddedLabel('Action Items'))
todos?: CollectionSize<ToDo>
}

export default love
Expand Down Expand Up @@ -418,17 +451,17 @@ export function createModel (builder: Builder): void {

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: love.class.Room,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput, props: { collection: 'messages' } } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: love.class.Office,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput, props: { collection: 'messages' } } }
})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: love.class.MeetingMinutes,
components: { input: chunter.component.ChatMessageInput }
components: { input: { component: chunter.component.ChatMessageInput, props: { collection: 'messages' } } }
})

builder.mixin(love.class.MeetingMinutes, core.class.Class, activity.mixin.ActivityDoc, {})
Expand All @@ -439,6 +472,10 @@ export function createModel (builder: Builder): void {
presenter: love.component.MeetingMinutesPresenter
})

builder.mixin(love.class.Room, core.class.Class, view.mixin.ObjectPresenter, {
presenter: love.component.RoomPresenter
})

builder.mixin(love.class.MeetingMinutes, core.class.Class, view.mixin.CollectionEditor, {
editor: love.component.MeetingMinutesSection
})
Expand Down Expand Up @@ -467,10 +504,11 @@ export function createModel (builder: Builder): void {
descriptor: view.viewlet.Table,
config: [
'',
{ key: 'status', presenter: love.component.MeetingMinutesStatusPresenter, label: love.string.Status },
'createdOn',
'meetingEnd',
{ key: 'messages', displayProps: { key: 'messages', suffix: true } },
{ key: 'transcription', displayProps: { key: 'transcription', suffix: true } },
'modifiedOn',
'modifiedBy'
{ key: 'transcription', displayProps: { key: 'transcription', suffix: true } }
],
configOptions: {
hiddenKeys: ['description'],
Expand All @@ -481,6 +519,26 @@ export function createModel (builder: Builder): void {
love.viewlet.TableMeetingMinutes
)

builder.createDoc(
view.class.Viewlet,
core.space.Model,
{
attachTo: love.class.MeetingMinutes,
descriptor: view.viewlet.Table,
config: [
'',
{ key: 'status', presenter: love.component.MeetingMinutesStatusPresenter, label: love.string.Status },
'createdOn',
'meetingEnd'
],
configOptions: {
sortable: true
},
variant: 'embedded'
},
love.viewlet.TableMeetingMinutesEmbedded
)

builder.createDoc(
view.class.ViewletDescriptor,
core.space.Model,
Expand Down Expand Up @@ -574,4 +632,8 @@ export function createModel (builder: Builder): void {
indexes: [],
searchDisabled: true
})

builder.mixin(love.class.MeetingMinutes, core.class.Class, view.mixin.ObjectPanelFooter, {
editor: love.component.PanelControlBar
})
}
21 changes: 20 additions & 1 deletion models/love/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
import contact from '@hcengineering/contact'
import { type Space, TxOperations, type Ref, makeCollaborativeDoc } from '@hcengineering/core'
import drive from '@hcengineering/drive'
import { RoomAccess, RoomType, createDefaultRooms, isOffice, loveId, type Floor, type Room } from '@hcengineering/love'
import {
MeetingStatus,
RoomAccess,
RoomType,
createDefaultRooms,
isOffice,
loveId,
type Floor,
type Room
} from '@hcengineering/love'
import {
createDefaultSpace,
migrateSpace,
Expand Down Expand Up @@ -142,6 +151,16 @@ export const loveOperation: MigrateOperation = {
}
}
}
},
{
state: 'default-meeting-minutes-status',
func: async (client) => {
await client.update(
DOMAIN_MEETING_MINUTES,
{ status: { $exists: false } },
{ status: MeetingStatus.Finished }
)
}
}
])
},
Expand Down
Loading

0 comments on commit bcdfed6

Please sign in to comment.