UBER-397: Fix panel activity (#3370)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-06-07 01:52:13 +07:00 committed by GitHub
parent 5c9c672038
commit 8e11da1a2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 19 deletions

View File

@ -197,10 +197,12 @@
<div class="popupPanel-body__mobile-content clear-mins" class:max={useMaxWidth}> <div class="popupPanel-body__mobile-content clear-mins" class:max={useMaxWidth}>
<slot /> <slot />
{#if !withoutActivity} {#if !withoutActivity}
<Component {#key object._id}
is={activity.component.Activity} <Component
props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }} is={activity.component.Activity}
/> props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }}
/>
{/key}
{/if} {/if}
</div> </div>
{:else} {:else}
@ -215,10 +217,12 @@
<div class="popupPanel-body__main-content py-8 clear-mins" class:max={useMaxWidth}> <div class="popupPanel-body__main-content py-8 clear-mins" class:max={useMaxWidth}>
<slot /> <slot />
{#if !withoutActivity} {#if !withoutActivity}
<Component {#key object._id}
is={activity.component.Activity} <Component
props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }} is={activity.component.Activity}
/> props={{ object, showCommenInput: !withoutInput, shouldScroll: embedded, focusIndex: 1000 }}
/>
{/key}
{/if} {/if}
</div> </div>
</Scroller> </Scroller>

View File

@ -22,6 +22,7 @@
export let value: Attachment export let value: Attachment
export let removable: boolean = false export let removable: boolean = false
export let showPreview = false
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -91,17 +92,20 @@
on:click={clickHandler} on:click={clickHandler}
on:mousedown={middleClickHandler} on:mousedown={middleClickHandler}
> >
<!-- <div {#if showPreview}
class="flex-center icon" <div
class:svg={value.type === 'image/svg+xml'} class="flex-center icon"
class:image={isImage(value.type)} class:svg={value.type === 'image/svg+xml'}
style={imgStyle} class:image={isImage(value.type)}
> style={imgStyle}
{#if !isImage(value.type)}{iconLabel(value.name)}{/if} >
</div> --> {#if !isImage(value.type)}{iconLabel(value.name)}{/if}
<div class="flex-center icon"> </div>
{iconLabel(value.name)} {:else}
</div> <div class="flex-center icon">
{iconLabel(value.name)}
</div>
{/if}
</a> </a>
<div class="flex-col info-container"> <div class="flex-col info-container">
<div class="name"> <div class="name">

View File

@ -379,6 +379,7 @@
<AttachmentPresenter <AttachmentPresenter
value={attachment} value={attachment}
removable removable
showPreview
on:remove={(result) => { on:remove={(result) => {
if (result !== undefined) removeAttachment(attachment) if (result !== undefined) removeAttachment(attachment)
}} }}