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

Paste image to card description #4297

Closed
wants to merge 2 commits into from

Conversation

RijaRR
Copy link

@RijaRR RijaRR commented Dec 7, 2022

Summary

on paste image in edition of card description. We insert image as card attachement and in card description. PR related to this issue

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

@RijaRR RijaRR mentioned this pull request Dec 7, 2022
5 tasks
@RijaRR RijaRR force-pushed the paste_image_to_card_desc2 branch from 6ea1d16 to ffa480a Compare December 7, 2022 10:01
Signed-off-by: rija.propitech <[email protected]>
@juliusknorr juliusknorr changed the title paste_image_to_card_desc_2 Paste image to card description Dec 7, 2022
<!--
- @copyright Copyright (c) 2022 Julius Härtl <[email protected]>
-
- @author Julius Härtl <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

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

heh, not sure this is intended

Copy link
Author

Choose a reason for hiding this comment

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

@marcelklehr I'm not sure which one is right. The content is coming from a previous file though AttachmentUploadProgress.vue will be created in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

let lineUpatedLength = 0

for (let i = 0; i < descStringLines.length; i++) {
if (i === cursor.line) {
Copy link
Member

Choose a reason for hiding this comment

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

Using a for-loop here seems excessive, if you only want to change one line. How anout this?

if (descStringLines[cursor.line]) {
        const line = descStringLines[cursor.line]
	descStringLines[cursor.line] = line.substring(0, cursor.ch) + attachmentString + line.substring(cursor.ch)
	lineUpatedLength = descStringLines[cursor.line].length
}

Copy link
Author

Choose a reason for hiding this comment

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

@marcelklehr it should work. I've changed this way.

this.loading = true
event.preventDefault()
for (const file of files) {
this.onLocalAttachmentSelected(file, 'file').then(this.addLastAttachmmentOnCursor)
Copy link
Member

@marcelklehr marcelklehr Dec 8, 2022

Choose a reason for hiding this comment

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

Phew, 'onLocalAttachmentSelected' should probably have been named differently, heh :D

Copy link
Member

Choose a reason for hiding this comment

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

Not your fault though, of course

<script>

export default {
name: 'AttachmentUploadProgress',
Copy link
Member

Choose a reason for hiding this comment

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

Good thinking to extract this component! 👍

return
}

const clipboardData = event.clipboardData
Copy link
Member

Choose a reason for hiding this comment

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

Where does the variable event come from?

}

this.loading = true
event.preventDefault()
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to work in Firefox as I still receive a path to my file in the text of the document:

image

@marcelklehr
Copy link
Member

In chrome nothing is inserted at all for me, for some reason :/

@okow

This comment was marked as duplicate.

@RijaRR
Copy link
Author

RijaRR commented Jun 2, 2023

Thank you for considering my contribution. After further consideration, I have decided to withdraw my pull request. I believe that other developers can better address the changes or additions needed for this project. I look forward to seeing how the project progresses. Feel free to continue the discussion without me. Best wishes to the team!

@RijaRR RijaRR closed this Jun 2, 2023
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.

Paste image on clipboard directly to comments like GitHub
4 participants