From bc03fe2d720a883829e0337619817ec1f0df5801 Mon Sep 17 00:00:00 2001 From: nboisteault Date: Thu, 5 Oct 2023 17:26:51 +0200 Subject: [PATCH] Add export started message when importing data --- assets/src/legacy/attributeTable.js | 2 +- assets/src/legacy/map.js | 7 ++++++- assets/src/legacy/switcher-layers-actions.js | 2 +- .../view/locales/en_US/dictionnary.UTF-8.properties | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/src/legacy/attributeTable.js b/assets/src/legacy/attributeTable.js index 63d2f393b6..0206a0758e 100644 --- a/assets/src/legacy/attributeTable.js +++ b/assets/src/legacy/attributeTable.js @@ -537,7 +537,7 @@ var lizAttributeTable = function() { // Export tools if ( 'exportLayers' in config.options && config.options.exportLayers == 'True' ) { html+= ' 
'; - html+= ' '; diff --git a/assets/src/legacy/map.js b/assets/src/legacy/map.js index fe8cd86168..919cbcd0e2 100644 --- a/assets/src/legacy/map.js +++ b/assets/src/legacy/map.js @@ -3893,7 +3893,12 @@ window.lizMap = function() { getFeatureUrlData['options']['OUTPUTFORMAT'] = eformat; // Download file - Utils.downloadFile(getFeatureUrlData['url'], getFeatureUrlData['options']); + document.querySelectorAll('.exportLayer').forEach(el => el.disabled = true); + mAddMessage(lizDict['layer.export.started'], 'info', true).addClass('export-in-progress'); + Utils.downloadFile(getFeatureUrlData['url'], getFeatureUrlData['options'], () => { + document.querySelectorAll('.exportLayer').forEach(el => el.disabled = false); + document.querySelector('#message .export-in-progress a').click(); + }); return false; } diff --git a/assets/src/legacy/switcher-layers-actions.js b/assets/src/legacy/switcher-layers-actions.js index 70d7471e33..6711758859 100644 --- a/assets/src/legacy/switcher-layers-actions.js +++ b/assets/src/legacy/switcher-layers-actions.js @@ -425,7 +425,7 @@ var lizLayerActionButtons = function() { }); // Export - $('#content').on('click', 'button.exportLayer', function(){ + $('#sub-dock').on('click', 'button.exportLayer', function(){ var eName = $(this).val(); var eFormat = $(this).parent().find('select.exportLayer').val(); lizMap.exportVectorLayer( eName, eFormat ); diff --git a/lizmap/modules/view/locales/en_US/dictionnary.UTF-8.properties b/lizmap/modules/view/locales/en_US/dictionnary.UTF-8.properties index a9ab60ece7..15bd868e54 100644 --- a/lizmap/modules/view/locales/en_US/dictionnary.UTF-8.properties +++ b/lizmap/modules/view/locales/en_US/dictionnary.UTF-8.properties @@ -129,6 +129,7 @@ layer.metadata.opacity.title=Opacity layer.export.right.required=Right is required to export layer. layer.export.unknown.export.error=The server reported an error 400 during the export of the layer. +layer.export.started=Export started, please wait... geobookmark.name.required=A name is required to create a bookmark. geobookmark.confirm.delete=Are you sure you want to delete this bookmark?