mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 14:55:31 +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 { Analytics } from '@hcengineering/analytics'
|
||||||
import calendar, { type Event, getAllEvents } from '@hcengineering/calendar'
|
import calendar, { type Event, getAllEvents } from '@hcengineering/calendar'
|
||||||
import contact, { getName, type Person, type PersonAccount } from '@hcengineering/contact'
|
import contact, { getName, type Person, type PersonAccount } from '@hcengineering/contact'
|
||||||
|
import { personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import core, {
|
import core, {
|
||||||
AccountRole,
|
AccountRole,
|
||||||
concatLink,
|
concatLink,
|
||||||
@ -645,7 +646,7 @@ async function openMeetingMinutes (room: Room): Promise<void> {
|
|||||||
attachedToClass: room._class,
|
attachedToClass: room._class,
|
||||||
collection: 'meetings',
|
collection: 'meetings',
|
||||||
space: core.space.Workspace,
|
space: core.space.Workspace,
|
||||||
title: `${room.name} ${date}`,
|
title: `${getRoomName(room, get(personByIdStore))} ${date}`,
|
||||||
description: makeCollaborativeDoc(_id, 'description'),
|
description: makeCollaborativeDoc(_id, 'description'),
|
||||||
status: MeetingStatus.Active,
|
status: MeetingStatus.Active,
|
||||||
modifiedBy: getCurrentAccount()._id,
|
modifiedBy: getCurrentAccount()._id,
|
||||||
|
@ -34,9 +34,11 @@ import love, {
|
|||||||
loveId,
|
loveId,
|
||||||
MeetingMinutes,
|
MeetingMinutes,
|
||||||
MeetingStatus,
|
MeetingStatus,
|
||||||
|
Office,
|
||||||
ParticipantInfo,
|
ParticipantInfo,
|
||||||
RequestStatus,
|
RequestStatus,
|
||||||
RoomAccess
|
RoomAccess,
|
||||||
|
RoomInfo
|
||||||
} from '@hcengineering/love'
|
} from '@hcengineering/love'
|
||||||
import notification from '@hcengineering/notification'
|
import notification from '@hcengineering/notification'
|
||||||
import { getMetadata, translate } from '@hcengineering/platform'
|
import { getMetadata, translate } from '@hcengineering/platform'
|
||||||
@ -241,6 +243,15 @@ async function setDefaultRoomAccess (info: ParticipantInfo, control: TriggerCont
|
|||||||
return res
|
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 (
|
async function finishMeetingMinutes (
|
||||||
info: ParticipantInfo,
|
info: ParticipantInfo,
|
||||||
control: TriggerControl,
|
control: TriggerControl,
|
||||||
@ -254,7 +265,7 @@ async function finishMeetingMinutes (
|
|||||||
return res
|
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) {
|
if (currentPersons.length === 0) {
|
||||||
const meetingMinutes = await control.findAll(control.ctx, love.class.MeetingMinutes, {
|
const meetingMinutes = await control.findAll(control.ctx, love.class.MeetingMinutes, {
|
||||||
|
Loading…
Reference in New Issue
Block a user