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 25, 2017
2 parents 72ba193 + fc3f838 commit 62d85cb
Show file tree
Hide file tree
Showing 27 changed files with 151 additions and 128 deletions.
16 changes: 11 additions & 5 deletions app/sensors/GeoDistanceDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class GeoDistanceDropdown extends Component {
unit: this.unit
};
this.allowedUnit = ["mi", "miles", "yd", "yards", "ft", "feet", "in", "inch", "km", "kilometers", "m", "meters", "cm", "centimeters", "mm", "millimeters", "NM", "nmi", "nauticalmiles"];
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId, false, true) : null;
this.defaultSelected = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
if (this.defaultSelected) {
const selected = this.props.data.filter(item => item.label === this.defaultSelected);
Expand Down Expand Up @@ -88,7 +88,7 @@ export default class GeoDistanceDropdown extends Component {
}

checkDefault() {
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = this.props.URLParams ? helper.URLParams.get(this.props.componentId, false, true) : null;
const defaultValue = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
this.changeValue(defaultValue);
}
Expand Down Expand Up @@ -246,7 +246,9 @@ export default class GeoDistanceDropdown extends Component {
});
}
helper.selectedSensor.setSortInfo(sortObj);
helper.URLParams.update(this.props.componentId, this.setURLValue(), this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, this.setURLValue(), this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -287,7 +289,9 @@ export default class GeoDistanceDropdown extends Component {
if(this.props.onValueChange) {
this.props.onValueChange(null);
}
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
}

Expand Down Expand Up @@ -339,7 +343,9 @@ export default class GeoDistanceDropdown extends Component {
unit: this.unit
});
}
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down
12 changes: 8 additions & 4 deletions app/sensors/GeoDistanceSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import _ from "lodash";
export default class GeoDistanceSlider extends Component {
constructor(props) {
super(props);
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId, false, true) : null;
this.defaultSelected = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
let value = this.defaultSelected && this.defaultSelected.distance ?
this.defaultSelected.distance < this.props.range.start ?
Expand Down Expand Up @@ -83,7 +83,7 @@ export default class GeoDistanceSlider extends Component {
}

checkDefault() {
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = this.props.URLParams ? helper.URLParams.get(this.props.componentId, false, true) : null;
const defaultValue = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
this.changeValue(defaultValue);
}
Expand Down Expand Up @@ -238,7 +238,9 @@ export default class GeoDistanceSlider extends Component {
});
}
helper.selectedSensor.setSortInfo(sortObj);
helper.URLParams.update(this.props.componentId, this.setURLValue(), this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, this.setURLValue(), this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -267,7 +269,9 @@ export default class GeoDistanceSlider extends Component {
key: this.props.componentId,
value: null
};
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
}

Expand Down
12 changes: 8 additions & 4 deletions app/sensors/PlacesSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class PlacesSearch extends Component {
this.handleResults = this.handleResults.bind(this);
this.customQuery = this.customQuery.bind(this);
this.setDefaultLocation = this.setDefaultLocation.bind(this);
this.urlParams = helper.URLParams.get(this.props.componentId);
this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId) : null;
}

componentWillMount() {
Expand Down Expand Up @@ -83,7 +83,7 @@ export default class PlacesSearch extends Component {
}

checkDefault(props) {
this.urlParams = helper.URLParams.get(props.componentId);
this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId) : null;
this.defaultValue = this.urlParams !== null ? this.urlParams : props.defaultSelected;
this.changeValue(this.defaultValue);
}
Expand Down Expand Up @@ -202,7 +202,9 @@ export default class PlacesSearch extends Component {
unit: this.props.unit
});
}
helper.URLParams.update(this.props.componentId, this.state.currentValue, this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, this.state.currentValue, this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -248,7 +250,9 @@ export default class PlacesSearch extends Component {
unit: this.props.unit
});
}
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
if(this.props.URLParams) {
helper.URLParams.update(this.props.componentId, null, this.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down
12 changes: 6 additions & 6 deletions dist/CustomQuery.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/GeoDistanceDropdown.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/GeoDistanceSlider.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/PlacesSearch.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/direction.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/earthquake.bundle.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/events.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/heatmap.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/list.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/meetupblast.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/nearby.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/now.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/transport.bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/weather.bundle.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions lib/sensors/GeoDistanceDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var GeoDistanceDropdown = function (_Component) {
unit: _this.unit
};
_this.allowedUnit = ["mi", "miles", "yd", "yards", "ft", "feet", "in", "inch", "km", "kilometers", "m", "meters", "cm", "centimeters", "mm", "millimeters", "NM", "nmi", "nauticalmiles"];
_this.urlParams = helper.URLParams.get(_this.props.componentId, false, true);
_this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId, false, true) : null;
_this.defaultSelected = _this.urlParams !== null ? _this.urlParams : _this.props.defaultSelected;
if (_this.defaultSelected) {
var selected = _this.props.data.filter(function (item) {
Expand Down Expand Up @@ -109,7 +109,7 @@ var GeoDistanceDropdown = function (_Component) {
};

GeoDistanceDropdown.prototype.checkDefault = function checkDefault() {
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = this.props.URLParams ? helper.URLParams.get(this.props.componentId, false, true) : null;
var defaultValue = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
this.changeValue(defaultValue);
};
Expand Down Expand Up @@ -278,7 +278,9 @@ var GeoDistanceDropdown = function (_Component) {
});
}
helper.selectedSensor.setSortInfo(_sortObj);
helper.URLParams.update(_this8.props.componentId, _this8.setURLValue(), _this8.props.URLParams);
if (_this8.props.URLParams) {
helper.URLParams.update(_this8.props.componentId, _this8.setURLValue(), _this8.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -311,7 +313,9 @@ var GeoDistanceDropdown = function (_Component) {
if (_this8.props.onValueChange) {
_this8.props.onValueChange(null);
}
helper.URLParams.update(_this8.props.componentId, null, _this8.props.URLParams);
if (_this8.props.URLParams) {
helper.URLParams.update(_this8.props.componentId, null, _this8.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -365,7 +369,9 @@ var GeoDistanceDropdown = function (_Component) {
unit: _this9.unit
});
}
helper.URLParams.update(_this9.props.componentId, null, _this9.props.URLParams);
if (_this9.props.URLParams) {
helper.URLParams.update(_this9.props.componentId, null, _this9.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down
12 changes: 8 additions & 4 deletions lib/sensors/GeoDistanceSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var GeoDistanceSlider = function (_Component) {

var _this = _possibleConstructorReturn(this, _Component.call(this, props));

_this.urlParams = helper.URLParams.get(_this.props.componentId, false, true);
_this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId, false, true) : null;
_this.defaultSelected = _this.urlParams !== null ? _this.urlParams : _this.props.defaultSelected;
var value = _this.defaultSelected && _this.defaultSelected.distance ? _this.defaultSelected.distance < _this.props.range.start ? _this.props.range.start : _this.defaultSelected.distance : _this.props.range.start;
value = parseInt(value, 10);
Expand Down Expand Up @@ -93,7 +93,7 @@ var GeoDistanceSlider = function (_Component) {
};

GeoDistanceSlider.prototype.checkDefault = function checkDefault() {
this.urlParams = helper.URLParams.get(this.props.componentId, false, true);
this.urlParams = this.props.URLParams ? helper.URLParams.get(this.props.componentId, false, true) : null;
var defaultValue = this.urlParams !== null ? this.urlParams : this.props.defaultSelected;
this.changeValue(defaultValue);
};
Expand Down Expand Up @@ -253,7 +253,9 @@ var GeoDistanceSlider = function (_Component) {
});
}
helper.selectedSensor.setSortInfo(sortObj);
helper.URLParams.update(_this7.props.componentId, _this7.setURLValue(), _this7.props.URLParams);
if (_this7.props.URLParams) {
helper.URLParams.update(_this7.props.componentId, _this7.setURLValue(), _this7.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand All @@ -280,7 +282,9 @@ var GeoDistanceSlider = function (_Component) {
key: _this7.props.componentId,
value: null
};
helper.URLParams.update(_this7.props.componentId, null, _this7.props.URLParams);
if (_this7.props.URLParams) {
helper.URLParams.update(_this7.props.componentId, null, _this7.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down
12 changes: 8 additions & 4 deletions lib/sensors/PlacesSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var PlacesSearch = function (_Component) {
_this.handleResults = _this.handleResults.bind(_this);
_this.customQuery = _this.customQuery.bind(_this);
_this.setDefaultLocation = _this.setDefaultLocation.bind(_this);
_this.urlParams = helper.URLParams.get(_this.props.componentId);
_this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId) : null;
return _this;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ var PlacesSearch = function (_Component) {
};

PlacesSearch.prototype.checkDefault = function checkDefault(props) {
this.urlParams = helper.URLParams.get(props.componentId);
this.urlParams = props.URLParams ? helper.URLParams.get(props.componentId) : null;
this.defaultValue = this.urlParams !== null ? this.urlParams : props.defaultSelected;
this.changeValue(this.defaultValue);
};
Expand Down Expand Up @@ -229,7 +229,9 @@ var PlacesSearch = function (_Component) {
unit: _this8.props.unit
});
}
helper.URLParams.update(_this8.props.componentId, _this8.state.currentValue, _this8.props.URLParams);
if (_this8.props.URLParams) {
helper.URLParams.update(_this8.props.componentId, _this8.state.currentValue, _this8.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down Expand Up @@ -277,7 +279,9 @@ var PlacesSearch = function (_Component) {
unit: _this9.props.unit
});
}
helper.URLParams.update(_this9.props.componentId, null, _this9.props.URLParams);
if (_this9.props.URLParams) {
helper.URLParams.update(_this9.props.componentId, null, _this9.props.URLParams);
}
helper.selectedSensor.set(obj, true);
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@appbaseio/reactivemaps",
"version": "1.2.0",
"version": "1.3.0",
"description": "Data Components for building map UIs",
"main": "lib/app.js",
"scripts": {
Expand All @@ -25,7 +25,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@appbaseio/reactivebase": "1.2.0",
"@appbaseio/reactivebase": "1.3.0",
"axios": "^0.15.2",
"google-map-react": "^0.14.5",
"google-maps": "^3.2.1",
Expand Down
2 changes: 1 addition & 1 deletion playground/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<body>
<div id="root"></div>
<div id="error-display"></div>
<script src="static/preview.332b7b6d17efa4d629bd.bundle.js"></script>
<script src="static/preview.299d114e22eefd3254d2.bundle.js"></script>
</body>
</html>

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion umd/reactivemaps.js

Large diffs are not rendered by default.

Binary file modified umd/reactivemaps.js.br
Binary file not shown.
Binary file modified umd/reactivemaps.js.gzip
Binary file not shown.
19 changes: 7 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# yarn lockfile v1


"@appbaseio/reactivebase@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@appbaseio/reactivebase/-/reactivebase-1.2.0.tgz#f0b838e63096bb516dc2325df0b13633ccbf6abe"
"@appbaseio/reactivebase@1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@appbaseio/reactivebase/-/reactivebase-1.3.0.tgz#a481b34d95a4d19c212ceace795fc5abaf2c6420"
dependencies:
appbase-js "^2.0.0-alpha-03"
appbase-js "2.0.0"
classnames "^2.2.5"
fbemitter "^2.1.1"
lodash "^4.17.4"
Expand Down Expand Up @@ -330,17 +330,16 @@ anymatch@^1.3.0:
arrify "^1.0.0"
micromatch "^2.1.5"

appbase-js@^2.0.0-alpha-03:
version "2.0.0-alpha-03"
resolved "https://registry.yarnpkg.com/appbase-js/-/appbase-js-2.0.0-alpha-03.tgz#867b2537e212758726d84fcc13aa2632a405b782"
[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/appbase-js/-/appbase-js-2.0.0.tgz#ebf6afa6a964bbc9649d99c7afce4bb24a35fe01"
dependencies:
babel-polyfill "^6.26.0"
es6-promise "^4.1.1"
eventemitter2 "^4.1.2"
fetch-everywhere "^1.0.5"
guid "0.0.12"
json-stable-stringify "^1.0.1"
json-stream "^1.0.0"
stream "^0.0.2"
url "^0.11.0"
ws "^2.2.0"
Expand Down Expand Up @@ -4926,10 +4925,6 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
dependencies:
jsonify "~0.0.0"

json-stream@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/json-stream/-/json-stream-1.0.0.tgz#1a3854e28d2bbeeab31cc7ddf683d2ddc5652708"

json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
Expand Down

0 comments on commit 62d85cb

Please sign in to comment.