From 9ef27e429279a6648068e83da2c4afc838a08bf0 Mon Sep 17 00:00:00 2001 From: David Quartey <42542676+DavidQuartz@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:38:04 +0000 Subject: [PATCH] [Backport 4.x] [Fixes #1064] Expose supported upload file formats as configurations (#1080) --- geonode_mapstore_client/context_processors.py | 4 +++- .../templates/geonode-mapstore-client/_geonode_config.html | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/geonode_mapstore_client/context_processors.py b/geonode_mapstore_client/context_processors.py index 66391d68e2..b6d0797f4c 100644 --- a/geonode_mapstore_client/context_processors.py +++ b/geonode_mapstore_client/context_processors.py @@ -12,6 +12,7 @@ from django.conf import settings from geonode.upload.utils import get_max_upload_size, get_max_upload_parallelism_limit +from geonode.utils import get_supported_datasets_file_types def resource_urls(request): """Global values to pass to templates""" @@ -54,6 +55,7 @@ def resource_urls(request): 'OPTIONS', dict()).get( 'MOSAIC_ENABLED', - False) + False), + 'SUPPORTED_DATASET_FILE_TYPES': get_supported_datasets_file_types() } return defaults diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html b/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html index a6819ba790..3af1fa6ef3 100644 --- a/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html +++ b/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html @@ -61,6 +61,7 @@ const pluginsConfigPatchRules = geoNodeSettings.PLUGINS_CONFIG_PATCH_RULES || []; const translationsPath = geoNodeSettings.TRANSLATIONS_PATH; const extensionsFolder = geoNodeSettings.EXTENSIONS_FOLDER_PATH; + const supportedDatasetFileTypes = geoNodeSettings.SUPPORTED_DATASET_FILE_TYPES; const isEmbed = checkBoolean('{{ is_embed }}') || false; const pluginsConfigKey = '{{ plugins_config_key }}'; @@ -126,7 +127,10 @@ isMobile: isMobile, datasetMaxUploadSize: datasetMaxUploadSize, documentMaxUploadSize: documentMaxUploadSize, - maxParallelUploads: maxParallelUploads + maxParallelUploads: maxParallelUploads, + upload: { + supportedDatasetFileTypes: supportedDatasetFileTypes + } }, geoNodeConfiguration: { cardsMenu: {