Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 45 additions & 31 deletions packages/panel/src/components/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->
<script lang="ts">
import { afterUpdate, createEventDispatcher, SvelteComponent } from 'svelte'
import { Writable, writable } from 'svelte/store'

Check warning on line 18 in packages/panel/src/components/Panel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unable to resolve path to module 'svelte/store'

import activity from '@hcengineering/activity'
import { AccountRole, Doc, getCurrentAccount } from '@hcengineering/core'
Expand Down Expand Up @@ -55,9 +55,10 @@
export let content: HTMLElement | undefined | null = undefined
export let withoutContentScroll: boolean = false
export let customAside: ButtonItem[] | undefined = undefined
export let selectedAside: string | boolean = customAside ? customAside[0].id : isAside

Check warning on line 58 in packages/panel/src/components/Panel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected nullish value in conditional. The condition is always false
export let printHeader: boolean = true
export let printAside: boolean = false
export let printActivity: boolean = true
export let adaptive: HeaderAdaptive = 'disabled'
export let hideBefore: boolean = false
export let hideSearch: boolean = true
Expand Down Expand Up @@ -90,7 +91,7 @@
const waitCount = 10
const PanelScrollTop: Writable<Record<string, number>> = writable<Record<string, number>>({})

const startScrollHeightCheck = () => {

Check warning on line 94 in packages/panel/src/components/Panel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Missing return type on function
clearTimeout(timer)
timer = setTimeout(() => {
if (content == null) {
Expand Down Expand Up @@ -256,12 +257,14 @@
<div bind:this={content} class="popupPanel-body__mobile-content clear-mins" class:max>
<slot />
{#if showActivity}
{#key object._id}
<Component
is={activity.component.Activity}
props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }}
/>
{/key}
<div class="panel-activity" class:no-print={!printActivity}>
{#key object._id}
<Component
is={activity.component.Activity}
props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }}
/>
{/key}
</div>
{/if}
</div>
{:else if withoutContentScroll}
Expand All @@ -274,25 +277,27 @@
>
<slot />
{#if showActivity}
{#key object._id}
<Component
is={activity.component.Activity}
props={{
object,
showCommenInput: !withoutInput,
shouldScroll: embedded,
focusIndex: 1000,
boundary: content
}}
/>
{/key}
<div class="panel-activity" class:no-print={!printActivity}>
{#key object._id}
<Component
is={activity.component.Activity}
props={{
object,
showCommenInput: !withoutInput,
shouldScroll: embedded,
focusIndex: 1000,
boundary: content
}}
/>
{/key}
</div>
{/if}
</div>
{:else}
<Scroller
bind:divScroll={content}
on:divScrollTop={(event) => {
if (lastHref === window.location.href && event && event.detail !== $PanelScrollTop[lastHref]) {

Check warning on line 300 in packages/panel/src/components/Panel.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected any value in conditional. An explicit comparison or type cast is required
$PanelScrollTop[lastHref] = event.detail
}
}}
Expand All @@ -308,21 +313,30 @@
>
<slot />
{#if showActivity}
{#key object._id}
<Component
is={activity.component.Activity}
bind:innerRef={activityRef}
props={{
object,
showCommenInput: !withoutInput,
shouldScroll: embedded,
focusIndex: 1000,
boundary: content
}}
/>
{/key}
<div class="panel-activity" class:no-print={!printActivity}>
{#key object._id}
<Component
is={activity.component.Activity}
bind:innerRef={activityRef}
props={{
object,
showCommenInput: !withoutInput,
shouldScroll: embedded,
focusIndex: 1000,
boundary: content
}}
/>
{/key}
</div>
{/if}
</div>
</Scroller>
{/if}
</Panel>

<style lang="scss">
// Keeps the layout of the activity section unchanged; only used to exclude it from printing.
.panel-activity {
display: contents;
}
</style>
1 change: 1 addition & 0 deletions plugins/document-resources/src/components/EditDoc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
bind:useMaxWidth
{sideContentSpace}
printHeader={false}
printActivity={false}
{embedded}
adaptive={'default'}
bind:content
Expand Down
Loading