Commit 4ccfad90 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

use file name as a name when necessary

parent d7e9aad5
Pipeline #21409 passed with stage
in 13 minutes and 17 seconds
......@@ -8,6 +8,8 @@ minerva (14.0.9) stable; urgency=medium
reversible even though they were not visualized so (#1109)
* Bug fix: when data overlay was being removed user could request to remove
overlay second time and an error was thrown (#1121)
* Bug fix: when data overlay name in zip uploaded zip file is not present the
name of a file is used as overlay name (#1065)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 3 Feb 2020 15:00:00 +0200
......
......@@ -512,12 +512,6 @@ AddProjectDialog.prototype._createOverlayTable = function () {
var entry = entries[i];
if (entry.getType() === "OVERLAY") {
var name = entry.getData().name;
if (name === undefined || name === null || name === "") {
name = entry.getFilename().substring(0, entry.getFilename().lastIndexOf('.'));
if (name.indexOf("/") >= 0) {
name = name.substring(name.lastIndexOf("/") + 1);
}
}
var row = [];
row[0] = entry.getFilename();
......@@ -1469,7 +1463,10 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) {
if (overlay.getName()) {
data.name = overlay.getName();
} else {
data.name = "";
data.name = filename.substring(0, filename.lastIndexOf('.'));
if (data.name.indexOf("/") >= 0) {
data.name = data.name.substring(data.name.lastIndexOf("/") + 1);
}
}
if (overlay.getDescription()) {
data.description = overlay.getDescription();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment