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

Drag and drop feature of comment editor does not work properly when editing a comment #8670

Closed
urvashigupta7 opened this issue Oct 23, 2020 · 17 comments · Fixed by #8897 or #8982
Closed
Assignees
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript

Comments

@urvashigupta7
Copy link
Contributor

urvashigupta7 commented Oct 23, 2020

When a file is uploaded using drag and drop feature it gets added in different text box.

Steps to reproduce bug :

  • Add file in comment box using drag and drop (Don't post new comment just add the file)
  • Try editing any existing comment, the file will get added in wrong textbox

ezgif com-video-to-gif (8)

@urvashigupta7 urvashigupta7 added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label Oct 23, 2020
@ghost
Copy link

ghost commented Oct 24, 2020

@cesswairimu @jywarren is this something i can take up?

@cesswairimu
Copy link
Collaborator

Hi, thanks @urvashigupta7 for opening this, I tested locally and it works fine. @karenefereyan could you please check on https://stable.publiclab.org/ could be its fixed but its not deployed yet. If you find the issue on stable you can go ahead. Thanks all

@urvashigupta7
Copy link
Contributor Author

Hi @cesswairimu. I am unable to add images while editing the comment on https://stable.publiclab.org/ . It just shows never-ending uploading

Screenshot from 2020-10-24 18-49-21

@cesswairimu
Copy link
Collaborator

cesswairimu commented Oct 24, 2020

Great investigation, thanks @urvashigupta7, would you like to work on this or should @karenefereyan give it a try

@ghost
Copy link

ghost commented Oct 25, 2020

Great investigation, thanks @urvashigupta7, would you like to work on this or should @karenefereyan give it a try

@urvashigupta7 would you like to work on it? Thanks cess

@urvashigupta7
Copy link
Contributor Author

@karenefereyan You can try this out 😄 Thanks!!

@ghost
Copy link

ghost commented Oct 25, 2020

@cesswairimu could you please assign this to me?

@ghost
Copy link

ghost commented Oct 25, 2020

@karenefereyan You can try this out 😄 Thanks!!

I see that you are a competitive programmer. I have been long interested in that. Could you tell me more about it?

@cesswairimu
Copy link
Collaborator

Go ahead @karenefereyan

@cesswairimu cesswairimu assigned ghost Oct 26, 2020
@urvashigupta7
Copy link
Contributor Author

@karenefereyan You can try this out smile Thanks!!

I see that you are a competitive programmer. I have been long interested in that. Could you tell me more about it?

Sure @karenefereyan . I would be happy to help. Let us just connect on twitter, we can discuss about this there.

@ghost
Copy link

ghost commented Nov 11, 2020

@cesswairimu @urvashigupta7 things have been tough on my side recently. Can you help me with the solving of this issue?

@ghost
Copy link

ghost commented Nov 12, 2020

@urvashigupta7 i'm unable to replicate the issue. I dragged and dropped files several times and afterward went ahead to edit comments and there are no irregularities. Or am i mistaken?

@urvashigupta7
Copy link
Contributor Author

Hi @karenefereyan. Edit comment does not work on https://stable.publiclab.org/ but I see edit comment works fine locally. But I am facing the issue I tried to show in the gif above.

@ghost
Copy link

ghost commented Nov 12, 2020

Hi @karenefereyan. Edit comment does not work on https://stable.publiclab.org/ but I see edit comment works fine locally. But I am facing the issue I tried to show in the gif above.

Oh okay. Thanks so much

@jywarren
Copy link
Member

jywarren commented Dec 1, 2020

Hello all, thank you for investigating and documenting this so carefully. I'm going to edit the title to add some specificity that this is during editing a comment. It may also be different depending on if the edited comment was just made (with no page refresh) or if it was there already, since newly made comments are inserted using JavaScript instead of being built-in at the time the page is prepared by Ruby.

I'm going to mark this as part of the overall Comment Editor project but whoever would like to work on it, i recommend writing a test that very specifically demonstrates this behavior, of editing a comment then drag-and-dropping an image - and to copy and adapt the test from this example:

test 'comment image drag and drop upload' do
Capybara.ignore_hidden_elements = false
visit "/wiki/wiki-page-path/comments"
find("p", text: "Reply to this comment...").click()
reply_preview_button = page.all('#post_comment')[0]
# Upload the image
drop_in_dropzone("#{Rails.root.to_s}/public/images/pl.png", ".dropzone")
# Wait for image upload to finish
wait_for_ajax
Capybara.ignore_hidden_elements = true
# Toggle preview
reply_preview_button.click()
# Make sure that image has been uploaded
page.assert_selector('#preview img', count: 1)
end

Thank you so much!

@jywarren jywarren added this to the Comment editor milestone Dec 1, 2020
@jywarren jywarren added the help wanted requires help by anyone willing to contribute label Dec 1, 2020
@jywarren
Copy link
Member

jywarren commented Dec 1, 2020

and linking to #8775

@jywarren jywarren changed the title Drag and drop feature of comment editor does not work properly Drag and drop feature of comment editor does not work properly when editing a comment Dec 1, 2020
@noi5e
Copy link
Contributor

noi5e commented Dec 27, 2020

I'm researching this bug right now, and I can consistently reproduce it. Here are some instructions for those curious:

Steps to Reproduce Bug

  1. Upload an image to the main comment form (at the bottom of page).
  2. Open an edit comment form.
  3. Upload an image to the edit comment form.
  4. The image doesn't end up in edit form (expected behavior). Instead it ends up in the main comment form (actual behavior).

Bug Notes

  • This bug is present in research notes, and questions (not wikis).
  • This bug is also present between an edit comment form, and a 'Reply to this comment' form.
    • ie. you can reproduce it if you follow the instructions above, and replace 'main comment form' with 'Reply to this comment' form.
  • The bug is present regardless of whether or not you upload via select, or drag-and-drop.
  • The bug is present only when an edit comment form is involved.
    • For example, cross-wiring doesn't happen when you upload into the main comment form, then upload into a 'Reply to this comment' form.

I wrote a system test demonstrating this behavior and will open a PR for it shortly.

@ghost ghost removed their assignment Dec 27, 2020
noi5e added a commit to noi5e/plots2 that referenced this issue Dec 29, 2020
noi5e added a commit to noi5e/plots2 that referenced this issue Dec 29, 2020
noi5e added a commit to noi5e/plots2 that referenced this issue Dec 30, 2020
noi5e added a commit to noi5e/plots2 that referenced this issue Dec 30, 2020
@noi5e noi5e self-assigned this Jan 3, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 6, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 6, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 7, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 8, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 8, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 8, 2021
jywarren pushed a commit that referenced this issue Jan 8, 2021
* add test for comment image crosswiring

* wrap everything in comment-form-wrapper, assign .selected in drop listener (#8670)

* delete defunct function, fix indentation & spacing #8670

* rewrite tests that rely on comment-form-wrapper

* remove deprecated code, comments; fix indent

* initialize  on pageload (#8670)

* rewrite for multiple file inputs

* change test to focus on image drag & drop #8670

* restore E.initialize call in drop #8670

* undo E.initialize call #8670

* assign unique IDs to comment form textareas #8670

* change ID selectors to class ones to match new IDs #8670

* fix indentation #8670

* change ID reference to class reference #8670

* initialize E with parameters in drop listener #8670

* update tests for new text-input selectors #8670

* change ID text-input reference to class ref #8670

* change text-input ID to class #8670

* drop: initialize E with params #8670

* remove semicolon
manchere pushed a commit to manchere/plots2 that referenced this issue Feb 13, 2021
…ab#8897)

* add test for comment image crosswiring

* wrap everything in comment-form-wrapper, assign .selected in drop listener (publiclab#8670)

* delete defunct function, fix indentation & spacing publiclab#8670

* rewrite tests that rely on comment-form-wrapper

* remove deprecated code, comments; fix indent

* initialize  on pageload (publiclab#8670)

* rewrite for multiple file inputs

* change test to focus on image drag & drop publiclab#8670

* restore E.initialize call in drop publiclab#8670

* undo E.initialize call publiclab#8670

* assign unique IDs to comment form textareas publiclab#8670

* change ID selectors to class ones to match new IDs publiclab#8670

* fix indentation publiclab#8670

* change ID reference to class reference publiclab#8670

* initialize E with parameters in drop listener publiclab#8670

* update tests for new text-input selectors publiclab#8670

* change ID text-input reference to class ref publiclab#8670

* change text-input ID to class publiclab#8670

* drop: initialize E with params publiclab#8670

* remove semicolon
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
…ab#8897)

* add test for comment image crosswiring

* wrap everything in comment-form-wrapper, assign .selected in drop listener (publiclab#8670)

* delete defunct function, fix indentation & spacing publiclab#8670

* rewrite tests that rely on comment-form-wrapper

* remove deprecated code, comments; fix indent

* initialize  on pageload (publiclab#8670)

* rewrite for multiple file inputs

* change test to focus on image drag & drop publiclab#8670

* restore E.initialize call in drop publiclab#8670

* undo E.initialize call publiclab#8670

* assign unique IDs to comment form textareas publiclab#8670

* change ID selectors to class ones to match new IDs publiclab#8670

* fix indentation publiclab#8670

* change ID reference to class reference publiclab#8670

* initialize E with parameters in drop listener publiclab#8670

* update tests for new text-input selectors publiclab#8670

* change ID text-input reference to class ref publiclab#8670

* change text-input ID to class publiclab#8670

* drop: initialize E with params publiclab#8670

* remove semicolon
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
…ab#8897)

* add test for comment image crosswiring

* wrap everything in comment-form-wrapper, assign .selected in drop listener (publiclab#8670)

* delete defunct function, fix indentation & spacing publiclab#8670

* rewrite tests that rely on comment-form-wrapper

* remove deprecated code, comments; fix indent

* initialize  on pageload (publiclab#8670)

* rewrite for multiple file inputs

* change test to focus on image drag & drop publiclab#8670

* restore E.initialize call in drop publiclab#8670

* undo E.initialize call publiclab#8670

* assign unique IDs to comment form textareas publiclab#8670

* change ID selectors to class ones to match new IDs publiclab#8670

* fix indentation publiclab#8670

* change ID reference to class reference publiclab#8670

* initialize E with parameters in drop listener publiclab#8670

* update tests for new text-input selectors publiclab#8670

* change ID text-input reference to class ref publiclab#8670

* change text-input ID to class publiclab#8670

* drop: initialize E with params publiclab#8670

* remove semicolon
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
…ab#8897)

* add test for comment image crosswiring

* wrap everything in comment-form-wrapper, assign .selected in drop listener (publiclab#8670)

* delete defunct function, fix indentation & spacing publiclab#8670

* rewrite tests that rely on comment-form-wrapper

* remove deprecated code, comments; fix indent

* initialize  on pageload (publiclab#8670)

* rewrite for multiple file inputs

* change test to focus on image drag & drop publiclab#8670

* restore E.initialize call in drop publiclab#8670

* undo E.initialize call publiclab#8670

* assign unique IDs to comment form textareas publiclab#8670

* change ID selectors to class ones to match new IDs publiclab#8670

* fix indentation publiclab#8670

* change ID reference to class reference publiclab#8670

* initialize E with parameters in drop listener publiclab#8670

* update tests for new text-input selectors publiclab#8670

* change ID text-input reference to class ref publiclab#8670

* change text-input ID to class publiclab#8670

* drop: initialize E with params publiclab#8670

* remove semicolon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript
Projects
None yet
4 participants