@@ -16,7 +16,7 @@
Loading
16 16
		this.name = parsedPath.name;
17 17
		this.namespace = parts[0];
18 18
		this.category = parts[1];
19 -
		this.url = `/assets/${this.namespace}/${this.category}/${parsedPath.base}`;
19 +
		this.url = `/assets/${this.namespace}/${this.category}/${encodeURIComponent(this.base)}`;
20 20
	}
21 21
}
22 22

@@ -102,7 +102,7 @@
Loading
102 102
		<!-- 2017/03/18: Had to remove with-backdrop during the dashboard re-write -->
103 103
		<paper-dialog id="uploadDialog">
104 104
			<paper-dialog-scrollable>
105 -
				<vaadin-upload id="uploader" target="/assets/[[collectionName]]/[[category.name]]" on-upload-start="refitUploadDialog" on-upload-before="_onUploadBefore" on-file-reject="_onFileReject" on-upload-success="_onUploadSuccess">
105 +
				<vaadin-upload id="uploader" target="/assets/[[collectionName]]/[[category.name]]" on-upload-start="refitUploadDialog" on-file-reject="_onFileReject" on-upload-success="_onUploadSuccess">
106 106
					<template is="dom-if" if="[[category.allowedTypes.length]]">
107 107
						<div id="acceptsMsg">[[acceptsMsg]]</div>
108 108
					</template>
@@ -203,12 +203,6 @@
Loading
203 203
		this.refitUploadDialog();
204 204
	}
205 205
206 -
	_onUploadBefore(event) {
207 -
		// Custom upload request url for file
208 -
		const {file} = event.detail;
209 -
		file.uploadTarget = `${event.target.target}/${file.name}`;
210 -
	}
211 -
212 206
	_onFileReject(event) {
213 207
		this.refitUploadDialog();
214 208
		this.$.toast.text = `${event.detail.file.name} error: ${event.detail.error}`;

@@ -25,7 +25,7 @@
Loading
25 25
	storage: multer.diskStorage({
26 26
		destination: ASSETS_ROOT,
27 27
		filename(req, file, cb) {
28 -
			cb(null, `${req.params.namespace}/${req.params.category}/${req.params.filePath}`);
28 +
			cb(null, `${req.params.namespace}/${req.params.category}/${file.originalname}`);
29 29
		}
30 30
	})
31 31
});
@@ -191,7 +191,7 @@
Loading
191 191
192 192
// Uploading new files
193 193
app.post(
194 -
	'/assets/:namespace/:category/:filePath',
194 +
	'/assets/:namespace/:category',
195 195
196 196
	// Check if the user is authorized.
197 197
	authCheck,
Files Coverage
lib 91.98%
src 86.08%
Project Totals (64 files) 90.73%
Notifications are pending CI completion. Periodically Codecov will check the CI state, when complete notifications will be submitted. Push notifications now.
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading