mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 16:30:49 +00:00
Remove outdated aside (#7405)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
This commit is contained in:
parent
bec1c70f21
commit
fcfaba492e
@ -115,7 +115,6 @@
|
|||||||
let currentSpace: Ref<Space> | undefined
|
let currentSpace: Ref<Space> | undefined
|
||||||
let currentSpecial: string | undefined
|
let currentSpecial: string | undefined
|
||||||
let specialComponent: SpecialNavModel | undefined
|
let specialComponent: SpecialNavModel | undefined
|
||||||
let asideId: string | undefined
|
|
||||||
let currentFragment: string | undefined = ''
|
let currentFragment: string | undefined = ''
|
||||||
|
|
||||||
let currentApplication: Application | undefined
|
let currentApplication: Application | undefined
|
||||||
@ -124,13 +123,10 @@
|
|||||||
|
|
||||||
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
||||||
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
||||||
if (asideId !== undefined && spaceSpecial === asideId) return
|
|
||||||
if (spaceSpecial === undefined) return
|
if (spaceSpecial === undefined) return
|
||||||
specialComponent = getSpecialComponent(spaceSpecial)
|
specialComponent = getSpecialComponent(spaceSpecial)
|
||||||
if (specialComponent !== undefined) {
|
if (specialComponent !== undefined) {
|
||||||
currentSpecial = spaceSpecial
|
currentSpecial = spaceSpecial
|
||||||
} else if (navigatorModel?.aside !== undefined || currentApplication?.aside !== undefined) {
|
|
||||||
asideId = spaceSpecial
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,10 +171,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (special !== currentSpecial && (navigatorModel?.aside || currentApplication?.aside)) {
|
|
||||||
asideId = special
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fragment !== currentFragment) {
|
if (fragment !== currentFragment) {
|
||||||
currentFragment = fragment
|
currentFragment = fragment
|
||||||
if (fragment != null && fragment.trim().length > 0) {
|
if (fragment != null && fragment.trim().length > 0) {
|
||||||
@ -250,13 +242,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeAside (): void {
|
|
||||||
const loc = getLocation()
|
|
||||||
loc.path.length = 4
|
|
||||||
asideId = undefined
|
|
||||||
navigate(loc)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getWindowTitle (loc: Location): Promise<string | undefined> {
|
async function getWindowTitle (loc: Location): Promise<string | undefined> {
|
||||||
if (loc.fragment == null) return
|
if (loc.fragment == null) return
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -277,7 +262,6 @@
|
|||||||
|
|
||||||
defineSeparators('workbenchGuest', workbenchGuestSeparators)
|
defineSeparators('workbenchGuest', workbenchGuestSeparators)
|
||||||
|
|
||||||
let aside: HTMLElement
|
|
||||||
let cover: HTMLElement
|
let cover: HTMLElement
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -303,15 +287,6 @@
|
|||||||
<SpaceView {currentSpace} {currentView} />
|
<SpaceView {currentSpace} {currentView} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if asideId}
|
|
||||||
{@const asideComponent = navigatorModel?.aside ?? currentApplication?.aside}
|
|
||||||
{#if asideComponent !== undefined}
|
|
||||||
<Separator name={'workbenchGuest'} index={0} />
|
|
||||||
<div class="antiPanel-component antiComponent aside" bind:this={aside}>
|
|
||||||
<Component is={asideComponent} props={{ currentSpace, _id: asideId }} on:close={closeAside} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div bind:this={cover} class="cover" />
|
<div bind:this={cover} class="cover" />
|
||||||
|
@ -136,7 +136,6 @@
|
|||||||
let currentSpecial: string | undefined
|
let currentSpecial: string | undefined
|
||||||
let currentQuery: Record<string, string | null> | undefined
|
let currentQuery: Record<string, string | null> | undefined
|
||||||
let specialComponent: SpecialNavModel | undefined
|
let specialComponent: SpecialNavModel | undefined
|
||||||
let asideId: string | undefined
|
|
||||||
let currentFragment: string | undefined = ''
|
let currentFragment: string | undefined = ''
|
||||||
|
|
||||||
let currentApplication: Application | undefined
|
let currentApplication: Application | undefined
|
||||||
@ -374,8 +373,6 @@
|
|||||||
loc.path[4] = currentSpecial
|
loc.path[4] = currentSpecial
|
||||||
} else if (loc.path[3] === resolved.defaultLocation.path[3]) {
|
} else if (loc.path[3] === resolved.defaultLocation.path[3]) {
|
||||||
loc.path[4] = resolved.defaultLocation.path[4]
|
loc.path[4] = resolved.defaultLocation.path[4]
|
||||||
} else {
|
|
||||||
loc.path[4] = asideId as string
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
loc.path.length = 4
|
loc.path.length = 4
|
||||||
@ -512,10 +509,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (special !== currentSpecial && (navigatorModel?.aside || currentApplication?.aside)) {
|
|
||||||
asideId = special
|
|
||||||
}
|
|
||||||
|
|
||||||
if (app !== undefined) {
|
if (app !== undefined) {
|
||||||
localStorage.setItem(`${locationStorageKeyId}_${app}`, originalLoc)
|
localStorage.setItem(`${locationStorageKeyId}_${app}`, originalLoc)
|
||||||
}
|
}
|
||||||
@ -589,21 +582,12 @@
|
|||||||
specialComponent = undefined
|
specialComponent = undefined
|
||||||
// eslint-disable-next-line no-fallthrough
|
// eslint-disable-next-line no-fallthrough
|
||||||
case 3:
|
case 3:
|
||||||
asideId = undefined
|
|
||||||
if (currentSpace !== undefined) {
|
if (currentSpace !== undefined) {
|
||||||
specialComponent = undefined
|
specialComponent = undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeAside (): void {
|
|
||||||
const loc = getLocation()
|
|
||||||
loc.path.length = 4
|
|
||||||
asideId = undefined
|
|
||||||
checkOnHide()
|
|
||||||
navigate(loc)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateSpace (spaceId?: Ref<Space>): Promise<void> {
|
async function updateSpace (spaceId?: Ref<Space>): Promise<void> {
|
||||||
if (spaceId === currentSpace) return
|
if (spaceId === currentSpace) return
|
||||||
clear(2)
|
clear(2)
|
||||||
@ -620,14 +604,11 @@
|
|||||||
|
|
||||||
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
||||||
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
||||||
if (asideId !== undefined && spaceSpecial === asideId) return
|
|
||||||
clear(3)
|
clear(3)
|
||||||
if (spaceSpecial === undefined) return
|
if (spaceSpecial === undefined) return
|
||||||
specialComponent = getSpecialComponent(spaceSpecial)
|
specialComponent = getSpecialComponent(spaceSpecial)
|
||||||
if (specialComponent !== undefined) {
|
if (specialComponent !== undefined) {
|
||||||
currentSpecial = spaceSpecial
|
currentSpecial = spaceSpecial
|
||||||
} else if (navigatorModel?.aside !== undefined || currentApplication?.aside !== undefined) {
|
|
||||||
asideId = spaceSpecial
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,7 +628,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let aside: HTMLElement
|
|
||||||
let cover: HTMLElement
|
let cover: HTMLElement
|
||||||
let workbenchWidth: number = $deviceInfo.docWidth
|
let workbenchWidth: number = $deviceInfo.docWidth
|
||||||
|
|
||||||
@ -762,14 +742,6 @@
|
|||||||
person && client.getHierarchy().hasMixin(person, contact.mixin.Employee)
|
person && client.getHierarchy().hasMixin(person, contact.mixin.Employee)
|
||||||
? !client.getHierarchy().as(person, contact.mixin.Employee).active
|
? !client.getHierarchy().as(person, contact.mixin.Employee).active
|
||||||
: false
|
: false
|
||||||
|
|
||||||
let asideComponent: AnyComponent | undefined
|
|
||||||
|
|
||||||
$: if (asideId !== undefined && navigatorModel !== undefined) {
|
|
||||||
asideComponent = navigatorModel?.aside ?? currentApplication?.aside
|
|
||||||
} else {
|
|
||||||
asideComponent = undefined
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if person && deactivated && !isAdminUser()}
|
{#if person && deactivated && !isAdminUser()}
|
||||||
@ -1001,11 +973,8 @@
|
|||||||
<Component
|
<Component
|
||||||
is={currentApplication.component}
|
is={currentApplication.component}
|
||||||
props={{
|
props={{
|
||||||
currentSpace,
|
currentSpace
|
||||||
asideId,
|
|
||||||
asideComponent: currentApplication?.aside
|
|
||||||
}}
|
}}
|
||||||
on:close={closeAside}
|
|
||||||
/>
|
/>
|
||||||
{:else if specialComponent}
|
{:else if specialComponent}
|
||||||
<Component
|
<Component
|
||||||
@ -1035,12 +1004,6 @@
|
|||||||
<SpaceView {currentSpace} {currentView} {createItemDialog} {createItemLabel} />
|
<SpaceView {currentSpace} {currentView} {createItemDialog} {createItemLabel} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if asideComponent !== undefined}
|
|
||||||
<Separator name={'workbench'} index={1} color={'transparent'} separatorSize={0} short />
|
|
||||||
<div class="antiPanel-component antiComponent aside" bind:this={aside}>
|
|
||||||
<Component is={asideComponent} props={{ currentSpace, _id: asideId }} on:close={closeAside} />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{#if !$deviceInfo.aside.float}
|
{#if !$deviceInfo.aside.float}
|
||||||
{#if $sidebarStore.variant === SidebarVariant.EXPANDED}
|
{#if $sidebarStore.variant === SidebarVariant.EXPANDED}
|
||||||
|
@ -192,8 +192,7 @@ export async function buildNavModel (
|
|||||||
const newSpaces = (nm.spaces ?? []).filter((it) => !spaces.some((sp) => sp.id === it.id))
|
const newSpaces = (nm.spaces ?? []).filter((it) => !spaces.some((sp) => sp.id === it.id))
|
||||||
newNavModel = {
|
newNavModel = {
|
||||||
spaces: [...spaces, ...newSpaces],
|
spaces: [...spaces, ...newSpaces],
|
||||||
specials: [...(newNavModel?.specials ?? []), ...(nm.specials ?? [])],
|
specials: [...(newNavModel?.specials ?? []), ...(nm.specials ?? [])]
|
||||||
aside: newNavModel?.aside ?? nm?.aside
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ export interface Application extends Doc {
|
|||||||
|
|
||||||
// Also attached ApplicationNavModel will be joined after this one main.
|
// Also attached ApplicationNavModel will be joined after this one main.
|
||||||
navigatorModel?: NavigatorModel
|
navigatorModel?: NavigatorModel
|
||||||
aside?: AnyComponent
|
|
||||||
|
|
||||||
locationResolver?: Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
locationResolver?: Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
||||||
locationDataResolver?: Resource<(loc: Location) => Promise<LocationData>>
|
locationDataResolver?: Resource<(loc: Location) => Promise<LocationData>>
|
||||||
@ -130,7 +129,6 @@ export interface ApplicationNavModel extends Doc {
|
|||||||
|
|
||||||
spaces?: SpacesNavModel[]
|
spaces?: SpacesNavModel[]
|
||||||
specials?: SpecialNavModel[]
|
specials?: SpecialNavModel[]
|
||||||
aside?: AnyComponent
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -163,7 +161,6 @@ export interface SpacesNavModel {
|
|||||||
export interface NavigatorModel {
|
export interface NavigatorModel {
|
||||||
spaces: SpacesNavModel[]
|
spaces: SpacesNavModel[]
|
||||||
specials?: SpecialNavModel[]
|
specials?: SpecialNavModel[]
|
||||||
aside?: AnyComponent
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user