From a41a4de8767b25de4f889a0b7bb22625be33b6fd Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 27 Aug 2019 19:25:29 +0200 Subject: [PATCH] info about project owner added --- CHANGELOG | 2 ++ .../src/main/js/gui/admin/MapsAdminPanel.js | 18 ++++++++++++------ frontend-js/src/main/js/map/data/Project.js | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ec07e20ce8..bafb6e9265 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low "View project" checkbox when editing privileges (#920) * Small improvement: notification email uses minerva name and id of affected project (#926) + * Small improvement: information about person who uploaded project is visible + in list of projects (#927) * Bug fix: work on FF Private Window mode could cause logout or raise an error on when opening new tab with minerva (#892) * Bug fix: fetching list of miRnas resulted sometimes in "Internal Server diff --git a/frontend-js/src/main/js/gui/admin/MapsAdminPanel.js b/frontend-js/src/main/js/gui/admin/MapsAdminPanel.js index 488cf4e399..0b4c5e32b5 100644 --- a/frontend-js/src/main/js/gui/admin/MapsAdminPanel.js +++ b/frontend-js/src/main/js/gui/admin/MapsAdminPanel.js @@ -127,6 +127,8 @@ MapsAdminPanel.prototype._createProjectTableRow = function () { title: 'ProjectId' }, { title: 'Created' + }, { + title: 'Created by' }, { title: 'Name' }, { @@ -141,7 +143,7 @@ MapsAdminPanel.prototype._createProjectTableRow = function () { title: 'Remove' }], columnDefs: [ - {"orderable": false, "targets": [6, 7]} + {"orderable": false, "targets": [7, 8]} ] }); self.bindUserGuiPreference({ @@ -261,9 +263,13 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) { } row[1] = date; row[2] = project.getName(); - row[3] = disease; - row[4] = organism; - row[5] = status; + row[3] = project.getOwner(); + if (row[3] === undefined) { + row[3] = 'N/A'; + } + row[4] = disease; + row[5] = organism; + row[6] = status; var disabledEdit = " disabled "; var disabledRemove = " disabled "; @@ -281,12 +287,12 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) { disabledRemove = ""; } - row[6] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabledEdit + "><i class='fa fa-edit' style='font-size:17px'></i></button>"; + row[7] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabledEdit + "><i class='fa fa-edit' style='font-size:17px'></i></button>"; if (self.getConfiguration().getOption(ConfigurationType.DEFAULT_MAP).getValue() === projectId) { disabledRemove = " disabled "; } - row[7] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabledRemove + "><i class='fa fa-trash-o' style='font-size:17px'></button>"; + row[8] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabledRemove + "><i class='fa fa-trash-o' style='font-size:17px'></button>"; return row; }; diff --git a/frontend-js/src/main/js/map/data/Project.js b/frontend-js/src/main/js/map/data/Project.js index 0d28c2672b..e01d1bffb3 100644 --- a/frontend-js/src/main/js/map/data/Project.js +++ b/frontend-js/src/main/js/map/data/Project.js @@ -70,6 +70,7 @@ Project.prototype.loadFromData = function (data) { self.setTopOverviewImage(data.topOverviewImage); self.setDisease(data.disease); self.setOrganism(data.organism); + self.setOwner(data.owner); self.setStatus(data.status); self.setNotifyEmail(data.notifyEmail); self.setProgress(data.progress); @@ -105,6 +106,7 @@ Project.prototype._update = function (data) { self.setTopOverviewImage(data.getTopOverviewImage()); self.setDisease(data.getDisease()); self.setOrganism(data.getOrganism()); + self.setOwner(data.getOwner()); self.setStatus(data.getStatus()); self.setProgress(data.getProgress()); self.setNotifyEmail(data.getNotifyEmail()); @@ -378,6 +380,22 @@ Project.prototype.setStatus = function (status) { this._status = status; }; +/** + * + * @returns {string} + */ +Project.prototype.getOwner = function () { + return this._owner; +}; + +/** + * + * @param {string} owner + */ +Project.prototype.setOwner = function (owner) { + this._owner = owner; +}; + /** * * @returns {number} @@ -603,5 +621,4 @@ Project.prototype.setCreationDate = function (creationDate) { }; - module.exports = Project; -- GitLab