-
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
Reload function added upon adding location tags #7496
Conversation
Codecov Report
@@ 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
|
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.
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!
Ok @nstjean will follow you. |
@nstjean can you help with this error. |
Ahh, it wants us to take out the |
a185d51
to
47c7a9e
Compare
Screenshots 📸 (click to expand)7496-test_questions.png7496-test_embeddable_grids.png7496-test_signup.png7496-test_viewing_the_settings_page.png7496-test_tag_by_author_page.png7496-test_wiki_page_with_inline_grids.png7496-test_stats.png7496-test_viewing_the_dashboard.png7496-test_searching_an_item_from_the_homepage.png7496-test_signup_modal_form_validation.png7496-test_tag_stats.png7496-test_login_modal_form_validation.png7496-test_questions_shadow.png7496-test_login_modal.png7496-test_profile_page.png7496-test_comments.png7496-test_tags.png7496-test_signup_modal.png7496-test_wiki.png7496-test_methods.png7496-test_tag_page.png7496-test_blog_page_with_location_modal.png7496-test_tag_wildcard.png7496-test_signup_modal_disabled_submit_button_on_empty_username.png7496-test_embeddable_thumbnail_grids.png7496-test_front_page_with_navbar_search_autocomplete.png7496-test_spam_moderation_page.png7496-test_login.png7496-test_viewing_the_dropdown_menu.png7496-test_viewing_question_post.png7496-test_mobile_displays.png7496-test_simple-data-grapher_powertag.png7496-test_front.png7496-test_question_page.png7496-test_tag_contributors_page.png7496-test_blog.png7496-failures_test_adding_a_location_to_the_wiki.png7496-test_people.png7496-test_wiki_revisions.pngLearn about automated screenshots Generated by 🚫 Danger |
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. |
Thanks, I see the new one now. :) |
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!
rake test
@publiclab/reviewers
for help, in a comment belowIf 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!