Skip to content

Commit

Permalink
fix .zip missing from file by sanitizing layer name from weird charac…
Browse files Browse the repository at this point in the history
…ters
  • Loading branch information
IoannaMi committed Feb 21, 2025
1 parent f84a72b commit bb921b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/views/DownloadGeoserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,8 @@
let zip = new JSZip()
return Promise.all(urls.map(async ({ url, fileType }) => {
//TODO: find a better solution for layers that don't have workspace
// the below if statement checks for workspace in layer name
const layerName = this.getLayerName()
let layerName = this.getLayerName()
const filename = `${ layerName }.${ fileType }`
console.log("filename: "+ filename)
Expand All @@ -362,7 +361,7 @@
this.generateZipFile(downloadProps)
.then((content) => {
this.$trackEvent('download', 'geoServer')
const layerName = this.getLayerName()
const layerName = this.getLayerName()
saveAs(content, layerName)
})
.catch(err => {
Expand Down Expand Up @@ -390,7 +389,8 @@
},
getLayerName() {
const layerName = this.selectedLayerData.name.split(' ').join('_')
let layerName = this.selectedLayerData.name.split(' ').join('_')
layerName = layerName.replace(/[^\w\d-]/g, "_")
return layerName
}
},
Expand Down

3 comments on commit bb921b4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://nl2120.netlify.app as production
🚀 Deployed on https://67b86478db490f0b5723638d--nl2120.netlify.app

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.