-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
… user's location using an address or HTML5 geolocation.
const address = JSON.stringify(request.query.address); | ||
|
||
fetch(`${geocodingUrl}?address=${address}&key=${GOOGLE_API_KEY}`) | ||
.then((response) => response.json()) |
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.
parens superfluous on single param arrow functions
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.
The style guide doesn't have an opinion on this.
frontend/js/components/atoms/Hr.js
Outdated
|
||
Hr.propTypes = { | ||
label: PropTypes.string, | ||
color: PropTypes.string |
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.
color is not used at all in this component
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.
The goal was that the developer could change the color of the HR where needed. I'll update the PR.
<TextField | ||
label="Locate Using Address" | ||
name="address" | ||
value={this.state.value} |
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.
is this implicitly the state or are we setting an object 'value'
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 works (because JavaScript), but it we should be setting this.state.address
instead.
@@ -24,12 +31,14 @@ class Home extends Component { | |||
} | |||
|
|||
Home.propTypes = { | |||
user: PropTypes.object | |||
user: PropTypes.object, |
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.
how is user passed into this component? unclear after looking at top level routes.
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.
It would be coming from the global store through connect
at the bottom of Home.js
(or any other environment). What user
is doing isn't well defined yet, so I'll remove it for now.
{this.props.label} | ||
</label> | ||
} | ||
<div className={`text-field-input ${this.props.button && 'has-button'}`}> |
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.
we've declared this.props.button as an element type but using it in this context as a string, what happens? would be serializing the elm?
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 checking to see if this.props.button
is truthy, and if so it returns the string has-button
.
} | ||
// If there are multiple results | ||
else if (response.results.length > 1) { | ||
// TODO |
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.
pick the first was always fine before but can see if you wanted to display these in a a dropdown ux...
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.
Let's open a separate issue for that.
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.
Opened #150
}); | ||
case GET_LOCATION_BY_GPS_FAILURE: | ||
return Object.assign({}, state, { | ||
status: { |
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.
d this need a isFetching prop also
?
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.
Good catch.
@wbprice what issue does this refer to? Also, I see this deals with configuration, maybe @BretFisher and you should get together with this on his Docker changes? |
@ryayak1460 Addresses #137, #138, and #139. #147 introduces some changes to how we treat environment variables. If that gets merged before this one, I'll update this PR. |
Expects an environment variable
GOOGLE_API_KEY
to be defined.Solves #137 #138 #139. Moving to the next page (Select a survey) is not implemented here.