diff --git a/models/love/src/index.ts b/models/love/src/index.ts
index a5222eeef7..9457c67b8b 100644
--- a/models/love/src/index.ts
+++ b/models/love/src/index.ts
@@ -275,8 +275,7 @@ export function createModel (builder: Builder): void {
label: love.string.Office,
type: WidgetType.Fixed,
icon: love.icon.Love,
- component: love.component.LoveWidget,
- headerLabel: love.string.Office
+ component: love.component.LoveWidget
},
love.ids.LoveWidget
)
diff --git a/plugins/love-resources/src/components/FloorPreview.svelte b/plugins/love-resources/src/components/FloorPreview.svelte
index a055751e95..7e5372e1ac 100644
--- a/plugins/love-resources/src/components/FloorPreview.svelte
+++ b/plugins/love-resources/src/components/FloorPreview.svelte
@@ -86,14 +86,7 @@
let pressed: boolean = false
const clickMore = (e: MouseEvent): void => {
pressed = true
- const value: SelectPopupValueType[] = [
- {
- id: 'configure',
- icon: IconSettings,
- label: configure ? plugin.string.FinalizeEditing : plugin.string.EditOffice
- },
- { id: 'rename', icon: IconEdit, label: plugin.string.RenameAFloor }
- ]
+ const value: SelectPopupValueType[] = [{ id: 'rename', icon: IconEdit, label: plugin.string.RenameAFloor }]
showPopup(SelectPopup, { value }, eventToHTMLElement(e), (result) => {
if (result === 'configure') {
dispatch('configure', floor)
diff --git a/plugins/love-resources/src/components/Floors.svelte b/plugins/love-resources/src/components/Floors.svelte
deleted file mode 100644
index ba1a66d752..0000000000
--- a/plugins/love-resources/src/components/Floors.svelte
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-{#if $deviceInfo.navigator.visible}
-
-
-
-
- {#each $floors as _floor}
- {
- if (floor === _floor._id) {
- configure = !configure
- } else {
- floor = _floor._id
- configure = true
- }
- }}
- on:select={() => {
- floor = _floor._id
- }}
- />
- {/each}
-
-
-
-
-
-{/if}
diff --git a/plugins/love-resources/src/components/Hall.svelte b/plugins/love-resources/src/components/Hall.svelte
index 26808c0361..829ee04544 100644
--- a/plugins/love-resources/src/components/Hall.svelte
+++ b/plugins/love-resources/src/components/Hall.svelte
@@ -20,17 +20,26 @@
import { getClient } from '@hcengineering/presentation'
import { deviceOptionsStore as deviceInfo, getCurrentLocation, navigate } from '@hcengineering/ui'
import { onDestroy, onMount } from 'svelte'
- import { activeFloor, floors, infos, invites, myInfo, myRequests, rooms, storePromise } from '../stores'
+ import {
+ activeFloor,
+ floors,
+ infos,
+ invites,
+ myInfo,
+ myRequests,
+ rooms,
+ selectedFloor,
+ storePromise
+ } from '../stores'
import { connectToMeeting, tryConnect } from '../utils'
import Floor from './Floor.svelte'
import FloorConfigure from './FloorConfigure.svelte'
- import Floors from './Floors.svelte'
function getRooms (rooms: Room[], floor: Ref): Room[] {
return rooms.filter((p) => p.floor === floor)
}
- let selectedFloor = $activeFloor === '' ? $floors[0]?._id : $activeFloor
+ $: floor = $selectedFloor ?? ($activeFloor === '' ? $floors[0]?._id : $activeFloor)
let configure: boolean = false
let replacedPanel: HTMLElement
@@ -73,21 +82,15 @@
})
-
{#if configure}
(configure = false)}
/>
{:else}
- (configure = true)}
- on:open
- />
+ (configure = true)} on:open />
{/if}
diff --git a/plugins/love-resources/src/components/LoveWidget.svelte b/plugins/love-resources/src/components/LoveWidget.svelte
index fda8cfb3b0..ed6fea387e 100644
--- a/plugins/love-resources/src/components/LoveWidget.svelte
+++ b/plugins/love-resources/src/components/LoveWidget.svelte
@@ -13,74 +13,78 @@
// limitations under the License.
-->
+
+
+
+ {#if editable}
+
+ {/if}
+
+
- {#if floorsSelector}
- {#each $floors as _floor}
- {
- selectFloor(_floor._id)
- }}
- />
- {/each}
- {:else if selectedFloor}
+ {#each $floors as _floor}
{
+ if (floor?._id === _floor._id) {
+ configure = !configure
+ } else {
+ selectedFloor.set(_floor?._id)
+ floor = _floor
+ configure = true
+ }
+ }}
+ on:select={() => {
+ selectedFloor.set(_floor?._id)
+ floor = _floor
+ }}
/>
- {/if}
+ {/each}
- {#if floorsSelector || $floors.length > 1}
-
- {/if}
diff --git a/plugins/love-resources/src/stores.ts b/plugins/love-resources/src/stores.ts
index 26a1538a13..a0780768c8 100644
--- a/plugins/love-resources/src/stores.ts
+++ b/plugins/love-resources/src/stores.ts
@@ -34,6 +34,7 @@ export const currentRoom = derived([rooms, myInfo], ([rooms, myInfo]) => {
return myInfo !== undefined ? rooms.find((p) => p._id === myInfo.room) : undefined
})
export const floors = writable([])
+export const selectedFloor = writable[ | undefined>(undefined)
export const activeFloor = derived([rooms, myInfo, myOffice], ([rooms, myInfo, myOffice]) => {
let res: Ref | undefined
if (myInfo !== undefined) {
]