Skip to content

Commit

Permalink
Merge pull request #280 from GIScience/hotfix-v0.3.9
Browse files Browse the repository at this point in the history
Hotfix v0.3.9
  • Loading branch information
TheGreatRefrigerator authored Mar 2, 2019
2 parents e8cb939 + 2c7e523 commit 0113d05
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 18 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Deprecated
### Removed-->

## [v0.3.9] - 2019-03-02

### Changed
- fuel options initialization
- hide fuel options if it is not possible to retrieve car brands
- retry fuel option initialization on option change (after changing endpoint)

### Fixed
- missing fuel endpoint in Gruntfile.default.js ([#279](https://github.com/GIScience/openrouteservice-app/issues/279))

## [v0.3.8] - 2019-02-28

Expand Down
6 changes: 4 additions & 2 deletions Gruntfile.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ module.exports = function(grunt) {
shortenlink: "https://api-ssl.bitly.com/v3/shorten",
mapsurfer:
"https://api.openrouteservice.org/mapsurfer/{z}/{x}/{y}.png",
landmarks: 'https://landmarks-api.openrouteservice.org/'
landmarks: 'https://landmarks-api.openrouteservice.org/',
fuel: "https://api.openrouteservice.org/fuel"
}
}
},
Expand All @@ -308,7 +309,8 @@ module.exports = function(grunt) {
shortenlink: "https://api-ssl.bitly.com/v3/shorten",
mapsurfer:
"https://api.openrouteservice.org/mapsurfer/{z}/{x}/{y}.png",
landmarks: 'https://landmarks-api.openrouteservice.org/'
landmarks: 'https://landmarks-api.openrouteservice.org/',
fuel: "https://api.openrouteservice.org/fuel"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/ors-navigation/ors-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular
if ($location.path() == "/") {
ctrl.activeMenu = "/directions";
} else ctrl.activeMenu = $location.path();
ctrl.version = "0.3.8";
ctrl.version = "0.3.9";
}
],
$routeConfig: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
</ul>
</div>
</div>
<div class="options-box" ng-if="$ctrl.routing" ng-show="$ctrl.activeSubgroup == 'Car'">
<div class="options-box" ng-if="$ctrl.routing && $ctrl.carBrands" ng-show="$ctrl.activeSubgroup == 'Car'">
<div class="pointer" ng-click="fuelSettings = !fuelSettings">
<i ng-class="$ctrl.getClass(fuelSettings)">
</i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
/** This is a reference of the settings object, if we change here, it is updated in settings */
ctrl.currentOptions = orsSettingsFactory.getActiveOptions();

let brandsRequest = orsFuelService.getBrands();
brandsRequest.promise.then(
brandsResponse => {
ctrl.carBrands = brandsResponse.brands;
},
brandsError => {
console.log(brandsError);
}
);
if (!ctrl.carBrands) {
ctrl.initOFS();
}

// preference/weight is only considered for routing panel
if (ctrl.routing)
Expand Down Expand Up @@ -481,6 +475,9 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.routing = route == "directions" ? true : false;
});
ctrl.changeOptions = () => {
if (!ctrl.carBrands) {
ctrl.initOFS();
}
// call setoptions
if (ctrl.currentOptions.difficulty)
ctrl.difficultySliders.Fitness.options.disabled =
Expand Down Expand Up @@ -581,6 +578,21 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
};

// OFS options
ctrl.initOFS = () => {
try {
let brandsRequest = orsFuelService.getBrands();
brandsRequest.promise.then(
brandsResponse => {
ctrl.carBrands = brandsResponse.brands;
},
brandsError => {
console.log(brandsError);
}
);
} catch (e) {
ctrl.carBrands = null;
}
};
ctrl.carCategories = carCategories;
ctrl.categoryCheck = true;
ctrl.carModels = ctrl.carYears = ctrl.carTypes = [];
Expand Down
3 changes: 2 additions & 1 deletion app/infrastructure/ors-settings-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ angular.module("orsApp.settings-service", []).factory("orsSettingsFactory", [
orsSettingsFactory.focusIdx,
settings.profile.options.landmarks
);
let ofsSettings = profile === "Car" ? settings.profile.options.ofs : undefined;
let ofsSettings =
profile === "Car" ? settings.profile.options.ofs : undefined;
if (ofsSettings) {
orsFuelService.getConsumption(ofsSettings);
}
Expand Down
2 changes: 1 addition & 1 deletion app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*|------------------------------------------------------------------------------------*/
/**
* @author: Amandus Butzer, [email protected], Timothy Ellersiek, [email protected]
* @version: 0.3.8
* @version: 0.3.9
*/
(function(searchString, position) {
fetchData().then(bootstrapApplication);
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openrouteservice.org",
"description": "angular version of openrouteservice.org",
"version": "0.3.8",
"version": "0.3.9",
"homepage": "http://www.uni-heidelberg.de",
"license": "MIT",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maps.openrouteservice.org",
"version": "0.3.8",
"version": "0.3.9",
"repository": {
"type": "git",
"url": "https://github.com/GIScience/openrouteservice-app.git"
Expand Down

0 comments on commit 0113d05

Please sign in to comment.