Skip to content

Commit 3aba55d

Browse files
committed
Add ability to enable camera in personal office
The camera in the personal office is turned off by default, but users now have the option to enable it in their office Signed-off-by: Anton Alexeyev <[email protected]>
1 parent 95a2ba3 commit 3aba55d

File tree

5 files changed

+58
-5
lines changed

5 files changed

+58
-5
lines changed

models/love/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ export class TRoom extends TDoc implements Room {
9696
@Index(IndexKind.FullText)
9797
description!: MarkupBlobRef | null
9898

99-
type!: RoomType
99+
@Prop(TypeAny(love.component.RoomTypePresenter, love.string.Video), love.string.Video, {
100+
editor: love.component.RoomTypePresenter
101+
})
102+
type!: RoomType
100103

101104
access!: RoomAccess
102105

plugins/love-resources/src/components/EditRoom.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414
-->
1515
<script lang="ts">
16-
import { EditBox, ModernButton } from '@hcengineering/ui'
17-
import { Room, isOffice, type ParticipantInfo } from '@hcengineering/love'
16+
import { EditBox, Icon, ModernButton } from '@hcengineering/ui'
17+
import { Room, isOffice, type ParticipantInfo, RoomType } from '@hcengineering/love'
1818
import { createEventDispatcher, onMount } from 'svelte'
1919
import { personByIdStore } from '@hcengineering/contact-resources'
2020
import { IntlString } from '@hcengineering/platform'
@@ -95,6 +95,7 @@
9595

9696
<div class="flex-row-stretch">
9797
<div class="row flex-grow">
98+
<Icon icon={object.type === RoomType.Video ? love.icon.CamEnabled : love.icon.CamDisabled} size={'small'} />
9899
<div class="name">
99100
<EditBox disabled={true} placeholder={love.string.Room} bind:value={roomName} focusIndex={1} />
100101
</div>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--
2+
// Copyright © 2025 Hardcore Engineering Inc.
3+
//
4+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License. You may
6+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
//
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
-->
15+
<script lang="ts">
16+
import { Office, Room, RoomType } from '@hcengineering/love'
17+
import { BooleanEditor } from '@hcengineering/view-resources'
18+
import { getCurrentEmployee } from '@hcengineering/contact'
19+
import type { ButtonKind, ButtonSize } from '@hcengineering/ui'
20+
21+
export let object: Room | undefined
22+
export let value: RoomType | undefined
23+
export let onChange: (value: any) => void
24+
export let kind: ButtonKind = 'no-border'
25+
export let size: ButtonSize = 'small'
26+
export let justify: 'left' | 'center' = 'center'
27+
export let width: string | undefined = 'fit-content'
28+
29+
$: booleanValue = value === RoomType.Video
30+
$: disabled = object === undefined || !('person' in object) || (object as Office).person !== getCurrentEmployee()
31+
32+
function onValueChanged (newValue: any): void {
33+
onChange(newValue === true ? RoomType.Video : RoomType.Audio)
34+
}
35+
</script>
36+
37+
<BooleanEditor
38+
{disabled}
39+
{kind}
40+
{size}
41+
{justify}
42+
{width}
43+
value={booleanValue}
44+
withoutUndefined={true}
45+
onChange={onValueChanged}
46+
/>

plugins/love-resources/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import MediaPopupItemExt from './components/MediaPopupItemExt.svelte'
2828
import SharingStateIndicator from './components/SharingStateIndicator.svelte'
2929
import MeetingScheduleData from './components/MeetingScheduleData.svelte'
3030
import EditMeetingScheduleData from './components/EditMeetingScheduleData.svelte'
31+
import RoomTypePresenter from './components/RoomTypePresenter.svelte'
3132

3233
import {
3334
copyGuestLink,
@@ -71,7 +72,8 @@ export default async (): Promise<Resources> => ({
7172
MediaPopupItemExt,
7273
SharingStateIndicator,
7374
MeetingScheduleData,
74-
EditMeetingScheduleData
75+
EditMeetingScheduleData,
76+
RoomTypePresenter
7577
},
7678
function: {
7779
CreateMeeting: createMeeting,

plugins/love-resources/src/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export default mergeIds(loveId, love, {
3636
MeetingMinutesDocEditor: '' as AnyComponent,
3737
MeetingMinutesStatusPresenter: '' as AnyComponent,
3838
MeetingScheduleData: '' as AnyComponent,
39-
EditMeetingScheduleData: '' as AnyComponent
39+
EditMeetingScheduleData: '' as AnyComponent,
40+
RoomTypePresenter: '' as AnyComponent
4041
},
4142
function: {
4243
CreateMeeting: '' as Resource<DocCreateFunction>,

0 commit comments

Comments
 (0)