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

Merge branch '447-suggestions-for-enhancement-v12' into 'master'

Resolve "Suggestions for enhancement (v12)"

Closes #447

See merge request !861
parents 77526774 5cc9904e
Pipeline #12120 passed with stage
in 9 minutes and 52 seconds
......@@ -15,6 +15,9 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
* Small improvement: when removing overlay in admin panel there is a
confirmation dialog (#696)
* Small improvement: overlay name is obligatory (#698)
* Small improvement: list of projects in admin panel contains creation date
(#447)
* Small improvement: links in list of publications open in new tab (#447)
* Small improvement: target gene in search panel contains also information
about type of database that identifies the target (#66)
* Small improvement: redundant 'references' field in gene variants data
......
......@@ -125,6 +125,8 @@ MapsAdminPanel.prototype._createProjectTableRow = function () {
$(projectsTable).DataTable({
columns: [{
title: 'ProjectId'
}, {
title: 'Created'
}, {
title: 'Name'
}, {
......@@ -237,10 +239,17 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
}
row[0] = formattedProjectId;
row[1] = project.getName();
row[2] = disease;
row[3] = organism;
row[4] = status;
var date = project.getCreationDate();
if (date === undefined) {
date = "N/A";
} else {
date = date.split(" ")[0];
}
row[1] = date;
row[2] = project.getName();
row[3] = disease;
row[4] = organism;
row[5] = status;
var disabled = " disabled ";
if ((user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_ADMIN)) ||
......@@ -249,12 +258,12 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
disabled = "";
}
row[5] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-edit' style='font-size:17px'></i></button>";
row[6] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-edit' style='font-size:17px'></i></button>";
if (self.getConfiguration().getOption(ConfigurationType.DEFAULT_MAP).getValue() === projectId) {
disabled = " disabled ";
}
row[6] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-trash-o' style='font-size:17px'></button>";
row[7] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-trash-o' style='font-size:17px'></button>";
return row;
};
......
......@@ -102,7 +102,7 @@ PublicationListDialog.prototype._dataTableAjaxCall = function (data, callback) {
var row = [];
var submaps = {};
if (article !== null && article !== undefined) {
row[0] = "<a href='" + article.link + "'>" + article.id + "</a>";
row[0] = "<a href='" + article.link + "' target='#pubmed_" + article.id + "'>" + article.id + "</a>";
row[1] = article.title;
row[2] = article.authors.join();
row[3] = article.journal;
......
......@@ -62,6 +62,7 @@ Project.prototype.loadFromData = function (data) {
} else {
self.setId(parseInt(data.idObject));
self.setProjectId(data.projectId);
self.setCreationDate(data.creationDate);
self.setDirectory(data.directory);
self.setVersion(data.version);
self.setName(data.name);
......@@ -582,5 +583,25 @@ Project.prototype.getBioEntitiesByIdentifiedElements = function (elements, compl
return Promise.all(promises);
};
/**
*
* @returns {string}
*/
Project.prototype.getCreationDate = function () {
return this._creationDate;
};
/**
*
* @param {string|null} creationDate
*/
Project.prototype.setCreationDate = function (creationDate) {
if (creationDate === null) {
creationDate = undefined;
}
this._creationDate = creationDate;
};
module.exports = Project;
......@@ -106,6 +106,7 @@ public class ProjectRestImpl extends BaseRestImpl {
result.put("errors", project.getErrors() != null && !project.getErrors().isEmpty());
result.put("name", project.getName());
result.put("projectId", project.getProjectId());
result.put("creationDate", super.prepareDate(project.getCreationDate()));
result.put("mapCanvasType", project.getMapCanvasType());
List<Map<String, Object>> images = new ArrayList<>();
......
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