diff --git a/models/love/src/index.ts b/models/love/src/index.ts index b185597208..775e5d556b 100644 --- a/models/love/src/index.ts +++ b/models/love/src/index.ts @@ -719,6 +719,12 @@ export function createModel (builder: Builder): void { love.completion.MeetingMinutesCategory ) + // Extensions + builder.createDoc(presentation.class.ComponentPointExtension, core.space.Model, { + extension: contact.extension.EmployeePopupActions, + component: love.component.InviteEmployeeButton + }) + createAttributePresenter( builder, view.component.DateTimePresenter, diff --git a/models/love/src/plugin.ts b/models/love/src/plugin.ts index e7ef324548..1c54922679 100644 --- a/models/love/src/plugin.ts +++ b/models/love/src/plugin.ts @@ -32,7 +32,8 @@ export default mergeIds(loveId, love, { WidgetSwitcher: '' as AnyComponent, RoomLanguageEditor: '' as AnyComponent, MediaPopupItemExt: '' as AnyComponent, - SharingStateIndicator: '' as AnyComponent + SharingStateIndicator: '' as AnyComponent, + InviteEmployeeButton: '' as AnyComponent }, app: { Love: '' as Ref diff --git a/plugins/chunter-resources/src/components/DirectMessageButton.svelte b/plugins/chunter-resources/src/components/DirectMessageButton.svelte index e0cfbff3df..dc10f34e69 100644 --- a/plugins/chunter-resources/src/components/DirectMessageButton.svelte +++ b/plugins/chunter-resources/src/components/DirectMessageButton.svelte @@ -44,12 +44,22 @@ } - +
+ +
+ + diff --git a/plugins/contact-resources/src/components/person/EmployeePreviewPopup.svelte b/plugins/contact-resources/src/components/person/EmployeePreviewPopup.svelte index e2989784e9..c94722ad8a 100644 --- a/plugins/contact-resources/src/components/person/EmployeePreviewPopup.svelte +++ b/plugins/contact-resources/src/components/person/EmployeePreviewPopup.svelte @@ -133,12 +133,10 @@
{#if !disabled}
-
- -
+
diff --git a/plugins/love-assets/assets/icons.svg b/plugins/love-assets/assets/icons.svg index 8d16937101..798e12b651 100644 --- a/plugins/love-assets/assets/icons.svg +++ b/plugins/love-assets/assets/icons.svg @@ -82,10 +82,8 @@ - - - - + + diff --git a/plugins/love-resources/package.json b/plugins/love-resources/package.json index 99783a4f51..a2782eea1e 100644 --- a/plugins/love-resources/package.json +++ b/plugins/love-resources/package.json @@ -64,6 +64,7 @@ "@hcengineering/emoji": "^0.6.0", "@hcengineering/emoji-resources": "^0.6.0", "@hcengineering/theme": "^0.6.5", + "@hcengineering/account-client": "^0.6.0", "@livekit/krisp-noise-filter": "^0.3.0", "@livekit/track-processors": "^0.5.6", "livekit-client": "^2.15.6", diff --git a/plugins/love-resources/src/components/EditRoom.svelte b/plugins/love-resources/src/components/EditRoom.svelte index b5a941e7e0..e079c67960 100644 --- a/plugins/love-resources/src/components/EditRoom.svelte +++ b/plugins/love-resources/src/components/EditRoom.svelte @@ -19,9 +19,10 @@ import { IntlString } from '@hcengineering/platform' import love from '../plugin' - import { getRoomName, tryConnect } from '../utils' - import { infos, invites, myInfo, myRequests, selectedRoomPlace, myOffice, currentRoom } from '../stores' + import { getRoomName } from '../utils' + import { infos, myOffice, currentRoom } from '../stores' import { lkSessionConnected } from '../liveKitClient' + import { createMeeting, joinMeeting } from '../meetings' export let object: Room @@ -38,21 +39,14 @@ dispatch('open', { ignoreKeys: ['name'] }) }) - let tryConnecting = false + const tryConnecting = false async function connect (): Promise { - tryConnecting = true - const place = $selectedRoomPlace - await tryConnect( - $myInfo, - object, - $infos, - $myRequests, - $invites, - place?._id === object._id ? { x: place.x, y: place.y } : undefined - ) - tryConnecting = false - selectedRoomPlace.set(undefined) + if ($infos.some(({ room }) => room === object._id)) { + await joinMeeting(object) + } else { + await createMeeting(object) + } } $: connecting = tryConnecting || ($currentRoom?._id === object._id && !$lkSessionConnected) diff --git a/plugins/love-resources/src/components/Hall.svelte b/plugins/love-resources/src/components/Hall.svelte index 88437afec3..b57f95339e 100644 --- a/plugins/love-resources/src/components/Hall.svelte +++ b/plugins/love-resources/src/components/Hall.svelte @@ -15,22 +15,10 @@
diff --git a/plugins/love-resources/src/components/Main.svelte b/plugins/love-resources/src/components/Main.svelte index 27d7e6703b..ae87fec615 100644 --- a/plugins/love-resources/src/components/Main.svelte +++ b/plugins/love-resources/src/components/Main.svelte @@ -14,15 +14,8 @@ -->
diff --git a/plugins/love-resources/src/components/MediaPopupItemExt.svelte b/plugins/love-resources/src/components/MediaPopupItemExt.svelte index fe7d6c0cd9..a02a2119c6 100644 --- a/plugins/love-resources/src/components/MediaPopupItemExt.svelte +++ b/plugins/love-resources/src/components/MediaPopupItemExt.svelte @@ -1,14 +1,14 @@
@@ -22,7 +20,7 @@ label={love.string.Kick} icon={love.icon.Kick} action={() => { - kick(person, $rooms, $infos) + void kick(person) }} /> {/if} @@ -32,7 +30,7 @@ label={love.string.Invite} icon={love.icon.Invite} action={() => { - invite(person, $myInfo?.room) + void sendInvites([person]) }} /> {#if room.access === RoomAccess.Knock} @@ -41,7 +39,7 @@ label={love.string.KnockAction} icon={love.icon.Knock} action={() => { - tryConnect($myInfo, room, info, $myRequests, $invites) + void joinMeeting(room) }} /> {/if} diff --git a/plugins/love-resources/src/components/Room.svelte b/plugins/love-resources/src/components/Room.svelte index a1c769a54e..ff7c0bff19 100644 --- a/plugins/love-resources/src/components/Room.svelte +++ b/plugins/love-resources/src/components/Room.svelte @@ -13,21 +13,19 @@ // limitations under the License. -->
@@ -11,8 +12,8 @@ on={$isShareWithSound} on:change={(e) => { $isShareWithSound = e.detail - if ($isSharingEnabled) { - void liveKitClient.setScreenShareEnabled($isSharingEnabled, e.detail) + if ($screenSharingState === ScreenSharingState.Local) { + void liveKitClient.setScreenShareEnabled(true, e.detail) } }} /> diff --git a/plugins/love-resources/src/components/SharingStateIndicator.svelte b/plugins/love-resources/src/components/SharingStateIndicator.svelte index 5aab12e21e..c605160954 100644 --- a/plugins/love-resources/src/components/SharingStateIndicator.svelte +++ b/plugins/love-resources/src/components/SharingStateIndicator.svelte @@ -16,13 +16,12 @@ import { tooltip, eventToHTMLElement, showPopup } from '@hcengineering/ui' import love from '../plugin' - import { isSharingEnabled, isShareWithSound, screenSharing, liveKitClient } from '../utils' + import { isShareWithSound, liveKitClient } from '../utils' import SharingStatePopup from './SharingStatePopup.svelte' import IconShare from './icons/Share.svelte' - import { lkSessionConnected } from '../liveKitClient' + import { lkSessionConnected, ScreenSharingState, screenSharingState } from '../liveKitClient' - let disabled: boolean = false let pressed: boolean = false function handleShowPopup (ev: MouseEvent): void { @@ -33,15 +32,13 @@ } function handleShare (): void { - if (disabled) return + if ($screenSharingState !== ScreenSharingState.Inactive) return void liveKitClient.setScreenShareEnabled(true, $isShareWithSound) } - - $: disabled = !$screenSharing && !$lkSessionConnected {#if $lkSessionConnected} - {#if $isSharingEnabled} + {#if $screenSharingState === ScreenSharingState.Local}