Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weather filter feature flag #160200005 #726

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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