-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can paste image in card desc #3951
Conversation
on paste image in edition of card description. We insert image as card attachement and in card description Signed-off-by: RijaRR <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your pull request. I left some first comments, but will get back later this week when I find some time for testing as well.
src/components/card/Description.vue
Outdated
embed = '!' | ||
} | ||
|
||
const attachmentString = embed + '[📎 ' + attachment.data + '](' + this.attachmentPreview(attachment) + ')' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit like some code duplication with https://github.com/nextcloud/deck/pull/3951/files#diff-13efa8e07ea02fc9250f60af86b21f7ffb530e682b2ed240fa3ae5529794af7fR205, so maybe you could unify that or move some parts out to a helper function
src/components/card/Description.vue
Outdated
} | ||
} | ||
|
||
if (files.length === 0) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (files.length === 0) return | |
if (files.length === 0) { | |
return | |
} |
To stick to https://docs.nextcloud.com/server/latest/developer_manual/getting_started/codingguidelines.html#id2 and makes the code a bit easier to grasp.
src/components/card/Description.vue
Outdated
|
||
}, | ||
onPaste() { | ||
if (!this.descriptionEditing) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!this.descriptionEditing) return | |
if (!this.descriptionEditing) { | |
return | |
} |
src/components/card/Description.vue
Outdated
@@ -238,6 +253,65 @@ export default { | |||
await this.saveDescription() | |||
}, 2500) | |||
}, | |||
async addLastAttachmmentOnCursor() { | |||
const attachementLength = this.$store.getters.attachmentsByCard(this.card.id).length | |||
if (attachementLength === 0) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (attachementLength === 0) return | |
if (attachementLength === 0) { | |
return | |
} |
src/components/card/Description.vue
Outdated
<h5> | ||
{{ t('deck', 'Description') }} | ||
<span v-if="descriptionLastEdit && !descriptionSaving">{{ t('deck', '(Unsaved)') }}</span> | ||
<span v-if="descriptionSaving">{{ t('deck', '(Saving…)') }}</span> | ||
<span v-for="attachment in uploadQueue" :key="attachment.name" class="attachment"> | ||
<a class="fileicon" :style="mimetypeForAttachment()" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is copied from the attachments tab, so maybe you could use a separate component to share the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliushaertl I have make some updates.
@juliushaertl thanks for the comments. I will work on it as soon as possible. |
Signed-off-by: RijaRR <[email protected]>
Signed-off-by: RijaRR <[email protected]>
Signed-off-by: RijaRR <[email protected]>
…o paste_image_to_card_desc
Any progress here? |
Waiting for this feature to complete and get merged! Really excited about this feature... |
The changes look good to me now. @RijaRR Could you maybe rebase your changes to latest master to fix the conflicts and squash them into one commit? Also eslint might need some fixes to properly pass :) |
@juliushaertl sorry, I'm not very good with git. The new pull request is here #4297. |
on paste image in edition of card description. We insert image as card attachement and in card description. PR related to this issue #533
Signed-off-by: RijaRR [email protected]
Summary
TODO
Checklist