Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced layer.zip folder and file name with name of layer #146

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/views/DownloadGeoserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,10 @@

//TODO: find a better solution for layers that don't have workspace
// the below if statement checks for workspace in layer name
let layerName
if (this.selectedLayerData.layer.includes(':')) {
layerName = this.selectedLayerData.layer.split(':')[1]
} else {
layerName = this.selectedLayerData.layer
}
const layerName = this.getLayerName()

const filename = `${ layerName }.${ fileType }`
console.log("filename: "+ filename)

return JSZipUtils.getBinaryContent(url)
.then(data => zip.file(filename, data, { binary: true }))
Expand All @@ -366,8 +362,8 @@
this.generateZipFile(downloadProps)
.then((content) => {
this.$trackEvent('download', 'geoServer')

saveAs(content, 'layer.zip')
const layerName = this.getLayerName()
saveAs(content, layerName)
})
.catch(err => {
console.log(err)
Expand All @@ -393,6 +389,10 @@
}

},
getLayerName() {
const layerName = this.selectedLayerData.name.split(' ').join('_')
return layerName
}
},
}
</script>
Loading