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

Reload function added upon adding location tags #7496

Closed
wants to merge 5 commits into from

Conversation

NitinBhasneria
Copy link
Collaborator

Fixes #7359 (<=== Add issue number here)

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!

@NitinBhasneria NitinBhasneria changed the title Reload function added urpm adding location tags Reload function added upon adding location tags Feb 14, 2020
@codecov
Copy link

codecov bot commented Feb 14, 2020

Codecov Report

Merging #7496 into master will increase coverage by 1.95%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7496      +/-   ##
==========================================
+ Coverage   80.06%   82.02%   +1.95%     
==========================================
  Files          97       97              
  Lines        5624     5612      -12     
==========================================
+ Hits         4503     4603     +100     
+ Misses       1121     1009     -112
Impacted Files Coverage Δ
app/models/comment.rb 76.89% <75%> (-0.06%) ⬇️
app/models/node.rb 90.9% <0%> (+0.37%) ⬆️
app/controllers/users_controller.rb 82.1% <0%> (+1.05%) ⬆️
app/helpers/application_helper.rb 84.52% <0%> (+1.19%) ⬆️
app/controllers/search_controller.rb 97.67% <0%> (+2.32%) ⬆️
app/controllers/wiki_controller.rb 85% <0%> (+3.07%) ⬆️
app/models/concerns/node_shared.rb 90.29% <0%> (+3.39%) ⬆️
app/models/tag_selection.rb 96% <0%> (+4%) ⬆️
app/api/srch/search.rb 69.28% <0%> (+4.57%) ⬆️
app/services/execute_search.rb 94.44% <0%> (+5.55%) ⬆️
... and 8 more

Copy link
Contributor

@nstjean nstjean left a comment

Choose a reason for hiding this comment

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

So right now with the code as this is the page will reload every time a tag is submitted, whether or not it was successfully added, and whether or not it's one of the power tags.

So first we need to move the reload statement up into the section here so it only does it when the tag is successful:

$.each(response['saved'], function(i, tag) {

}

Second we need to add an if statement to check if it's one of the mapping power tags. We only want specific tags to reload: lat, lon, or place. We can use:

if (!!tag[0].split(':')[0].match(/^(lat|lon|place)$/)) {
  location.reload(true);
}

Then we need to test it to make sure it's doing what we want it to!

@NitinBhasneria
Copy link
Collaborator Author

Ok @nstjean will follow you.

@NitinBhasneria
Copy link
Collaborator Author

@nstjean can you help with this error.

@nstjean
Copy link
Contributor

nstjean commented Feb 14, 2020

Ahh, it wants us to take out the !! in there.

NitinBhasneia added 2 commits February 14, 2020 21:36
@plotsbot
Copy link
Collaborator

1 Warning
⚠️ There was an error with Danger bot’s Junit parsing: No JUnit file was found at output.xml
2 Messages
📖 @NitinBhasneria Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 #
Screenshots 📸 (click to expand)

7496-test_questions.png

7496-test_embeddable_grids.png

7496-test_signup.png

7496-test_viewing_the_settings_page.png

7496-test_tag_by_author_page.png

7496-test_wiki_page_with_inline_grids.png

7496-test_stats.png

7496-test_viewing_the_dashboard.png

7496-test_searching_an_item_from_the_homepage.png

7496-test_signup_modal_form_validation.png

7496-test_tag_stats.png

7496-test_login_modal_form_validation.png

7496-test_questions_shadow.png

7496-test_login_modal.png

7496-test_profile_page.png

7496-test_comments.png

7496-test_tags.png

7496-test_signup_modal.png

7496-test_wiki.png

7496-test_methods.png

7496-test_tag_page.png

7496-test_blog_page_with_location_modal.png

7496-test_tag_wildcard.png

7496-test_signup_modal_disabled_submit_button_on_empty_username.png

7496-test_embeddable_thumbnail_grids.png

7496-test_front_page_with_navbar_search_autocomplete.png

7496-test_spam_moderation_page.png

7496-test_login.png

7496-test_viewing_the_dropdown_menu.png

7496-test_viewing_question_post.png

7496-test_mobile_displays.png

7496-test_simple-data-grapher_powertag.png

7496-test_front.png

7496-test_question_page.png

7496-test_tag_contributors_page.png

7496-test_blog.png

7496-failures_test_adding_a_location_to_the_wiki.png

7496-test_people.png

7496-test_wiki_revisions.png

Learn about automated screenshots

Generated by 🚫 Danger

@nstjean
Copy link
Contributor

nstjean commented Feb 17, 2020

Are you having troubles with this? Can you reopen it so I can see the error?

Also, just a mention, for the commit messages try to put something descriptive so you know in the future what you did. :) "Improved" will be confusing later.

@NitinBhasneria
Copy link
Collaborator Author

@nstjean please see #7520

@nstjean
Copy link
Contributor

nstjean commented Feb 17, 2020

Thanks, I see the new one now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refresh page upon adding location tags
3 participants