Skip to content

Commit

Permalink
Merge pull request #726 from WorldBank-Transport/feature/weather-filt…
Browse files Browse the repository at this point in the history
…er-feature-flag

Add weather filter feature flag #160200005
  • Loading branch information
pcaisse authored Oct 23, 2018
2 parents fe281c9 + 0710c15 commit 9fd4e41
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deployment/ansible/group_vars/development
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ web_js_record_type_secondary_label: "Intervention"
web_js_blackspots_visible: "true"
web_js_heatmap_visible: "true"

web_js_weather_filter_visible: "true"

web_js_api_hostname: "http://localhost:7000"
web_js_windshaft_hostname: "http://localhost:7000"
driver_app_hostname: "{{ web_js_api_hostname }}"
Expand Down
3 changes: 3 additions & 0 deletions deployment/ansible/group_vars/production.example
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ web_js_blackspots_visible: "true"
# DRIVER can display crashes as individual points, as a heatmap, or both. Set this to "true" to
# enable the heatmap visualization.
web_js_heatmap_visible: "true"
# Whether or not to show the weather filter in the filter bar. This decision may depend on the
# quality of the weather data available in your location.
web_js_weather_filter_visible: "false"
# The Google Analytics ID that should be used for the application. For more information, see here:
# https://support.google.com/analytics/answer/1008080?hl=en
google_analytics_id: ""
Expand Down
3 changes: 3 additions & 0 deletions deployment/ansible/group_vars/production.j2
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ web_js_blackspots_visible: "true"
# DRIVER can display crashes as individual points, as a heatmap, or both. Set this to "true" to
# enable the heatmap visualization.
web_js_heatmap_visible: "true"
# Whether or not to show the weather filter in the filter bar. This decision may depend on the
# quality of the weather data available in your location.
web_js_weather_filter_visible: "false"
# The Google Analytics ID that should be used for the application. For more information, see here:
# https://support.google.com/analytics/answer/1008080?hl=en
google_analytics_id: ""
Expand Down
2 changes: 2 additions & 0 deletions deployment/ansible/group_vars/staging
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ web_js_record_type_secondary_label: "Intervention"
web_js_blackspots_visible: "true"
web_js_heatmap_visible: "true"

web_js_weather_filter_visible: "true"

web_js_api_hostname: "https://prs.azavea.com"
web_js_windshaft_hostname: "https://prs.azavea.com"
driver_app_hostname: "https://prs.azavea.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
enabled: {{ web_js_mapillary }},
clientId: '{{ web_js_mapillary_client_id }}',
range: {{ web_js_mapillary_range }}
},
weatherFilter: {
visible: {{ web_js_weather_filter_visible }}
}
};

Expand Down
3 changes: 2 additions & 1 deletion web/app/scripts/filterbar/filterbar-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* ngInject */
function FilterbarController($modal, $scope, $timeout, debounce, RecordSchemaState,
AuthService, FilterState, RecordState) {
AuthService, FilterState, RecordState, WebConfig) {
var ctl = this;
ctl.filters = {};
ctl.filterPolygon = null;
Expand All @@ -12,6 +12,7 @@
ctl.showSavedFiltersModal = showSavedFiltersModal;
ctl.userCanAdd = false;
ctl.hasWriteAccess = AuthService.hasWriteAccess();
ctl.showWeatherFilter = WebConfig.weatherFilter.visible;
init();

function init() {
Expand Down
2 changes: 1 addition & 1 deletion web/app/scripts/filterbar/filterbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ul class="nav navbar-nav" ng-if="ctl.hasWriteAccess">
<li text-search-field="__createdBy"></li>
</ul>
<ul class="nav navbar-nav">
<ul class="nav navbar-nav" ng-if="::filterbar.showWeatherFilter">
<li weather-field class="dropdown"></li>
</ul>
<ul class="nav navbar-nav" ng-repeat="(key, value) in filterbar.filterables">
Expand Down
3 changes: 3 additions & 0 deletions web/test/mock/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
},
mapillary: {
enabled: false
},
weatherFilter: {
visible: true
}
};

Expand Down

0 comments on commit 9fd4e41

Please sign in to comment.