UBER-1157: Some dependant fixes (#3936)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-11-03 16:11:12 +07:00 committed by GitHub
parent 67d63e5d28
commit 9f82ec3b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 62 additions and 53 deletions

View File

@ -610,7 +610,7 @@ input.search {
}
/* --------- */
.no-word-wrap { word-wrap: none; }
.no-word-wrap { word-wrap: none; text-wrap: nowrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.abs-lt-content {

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
import { writable } from 'svelte/store'
import type { DefSeparators, SeparatedItem } from './types'
import { DelayedCaller } from './utils'
import type { SeparatedItem, DefSeparators } from './types'
// limitations under the License.
let observer: ResizeObserver
@ -163,10 +163,4 @@ export const settingsSeparators: DefSeparators = [
null
]
export const timeSeparators: DefSeparators = [
{ minSize: 12.5, size: 17.5, maxSize: 22.5, float: 'navigator' },
{ minSize: 25, size: 35, maxSize: 45 },
null
]
export const separatorsStore = writable<string[]>([])

View File

@ -57,7 +57,7 @@ function generateDailyValues (
while (true) {
if (bySetPos == null || bySetPos.includes(getSetPos(currentDate))) {
const res = currentDate.getTime()
if (res > from) {
if (res > from && res < to) {
values.push(res)
}
i++
@ -92,7 +92,7 @@ function generateWeeklyValues (
while (date < end) {
if ((byDay == null || matchesByDay(date, byDay)) && (bySetPos == null || bySetPos.includes(getSetPos(date)))) {
const res = date.getTime()
if (res > from) {
if (res > from && res < to) {
values.push(res)
}
i++
@ -172,7 +172,7 @@ function generateMonthlyValues (
(bySetPos == null || bySetPos.includes(getSetPos(currentDate)))
) {
const res = currentDate.getTime()
if (res > from) {
if (res > from && res < to) {
values.push(res)
}
i++
@ -212,7 +212,7 @@ function generateYearlyValues (
(bySetPos == null || bySetPos.includes(getSetPos(currentDate)))
) {
const res = currentDate.getTime()
if (res > from) {
if (res > from && res < to) {
values.push(res)
}
i++
@ -316,7 +316,8 @@ export function getAllEvents (events: Event[], from: Timestamp, to: Timestamp):
}
}
for (const rec of recur) {
recurData.push(...getReccuringEventInstances(rec, instancesMap.get(rec.eventId) ?? [], from, to))
const recEvents = getReccuringEventInstances(rec, instancesMap.get(rec.eventId) ?? [], from, to)
recurData.push(...recEvents)
}
const res = [
...base,

View File

@ -39,7 +39,7 @@
import ScheduleView from './ScheduleView.svelte'
import Sidebar from './sidebar/Sidebar.svelte'
export let visibileNav: boolean = true
export let visibleNav: boolean = true
export let navFloat: boolean = false
export let appsDirection: 'vertical' | 'horizontal' = 'horizontal'
@ -127,7 +127,7 @@
</script>
<div class="flex h-full clear-mins">
{#if visibileNav}
{#if visibleNav}
<Sidebar
{department}
{descendants}

View File

@ -42,7 +42,7 @@
import People from './People.svelte'
import { subscribe } from '../utils'
export let visibileNav: boolean = true
export let visibleNav: boolean = true
export let navFloat: boolean = false
export let appsDirection: 'vertical' | 'horizontal' = 'horizontal'
let filter: 'all' | 'read' | 'unread' = 'all'
@ -143,7 +143,7 @@
</script>
<div class="flex-row-top h-full">
{#if visibileNav}
{#if visibleNav}
<div
class="antiPanel-navigator {appsDirection === 'horizontal'
? 'portrait'

View File

@ -36,7 +36,7 @@
import { onDestroy } from 'svelte'
import CategoryElement from './CategoryElement.svelte'
export let visibileNav: boolean = true
export let visibleNav: boolean = true
export let navFloat: boolean = false
export let appsDirection: 'vertical' | 'horizontal' = 'horizontal'
@ -97,7 +97,7 @@
</script>
<div class="flex h-full clear-mins">
{#if visibileNav}
{#if visibleNav}
<div class="antiPanel-navigator {appsDirection === 'horizontal' ? 'portrait' : 'landscape'}">
<div class="antiPanel-wrap__content">
<NavHeader label={setting.string.Settings} />
@ -149,7 +149,7 @@
<Component
is={category.component}
props={{
visibileNav
visibleNav
}}
/>
{/if}

View File

@ -37,7 +37,7 @@
let categories: SettingsCategory[] = []
const account = getCurrentAccount() as PersonAccount
export let visibileNav = true
export let visibleNav = true
const settingsQuery = createQuery()
settingsQuery.query(
@ -72,7 +72,7 @@
</script>
<div class="flex h-full clear-mins">
{#if visibileNav}
{#if visibleNav}
<div class="antiPanel-navigator filledNav indent">
<div class="antiPanel-wrap__content">
<div class="antiNav-header overflow-label">

View File

@ -41,6 +41,7 @@ import { getResource } from '@hcengineering/platform'
import { AttributeCategory, KeyedAttribute, getAttributePresenterClass, hasResource } from '@hcengineering/presentation'
import {
AnyComponent,
AnySvelteComponent,
ErrorPresenter,
Location,
getCurrentResolvedLocation,
@ -889,3 +890,16 @@ export async function openDoc (hierarchy: Hierarchy, object: Doc): Promise<void>
const loc = await getObjectLinkFragment(hierarchy, object, {}, comp)
navigate(loc)
}
/**
* @public
*/
export async function getSpacePresenter (
client: Client,
_class: Ref<Class<Doc>>
): Promise<AnySvelteComponent | undefined> {
const value = client.getHierarchy().classHierarchyMixin(_class, view.mixin.SpacePresenter)
if (value?.presenter !== undefined) {
return await getResource(value.presenter)
}
}

View File

@ -113,9 +113,9 @@
let panelInstance: PanelInstance
let popupInstance: Popup
let visibileNav: boolean = getMetadata(workbench.metadata.NavigationExpandedDefault) ?? true
let visibleNav: boolean = getMetadata(workbench.metadata.NavigationExpandedDefault) ?? true
async function toggleNav (): Promise<void> {
visibileNav = !visibileNav
visibleNav = !visibleNav
closeTooltip()
if (currentApplication && navigatorModel && navigator) {
await tick()
@ -480,16 +480,16 @@
let navFloat: boolean = !($deviceInfo.docWidth < 1024)
$: if ($deviceInfo.docWidth <= 1024 && !navFloat) {
visibileNav = false
visibleNav = false
navFloat = true
} else if ($deviceInfo.docWidth > 1024 && navFloat) {
if (getMetadata(workbench.metadata.NavigationExpandedDefault) === undefined) {
navFloat = false
visibileNav = true
visibleNav = true
}
}
const checkOnHide = (): void => {
if (visibileNav && $deviceInfo.docWidth <= 1024) visibileNav = false
if (visibleNav && $deviceInfo.docWidth <= 1024) visibleNav = false
}
let appsDirection: 'vertical' | 'horizontal'
$: appsDirection = $deviceInfo.isMobile && $deviceInfo.isPortrait ? 'horizontal' : 'vertical'
@ -598,7 +598,7 @@
</clipPath>
</svg>
<div class="workbench-container" style:flex-direction={appsDirection === 'horizontal' ? 'column-reverse' : 'row'}>
<div class="antiPanel-application {appsDirection}" class:lastDivider={!visibileNav}>
<div class="antiPanel-application {appsDirection}" class:lastDivider={!visibleNav}>
<div
class="hamburger-container clear-mins"
class:portrait={appsDirection === 'horizontal'}
@ -617,8 +617,8 @@
<div class="topmenu-container clear-mins flex-no-shrink" class:mini={appsMini}>
<AppItem
icon={TopMenu}
label={visibileNav ? workbench.string.HideMenu : workbench.string.ShowMenu}
selected={!visibileNav}
label={visibleNav ? workbench.string.HideMenu : workbench.string.ShowMenu}
selected={!visibleNav}
size={appsMini ? 'small' : 'medium'}
on:click={toggleNav}
/>
@ -684,9 +684,9 @@
}}
/>
<div class="workbench-container">
{#if currentApplication && navigatorModel && navigator && visibileNav}
{#if currentApplication && navigatorModel && navigator && visibleNav}
<!-- svelte-ignore a11y-click-events-have-key-events -->
{#if navFloat}<div class="cover shown" on:click={() => (visibileNav = false)} />{/if}
{#if navFloat}<div class="cover shown" on:click={() => (visibleNav = false)} />{/if}
<div class="antiPanel-navigator {appsDirection === 'horizontal' ? 'portrait' : 'landscape'}">
<div class="antiPanel-wrap__content">
{#if currentApplication}
@ -741,7 +741,7 @@
}}
>
{#if currentApplication && currentApplication.component}
<Component is={currentApplication.component} props={{ currentSpace, visibileNav, navFloat, appsDirection }} />
<Component is={currentApplication.component} props={{ currentSpace, visibleNav, navFloat, appsDirection }} />
{:else if specialComponent}
<Component
is={specialComponent.component}
@ -749,7 +749,7 @@
model: navigatorModel,
...specialComponent.componentProps,
currentSpace,
visibileNav,
visibleNav,
navFloat,
appsDirection
}}
@ -764,7 +764,7 @@
{:else if currentView?.component !== undefined}
<Component
is={currentView.component}
props={{ ...currentView.componentProps, currentView, visibileNav, navFloat, appsDirection }}
props={{ ...currentView.componentProps, currentView, visibleNav, navFloat, appsDirection }}
/>
{:else}
<SpaceView {currentSpace} {currentView} {createItemDialog} {createItemLabel} />

View File

@ -31,11 +31,17 @@
navigate,
showPopup
} from '@hcengineering/ui'
import { NavLink, TreeItem, TreeNode, getActions as getContributedActions } from '@hcengineering/view-resources'
import {
NavLink,
TreeItem,
TreeNode,
getActions as getContributedActions,
getSpacePresenter
} from '@hcengineering/view-resources'
import { SpacesNavModel } from '@hcengineering/workbench'
import { createEventDispatcher } from 'svelte'
import plugin from '../../plugin'
import { classIcon, getSpaceName, getSpacePresenter } from '../../utils'
import { classIcon, getSpaceName } from '../../utils'
import TreeSeparator from './TreeSeparator.svelte'
export let model: SpacesNavModel

View File

@ -22,9 +22,15 @@
import { getClient } from '@hcengineering/presentation'
import { Action, IconEdit } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { NavLink, TreeItem, TreeNode, getActions as getContributedActions } from '@hcengineering/view-resources'
import {
NavLink,
TreeItem,
TreeNode,
getActions as getContributedActions,
getSpacePresenter
} from '@hcengineering/view-resources'
import { SpacesNavModel } from '@hcengineering/workbench'
import { classIcon, getSpaceName, getSpacePresenter } from '../../utils'
import { classIcon, getSpaceName } from '../../utils'
export let label: IntlString
export let spaces: Space[]

View File

@ -17,12 +17,13 @@
import type { Class, Client, Doc, Obj, Ref, Space, TxOperations } from '@hcengineering/core'
import core from '@hcengineering/core'
import type { Workspace } from '@hcengineering/login'
import login, { loginId } from '@hcengineering/login'
import type { Asset } from '@hcengineering/platform'
import { getResource, setMetadata } from '@hcengineering/platform'
import preference from '@hcengineering/preference'
import { closeClient, getClient } from '@hcengineering/presentation'
import presentation from '@hcengineering/presentation/src/plugin'
import {
AnySvelteComponent,
closePanel,
fetchMetadataLocalStorage,
getCurrentLocation,
@ -33,9 +34,6 @@ import view from '@hcengineering/view'
import type { Application } from '@hcengineering/workbench'
import workbench, { NavigatorModel } from '@hcengineering/workbench'
import { writable } from 'svelte/store'
import login, { loginId } from '@hcengineering/login'
import presentation from '@hcengineering/presentation/src/plugin'
export function classIcon (client: Client, _class: Ref<Class<Obj>>): Asset | undefined {
return client.getHierarchy().getClass(_class).icon
}
@ -206,13 +204,3 @@ export function signOut (): void {
void closeClient()
navigate({ path: [loginId] })
}
export async function getSpacePresenter (
client: Client,
_class: Ref<Class<Doc>>
): Promise<AnySvelteComponent | undefined> {
const value = client.getHierarchy().classHierarchyMixin(_class, view.mixin.SpacePresenter)
if (value?.presenter !== undefined) {
return await getResource(value.presenter)
}
}