mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
Fix office meeting minutes (#7193)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
46e0f217bf
commit
d4394e8a2a
@ -1,6 +1,7 @@
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import calendar, { type Event, getAllEvents } from '@hcengineering/calendar'
|
||||
import contact, { getName, type Person, type PersonAccount } from '@hcengineering/contact'
|
||||
import { personByIdStore } from '@hcengineering/contact-resources'
|
||||
import core, {
|
||||
AccountRole,
|
||||
concatLink,
|
||||
@ -645,7 +646,7 @@ async function openMeetingMinutes (room: Room): Promise<void> {
|
||||
attachedToClass: room._class,
|
||||
collection: 'meetings',
|
||||
space: core.space.Workspace,
|
||||
title: `${room.name} ${date}`,
|
||||
title: `${getRoomName(room, get(personByIdStore))} ${date}`,
|
||||
description: makeCollaborativeDoc(_id, 'description'),
|
||||
status: MeetingStatus.Active,
|
||||
modifiedBy: getCurrentAccount()._id,
|
||||
|
@ -34,9 +34,11 @@ import love, {
|
||||
loveId,
|
||||
MeetingMinutes,
|
||||
MeetingStatus,
|
||||
Office,
|
||||
ParticipantInfo,
|
||||
RequestStatus,
|
||||
RoomAccess
|
||||
RoomAccess,
|
||||
RoomInfo
|
||||
} from '@hcengineering/love'
|
||||
import notification from '@hcengineering/notification'
|
||||
import { getMetadata, translate } from '@hcengineering/platform'
|
||||
@ -241,6 +243,15 @@ async function setDefaultRoomAccess (info: ParticipantInfo, control: TriggerCont
|
||||
return res
|
||||
}
|
||||
|
||||
async function getRoomActivePersons (control: TriggerControl, roomInfo: RoomInfo): Promise<Ref<Person>[]> {
|
||||
if (roomInfo.isOffice) {
|
||||
const room = (await control.findAll(control.ctx, love.class.Office, { _id: roomInfo.room as Ref<Office> }))[0]
|
||||
|
||||
return roomInfo.persons.filter((p) => p !== room.person)
|
||||
}
|
||||
return roomInfo.persons
|
||||
}
|
||||
|
||||
async function finishMeetingMinutes (
|
||||
info: ParticipantInfo,
|
||||
control: TriggerControl,
|
||||
@ -254,7 +265,7 @@ async function finishMeetingMinutes (
|
||||
return res
|
||||
}
|
||||
|
||||
const currentPersons = roomInfo.persons.filter((p) => p !== info.person)
|
||||
const currentPersons = (await getRoomActivePersons(control, roomInfo)).filter((p) => p !== info.person)
|
||||
|
||||
if (currentPersons.length === 0) {
|
||||
const meetingMinutes = await control.findAll(control.ctx, love.class.MeetingMinutes, {
|
||||
|
Loading…
Reference in New Issue
Block a user