mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 16:56:07 +00:00
Minor fixes in Office (#5775)
Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
parent
f8b79226d9
commit
9be4dbfe9d
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
||||||
<button
|
<button
|
||||||
class="hulyNavItem-container {type} {type === 'type-anchor-link' || isSecondary
|
class="hulyNavItem-container line-height-auto {type} {type === 'type-anchor-link' || isSecondary
|
||||||
? 'font-regular-12'
|
? 'font-regular-12'
|
||||||
: 'font-regular-14'}"
|
: 'font-regular-14'}"
|
||||||
class:selected
|
class:selected
|
||||||
@ -128,7 +128,7 @@
|
|||||||
style:color={type === 'type-tag' && selected ? color : null}
|
style:color={type === 'type-tag' && selected ? color : null}
|
||||||
>
|
>
|
||||||
{#if description}
|
{#if description}
|
||||||
<span class="hulyNavItem-label font-medium-12 mr-0-5">
|
<span class="hulyNavItem-label font-medium-12 line-height-auto mr-0-5">
|
||||||
{#if label}<Label {label} />{/if}
|
{#if label}<Label {label} />{/if}
|
||||||
{#if title}{title}{/if}
|
{#if title}{title}{/if}
|
||||||
<slot />
|
<slot />
|
||||||
|
@ -106,6 +106,7 @@ export { default as Chip } from './components/Chip.svelte'
|
|||||||
export { default as Loading } from './components/Loading.svelte'
|
export { default as Loading } from './components/Loading.svelte'
|
||||||
export { default as Spinner } from './components/Spinner.svelte'
|
export { default as Spinner } from './components/Spinner.svelte'
|
||||||
export { default as Popup } from './components/Popup.svelte'
|
export { default as Popup } from './components/Popup.svelte'
|
||||||
|
export { default as PopupInstance } from './components/PopupInstance.svelte'
|
||||||
export { default as CircleButton } from './components/CircleButton.svelte'
|
export { default as CircleButton } from './components/CircleButton.svelte'
|
||||||
export { default as Link } from './components/Link.svelte'
|
export { default as Link } from './components/Link.svelte'
|
||||||
export { default as LinkWrapper } from './components/LinkWrapper.svelte'
|
export { default as LinkWrapper } from './components/LinkWrapper.svelte'
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
{#if value.allDay}
|
{#if value.allDay}
|
||||||
<DatePresenter value={value.date} />
|
<DatePresenter value={value.date} />
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex-row-center">
|
<div class="flex-row-center flex-no-shrink">
|
||||||
<DateTimeRangePresenter value={value.date} /> <span class="p-1">-</span>
|
<DateTimeRangePresenter value={value.date} /> <span class="p-1">-</span>
|
||||||
<DateRangePresenter value={value.dueDate} mode={DateRangeMode.TIME} editable={false} />
|
<DateRangePresenter value={value.dueDate} mode={DateRangeMode.TIME} editable={false} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,7 +18,16 @@
|
|||||||
import login from '@hcengineering/login'
|
import login from '@hcengineering/login'
|
||||||
import { getResource } from '@hcengineering/platform'
|
import { getResource } from '@hcengineering/platform'
|
||||||
import { copyTextToClipboard, getClient } from '@hcengineering/presentation'
|
import { copyTextToClipboard, getClient } from '@hcengineering/presentation'
|
||||||
import { IconUpOutline, ModernButton, SplitButton, eventToHTMLElement, showPopup } from '@hcengineering/ui'
|
import {
|
||||||
|
IconUpOutline,
|
||||||
|
ModernButton,
|
||||||
|
SplitButton,
|
||||||
|
eventToHTMLElement,
|
||||||
|
showPopup,
|
||||||
|
PopupInstance,
|
||||||
|
type CompAndProps,
|
||||||
|
type AnySvelteComponent
|
||||||
|
} from '@hcengineering/ui'
|
||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
import love, { Room, RoomType, isOffice, roomAccessIcon } from '@hcengineering/love'
|
import love, { Room, RoomType, isOffice, roomAccessIcon } from '@hcengineering/love'
|
||||||
import plugin from '../plugin'
|
import plugin from '../plugin'
|
||||||
@ -43,10 +52,12 @@
|
|||||||
import RoomAccessPopup from './RoomAccessPopup.svelte'
|
import RoomAccessPopup from './RoomAccessPopup.svelte'
|
||||||
|
|
||||||
export let room: Room
|
export let room: Room
|
||||||
|
export let fullScreen: boolean = false
|
||||||
|
|
||||||
let allowCam: boolean = false
|
let allowCam: boolean = false
|
||||||
const allowShare: boolean = true
|
const allowShare: boolean = true
|
||||||
let allowLeave: boolean = false
|
let allowLeave: boolean = false
|
||||||
|
let popup: CompAndProps | undefined = undefined
|
||||||
|
|
||||||
$: allowCam = $currentRoom?.type === RoomType.Video
|
$: allowCam = $currentRoom?.type === RoomType.Video
|
||||||
$: allowLeave = $myInfo?.room !== ($myOffice?._id ?? plugin.ids.Reception)
|
$: allowLeave = $myInfo?.room !== ($myOffice?._id ?? plugin.ids.Reception)
|
||||||
@ -67,18 +78,43 @@
|
|||||||
await leaveRoom($myInfo, $myOffice)
|
await leaveRoom($myInfo, $myOffice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPopup (component: AnySvelteComponent, e: MouseEvent, props: any = {}): CompAndProps {
|
||||||
|
return {
|
||||||
|
id: 'fsPopup',
|
||||||
|
is: component,
|
||||||
|
props,
|
||||||
|
element: eventToHTMLElement(e),
|
||||||
|
options: { category: 'popup', overlay: true },
|
||||||
|
close: () => {
|
||||||
|
popup = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function micSettings (e: MouseEvent): void {
|
function micSettings (e: MouseEvent): void {
|
||||||
|
if (fullScreen) {
|
||||||
|
popup = getPopup(MicSettingPopup, e)
|
||||||
|
} else {
|
||||||
showPopup(MicSettingPopup, {}, eventToHTMLElement(e))
|
showPopup(MicSettingPopup, {}, eventToHTMLElement(e))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function camSettings (e: MouseEvent): void {
|
function camSettings (e: MouseEvent): void {
|
||||||
|
if (fullScreen) {
|
||||||
|
popup = getPopup(CamSettingPopup, e)
|
||||||
|
} else {
|
||||||
showPopup(CamSettingPopup, {}, eventToHTMLElement(e))
|
showPopup(CamSettingPopup, {}, eventToHTMLElement(e))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setAccess (e: MouseEvent): void {
|
function setAccess (e: MouseEvent): void {
|
||||||
if (isOffice(room) && room.person !== me) return
|
if (isOffice(room) && room.person !== me) return
|
||||||
|
if (fullScreen) {
|
||||||
|
popup = getPopup(RoomAccessPopup, e, { room })
|
||||||
|
} else {
|
||||||
showPopup(RoomAccessPopup, { room }, eventToHTMLElement(e))
|
showPopup(RoomAccessPopup, { room }, eventToHTMLElement(e))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function copyGuestLink (): Promise<void> {
|
async function copyGuestLink (): Promise<void> {
|
||||||
const getLink = await getResource(login.function.GetInviteLink)
|
const getLink = await getResource(login.function.GetInviteLink)
|
||||||
@ -191,6 +227,21 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
{#if popup && fullScreen}
|
||||||
|
<PopupInstance
|
||||||
|
is={popup.is}
|
||||||
|
props={popup.props}
|
||||||
|
element={popup.element}
|
||||||
|
onClose={popup.onClose}
|
||||||
|
onUpdate={popup.onUpdate}
|
||||||
|
zIndex={1}
|
||||||
|
top={true}
|
||||||
|
close={popup.close}
|
||||||
|
overlay={popup.options.overlay}
|
||||||
|
contentPanel={undefined}
|
||||||
|
{popup}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
isCurrentInstanceConnected,
|
isCurrentInstanceConnected,
|
||||||
isMicEnabled,
|
isMicEnabled,
|
||||||
isSharingEnabled,
|
isSharingEnabled,
|
||||||
isFullScreen,
|
|
||||||
leaveRoom,
|
leaveRoom,
|
||||||
screenSharing,
|
screenSharing,
|
||||||
setCam,
|
setCam,
|
||||||
@ -393,13 +392,6 @@
|
|||||||
size={'small'}
|
size={'small'}
|
||||||
action={changeShare}
|
action={changeShare}
|
||||||
/>
|
/>
|
||||||
<ActionIcon
|
|
||||||
icon={$isFullScreen ? love.icon.ExitFullScreen : love.icon.FullScreen}
|
|
||||||
size={'small'}
|
|
||||||
action={() => {
|
|
||||||
$isFullScreen = !$isFullScreen
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
{#if allowLeave}
|
{#if allowLeave}
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
let resizeInitParams: ResizeInitParams | undefined = undefined
|
let resizeInitParams: ResizeInitParams | undefined = undefined
|
||||||
let floorContainer: HTMLDivElement
|
let floorContainer: HTMLDivElement
|
||||||
let floorRect: DOMRect
|
let floorRect: DOMRect
|
||||||
|
let floorOffsetInline: number
|
||||||
const floorSize: FloorSize = {
|
const floorSize: FloorSize = {
|
||||||
cols: GRID_WIDTH + 2,
|
cols: GRID_WIDTH + 2,
|
||||||
rows: 5,
|
rows: 5,
|
||||||
@ -342,6 +343,7 @@
|
|||||||
if (event.detail === undefined) return
|
if (event.detail === undefined) return
|
||||||
const { room, size, offset } = event.detail
|
const { room, size, offset } = event.detail
|
||||||
floorRect = floorContainer.getBoundingClientRect()
|
floorRect = floorContainer.getBoundingClientRect()
|
||||||
|
floorOffsetInline = floorRect.x - divScroll.getBoundingClientRect().x
|
||||||
dragged = {
|
dragged = {
|
||||||
x: size.x - floorRect.x + floorSize.cellRound,
|
x: size.x - floorRect.x + floorSize.cellRound,
|
||||||
y: size.y - floorRect.y + floorSize.cellRound,
|
y: size.y - floorRect.y + floorSize.cellRound,
|
||||||
@ -363,7 +365,7 @@
|
|||||||
room={locked.room}
|
room={locked.room}
|
||||||
cellSize={floorSize.cellSize}
|
cellSize={floorSize.cellSize}
|
||||||
top={dragged.y}
|
top={dragged.y}
|
||||||
left={dragged.x}
|
left={dragged.x + floorOffsetInline - floorSize.cellRound}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</Scroller>
|
</Scroller>
|
||||||
|
@ -366,7 +366,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if $currentRoom}
|
{#if $currentRoom}
|
||||||
<ControlBar room={$currentRoom} />
|
<ControlBar room={$currentRoom} fullScreen={$isFullScreen} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -179,8 +179,6 @@
|
|||||||
style:--huly-floor-roomWidth={room.width}
|
style:--huly-floor-roomWidth={room.width}
|
||||||
style:--huly-floor-roomHeight={room.height}
|
style:--huly-floor-roomHeight={room.height}
|
||||||
style:--huly-floor-roomShadow={`var(--theme-popup-shadow), ${$shadow.x}px ${$shadow.y}px ${$shadow.r}px ${$shadow.s}px rgba(${$shadowColor.r}, ${$shadowColor.g}, ${$shadowColor.b}, ${$shadowColor.a})`}
|
style:--huly-floor-roomShadow={`var(--theme-popup-shadow), ${$shadow.x}px ${$shadow.y}px ${$shadow.r}px ${$shadow.s}px rgba(${$shadowColor.r}, ${$shadowColor.g}, ${$shadowColor.b}, ${$shadowColor.a})`}
|
||||||
style:top={top ? `${top}px` : undefined}
|
|
||||||
style:left={left ? `${left}px` : undefined}
|
|
||||||
style:grid-column={`${room.x + 2} / span ${room.width}`}
|
style:grid-column={`${room.x + 2} / span ${room.width}`}
|
||||||
style:grid-row={`${room.y + 2} / span ${room.height}`}
|
style:grid-row={`${room.y + 2} / span ${room.height}`}
|
||||||
style:grid-template-columns={`repeat(${room.width}, 1fr)`}
|
style:grid-template-columns={`repeat(${room.width}, 1fr)`}
|
||||||
|
Loading…
Reference in New Issue
Block a user