-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix preview button text to go back editing #7140
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7140 +/- ##
======================================
Coverage 81.6% 81.6%
======================================
Files 97 97
Lines 5599 5599
======================================
Hits 4569 4569
Misses 1030 1030 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great so far!! Excellent work! This works on the comments but I notice it's still not changing the button for the /wiki/new/ path. I think the code for it is here:
https://github.com/publiclab/plots2/blob/master/app/views/wiki/edit.html.erb
Can you see if you can update that one too? Thank you!!
@nstjean Sure! Now that you said I looked up and also found the preview button on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!!! Thanks so much! 🎉
This is fantastic. I think this has been broken for a little while. Would you be able to write a short system test to protect this fix for the future? It could be based on this; and it could be pretty minimal but it'd be great to just check each of these use cases: https://github.com/publiclab/plots2/blob/master/test/system/comment_test.rb That way this excellent fix gets protected. I think that we're re-using code a lot which is efficient, but it means people may not realize when they break a different use case for the same code! BTW, Does this fix #6297? 🎉 Also noting possible links to #5531, #6833 Awesome!!!! |
@jywarren Sure, I'll work on the tests. |
I noticed that #6297 is still occurring with the changes |
Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks! |
@@ -61,4 +61,22 @@ class CommentTest < ApplicationSystemTestCase | |||
assert_selector("#{parentid} .comment .comment-body p", text: 'batman') | |||
end | |||
|
|||
test 'the text change on preview button click' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, so did the original fix not resolve it, or is the test not passing but it should be?
There are some conflicts. Kindly resolve |
e7bfbcb
to
c9284bf
Compare
Screenshots 📸 (click to expand)7140-test_questions.png7140-test_embeddable_grids.png7140-test_signup.png7140-test_viewing_the_settings_page.png7140-test_tag_by_author_page.png7140-test_wiki_page_with_inline_grids.png7140-test_stats.png7140-test_viewing_the_dashboard.png7140-test_searching_an_item_from_the_homepage.png7140-test_signup_modal_form_validation.png7140-test_tag_stats.png7140-failures_test_drag_and_drop_image_upload_to_wiki_post_editor.png7140-test_login_modal_form_validation.png7140-test_questions_shadow.png7140-test_login_modal.png7140-test_profile_page.png7140-test_comments.png7140-test_tags.png7140-test_signup_modal.png7140-failures_test_edit_wiki.png7140-test_wiki.png7140-test_methods.png7140-test_tag_page.png7140-failures_test_comment_preview_button.png7140-test_blog_page_with_location_modal.png7140-test_tag_wildcard.png7140-test_signup_modal_disabled_submit_button_on_empty_username.png7140-test_embeddable_thumbnail_grids.png7140-test_front_page_with_navbar_search_autocomplete.png7140-test_spam_moderation_page.png7140-test_login.png7140-test_viewing_the_dropdown_menu.png7140-failures_test_add_a_comment_manually.png7140-failures_test_the_text_change_on_preview_button_click.png7140-test_viewing_question_post.png7140-test_mobile_displays.png7140-failures_test_comment_image_drag_and_drop_upload.png7140-test_simple-data-grapher_powertag.png7140-failures_test_comment_image_upload.png7140-test_front.png7140-test_question_page.png7140-test_tag_contributors_page.png7140-test_blog.png7140-test_people.png7140-test_wiki_revisions.pngLearn about automated screenshots Generated by 🚫 Danger |
As the person is inactive for more than a month, I am closing the PR. In case you want to push changes please feel free to open a new PR OR reopen this PR and add additional changes to it. |
Fixes #7122
Bug:
The preview button text was not being altered when clicked. With this you would need to click 'Preview' again to go back to editing.
I found this happening both in comments (create and edit) and in the legacy editor.
How it was fixed:
There were two bugs in
app/assets/javascripts/editor.js
file, thetoggle_preview
was getting the button by it's class but there were cases that multiple preview buttons were in the same page causing it to fail. Also the jquery.button('text')
function was not altering the button text.It has been created a parameter to receive the button object to ensure the right button is being accessed.