TSK-1328 Comment input in popup (#3154)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-05-10 12:11:00 +06:00 committed by GitHub
parent 16da75f6d8
commit d486dea298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View File

@ -20,11 +20,13 @@
import { createQuery } from '@hcengineering/presentation'
import { Label, resizeObserver, Spinner } from '@hcengineering/ui'
import { DocNavLink, ObjectPresenter } from '@hcengineering/view-resources'
import CommentPresenter from './CommentPresenter.svelte'
import { createEventDispatcher } from 'svelte'
import CommentInput from './CommentInput.svelte'
import CommentPresenter from './CommentPresenter.svelte'
export let objectId: Ref<Doc>
export let object: Doc
export let withInput: boolean = true
let loading = true
@ -68,6 +70,11 @@
{/each}
{/if}
</div>
{#if withInput}
<div class="mt-2">
<CommentInput {object} />
</div>
{/if}
<style lang="scss">
.item {

View File

@ -23,6 +23,7 @@
export let object: Doc
export let size: 'small' | 'medium' | 'large' = 'small'
export let showCounter = true
export let withInput: boolean = true
</script>
{#if value && value > 0}
@ -31,7 +32,7 @@
<div
use:tooltip={{
component: CommentPopup,
props: { objectId: object._id, object }
props: { objectId: object._id, object, withInput }
}}
class="sm-tool-icon"
>

View File

@ -110,7 +110,11 @@
<CommentsPresenter value={object.comments} {object} />
{/if}
{#if object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0}
<CommentsPresenter value={object.$lookup?.attachedTo?.comments} object={object.$lookup?.attachedTo} />
<CommentsPresenter
value={object.$lookup?.attachedTo?.comments}
object={object.$lookup?.attachedTo}
withInput={false}
/>
{/if}
</div>
{/if}

View File

@ -426,7 +426,11 @@
<CommentsPresenter value={object.comments} {object} />
{/if}
{#if object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0}
<CommentsPresenter value={object.$lookup?.attachedTo?.comments} object={object.$lookup?.attachedTo} />
<CommentsPresenter
value={object.$lookup?.attachedTo?.comments}
object={object.$lookup?.attachedTo}
withInput={false}
/>
{/if}
</div>
</div>