mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-28 19:08:01 +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 currentSpecial: string | undefined
|
||||
let specialComponent: SpecialNavModel | undefined
|
||||
let asideId: string | undefined
|
||||
let currentFragment: string | undefined = ''
|
||||
|
||||
let currentApplication: Application | undefined
|
||||
@ -124,13 +123,10 @@
|
||||
|
||||
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
||||
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
||||
if (asideId !== undefined && spaceSpecial === asideId) return
|
||||
if (spaceSpecial === undefined) return
|
||||
specialComponent = getSpecialComponent(spaceSpecial)
|
||||
if (specialComponent !== undefined) {
|
||||
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) {
|
||||
currentFragment = fragment
|
||||
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> {
|
||||
if (loc.fragment == null) return
|
||||
const hierarchy = client.getHierarchy()
|
||||
@ -277,7 +262,6 @@
|
||||
|
||||
defineSeparators('workbenchGuest', workbenchGuestSeparators)
|
||||
|
||||
let aside: HTMLElement
|
||||
let cover: HTMLElement
|
||||
</script>
|
||||
|
||||
@ -303,15 +287,6 @@
|
||||
<SpaceView {currentSpace} {currentView} />
|
||||
{/if}
|
||||
</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 bind:this={cover} class="cover" />
|
||||
|
@ -136,7 +136,6 @@
|
||||
let currentSpecial: string | undefined
|
||||
let currentQuery: Record<string, string | null> | undefined
|
||||
let specialComponent: SpecialNavModel | undefined
|
||||
let asideId: string | undefined
|
||||
let currentFragment: string | undefined = ''
|
||||
|
||||
let currentApplication: Application | undefined
|
||||
@ -374,8 +373,6 @@
|
||||
loc.path[4] = currentSpecial
|
||||
} else if (loc.path[3] === resolved.defaultLocation.path[3]) {
|
||||
loc.path[4] = resolved.defaultLocation.path[4]
|
||||
} else {
|
||||
loc.path[4] = asideId as string
|
||||
}
|
||||
} else {
|
||||
loc.path.length = 4
|
||||
@ -512,10 +509,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (special !== currentSpecial && (navigatorModel?.aside || currentApplication?.aside)) {
|
||||
asideId = special
|
||||
}
|
||||
|
||||
if (app !== undefined) {
|
||||
localStorage.setItem(`${locationStorageKeyId}_${app}`, originalLoc)
|
||||
}
|
||||
@ -589,21 +582,12 @@
|
||||
specialComponent = undefined
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 3:
|
||||
asideId = undefined
|
||||
if (currentSpace !== 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> {
|
||||
if (spaceId === currentSpace) return
|
||||
clear(2)
|
||||
@ -620,14 +604,11 @@
|
||||
|
||||
function setSpaceSpecial (spaceSpecial: string | undefined): void {
|
||||
if (currentSpecial !== undefined && spaceSpecial === currentSpecial) return
|
||||
if (asideId !== undefined && spaceSpecial === asideId) return
|
||||
clear(3)
|
||||
if (spaceSpecial === undefined) return
|
||||
specialComponent = getSpecialComponent(spaceSpecial)
|
||||
if (specialComponent !== undefined) {
|
||||
currentSpecial = spaceSpecial
|
||||
} else if (navigatorModel?.aside !== undefined || currentApplication?.aside !== undefined) {
|
||||
asideId = spaceSpecial
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,7 +628,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
let aside: HTMLElement
|
||||
let cover: HTMLElement
|
||||
let workbenchWidth: number = $deviceInfo.docWidth
|
||||
|
||||
@ -762,14 +742,6 @@
|
||||
person && client.getHierarchy().hasMixin(person, contact.mixin.Employee)
|
||||
? !client.getHierarchy().as(person, contact.mixin.Employee).active
|
||||
: false
|
||||
|
||||
let asideComponent: AnyComponent | undefined
|
||||
|
||||
$: if (asideId !== undefined && navigatorModel !== undefined) {
|
||||
asideComponent = navigatorModel?.aside ?? currentApplication?.aside
|
||||
} else {
|
||||
asideComponent = undefined
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if person && deactivated && !isAdminUser()}
|
||||
@ -1001,11 +973,8 @@
|
||||
<Component
|
||||
is={currentApplication.component}
|
||||
props={{
|
||||
currentSpace,
|
||||
asideId,
|
||||
asideComponent: currentApplication?.aside
|
||||
currentSpace
|
||||
}}
|
||||
on:close={closeAside}
|
||||
/>
|
||||
{:else if specialComponent}
|
||||
<Component
|
||||
@ -1035,12 +1004,6 @@
|
||||
<SpaceView {currentSpace} {currentView} {createItemDialog} {createItemLabel} />
|
||||
{/if}
|
||||
</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>
|
||||
{#if !$deviceInfo.aside.float}
|
||||
{#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))
|
||||
newNavModel = {
|
||||
spaces: [...spaces, ...newSpaces],
|
||||
specials: [...(newNavModel?.specials ?? []), ...(nm.specials ?? [])],
|
||||
aside: newNavModel?.aside ?? nm?.aside
|
||||
specials: [...(newNavModel?.specials ?? []), ...(nm.specials ?? [])]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ export interface Application extends Doc {
|
||||
|
||||
// Also attached ApplicationNavModel will be joined after this one main.
|
||||
navigatorModel?: NavigatorModel
|
||||
aside?: AnyComponent
|
||||
|
||||
locationResolver?: Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
||||
locationDataResolver?: Resource<(loc: Location) => Promise<LocationData>>
|
||||
@ -130,7 +129,6 @@ export interface ApplicationNavModel extends Doc {
|
||||
|
||||
spaces?: SpacesNavModel[]
|
||||
specials?: SpecialNavModel[]
|
||||
aside?: AnyComponent
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,7 +161,6 @@ export interface SpacesNavModel {
|
||||
export interface NavigatorModel {
|
||||
spaces: SpacesNavModel[]
|
||||
specials?: SpecialNavModel[]
|
||||
aside?: AnyComponent
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user