Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
metagrover committed Sep 21, 2017
2 parents 1f011b3 + 7750f9e commit 72ba193
Show file tree
Hide file tree
Showing 35 changed files with 423 additions and 311 deletions.
17 changes: 14 additions & 3 deletions app/sensors/GeoDistanceDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class GeoDistanceDropdown extends Component {

// Set query information
componentWillMount() {
this.previousQuery = null; // initial value for onQueryChange
this.googleMaps = window.google.maps;
this.unit = this.props.unit;
this.getUserLocation();
Expand Down Expand Up @@ -163,12 +164,20 @@ export default class GeoDistanceDropdown extends Component {

// set the query type and input data
setQueryInfo() {
const getQuery = (value) => {
const currentQuery = this.props.customQuery ? this.props.customQuery(value) : this.customQuery(value);
if (this.props.onQueryChange && JSON.stringify(this.previousQuery) !== JSON.stringify(currentQuery)) {
this.props.onQueryChange(this.previousQuery, currentQuery);
}
this.previousQuery = currentQuery;
return currentQuery;
};
const obj = {
key: this.props.componentId,
value: {
queryType: this.type,
dataField: this.props.dataField,
customQuery: this.props.customQuery ? this.props.customQuery : this.customQuery,
customQuery: getQuery,
reactiveId: this.context.reactiveId,
showFilter: this.props.showFilter,
filterLabel: this.props.filterLabel ? this.props.filterLabel : this.props.componentId,
Expand Down Expand Up @@ -479,7 +488,8 @@ GeoDistanceDropdown.propTypes = {
URLParams: React.PropTypes.bool,
showFilter: React.PropTypes.bool,
filterLabel: React.PropTypes.string,
className: React.PropTypes.string
className: React.PropTypes.string,
onQueryChange: React.PropTypes.func
};

// Default props value
Expand Down Expand Up @@ -518,5 +528,6 @@ GeoDistanceDropdown.types = {
URLParams: TYPES.BOOLEAN,
showFilter: TYPES.BOOLEAN,
filterLabel: TYPES.STRING,
className: TYPES.STRING
className: TYPES.STRING,
onQueryChange: TYPES.FUNCTION
};
17 changes: 14 additions & 3 deletions app/sensors/GeoDistanceSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class GeoDistanceSlider extends Component {

// Set query information
componentWillMount() {
this.previousQuery = null; // initial value for onQueryChange
this.googleMaps = window.google.maps;
this.getUserLocation();
this.setQueryInfo();
Expand Down Expand Up @@ -148,12 +149,20 @@ export default class GeoDistanceSlider extends Component {

// set the query type and input data
setQueryInfo() {
const getQuery = (value) => {
const currentQuery = this.props.customQuery ? this.props.customQuery(value) : this.customQuery(value);
if (this.props.onQueryChange && JSON.stringify(this.previousQuery) !== JSON.stringify(currentQuery)) {
this.props.onQueryChange(this.previousQuery, currentQuery);
}
this.previousQuery = currentQuery;
return currentQuery;
};
const obj = {
key: this.props.componentId,
value: {
queryType: this.type,
dataField: this.props.dataField,
customQuery: this.props.customQuery ? this.props.customQuery : this.customQuery,
customQuery: getQuery,
reactiveId: this.context.reactiveId,
showFilter: this.props.showFilter,
filterLabel: this.props.filterLabel ? this.props.filterLabel : this.props.componentId,
Expand Down Expand Up @@ -476,7 +485,8 @@ GeoDistanceSlider.propTypes = {
URLParams: React.PropTypes.bool,
showFilter: React.PropTypes.bool,
filterLabel: React.PropTypes.string,
className: React.PropTypes.string
className: React.PropTypes.string,
onQueryChange: React.PropTypes.func
};

// Default props value
Expand Down Expand Up @@ -524,5 +534,6 @@ GeoDistanceSlider.types = {
URLParams: TYPES.BOOLEAN,
showFilter: TYPES.BOOLEAN,
filterLabel: TYPES.STRING,
className: TYPES.STRING
className: TYPES.STRING,
onQueryChange: TYPES.FUNCTION
};
17 changes: 14 additions & 3 deletions app/sensors/PlacesSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class PlacesSearch extends Component {
}

componentWillMount() {
this.previousQuery = null; // initial value for onQueryChange
this.googleMaps = window.google.maps;
this.setQueryInfo();
this.getUserLocation(this.setDefaultLocation);
Expand Down Expand Up @@ -122,12 +123,20 @@ export default class PlacesSearch extends Component {

// set the query type and input data
setQueryInfo() {
const getQuery = (value) => {
const currentQuery = this.props.customQuery ? this.props.customQuery(value) : this.customQuery(value);
if (this.props.onQueryChange && JSON.stringify(this.previousQuery) !== JSON.stringify(currentQuery)) {
this.props.onQueryChange(this.previousQuery, currentQuery);
}
this.previousQuery = currentQuery;
return currentQuery;
};
const obj = {
key: this.props.componentId,
value: {
queryType: this.type,
inputData: this.props.dataField,
customQuery: this.props.customQuery ? this.props.customQuery : this.customQuery,
customQuery: getQuery,
reactiveId: this.context.reactiveId,
showFilter: this.props.showFilter,
filterLabel: this.props.filterLabel ? this.props.filterLabel : this.props.componentId,
Expand Down Expand Up @@ -361,7 +370,8 @@ PlacesSearch.propTypes = {
showFilter: React.PropTypes.bool,
filterLabel: React.PropTypes.string,
unit: React.PropTypes.oneOf(["mi", "miles", "yd", "yards", "ft", "feet", "in", "inch", "km", "kilometers", "m", "meters", "cm", "centimeters", "mm", "millimeters", "NM", "nmi", "nauticalmiles"]),
className: React.PropTypes.string
className: React.PropTypes.string,
onQueryChange: React.PropTypes.func
};
// Default props value
PlacesSearch.defaultProps = {
Expand Down Expand Up @@ -392,5 +402,6 @@ PlacesSearch.types = {
URLParams: TYPES.BOOLEAN,
showFilter: TYPES.BOOLEAN,
filterLabel: TYPES.STRING,
className: TYPES.STRING
className: TYPES.STRING,
onQueryChange: TYPES.FUNCTION
};
22 changes: 11 additions & 11 deletions dist/CustomQuery.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/GeoDistanceDropdown.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/GeoDistanceSlider.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/PlacesSearch.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/style.min.css

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/direction.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/earthquake.bundle.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions dist/events.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/heatmap.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/list.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/meetupblast.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/nearby.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/now.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/transport.bundle.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/weather.bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions examples/GeoDistanceDropdown/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class Main extends Component {
}
placeholder="Search Location"
beforeValueChange={() => new Promise((resolve, reject) => resolve())}
onQueryChange={(prevQuery, nextQuery) => {
console.log("prevQuery", prevQuery);
console.log("nextQuery", nextQuery);
}}
/>
</div>
<div className="col s6 col-xs-6">
Expand Down
4 changes: 4 additions & 0 deletions examples/GeoDistanceSlider/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Main extends Component {
resolve();
})
}}
onQueryChange={(prevQuery, nextQuery) => {
console.log("prevQuery", prevQuery);
console.log("nextQuery", nextQuery);
}}
/>
</div>
<div className="col s6 col-xs-6">
Expand Down
16 changes: 5 additions & 11 deletions examples/PlacesSearch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Main extends Component {

onIdle(res) {
this.mapRef = res.props.map;
this.executeQuery();
}

render() {
Expand All @@ -66,23 +65,19 @@ class Main extends Component {
credentials="y4pVxY2Ok:c92481e2-c07f-4473-8326-082919282c18"
type="meetupdata1"
>
<SelectedFilters componentId="SelectedFilters" />
<div className="col s12 m6 col-xs-12 col-sm-6">
<div className="row h-100">
<div className="col s12 col-xs-12">
<SelectedFilters componentId={["OriginSensor", "DestinationSensor"]} />
<PlacesSearch
dataField={this.props.mapping.venue}
componentId="OriginSensor"
placeholder="Search Venue"
title="Origin"
// onValueChange={this.originQuery}
URLParams={true}
onValueChange={(val) => {console.log(val)}}
beforeValueChange={(val) => {
return new Promise(resolve => {
console.log(val);
resolve();
})
onValueChange={this.originQuery}
onQueryChange={(prevQuery, nextQuery) => {
console.log("prevQuery", prevQuery);
console.log("nextQuery", nextQuery);
}}
/>
</div>
Expand All @@ -94,7 +89,6 @@ class Main extends Component {
autoLocation={false}
title="Destination"
onValueChange={this.destinationQuery}
URLParams={true}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit 72ba193

Please sign in to comment.