mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-21 06:52:33 +00:00
Show control bar only for active meeting
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
ff68b604e3
commit
e1659e90a1
@ -608,10 +608,6 @@ export function createModel (builder: Builder): void {
|
||||
searchDisabled: true
|
||||
})
|
||||
|
||||
builder.mixin(love.class.Room, core.class.Class, view.mixin.ObjectPanelFooter, {
|
||||
editor: love.component.PanelControlBar
|
||||
})
|
||||
|
||||
builder.mixin(love.class.MeetingMinutes, core.class.Class, view.mixin.ObjectPanelFooter, {
|
||||
editor: love.component.PanelControlBar
|
||||
})
|
||||
|
@ -14,22 +14,15 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { location, Location } from '@hcengineering/ui'
|
||||
import { loveId, Room, Office } from '@hcengineering/love'
|
||||
import { MeetingMinutes } from '@hcengineering/love'
|
||||
|
||||
import ControlBar from './ControlBar.svelte'
|
||||
import { isConnected } from '../utils'
|
||||
import { currentRoom, myOffice } from '../stores'
|
||||
import { currentRoom, currentMeetingMinutes } from '../stores'
|
||||
|
||||
function showControlBar (room: Room, loc: Location, myOffice?: Office): boolean {
|
||||
if (loc.path[2] !== loveId) return false
|
||||
if (room._id !== myOffice?._id) return true
|
||||
|
||||
return $isConnected
|
||||
}
|
||||
export let object: MeetingMinutes
|
||||
</script>
|
||||
|
||||
{#if $currentRoom && showControlBar($currentRoom, $location, $myOffice)}
|
||||
{#if $currentRoom && $currentMeetingMinutes?._id === object._id}
|
||||
<div class="flex-grow flex-shrink">
|
||||
<ControlBar room={$currentRoom} />
|
||||
</div>
|
||||
|
@ -43,7 +43,7 @@
|
||||
import { getObjectLinkFragment } from '@hcengineering/view-resources'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import love from '../plugin'
|
||||
import { currentRoom, infos, invites, myInfo, myOffice, myRequests, meetingMinutesStore } from '../stores'
|
||||
import { currentRoom, infos, invites, myInfo, myOffice, myRequests, currentMeetingMinutes } from '../stores'
|
||||
import {
|
||||
getRoomName,
|
||||
isCameraEnabled,
|
||||
@ -109,7 +109,7 @@
|
||||
}
|
||||
|
||||
async function back (): Promise<void> {
|
||||
const meetingMinutes = $meetingMinutesStore
|
||||
const meetingMinutes = $currentMeetingMinutes
|
||||
if (meetingMinutes !== undefined) {
|
||||
const hierarchy = client.getHierarchy()
|
||||
const panelComponent = hierarchy.classHierarchyMixin(
|
||||
|
@ -24,7 +24,7 @@
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
import love from '../plugin'
|
||||
import { myInfo, selectedRoomPlace, currentRoom, meetingMinutesStore } from '../stores'
|
||||
import { myInfo, selectedRoomPlace, currentRoom, currentMeetingMinutes } from '../stores'
|
||||
import { getRoomLabel, lk } from '../utils'
|
||||
import PersonActionPopup from './PersonActionPopup.svelte'
|
||||
import RoomLanguage from './RoomLanguage.svelte'
|
||||
@ -70,7 +70,7 @@
|
||||
if ($currentRoom?._id === room._id) {
|
||||
const sid = await lk.getSid()
|
||||
const meetingMinutes =
|
||||
get(meetingMinutesStore) ?? (await client.findOne(love.class.MeetingMinutes, { sid, attachedTo: room._id }))
|
||||
get(currentMeetingMinutes) ?? (await client.findOne(love.class.MeetingMinutes, { sid, attachedTo: room._id }))
|
||||
if (meetingMinutes === undefined) {
|
||||
await openDoc(hierarchy, room)
|
||||
} else {
|
||||
|
@ -21,7 +21,7 @@
|
||||
import love from '../../plugin'
|
||||
import VideoTab from './VideoTab.svelte'
|
||||
import { isCurrentInstanceConnected, lk } from '../../utils'
|
||||
import { currentRoom, meetingMinutesStore } from '../../stores'
|
||||
import { currentRoom, currentMeetingMinutes } from '../../stores'
|
||||
import ChatTab from './ChatTab.svelte'
|
||||
import TranscriptionTab from './TranscriptionTab.svelte'
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
meetingQuery.query(love.class.MeetingMinutes, { sid, attachedTo: room._id }, async (res) => {
|
||||
meetingMinutes = res[0]
|
||||
if (meetingMinutes) {
|
||||
meetingMinutesStore.set(meetingMinutes)
|
||||
currentMeetingMinutes.set(meetingMinutes)
|
||||
}
|
||||
isMeetingMinutesLoaded = true
|
||||
})
|
||||
|
@ -60,7 +60,7 @@ export const activeInvites = derived(invites, (val) => {
|
||||
export const myPreferences = writable<DevicesPreference | undefined>()
|
||||
export let $myPreferences: DevicesPreference | undefined
|
||||
|
||||
export const meetingMinutesStore = writable<MeetingMinutes | undefined>(undefined)
|
||||
export const currentMeetingMinutes = writable<MeetingMinutes | undefined>(undefined)
|
||||
export const selectedRoomPlace = writable<{ _id: Ref<Room>, x: number, y: number } | undefined>(undefined)
|
||||
|
||||
function filterParticipantInfo (value: ParticipantInfo[]): ParticipantInfo[] {
|
||||
|
@ -82,7 +82,7 @@ import { openDoc } from '@hcengineering/view-resources'
|
||||
|
||||
import { sendMessage } from './broadcast'
|
||||
import love from './plugin'
|
||||
import { $myPreferences, currentRoom, meetingMinutesStore, selectedRoomPlace } from './stores'
|
||||
import { $myPreferences, currentRoom, currentMeetingMinutes, selectedRoomPlace } from './stores'
|
||||
import RoomSettingsPopup from './components/RoomSettingsPopup.svelte'
|
||||
|
||||
export const selectedCamId = 'selectedDevice_cam'
|
||||
@ -478,7 +478,7 @@ function closeMeetingMinutes (): void {
|
||||
const loc = getCurrentLocation()
|
||||
|
||||
if (loc.path[2] === loveId) {
|
||||
const meetingMinutes = get(meetingMinutesStore)
|
||||
const meetingMinutes = get(currentMeetingMinutes)
|
||||
const panel = get(panelstore).panel
|
||||
const { _id } = panel ?? {}
|
||||
|
||||
@ -486,7 +486,7 @@ function closeMeetingMinutes (): void {
|
||||
closePanel()
|
||||
}
|
||||
}
|
||||
meetingMinutesStore.set(undefined)
|
||||
currentMeetingMinutes.set(undefined)
|
||||
}
|
||||
|
||||
export async function setCam (value: boolean): Promise<void> {
|
||||
@ -660,13 +660,13 @@ async function openMeetingMinutes (room: Room): Promise<void> {
|
||||
{ sid, title: newDoc.title, description: newDoc.description, status: newDoc.status },
|
||||
_id
|
||||
)
|
||||
meetingMinutesStore.set(newDoc)
|
||||
currentMeetingMinutes.set(newDoc)
|
||||
const loc = getCurrentLocation()
|
||||
if (loc.path[2] === loveId) {
|
||||
await openDoc(client.getHierarchy(), newDoc)
|
||||
}
|
||||
} else {
|
||||
meetingMinutesStore.set(doc)
|
||||
currentMeetingMinutes.set(doc)
|
||||
const loc = getCurrentLocation()
|
||||
if (loc.path[2] === loveId) {
|
||||
await openDoc(client.getHierarchy(), doc)
|
||||
|
Loading…
Reference in New Issue
Block a user