From dd152d50d2fa3a48c592d47d4866c9432fdfd684 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Wed, 1 Mar 2023 14:10:10 -0800 Subject: [PATCH 01/10] accept the fact that theres only one dashboard config --- server/__init__.py | 4 ++-- server/lib/util.py | 12 ++++-------- server/routes/disasters.py | 11 ++++++++--- server/routes/nl.py | 6 +++--- server/tests/lib/subject_page_config_content_test.py | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/server/__init__.py b/server/__init__.py index e691294471..4eafce10a9 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -98,8 +98,8 @@ def register_routes_stanford_dc(app, is_local): return # load disaster dashboard configs - disaster_dashboard_configs = libutil.get_disaster_dashboard_configs() - app.config['DISASTER_DASHBOARD_CONFIGS'] = disaster_dashboard_configs + disaster_dashboard_config = libutil.get_disaster_dashboard_config() + app.config['DISASTER_DASHBOARD_CONFIG'] = disaster_dashboard_config if app.config['INTEGRATION']: return diff --git a/server/lib/util.py b/server/lib/util.py index 5dc1a208cc..5c8c9dbed0 100644 --- a/server/lib/util.py +++ b/server/lib/util.py @@ -97,14 +97,10 @@ def get_topic_page_config(): # Returns list of disaster dashboard configs loaded as SubjectPageConfig protos -def get_disaster_dashboard_configs(): - dashboard_configs = [] - dashboard_configs_dir = os.path.join(get_repo_root(), "config", - "disaster_dashboard") - for filename in os.listdir(dashboard_configs_dir): - filepath = os.path.join(dashboard_configs_dir, filename) - dashboard_configs.append(get_subject_page_config(filepath)) - return dashboard_configs +def get_disaster_dashboard_config(): + filepath = os.path.join(get_repo_root(), "config", + "disaster_dashboard", "dashboard.textproto") + return get_subject_page_config(filepath) # Returns a summary of the available topic page summaries as an object: diff --git a/server/routes/disasters.py b/server/routes/disasters.py index 85375635ba..5bde899c8b 100644 --- a/server/routes/disasters.py +++ b/server/routes/disasters.py @@ -20,6 +20,8 @@ from flask import Blueprint from flask import current_app from flask import escape +from flask import url_for +from flask import redirect from google.protobuf.json_format import MessageToJson from server.config import subject_page_pb2 @@ -46,12 +48,15 @@ @bp.route('/') @bp.route('/', strict_slashes=False) -def disaster_dashboard(place_dcid=DEFAULT_PLACE_DCID): - all_configs = current_app.config['DISASTER_DASHBOARD_CONFIGS'] +def disaster_dashboard(place_dcid): + if not place_dcid: + return redirect(url_for('disasters.disaster_dashboard', DEFAULT_PLACE_DCID), code=302) + + all_configs = current_app.config['DISASTER_DASHBOARD_CONFIG'] if current_app.config['LOCAL']: # Reload configs for faster local iteration. # TODO: Delete this when we are close to launch - all_configs = server.lib.util.get_disaster_dashboard_configs() + all_configs = server.lib.util.get_disaster_dashboard_config() if len(all_configs) < 1: return "Error: no config installed" diff --git a/server/routes/nl.py b/server/routes/nl.py index a40a614b54..6a7545d60d 100644 --- a/server/routes/nl.py +++ b/server/routes/nl.py @@ -42,7 +42,7 @@ import server.lib.nl.page_config_builder as nl_page_config import server.lib.nl.utils as utils import server.lib.nl.utterance as nl_utterance -from server.lib.util import get_disaster_dashboard_configs +from server.lib.util import get_disaster_dashboard_config import server.services.bigtable as bt import server.services.datacommons as dc @@ -383,10 +383,10 @@ def data(): # TODO: Switch to NL-specific event configs instead of relying # on disaster dashboard's. - disaster_configs = current_app.config['DISASTER_DASHBOARD_CONFIGS'] + disaster_configs = current_app.config['DISASTER_DASHBOARD_CONFIG'] if current_app.config['LOCAL']: # Reload configs for faster local iteration. - disaster_configs = get_disaster_dashboard_configs() + disaster_configs = get_disaster_dashboard_config() disaster_config = None if disaster_configs: disaster_config = disaster_configs[0] diff --git a/server/tests/lib/subject_page_config_content_test.py b/server/tests/lib/subject_page_config_content_test.py index 04b727f943..416ba033a3 100644 --- a/server/tests/lib/subject_page_config_content_test.py +++ b/server/tests/lib/subject_page_config_content_test.py @@ -103,7 +103,7 @@ def test_required_fields(self): all_configs = {} all_configs.update(libutil.get_topic_page_config()) all_configs.update( - {"disaster_dashboard": libutil.get_disaster_dashboard_configs()}) + {"disaster_dashboard": libutil.get_disaster_dashboard_config()}) for id, configs in all_configs.items(): for page_i, page in enumerate(configs): page_msg = f"{id}[config={page_i}]" From fe110f22fb2fc7f0c295aefdfa4e681daee6921e Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Wed, 1 Mar 2023 14:11:12 -0800 Subject: [PATCH 02/10] rename Earth -> dashboard.textproto --- .../disaster_dashboard/{Earth.textproto => dashboard.textproto} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename server/config/disaster_dashboard/{Earth.textproto => dashboard.textproto} (100%) diff --git a/server/config/disaster_dashboard/Earth.textproto b/server/config/disaster_dashboard/dashboard.textproto similarity index 100% rename from server/config/disaster_dashboard/Earth.textproto rename to server/config/disaster_dashboard/dashboard.textproto From 5ea9eeb37ee3a8bcebc4c50a6e8c6182fbbfc1b3 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Wed, 1 Mar 2023 14:12:23 -0800 Subject: [PATCH 03/10] Earth.textproto --> nl/disasters.textproto --- .../Earth.textproto => nl_page/disasters.textproto} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename server/config/{disaster_dashboard/Earth.textproto => nl_page/disasters.textproto} (100%) diff --git a/server/config/disaster_dashboard/Earth.textproto b/server/config/nl_page/disasters.textproto similarity index 100% rename from server/config/disaster_dashboard/Earth.textproto rename to server/config/nl_page/disasters.textproto From dbacbffb073d2cf2a226fe204a0bc96d6c96e327 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Wed, 1 Mar 2023 14:21:17 -0800 Subject: [PATCH 04/10] move back to dashboard dir --- server/config/{nl_page => disaster_dashboard}/dashboard.textproto | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename server/config/{nl_page => disaster_dashboard}/dashboard.textproto (100%) diff --git a/server/config/nl_page/dashboard.textproto b/server/config/disaster_dashboard/dashboard.textproto similarity index 100% rename from server/config/nl_page/dashboard.textproto rename to server/config/disaster_dashboard/dashboard.textproto From aeaec8fffe697684d4291d4f5b5d01bc13d72926 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Thu, 2 Mar 2023 12:01:33 -0800 Subject: [PATCH 05/10] fix bug in top event --- static/js/components/tiles/top_event_tile.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/components/tiles/top_event_tile.tsx b/static/js/components/tiles/top_event_tile.tsx index 7d02f3d33e..b0063e1962 100644 --- a/static/js/components/tiles/top_event_tile.tsx +++ b/static/js/components/tiles/top_event_tile.tsx @@ -74,6 +74,9 @@ export function TopEventTile(props: TopEventTilePropType): JSX.Element { const displayPropUnits = {}; if (props.topEventMetadata.displayProp) { for (const dp of props.topEventMetadata.displayProp) { + if (_.isEmpty(props.eventTypeSpec.displayProp)) { + continue; + } for (const edp of props.eventTypeSpec.displayProp) { if (edp.prop == dp) { displayPropNames[dp] = edp.displayName; From 2dea0b54e6dd20b1c5f7357b3de85f2150fbc6a2 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Thu, 2 Mar 2023 12:16:18 -0800 Subject: [PATCH 06/10] checkpoint --- server/__init__.py | 8 +++--- server/config/nl_page/disasters.textproto | 15 +++++++++++ server/lib/nl/page_config_builder.py | 13 +-------- server/lib/util.py | 13 ++++++--- server/routes/disasters.py | 27 +++++-------------- server/routes/nl.py | 9 +++---- .../lib/subject_page_config_content_test.py | 3 ++- 7 files changed, 43 insertions(+), 45 deletions(-) diff --git a/server/__init__.py b/server/__init__.py index 4eafce10a9..b4e14a85c5 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -85,7 +85,7 @@ def register_routes_custom_dc(app): pass -def register_routes_stanford_dc(app, is_local): +def register_routes_disasters(app): # Install blueprints specific to Stanford DC from server.routes import disasters from server.routes import event @@ -215,12 +215,12 @@ def create_app(): register_routes_custom_dc(app) if (cfg.ENV == 'stanford' or os.environ.get('ENABLE_MODEL') == 'true' or cfg.LOCAL and not cfg.LITE): - register_routes_stanford_dc(app, cfg.LOCAL) + register_routes_disasters(app) if cfg.TEST or cfg.INTEGRATION: # disaster dashboard tests require stanford's routes to be registered. register_routes_base_dc(app) - register_routes_stanford_dc(app, cfg.LOCAL) + register_routes_disasters(app) else: register_routes_base_dc(app) @@ -301,6 +301,8 @@ def create_app(): nl_model = nl.Model() app.config['NL_MODEL'] = nl_model + # This also requires disaster and event routes. + app.config['NL_DISASTER_CONFIG'] = libutil.get_nl_disaster_config() if not cfg.TEST: urls = get_health_check_urls() diff --git a/server/config/nl_page/disasters.textproto b/server/config/nl_page/disasters.textproto index 2d611cf681..c69e409d9b 100644 --- a/server/config/nl_page/disasters.textproto +++ b/server/config/nl_page/disasters.textproto @@ -34,6 +34,21 @@ metadata { key: "AdministrativeArea1" value: "AdministrativeArea2" } + event_type_spec { + key: "earthquake" + value { + id: "earthquake" + name: "Earthquake" + event_type_dcids: "EarthquakeEvent" + color: "#930000" + default_severity_filter: { + prop: 'magnitude' + display_name: 'Magnitude' + upper_limit: 10 + lower_limit: 6 + } + } + } event_type_spec { key: "flood" value { diff --git a/server/lib/nl/page_config_builder.py b/server/lib/nl/page_config_builder.py index df3f3516f9..4b4614c12e 100644 --- a/server/lib/nl/page_config_builder.py +++ b/server/lib/nl/page_config_builder.py @@ -627,18 +627,7 @@ def _event_chart_block(metadata, block, column, place: Place, # Map EventType to config key. event_id = constants.EVENT_TYPE_TO_CONFIG_KEY[event_type] - if event_id == 'earthquake': - eq_val = metadata.event_type_spec[event_id] - eq_val.id = event_id - eq_val.name = 'Earthquake' - eq_val.event_type_dcids.append('EarthquakeEvent') - eq_val.color = '#930000' - sev_filter = eq_val.default_severity_filter - sev_filter.prop = 'magnitude' - sev_filter.display_name = 'Magnitude' - sev_filter.upper_limit = 10 - sev_filter.lower_limit = 6 - elif event_id in event_config.metadata.event_type_spec: + if event_id in event_config.metadata.event_type_spec: metadata.event_type_spec[event_id].CopyFrom( event_config.metadata.event_type_spec[event_id]) else: diff --git a/server/lib/util.py b/server/lib/util.py index 5c8c9dbed0..368f9b2701 100644 --- a/server/lib/util.py +++ b/server/lib/util.py @@ -96,10 +96,17 @@ def get_topic_page_config(): return topic_configs -# Returns list of disaster dashboard configs loaded as SubjectPageConfig protos +# Returns disaster dashboard config loaded as SubjectPageConfig protos def get_disaster_dashboard_config(): - filepath = os.path.join(get_repo_root(), "config", - "disaster_dashboard", "dashboard.textproto") + filepath = os.path.join(get_repo_root(), "config", "disaster_dashboard", + "dashboard.textproto") + return get_subject_page_config(filepath) + + +# Returns disaster dashboard config for NL +def get_nl_disaster_config(): + filepath = os.path.join(get_repo_root(), "config", "nl_page", + "disasters.textproto") return get_subject_page_config(filepath) diff --git a/server/routes/disasters.py b/server/routes/disasters.py index 5bde899c8b..a74a94b08a 100644 --- a/server/routes/disasters.py +++ b/server/routes/disasters.py @@ -20,8 +20,8 @@ from flask import Blueprint from flask import current_app from flask import escape -from flask import url_for from flask import redirect +from flask import url_for from google.protobuf.json_format import MessageToJson from server.config import subject_page_pb2 @@ -48,32 +48,19 @@ @bp.route('/') @bp.route('/', strict_slashes=False) -def disaster_dashboard(place_dcid): +def disaster_dashboard(place_dcid=None): if not place_dcid: - return redirect(url_for('disasters.disaster_dashboard', DEFAULT_PLACE_DCID), code=302) + return redirect(url_for('disasters.disaster_dashboard', place_dcid=DEFAULT_PLACE_DCID), + code=302) - all_configs = current_app.config['DISASTER_DASHBOARD_CONFIG'] + dashboard_config = current_app.config['DISASTER_DASHBOARD_CONFIG'] if current_app.config['LOCAL']: # Reload configs for faster local iteration. # TODO: Delete this when we are close to launch - all_configs = server.lib.util.get_disaster_dashboard_config() + dashboard_config = server.lib.util.get_disaster_dashboard_config() - if len(all_configs) < 1: - return "Error: no config installed" - - # Find the config for the topic & place. - dashboard_config = None - default_config = None - for config in all_configs: - if place_dcid in config.metadata.place_dcid: - dashboard_config = config - break - if DEFAULT_PLACE_DCID in config.metadata.place_dcid: - # TODO: Add a better way to find the default config. - default_config = config if not dashboard_config: - # Use the default config instead - dashboard_config = default_config + return "Error: no config installed" # Override the min severity for fires for Earth # TODO: Do this by extending the config instead. diff --git a/server/routes/nl.py b/server/routes/nl.py index 6a7545d60d..9661b27c2b 100644 --- a/server/routes/nl.py +++ b/server/routes/nl.py @@ -42,7 +42,7 @@ import server.lib.nl.page_config_builder as nl_page_config import server.lib.nl.utils as utils import server.lib.nl.utterance as nl_utterance -from server.lib.util import get_disaster_dashboard_config +from server.lib.util import get_nl_disaster_config import server.services.bigtable as bt import server.services.datacommons as dc @@ -383,13 +383,10 @@ def data(): # TODO: Switch to NL-specific event configs instead of relying # on disaster dashboard's. - disaster_configs = current_app.config['DISASTER_DASHBOARD_CONFIG'] + disaster_config = current_app.config['NL_DISASTER_CONFIG'] if current_app.config['LOCAL']: # Reload configs for faster local iteration. - disaster_configs = get_disaster_dashboard_config() - disaster_config = None - if disaster_configs: - disaster_config = disaster_configs[0] + disaster_config = get_nl_disaster_config() else: logging.error('Unable to load event configs!') diff --git a/server/tests/lib/subject_page_config_content_test.py b/server/tests/lib/subject_page_config_content_test.py index 416ba033a3..8607d136c4 100644 --- a/server/tests/lib/subject_page_config_content_test.py +++ b/server/tests/lib/subject_page_config_content_test.py @@ -103,7 +103,8 @@ def test_required_fields(self): all_configs = {} all_configs.update(libutil.get_topic_page_config()) all_configs.update( - {"disaster_dashboard": libutil.get_disaster_dashboard_config()}) + {"disaster_dashboard": [libutil.get_disaster_dashboard_config()]}) + all_configs.update({"nl_disasters": [libutil.get_nl_disaster_config()]}) for id, configs in all_configs.items(): for page_i, page in enumerate(configs): page_msg = f"{id}[config={page_i}]" From 560aa70420a3e4a8f3a8d18d6aca0c6c6e5f0bcf Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Fri, 3 Mar 2023 17:37:22 -0800 Subject: [PATCH 07/10] add ability to see nl disaster on topic --- server/config/nl_page/disasters.textproto | 31 +---------------------- server/routes/topic_page.py | 17 ++++++++++--- server/templates/topic_page.html | 1 + 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/server/config/nl_page/disasters.textproto b/server/config/nl_page/disasters.textproto index c69e409d9b..bae5aa3b39 100644 --- a/server/config/nl_page/disasters.textproto +++ b/server/config/nl_page/disasters.textproto @@ -175,7 +175,6 @@ metadata { prop: "differenceTemperature" display_name: "Difference" unit: "Celsius" - # If updating the lower_limit, also update the Extreme Heat event description (below, in this file). upper_limit: 35 lower_limit: 18 } @@ -197,7 +196,6 @@ metadata { prop: "differenceTemperature" display_name: "Difference" unit: "Celsius" - # If updating the upper_limit, also update the Extreme Cold event description (below, in this file). upper_limit: -18 lower_limit: -35 } @@ -220,6 +218,7 @@ categories { type: DISASTER_EVENT_MAP disaster_event_map_tile_spec: { polygon_event_type_key: "drought" + point_event_type_key: "earthquake" point_event_type_key: "fire" point_event_type_key: "flood" # point_event_type_key: "tornado" @@ -235,12 +234,6 @@ categories { categories { title: "Drought" - description: - "Droughts are measured using the Standardized Precipitation Index (SPI), " - "which quantifies the precipitation deficit at a given location for a set " - "timescale. Places where the 9-month SPI was less than -1.5 are considered " - "to be experiencing drought. We source drought data from " - "[NOAA](https://www.drought.gov/data-maps-tools/global-precipitation-climatology-centre-gpcc-standardized-precipitation-index-spi)." blocks { type: DISASTER_EVENT columns { @@ -282,11 +275,6 @@ categories { categories { title: "Fires" - description: - "Fire detection is based on both dispatcher reporting and VIIRS active " - "fire detection, which uses satellite imaging to identify fires based on " - "thermal readings. We source fire data from [NASA](https://lpdaac.usgs.gov/products/vnp14a1v001/) " - "and [WFIGS](https://data-nifc.opendata.arcgis.com/datasets/nifc::wfigs-wildland-fire-locations-full-history/about)." blocks { type: DISASTER_EVENT columns { @@ -339,10 +327,6 @@ categories { categories { title: "Floods" - description: - "Flood detection is based on MODIS and Sentinel-2 L1C satellite imagery " - "from the [Global Flood Database](https://developers.google.com/earth-engine/datasets/catalog/GLOBAL_FLOOD_DB_MODIS_EVENTS_V1) " - "and [Dynamic World](https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_DYNAMICWORLD_V1) respectively." blocks { type: DISASTER_EVENT columns { @@ -395,11 +379,6 @@ categories { categories { title: "Storms" - description: - "Cyclones, hurricanes, and typhoons are different names for the same " - "weather phenomenon: a rotating storm with extreme wind speeds and " - "torrential rain. We source our storm data from " - "[NOAA](https://www.ncei.noaa.gov/products/international-best-track-archive)." blocks { type: DISASTER_EVENT columns { @@ -440,12 +419,6 @@ categories { categories { title: "Wet bulb" - description: - "Wet-bulb temperature is the lowest temperature to which an object can cool " - "down when moisture evaporates from it. It measures how well our bodies cool " - "down by sweating when it’s hot and humid. The theoretical limit to human " - "survival for more than a few hours in the shade, even with unlimited water, " - "is a wet-bulb temperature of 35 °C." blocks { type: DISASTER_EVENT columns { @@ -500,7 +473,6 @@ categories { # categories { # title: "Extreme Heat" -# description: "Heat events for a place are defined by a large ( > 18 degree Celsius) difference between maximum temperatures and the average of monthly maximum temperatures over 1980-2010." # blocks { # type: DISASTER_EVENT # columns { @@ -553,7 +525,6 @@ categories { # categories { # title: "Extreme Cold" -# description: "Cold events for a place are defined by a large ( < -18 degree Celsius) difference between minimum temperatures and the average of monthly minimum temperatures over 1980-2010." # blocks { # type: DISASTER_EVENT # columns { diff --git a/server/routes/topic_page.py b/server/routes/topic_page.py index 044060c061..3f8d895b32 100644 --- a/server/routes/topic_page.py +++ b/server/routes/topic_page.py @@ -18,11 +18,15 @@ import flask from flask import current_app +from flask import g from google.protobuf.json_format import MessageToJson import server.lib.util as libutil import server.routes.api.place as place_api +_NL_DISASTER_TOPIC = 'nl_disasters' +_DEBUG_TOPICS = ['dev', _NL_DISASTER_TOPIC] + bp = flask.Blueprint('topic_page', __name__, url_prefix='/topic') @@ -36,15 +40,20 @@ def topic_page(topic_id=None, place_dcid=None): return flask.render_template('topic_page_landing.html') all_configs = current_app.config['TOPIC_PAGE_CONFIG'] - if os.environ.get('FLASK_ENV') == 'local': + if g.env == 'local': all_configs = libutil.get_topic_page_config() topic_configs = all_configs.get(topic_id, []) - if len(topic_configs) < 1: - return "Error: no config found" - if topic_id == 'dev' and os.environ.get('FLASK_ENV') == 'production': + if topic_id in _DEBUG_TOPICS: + if g.env in ['local', 'autopush', 'dev']: + if topic_id == _NL_DISASTER_TOPIC: + topic_configs = [libutil.get_nl_disaster_config()] + else: flask.abort(404) + if len(topic_configs) < 1: + return "Error: no config found" + if not place_dcid: return flask.render_template( 'topic_page.html', diff --git a/server/templates/topic_page.html b/server/templates/topic_page.html index 96179a8de9..b03f87d0e4 100644 --- a/server/templates/topic_page.html +++ b/server/templates/topic_page.html @@ -26,6 +26,7 @@ {% block head %} + {% endblock %} {% block content %} From c1371f50dce59135e96269ca0dfeb4db445adad0 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Mon, 6 Mar 2023 10:38:30 -0800 Subject: [PATCH 08/10] pr comments --- server/config/nl_page/disasters.textproto | 4 ++-- server/routes/topic_page.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/config/nl_page/disasters.textproto b/server/config/nl_page/disasters.textproto index bae5aa3b39..f5241b0809 100644 --- a/server/config/nl_page/disasters.textproto +++ b/server/config/nl_page/disasters.textproto @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -## This file specifies the disaster dashboard config for Earth. +## This file specifies disaster charts config for the NL interface. metadata { topic_id: "disaster_dashboard" diff --git a/server/routes/topic_page.py b/server/routes/topic_page.py index 3f8d895b32..8c691ef68d 100644 --- a/server/routes/topic_page.py +++ b/server/routes/topic_page.py @@ -48,8 +48,8 @@ def topic_page(topic_id=None, place_dcid=None): if g.env in ['local', 'autopush', 'dev']: if topic_id == _NL_DISASTER_TOPIC: topic_configs = [libutil.get_nl_disaster_config()] - else: - flask.abort(404) + else: + flask.abort(404) if len(topic_configs) < 1: return "Error: no config found" From 6862b3cddb352a5079cad1d6091e7eb21a9f8604 Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Mon, 6 Mar 2023 11:32:04 -0800 Subject: [PATCH 09/10] sync changes --- server/config/nl_page/disasters.textproto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/config/nl_page/disasters.textproto b/server/config/nl_page/disasters.textproto index f5241b0809..d463235287 100644 --- a/server/config/nl_page/disasters.textproto +++ b/server/config/nl_page/disasters.textproto @@ -85,6 +85,11 @@ metadata { end_date_prop: "endDate" end_date_prop: "containmentDate" end_date_prop: "controlledDate" + display_prop { + prop: "area" + display_name: "Area" + unit: "SquareKilometer" + } } } event_type_spec { @@ -134,6 +139,11 @@ metadata { upper_limit: 100000, lower_limit: 10 } + display_prop { + prop: "area" + display_name: "Area" + unit: "SquareKilometer" + } polygon_geo_json_prop: "geoJsonCoordinatesDP1" end_date_prop: "endDate" } From 3390a3c8bbea8c6e87fd02468b269b27f387755a Mon Sep 17 00:00:00 2001 From: Carolyn Au Date: Mon, 6 Mar 2023 11:39:58 -0800 Subject: [PATCH 10/10] fix lint --- server/routes/disasters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/routes/disasters.py b/server/routes/disasters.py index a74a94b08a..4d2a575aef 100644 --- a/server/routes/disasters.py +++ b/server/routes/disasters.py @@ -50,7 +50,8 @@ @bp.route('/', strict_slashes=False) def disaster_dashboard(place_dcid=None): if not place_dcid: - return redirect(url_for('disasters.disaster_dashboard', place_dcid=DEFAULT_PLACE_DCID), + return redirect(url_for('disasters.disaster_dashboard', + place_dcid=DEFAULT_PLACE_DCID), code=302) dashboard_config = current_app.config['DISASTER_DASHBOARD_CONFIG']