From fbe2e56c5d8ce9d0d3650545e70873f2e6b3f79c Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 31 Oct 2018 11:58:05 +0200 Subject: [PATCH 1/3] Make citybike map layer visibility default to obey transportmode availablility --- app/store/MapLayerStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/store/MapLayerStore.js b/app/store/MapLayerStore.js index 78bff4003a..241d3e5897 100644 --- a/app/store/MapLayerStore.js +++ b/app/store/MapLayerStore.js @@ -4,7 +4,6 @@ import { setMapLayerSettings, getMapLayerSettings } from './localStorage'; class MapLayerStore extends Store { static defaultLayers = { - citybike: false, // TODO: set back to true when stations open again parkAndRide: true, stop: { bus: true, @@ -35,6 +34,11 @@ class MapLayerStore extends Store { constructor(dispatcher) { super(dispatcher); + + const { config } = dispatcher.getContext(); + this.mapLayers.citybike = + config.transportModes.citybike && config.transportModes.citybike.availableForSelection; + const storedMapLayers = getMapLayerSettings(); if (Object.keys(storedMapLayers).length > 0) { this.mapLayers = { ...storedMapLayers }; From dd7a4e0a4617558e3cdffdcc0a823bb7e803dc04 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 31 Oct 2018 12:32:49 +0200 Subject: [PATCH 2/3] Update engine specs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0a5bce8f7..0c5295bbac 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ }, "engineStrict": true, "engines": { - "node": ">=8.0", + "node": ">=8.11.2", "npm": ">=3.0" }, "browserslist": [ From 97c7413010b5fcc1a691ebf2dbb1e4ed640334d0 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 31 Oct 2018 12:33:03 +0200 Subject: [PATCH 3/3] Lint --- app/store/MapLayerStore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/store/MapLayerStore.js b/app/store/MapLayerStore.js index 241d3e5897..b11ab20ff1 100644 --- a/app/store/MapLayerStore.js +++ b/app/store/MapLayerStore.js @@ -37,7 +37,8 @@ class MapLayerStore extends Store { const { config } = dispatcher.getContext(); this.mapLayers.citybike = - config.transportModes.citybike && config.transportModes.citybike.availableForSelection; + config.transportModes.citybike && + config.transportModes.citybike.availableForSelection; const storedMapLayers = getMapLayerSettings(); if (Object.keys(storedMapLayers).length > 0) {