Commit c473dd84 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '777-manual-upload-of-overlays' into 'devel_12.2.x'

Resolve "Manual upload of public overlays in wrong order"

See merge request minerva/core!725
parents e6d4b196 619e9b96
Pipeline #9625 passed with stage
in 8 minutes and 47 seconds
minerva (12.2.2) stable; urgency=medium
* Bug fix: downloading overlays didn't work from admin panel when project
with different id than default map was accessed
* Bug fix: change of owner of the data overlay in admin panel incorrectly
ordered overlays (#777)
minerva (12.2.1) stable; urgency=medium
* Bug fix: export of reaction colorsi in SBML is properly encoded (COPASI can
read colors properly) (#744)
......
......@@ -436,7 +436,8 @@ EditProjectDialog.prototype._createOverlayTable = function () {
$(overlaysTable).on("click", "[name='downloadSource']", function () {
var button = this;
return self.getServerConnector().getOverlaySourceDownloadUrl({
overlayId: $(button).attr("data")
overlayId: $(button).attr("data"),
projectId:self.getProject().getProjectId()
}).then(function (url) {
return self.downloadFile(url);
}).then(null, GuiConnector.alert);
......@@ -990,8 +991,34 @@ EditProjectDialog.prototype.saveOverlay = function (overlayId) {
overlay.setDescription($("[name='description-" + overlayId + "']", self.getElement())[0].value);
overlay.setPublicOverlay($("[name='publicOverlay-" + overlayId + "']", self.getElement())[0].checked);
overlay.setDefaultOverlay($("[name='defaultOverlay-" + overlayId + "']", self.getElement())[0].checked);
overlay.setCreator($("[name='creator-" + overlayId + "']", self.getElement())[0].value);
var creator = $("[name='creator-" + overlayId + "']", self.getElement())[0].value;
if (creator === "") {
creator = undefined;
}
if (overlay.getCreator() !== creator) {
//put it on the bottom of ordered list of data overlays for given user
var order = 1;
for (var key in self._overlayById) {
if (self._overlayById.hasOwnProperty(key)) {
var existingOverlay = self._overlayById[key];
if (existingOverlay.getCreator() === creator) {
if (existingOverlay.getId() !== overlayId) {
order = Math.max(order, self._overlayById[key].getOrder() + 1);
} else {
order = Math.max(order, self._overlayById[key].getOrder());
}
}
}
}
if (creator === undefined) {
creator = "";
}
overlay.setCreator(creator);
overlay.setOrder(order);
}
console.log("output");
console.log(overlay);
return self.getServerConnector().updateOverlay(overlay);
};
......
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