Commit 977a67ca authored by Piotr Gawron's avatar Piotr Gawron
Browse files

info about "View only" access when editing project

parent c30ef233
minerva (14.0.0~beta.2) unstable; urgency=low
* Small improvement: info window contains information about overlay No (#919)
* Small improvement: curator without write access to project has info about
it when editing project (#940)
* Bug fix: exported SBML passes online validation (#831)
* Bug fix: changing owner of data overlay should change order index (#945)
* Bug fix: allow user to remove own comments (#931)
......
......@@ -1333,7 +1333,7 @@ ServerConnector.getProjectStatistics = function (projectId) {
/**
*
* @returns {Promise<User>}
* @returns {Promise<User>|PromiseLike<User>}
*/
ServerConnector.getLoggedUser = function () {
var self = this;
......
......@@ -34,6 +34,13 @@ var xss = require('xss');
function EditProjectDialog(params) {
AbstractGuiElement.call(this, params);
var self = this;
/**
*
* @type {string}
* @private
*/
self._title = self.getProject().getProjectId();
guiUtils.setConfiguration(params.configuration);
self.setConfiguration(params.configuration);
$(self.getElement()).addClass("minerva-edit-project-dialog");
......@@ -661,7 +668,14 @@ EditProjectDialog.prototype.init = function () {
self.projectDataUpdated(self.getProject());
});
return self.initUsersTab().then(function () {
return self.refresh()
return self.getServerConnector().getLoggedUser();
}).then(function (loggedUser) {
var readOnlyAccess = loggedUser.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_CURATOR)) &&
!loggedUser.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.WRITE_PROJECT), self.getProject().getProjectId());
if (readOnlyAccess) {
self._title += " (View only)";
}
return self.refresh();
}).then(function () {
$(window).trigger('resize');
});
......@@ -1071,7 +1085,7 @@ EditProjectDialog.prototype.open = function () {
if (!$(div).hasClass("ui-dialog-content")) {
$(div).dialog({
dialogClass: 'minerva-edit-project-dialog',
title: self.getProject().getProjectId(),
title: self._title,
width: window.innerWidth * 0.75,
height: window.innerHeight / 2
});
......
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