mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 12:47:45 +02:00
UBER-395: Allow to drop images into description (#3382)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -138,7 +138,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function createAttachment (file: File) {
|
||||
async function createAttachment (file: File): Promise<{ file: string; type: string } | undefined> {
|
||||
if (space === undefined || objectId === undefined || _class === undefined) return
|
||||
try {
|
||||
const uuid = await uploadFile(file)
|
||||
@@ -164,6 +164,7 @@
|
||||
saveDraft()
|
||||
dispatch('attach', { action: 'saved', value: attachments.size })
|
||||
dispatch('attached', _id)
|
||||
return { file: uuid, type: file.type }
|
||||
} catch (err: any) {
|
||||
setPlatformStatus(unknownError(err))
|
||||
}
|
||||
@@ -199,6 +200,7 @@
|
||||
removedAttachments.add(attachment)
|
||||
attachments.delete(attachment._id)
|
||||
attachments = attachments
|
||||
refInput.removeAttachment(attachment.file)
|
||||
saveDraft()
|
||||
dispatch('detached', attachment._id)
|
||||
}
|
||||
@@ -367,6 +369,9 @@
|
||||
on:attach={() => {
|
||||
attach()
|
||||
}}
|
||||
attachFile={async (file) => {
|
||||
return createAttachment(file)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{#if attachments.size && enableAttachments}
|
||||
|
||||
@@ -533,6 +533,7 @@
|
||||
onCancel={showConfirmationDialog}
|
||||
hideAttachments={attachments.size === 0}
|
||||
hideSubheader={!parentIssue}
|
||||
noFade={true}
|
||||
on:changeContent
|
||||
>
|
||||
<svelte:fragment slot="header">
|
||||
@@ -611,6 +612,7 @@
|
||||
alwaysEdit
|
||||
showButtons={false}
|
||||
kind={'indented'}
|
||||
isScrollable={false}
|
||||
enableBackReferences={true}
|
||||
enableAttachments={false}
|
||||
bind:content={object.description}
|
||||
|
||||
Reference in New Issue
Block a user