Skip to content

Commit

Permalink
Fixes #776] Include the upload limits inside __GEONODE_CONFIG__ (#778)
Browse files Browse the repository at this point in the history
* - [Fixes #776] Include the upload limits inside __GEONODE_CONFIG__

* - get size from DB

* - use camelCase

* - refactor

* - add function in geonode
  • Loading branch information
marthamareal authored Feb 2, 2022
1 parent 5c24756 commit 6b442df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions geonode_mapstore_client/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

from django.conf import settings

from geonode.upload.utils import get_max_upload_size

def resource_urls(request):
"""Global values to pass to templates"""
defaults = dict(
Expand All @@ -26,6 +28,8 @@ def resource_urls(request):
'DEFAULT_MAP_CRS': getattr(settings, "DEFAULT_MAP_CRS", 'EPSG:3857'),
'DEFAULT_MAP_ZOOM': getattr(settings, "DEFAULT_MAP_ZOOM", 0),
'DEFAULT_TILE_SIZE': getattr(settings, "DEFAULT_TILE_SIZE", 512),
'DATASET_MAX_UPLOAD_SIZE': get_max_upload_size("dataset_upload_size"),
'DOCUMENT_MAX_UPLOAD_SIZE': get_max_upload_size("documet_upload_size"),
'DEFAULT_LAYER_FORMAT': getattr(settings, "DEFAULT_LAYER_FORMAT", 'image/png'),
'ALLOWED_DOCUMENT_TYPES': getattr(settings, "ALLOWED_DOCUMENT_TYPES", []),
'LANGUAGES': getattr(settings, "LANGUAGES", []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
const defaultMapCenterY = geoNodeSettings.DEFAULT_MAP_CENTER_Y || 0;
const defaultMapZoom = geoNodeSettings.DEFAULT_MAP_ZOOM || 0;
const defaultTileSize = geoNodeSettings.DEFAULT_TILE_SIZE || 512;
const datasetMaxUploadSize = geoNodeSettings.DATASET_MAX_UPLOAD_SIZE;
const documentMaxUploadSize = geoNodeSettings.DOCUMENT_MAX_UPLOAD_SIZE;
const defaultLayerFormat = geoNodeSettings.DEFAULT_LAYER_FORMAT || 'image/png';
const catalogueServices = geoNodeSettings.CATALOGUE_SERVICES || {};
const catalogueSelectedService = geoNodeSettings.CATALOGUE_SELECTED_SERVICE || '';
Expand Down Expand Up @@ -88,7 +90,9 @@
defaultLayerFormat: defaultLayerFormat,
timeEnabled: timeEnabled,
allowedDocumentTypes: allowedDocumentTypes,
isMobile: isMobile
isMobile: isMobile,
datasetMaxUploadSize: datasetMaxUploadSize,
documentMaxUploadSize: documentMaxUploadSize,
},
geoNodeConfiguration: {
cardsMenu: {
Expand Down

0 comments on commit 6b442df

Please sign in to comment.