From 7738f03382a9fc68d727f16aa4b0d4d19c11e6ee Mon Sep 17 00:00:00 2001 From: Alexandru Artimon Date: Mon, 7 Oct 2024 18:48:43 +0000 Subject: [PATCH] HDX-10138 - Post CKAN upgrade - fix additional tests --- ckanext-hdx_theme/ckanext/hdx_theme/config_declaration.yaml | 6 +++--- ckanext-hdx_theme/ckanext/hdx_theme/plugin.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/config_declaration.yaml b/ckanext-hdx_theme/ckanext/hdx_theme/config_declaration.yaml index 48a7a35087..101e750073 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/config_declaration.yaml +++ b/ckanext-hdx_theme/ckanext/hdx_theme/config_declaration.yaml @@ -111,7 +111,7 @@ groups: description: URL Pattern(template) for the datagrid config - key: hdx.datagrid.prod type: bool - default: true + default: false #needs to be false so that tests pass example: true description: Caching will be enabled if true and the "master" branch from the github repo will be used for the Datagrid config - annotation: HDX Caching @@ -225,14 +225,14 @@ groups: example: http://gislayer:5000/api/file-structure-check/dataset/{dataset_id}/resource/{resource_id} description: URL for spreadsheet file structure checker - key: hdx.gis.layer_import_url - default: http://${HDX_GEOPREVIEW_API}/api/add-layer/dataset/{dataset_id}/resource/{resource_id}?resource_download_url={resource_download_url}&url_type={url_type} + # default: Needs to be empty for tests to work example: http://gislayer:5000/api/add-layer/dataset/{dataset_id}/resource/{resource_id}?resource_download_url={resource_download_url}&url_type={url_type} description: URL for GIS layer import for geopreview - key: hdx.gis.layer_delete_url example: http://gislayer:5000/api/delete-one-layer/{resource_id} description: URL for GIS layer delete for geopreview - key: hdx.gis.resource_pbf_url - default: //${HDX_DOMAIN}/gis/{resource_id}/{z}/{x}/{y}.pbf + # default: Needs to be empty for tests to work example: http://gislayer:5000/services/postgis/{resource_id}/wkb_geometry/vector-tiles/{z}/{x}/{y}.pbf description: URL for Resource PBF used in rendering maps - key: hdx.mapbox.baselayer.url diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py b/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py index ff7a24cfb3..be7b060e6e 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py +++ b/ckanext-hdx_theme/ckanext/hdx_theme/plugin.py @@ -83,7 +83,7 @@ def update_config(self, config): self.__add_wp_faq_url_for_checks(config) def __add_gis_layer_config_for_checks(self, config): - gis_layer_api = config.get('hdx.gis.layer_import_url') + gis_layer_api = config.get('hdx.gis.layer_import_url') or '' api_index = gis_layer_api.find('/api') gis_layer_base_api = gis_layer_api[0:api_index] gis_layer_base_api = self._create_full_URL(gis_layer_base_api) @@ -91,7 +91,7 @@ def __add_gis_layer_config_for_checks(self, config): def __add_spatial_config_for_checks(self, config): # search_str = '/services' - spatial_url = config.get('hdx.gis.resource_pbf_url') + spatial_url = config.get('hdx.gis.resource_pbf_url') or '' url_parts = urlparse(spatial_url) spatial_check_url = urlunparse((url_parts.scheme, url_parts.netloc, '/gis/test', '', '', '')) # url_index = spatial_url.find(search_str)