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

State: Add geolocation #7457

Closed
wants to merge 1 commit into from
Closed

State: Add geolocation #7457

wants to merge 1 commit into from

Conversation

umurkontaci
Copy link
Contributor

@umurkontaci umurkontaci commented Aug 14, 2016

This PR is part of #7453 and fixes #7455.

Adds geolocation to the state tree.

/cc: @klimeryk @aidvu

Test live: https://calypso.live/?branch=add/geolocation

@umurkontaci umurkontaci added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature Group] Emails & Domains Features related to email integrations and domain management. State labels Aug 14, 2016
@klimeryk
Copy link
Contributor

Pinging also @aduth, since this functionality could also be used to enhance geolocation in post editor.

} );

return new Promise( ( resolve, reject ) => {
superagent.get( 'https://public-api.wordpress.com/geo.php', null, ( error, res ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We recently (#6947, cc @retrofox ) upgraded superagent to 2.x, which adds proper Promise support, so instead of creating a Promise instance you could simply return this get call.

@aduth aduth added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 15, 2016
@wensco wensco added this to the Cobalt: Backlog milestone Aug 23, 2016
@umurkontaci
Copy link
Contributor Author

Rebased and fixed everything commented. Ready for a review

@umurkontaci umurkontaci added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Sep 1, 2016
*/
import { combineReducers } from 'redux';
import camelCase from 'lodash/camelCase';
import mapKeys from 'lodash/mapKeys';
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional, but we can now do the following without worrying about bundle size: see #6539

import { camelCase, mapKeys } from 'lodash';

@gwwar gwwar added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Sep 2, 2016
@umurkontaci
Copy link
Contributor Author

Same feature has been added in #8423 by @aduth

@aduth
Copy link
Contributor

aduth commented Oct 5, 2016

Yikes, I knew it sounded familiar, but I totally forgot about this pull request. At least it appears we took a very similar approach! #8423 doesn't include tests or good JSDoc with the expectation that it'd be short-lived, so if there's a desire to use it elsewhere, we should plan to add those.

@umurkontaci
Copy link
Contributor Author

Yeah, I noticed when I had merge conflicts in action-types.js, alphabetical sorting to the rescue!

Once I finish #7453 , it is going to stay for a long time. So yeah, it's a good idea to add tests & docs.

@lancewillett lancewillett deleted the add/geolocation branch October 6, 2016 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management. State
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone Input: Make a GeoIP function
5 participants