Commit 1c32bca7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

info tab provides information about disease and organism

parent e2ba8aba
......@@ -24,6 +24,8 @@ minerva (12.3.0~alpha.0) unstable; urgency=low
API (#732)
* Small improvement: reactant/product/modifier specific colors are parsed
properly from CellDesigner file (#597)
* Small improvement: Info tab contains information about disease and
organism when info is provided
* Bug fix: progress bar of gene genome mapping upload is refreshing properly
(#728)
* Bug fix: when editing project Disease and Organism could not be removed
......
......@@ -183,6 +183,30 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function () {
liElement.appendChild(manualButton);
dataTab.appendChild(liElement);
if (self.getProject().getDisease() !== undefined) {
var diseaseDiv = Functions.createElement({type: "div", content: "Disease: "});
var diseaseLink = guiUtils.createAnnotationLink(self.getProject().getDisease());
diseaseLink.name = "projectDisease";
liElement = Functions.createElement({
type: "li"
});
diseaseDiv.appendChild(diseaseLink);
liElement.appendChild(diseaseDiv);
dataTab.appendChild(liElement);
}
if (self.getProject().getOrganism() !== undefined) {
var organismDiv = Functions.createElement({type: "div", content: "Organism: "});
var organismLink = guiUtils.createAnnotationLink(self.getProject().getOrganism());
organismLink.name = "projectOrganism";
liElement = Functions.createElement({
type: "li"
});
organismDiv.appendChild(organismLink);
liElement.appendChild(organismDiv);
dataTab.appendChild(liElement);
}
if (self.getProject().getModels()[0].getReferences().length > 0) {
var referencesTab = Functions.createElement({
type: "div"
......@@ -197,6 +221,7 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function () {
referencesTab.appendChild(guiUtils.createAnnotationList(self.getProject().getModels()[0].getReferences(), {groupAnnotations: false}));
}
};
/**
......@@ -228,17 +253,32 @@ ProjectInfoPanel.prototype.refresh = function () {
var projectNameText = $("[name='projectNameText']", self.getElement())[0];
var projectVersionText = $("[name='projectVersionText']", self.getElement())[0];
var projectPublicationsText = $("[name='projectPublicationsText']", self.getElement())[0];
var projectOrganismText = $("[name='projectOrganism']", self.getElement())[0];
var projectDiseaseText = $("[name='projectDisease']", self.getElement())[0];
var project = self.getProject();
projectNameText.innerHTML = project.getName();
projectVersionText.innerHTML = project.getVersion();
return ServerConnector.getProjectStatistics().then(function (statistics) {
projectPublicationsText.innerHTML = statistics.getPublicationCount();
return ServerConnector.getLoggedUser();
}).then(function (user) {
self.showUserProfilePage(user);
});
var promises = [
ServerConnector.getProjectStatistics().then(function (statistics) {
projectPublicationsText.innerHTML = statistics.getPublicationCount()
}),
ServerConnector.getLoggedUser().then(function (user) {
self.showUserProfilePage(user);
})];
if (projectOrganismText !== undefined) {
promises.push(ServerConnector.getTaxonomy({id: parseInt(project.getOrganism().getResource())}).then(function (taxonomy) {
projectOrganismText.innerHTML = taxonomy.getName();
}));
}
if (projectDiseaseText !== undefined) {
promises.push(ServerConnector.getMesh({id: project.getDisease().getResource()}).then(function (mesh) {
projectDiseaseText.innerHTML = mesh.getName();
}));
}
return Promise.all(promises);
};
/**
......
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