Commit 86be8a9c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1065-overlay-in-zip' into 'devel_14.0.x'

use file name as a name when necessary

See merge request !1066
parents d7e9aad5 4ccfad90
Pipeline #21410 passed with stage
in 13 minutes and 39 seconds
...@@ -8,6 +8,8 @@ minerva (14.0.9) stable; urgency=medium ...@@ -8,6 +8,8 @@ minerva (14.0.9) stable; urgency=medium
reversible even though they were not visualized so (#1109) reversible even though they were not visualized so (#1109)
* Bug fix: when data overlay was being removed user could request to remove * Bug fix: when data overlay was being removed user could request to remove
overlay second time and an error was thrown (#1121) 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 -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 3 Feb 2020 15:00:00 +0200
......
...@@ -512,12 +512,6 @@ AddProjectDialog.prototype._createOverlayTable = function () { ...@@ -512,12 +512,6 @@ AddProjectDialog.prototype._createOverlayTable = function () {
var entry = entries[i]; var entry = entries[i];
if (entry.getType() === "OVERLAY") { if (entry.getType() === "OVERLAY") {
var name = entry.getData().name; 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 = []; var row = [];
row[0] = entry.getFilename(); row[0] = entry.getFilename();
...@@ -1469,7 +1463,10 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) { ...@@ -1469,7 +1463,10 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) {
if (overlay.getName()) { if (overlay.getName()) {
data.name = overlay.getName(); data.name = overlay.getName();
} else { } 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()) { if (overlay.getDescription()) {
data.description = 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