Commit 9ea5a00d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '756-oevrlays-and-users-is-missing' into 'devel_12.2.x'

when user cannot manage users information in overlays and users tab in edit…

See merge request minerva/core!712
parents 7e6b7ad0 00795be6
...@@ -14,6 +14,8 @@ minerva (12.2.0~beta.3) unstable; urgency=medium ...@@ -14,6 +14,8 @@ minerva (12.2.0~beta.3) unstable; urgency=medium
upload data overlay (#752) upload data overlay (#752)
* Bug fix: update/remove button is disabled when user has no privileges for * Bug fix: update/remove button is disabled when user has no privileges for
managing overlays (#742) managing overlays (#742)
* Bug fix: when user cannot manage users information in overlays and users
tab in edit project dialog is provided instead of hiding tabs (#756)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 6 Mar 2019 14:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 6 Mar 2019 14:00:00 +0200
......
...@@ -641,7 +641,7 @@ EditProjectDialog.prototype.refreshOverlays = function () { ...@@ -641,7 +641,7 @@ EditProjectDialog.prototype.refreshOverlays = function () {
return self.setOverlays(overlays); return self.setOverlays(overlays);
}); });
} else { } else {
guiUtils.hideTab(self, $(".minerva-project-overlays-tab", self.getElement())[0]); guiUtils.disableTab($(".minerva-project-overlays-tab", self.getElement())[0], "You have no privileges to manage users data");
} }
}); });
}; };
...@@ -671,7 +671,7 @@ EditProjectDialog.prototype.refreshUsers = function () { ...@@ -671,7 +671,7 @@ EditProjectDialog.prototype.refreshUsers = function () {
return self.setUsers(users); return self.setUsers(users);
}); });
} else { } else {
guiUtils.hideTab(self, $(".minerva-project-users-tab", self.getElement())[0]); guiUtils.disableTab($(".minerva-project-users-tab", self.getElement())[0], "You have no privileges to manage users data");
} }
}); });
}; };
......
...@@ -1140,6 +1140,26 @@ GuiUtils.prototype.hideTab = function (abstractGuiElement, panel) { ...@@ -1140,6 +1140,26 @@ GuiUtils.prototype.hideTab = function (abstractGuiElement, panel) {
} }
}; };
/**
*
* @param {HTMLElement} element
* @param {string} message
*/
GuiUtils.prototype.disableTab = function (element, message) {
$(element).children().css("visibility", "hidden");
$("[class='minerva-help-button']", element).children().css("visibility", "visible");
var hideReasonDiv = document.createElement("div");
hideReasonDiv.className = "searchPanel";
var center = document.createElement("center");
var messageDiv = document.createElement("h4");
messageDiv.innerHTML = message;
center.appendChild(messageDiv);
hideReasonDiv.appendChild(center);
$(element).prepend(hideReasonDiv);
};
/** /**
* *
* @param {AbstractGuiElement} abstractGuiElement * @param {AbstractGuiElement} abstractGuiElement
......
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