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

Adds image button to wiki Editor #8252

Merged
merged 13 commits into from
Sep 14, 2020
Merged

Conversation

cypherean
Copy link
Contributor

@cypherean cypherean commented Aug 5, 2020

Fixes #8241, fixes #8259

simplescreenrecorder-2020-08-08_13 22 07

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@cypherean cypherean requested a review from a team as a code owner August 5, 2020 06:55
@gitpod-io
Copy link

gitpod-io bot commented Aug 5, 2020

@welcome
Copy link

welcome bot commented Aug 5, 2020

Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help.
Dangerbot will test out your code and reply in a bit with some pointers and requests.
Also please refer here for installation help 💿
There may be some errors, but don't worry! We'll work through them with you! 👍🎉😄
It would be great if you can tell us your Twitter handle so we can thank you properly?

@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #8252 into main will increase coverage by 0.71%.
The diff coverage is 91.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8252      +/-   ##
==========================================
+ Coverage   81.27%   81.98%   +0.71%     
==========================================
  Files         101      101              
  Lines        5859     5902      +43     
==========================================
+ Hits         4762     4839      +77     
+ Misses       1097     1063      -34     
Impacted Files Coverage Δ
app/controllers/tag_controller.rb 81.45% <83.33%> (+0.05%) ⬆️
app/controllers/spam2_controller.rb 71.84% <84.61%> (+10.30%) ⬆️
app/controllers/notes_controller.rb 83.46% <85.71%> (+0.06%) ⬆️
app/controllers/wiki_controller.rb 85.40% <87.50%> (+0.06%) ⬆️
app/controllers/admin_controller.rb 80.24% <100.00%> (ø)
app/controllers/batch_controller.rb 90.19% <100.00%> (+22.23%) ⬆️
app/controllers/comment_controller.rb 86.95% <100.00%> (ø)
app/controllers/home_controller.rb 98.38% <100.00%> (ø)
app/controllers/like_controller.rb 72.22% <100.00%> (ø)
app/controllers/users_controller.rb 81.11% <100.00%> (ø)
... and 7 more

@cypherean cypherean requested a review from a team as a code owner August 5, 2020 09:16
@cypherean cypherean changed the title Adds image button to wiki Editor [WIP] Adds image button to wiki Editor Aug 5, 2020
@cypherean cypherean changed the title [WIP] Adds image button to wiki Editor Adds image button to wiki Editor Aug 6, 2020
@jywarren
Copy link
Member

jywarren commented Aug 6, 2020

Exciting! Actually i wonder if we could do something a little simpler, i left a comment here! #8241 (comment)

Thank you so much @shreyaa-sharmaa !!

@jywarren
Copy link
Member

jywarren commented Aug 6, 2020

I'm thinking it could be related to @NitinBhasneria's work here! #8240

@cypherean
Copy link
Contributor Author

@jywarren its done. 🎉

@cypherean
Copy link
Contributor Author

cypherean commented Aug 8, 2020

I've also made a small changes to the toolbar so we can combine it with #8259.
Before:
current

Now:
t4

Copy link
Contributor

@sagarpreet-chadha sagarpreet-chadha left a comment

Choose a reason for hiding this comment

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

We can restrict the format of files uploaded using https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept . We donot want users to upload pdf,docs,etc., right?

Also after uploading multiple images, how does the user knows which image will be rendered where? Can you attach a screenshot of this case?
Thanks 🎉

@cypherean
Copy link
Contributor Author

cypherean commented Aug 9, 2020

@sagarpreet-chadha I've added the condition for file upload. Should I change it to accept="image/*" instead? Right now it is accept=" .jpg, .jpeg, .png"

We can upload one file at a time (similar to how we did it before) and thus the selected picture would come one after the other based on order of addition.

@jywarren
Copy link
Member

This sounds like a great plan, @shreyaa-sharmaa ! Let's do it!

Copy link
Contributor

@sagarpreet-chadha sagarpreet-chadha left a comment

Choose a reason for hiding this comment

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

Yes @shreyaa-sharmaa , let's support all the images format. Then this PR is good to go 🎉

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@cypherean
Copy link
Contributor Author

This is not ready to be merger yet.

@jywarren
Copy link
Member

OK, no rush, just tell us when you'd like to get this added in! Much appreciated!!

@@ -160,39 +160,10 @@ version of the editor is released. */
resize: vertical;
}

#imagebar {
Copy link
Member

Choose a reason for hiding this comment

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

Hi @shreyaa-sharmaa -- actually, we'd like to keep the image upload bar as well, so we have both. Will that be possible? Thank you! I'm sorry i missed this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do that.

@cypherean
Copy link
Contributor Author

Yeah, I misunderstood how adding an image in the post worked. But I've figured it out now. Sorry it's taking so long. I'll try to get it done asap.

@cypherean
Copy link
Contributor Author

This is almost done. I just need to ask about the placement of the progress bar. Should we have a progress bar below the textarea or to the right of it (same as that of main image)?
cc: @jywarren @sagarpreet-chadha

@sagarpreet-chadha
Copy link
Contributor

Let me ask UX experts @jywarren @ebarry for this, thanks 💯 Great work so far 😄

@jywarren
Copy link
Member

Hi! I believe we do it this way in the comment boxes... is it easy to just use the code that drives this?

Thank you!!!

Screen Shot 2020-08-25 at 1 07 24 PM

@ebarry
Copy link
Member

ebarry commented Aug 25, 2020

The progress bar as @jywarren advises looks good!
For reference, here's what the progress bar looks like on /post :
Untitled

@jywarren
Copy link
Member

I believe this is for inline image additions, not for the lead image, though, which is what @ebarry is highlighting. Thanks though, it's good context!

@cypherean
Copy link
Contributor Author

The original code for progress-bar for inline images doesn't work. I tried to use one similar to the comment boxes (noting here that the same function triggers progress bar in both these cases) but that didn't work as well. Right now I'm tracking it down. I'll hopefully get it done by tomorrow. Anyone here has any idea why the original one doesn't work? 😕

@jywarren
Copy link
Member

jywarren commented Sep 1, 2020

Hmm, i'm sorry you're having trouble! The original code presumably works in a couple other contexts still, like the comment box. I think it was complicated because it was intended to be re-used code for various contexts. Where is it failing? Could it be due to css selectors not being specific enough?

@cypherean
Copy link
Contributor Author

cypherean commented Sep 5, 2020

It's working now. Sorry it took so long. 😅
GIF of changes:
simplescreenrecorder-2020-09-05_12 32 03

Please test it in gitpod and let me know if any changes are required.

@cypherean
Copy link
Contributor Author

I believe this is complete now. Please have a look @jywarren @sagarpreet-chadha

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

This looks fantastic. Thank you so much, @shreyaa-sharmaa for bringing this to the finish line!!! 👍 🎉

@jywarren jywarren merged commit 2412b38 into publiclab:main Sep 14, 2020
@jywarren
Copy link
Member

Screen Shot 2020-09-15 at 12 21 16 PM

! Nice!!!

nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* initial commit

* test fix

* toolbar repositioning

* interface improvement

* removing the insert image modal

* bootstrap fixes

* file upload condition

* changed condition to accept all image types

* redifined structure for image upload

* added imagebar

* css fixes

* refactored code

* code climate issue fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants