Skip to content
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

Closed
wants to merge 13 commits into from

Conversation

RijaRR
Copy link

@RijaRR RijaRR commented Aug 5, 2022

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 47516266+RijaRR@users.noreply.github.com

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

on paste image in edition of card description. We insert image as card attachement and in card description

Signed-off-by: RijaRR <47516266+RijaRR@users.noreply.github.com>
Copy link
Member

@juliushaertl juliushaertl left a 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.

embed = '!'
}

const attachmentString = embed + '[📎 ' + attachment.data + '](' + this.attachmentPreview(attachment) + ')'
Copy link
Member

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

}
}

if (files.length === 0) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.


},
onPaste() {
if (!this.descriptionEditing) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!this.descriptionEditing) return
if (!this.descriptionEditing) {
return
}

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (attachementLength === 0) return
if (attachementLength === 0) {
return
}

<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()" />
Copy link
Member

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

Copy link
Author

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.

@RijaRR
Copy link
Author

RijaRR commented Aug 9, 2022

@juliushaertl thanks for the comments. I will work on it as soon as possible.

@okow
Copy link

okow commented Oct 12, 2022

Any progress here?
I would love to get this feature...

@kirtan403
Copy link

Waiting for this feature to complete and get merged! Really excited about this feature...

@juliushaertl
Copy link
Member

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 :)

@RijaRR
Copy link
Author

RijaRR commented Dec 7, 2022

@juliushaertl sorry, I'm not very good with git. The new pull request is here #4297.

@RijaRR RijaRR closed this Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants