Skip to content

Commit

Permalink
Externalized supported files types
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidQuartz committed Jul 4, 2022
1 parent 080c493 commit 87357f3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
53 changes: 52 additions & 1 deletion geonode_mapstore_client/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,57 @@ def resource_urls(request):
'OPTIONS',
dict()).get(
'MOSAIC_ENABLED',
False)
False),
'SUPPORTED_DATASET_FILE_TYPES': getattr(settings, "MAPSTORE_SUPPORTED_DATASET_FILE_TYPES", [
{
"id": "shp",
"label": "ESRI Shapefile",
"format": "vector",
"ext": ["shp"],
"requires": ["shp", "prj", "dbf", "shx"],
"optional": ["xml", "sld"]
},
{
"id": "tiff",
"label": "GeoTIFF",
"format": "raster",
"ext": ["tiff", "tif"],
"mimeType": ["image/tiff"],
"optional": ["xml", "sld"]
},
{
"id": "csv",
"label": "Comma Separated Value (CSV)",
"format": "vector",
"ext": ["csv"],
"mimeType": ["text/csv"],
"optional": ["xml", "sld"]
},
{
"id": "zip",
"label": "Zip Archive",
"format": "archive",
"ext": ["zip"],
"mimeType": ["application/zip"],
"optional": ["xml", "sld"]
},
{
"id": "xml",
"label": "XML Metadata File",
"format": "metadata",
"ext": ["xml"],
"mimeType": ["application/json"],
"needsFiles": ["shp", "prj", "dbf", "shx", "csv", "tiff", "zip", "sld"]
},
{
"id": "sld",
"label": "Styled Layer Descriptor (SLD)",
"format": "metadata",
"ext": ["sld"],
"mimeType": ["application/json"],
"needsFiles": ["shp", "prj", "dbf", "shx", "csv", "tiff", "zip", "xml"]
}
]
)
}
return defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}';
Expand Down Expand Up @@ -126,7 +127,10 @@
isMobile: isMobile,
datasetMaxUploadSize: datasetMaxUploadSize,
documentMaxUploadSize: documentMaxUploadSize,
maxParallelUploads: maxParallelUploads
maxParallelUploads: maxParallelUploads,
upload: {
supportedDatasetFileTypes: supportedDatasetFileTypes
}
},
geoNodeConfiguration: {
cardsMenu: {
Expand Down

0 comments on commit 87357f3

Please sign in to comment.