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

[Bug] Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image #9018

Closed
3 tasks done
noi5e opened this issue Jan 16, 2021 · 0 comments · Fixed by #9019
Closed
3 tasks done

[Bug] Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image #9018

noi5e opened this issue Jan 16, 2021 · 0 comments · Fixed by #9019
Assignees
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed JavaScript outreachy

Comments

@noi5e
Copy link
Contributor

noi5e commented Jan 16, 2021

Steps to Reproduce:

  1. Open up an edit comment form.
  2. Upload an image by clicking on the button in the toolbar.
  3. The rich-text image link does appear in the correct form.
  4. However, even though the upload proceeds correctly, the progress bars don't show.
Edit.Comment.Image.Upload.Progress.Bars.Bug.Before.Fix.mov

This bug occurs because the toolbar button in edit comment forms call on a fileupload method in dragdrop.js. The CSS selectors in this method refer to elements that exist in reply and main comment forms, but that DON'T exist in edit comment forms:

elem = $($D.selected).closest('div.comment-form-wrapper').eq(0);
elem.find('#create_progress').eq(0).show();
elem.find('#create_uploading').eq(0).show();
elem.find('#create_prompt').eq(0).hide();
elem.find('.dropzone').eq(0).removeClass('hover');

Here's how they are in edit comment forms:

<div id="imagebar">
<div id="c<%= comment.id%>progress" style="display:none;" class="progress progress-striped active pull-right">
<div id="c<%= comment.id%>progress-bar" class="progress-bar" style="width: 0%;"></div>
</div>
<p>
<span id="c<%= comment.id%>uploading" class="uploading" style="display:none;">
<%= translation('comments._edit.uploading') %>
</span>
<span id="c<%= comment.id%>prompt" class="prompt">
<span style="padding-right:4px;float:left;" class="hidden-xs">
<%= raw translation('comments._edit.drag_and_drop') %>
</span>

As opposed to reply and main comment forms:

<div id="imagebar">
<div id="create_progress" style="display:none;" class="progress float-right">
<div id="create_progress-bar" class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0%;"></div>
</div>
<p>
<span id="create_uploading" class="uploading" style="display:none;">
<%= translation('comments._form.uploading') %>
</span>
<span id="create_prompt" class="prompt">
<span style="padding-right:4px;float:left;" class="d-none d-md-inline">
<%= raw translation('comments._form.drag_and_drop') %>
</span>

Going to take care of this bug in stages:

  • Write system tests.
  • Add unique IDs and common classes to progress bar elements.
  • Change scripts to refer to the common class, ie. .progress instead of #create_upload.

I think this bugfix will pave the way for combining the scripts for edit comment forms with scripts for reply/main comment forms... They're so similar, it would really be helpful if they were just consolidated.


(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

@noi5e noi5e added bug the issue is regarding one of our programs which faces problems when a certain task is executed JavaScript outreachy labels Jan 16, 2021
@noi5e noi5e self-assigned this Jan 16, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 16, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 17, 2021
jywarren pushed a commit that referenced this issue Jan 18, 2021
…9019)

* add tests for image upload progress bars #9018

* fix image upload hover & progress bar issues #9018

* change ID references to class references #9018

* fix style for edit comment forms on questions #9018

* add classes to image upload progress bars #9018

* add classes; remove non-unique IDs #9018

* tweak image upload progress bar tests #9018

* forgot to remove screenshot #9018
@noi5e noi5e changed the title Bug: Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Jan 23, 2021
@noi5e noi5e changed the title Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Discussion: Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Jan 23, 2021
@noi5e noi5e changed the title Discussion: Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image [Discussion] Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Jan 24, 2021
@noi5e noi5e changed the title [Discussion] Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image [Bug] Progress Bars Don't Show for Edit Comment CLICK-to-Upload Image Jan 25, 2021
manchere pushed a commit to manchere/plots2 that referenced this issue Feb 13, 2021
…ubliclab#9019)

* add tests for image upload progress bars publiclab#9018

* fix image upload hover & progress bar issues publiclab#9018

* change ID references to class references publiclab#9018

* fix style for edit comment forms on questions publiclab#9018

* add classes to image upload progress bars publiclab#9018

* add classes; remove non-unique IDs publiclab#9018

* tweak image upload progress bar tests publiclab#9018

* forgot to remove screenshot publiclab#9018
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
…ubliclab#9019)

* add tests for image upload progress bars publiclab#9018

* fix image upload hover & progress bar issues publiclab#9018

* change ID references to class references publiclab#9018

* fix style for edit comment forms on questions publiclab#9018

* add classes to image upload progress bars publiclab#9018

* add classes; remove non-unique IDs publiclab#9018

* tweak image upload progress bar tests publiclab#9018

* forgot to remove screenshot publiclab#9018
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
…ubliclab#9019)

* add tests for image upload progress bars publiclab#9018

* fix image upload hover & progress bar issues publiclab#9018

* change ID references to class references publiclab#9018

* fix style for edit comment forms on questions publiclab#9018

* add classes to image upload progress bars publiclab#9018

* add classes; remove non-unique IDs publiclab#9018

* tweak image upload progress bar tests publiclab#9018

* forgot to remove screenshot publiclab#9018
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
…ubliclab#9019)

* add tests for image upload progress bars publiclab#9018

* fix image upload hover & progress bar issues publiclab#9018

* change ID references to class references publiclab#9018

* fix style for edit comment forms on questions publiclab#9018

* add classes to image upload progress bars publiclab#9018

* add classes; remove non-unique IDs publiclab#9018

* tweak image upload progress bar tests publiclab#9018

* forgot to remove screenshot publiclab#9018
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 JavaScript outreachy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant