Skip to content

Commit

Permalink
Add export started message when importing data (#3913)
Browse files Browse the repository at this point in the history
  • Loading branch information
nboisteault committed Oct 6, 2023
1 parent 035d906 commit 9ffd083
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/src/legacy/attributeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ var lizAttributeTable = function() {
// Export tools
if ( 'exportLayers' in config.options && config.options.exportLayers == 'True' ) {
html+= '&nbsp;<div class="export-formats btn-group pull-right" role="group" >';
html+= ' <button type="button" class="btn btn-mini dropdown-toggle" data-toggle="dropdown" aria-expanded="false">';
html+= ' <button type="button" class="btn btn-mini dropdown-toggle exportLayer" data-toggle="dropdown" aria-expanded="false">';
html+= lizDict['attributeLayers.toolbar.btn.data.export.title'];
html+= ' <span class="caret"></span>';
html+= ' </button>';
Expand Down
7 changes: 6 additions & 1 deletion assets/src/legacy/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4956,7 +4956,12 @@ window.lizMap = function() {
getFeatureUrlData['options']['OUTPUTFORMAT'] = eformat;

// Download file
downloadFile(getFeatureUrlData['url'], getFeatureUrlData['options']);
document.querySelectorAll('.exportLayer').forEach(el => el.disabled = true);
mAddMessage(lizDict['layer.export.started'], 'info', true).addClass('export-in-progress');
downloadFile(getFeatureUrlData['url'], getFeatureUrlData['options'], () => {
document.querySelectorAll('.exportLayer').forEach(el => el.disabled = false);
document.querySelector('#message .export-in-progress a').click();
});

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/legacy/switcher-layers-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,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?
Expand Down

0 comments on commit 9ffd083

Please sign in to comment.