Commit 00795be6 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

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

when user cannot manage users information in overlays and users tab in edit project dialog is provided instead of hiding tabs
parent f48493f6
......@@ -14,6 +14,8 @@ minerva (12.2.0~beta.3) unstable; urgency=medium
upload data overlay (#752)
* Bug fix: update/remove button is disabled when user has no privileges for
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
......
......@@ -641,7 +641,7 @@ EditProjectDialog.prototype.refreshOverlays = function () {
return self.setOverlays(overlays);
});
} 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 () {
return self.setUsers(users);
});
} 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) {
}
};
/**
*
* @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
......
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