Commit 71aee6d2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

filtering by submap implemented

parent d7f142ab
...@@ -20,7 +20,7 @@ minerva (12.3.0~alpha.0) unstable; urgency=low ...@@ -20,7 +20,7 @@ minerva (12.3.0~alpha.0) unstable; urgency=low
whitespace, "_" used as separator (#596) whitespace, "_" used as separator (#596)
* Small improvement: list of references in drug panel contains PUBMED prefix * Small improvement: list of references in drug panel contains PUBMED prefix
(#666) (#666)
* Small improvement: list of projects is aut refreshed every 5 seconds if at * Small improvement: list of projects is auto refreshed every 5 seconds if at
least one of the project is uploading/removing (#610) least one of the project is uploading/removing (#610)
* Small improvement: passwords to email account and ldap are not sent over * Small improvement: passwords to email account and ldap are not sent over
API (#732) API (#732)
...@@ -35,8 +35,8 @@ minerva (12.3.0~alpha.0) unstable; urgency=low ...@@ -35,8 +35,8 @@ minerva (12.3.0~alpha.0) unstable; urgency=low
type (#784) type (#784)
* Small improvement: when plugin listeners crash the system notifies user * Small improvement: when plugin listeners crash the system notifies user
about problem with a plugin (#767) about problem with a plugin (#767)
* Small improvement: when exporting list of reaction there is possibility to * Small improvement: when exporting reaction and elements there is
filter by (sub)map (#615) possibility to filter by (sub)map (#615)
* Bug fix: progress bar of gene genome mapping upload is refreshing properly * Bug fix: progress bar of gene genome mapping upload is refreshing properly
(#728) (#728)
* Bug fix: when editing project Disease and Organism could not be removed * Bug fix: when editing project Disease and Organism could not be removed
......
...@@ -6,6 +6,8 @@ var AbstractExportPanel = require('./AbstractExportPanel'); ...@@ -6,6 +6,8 @@ var AbstractExportPanel = require('./AbstractExportPanel');
var ValidationError = require('../../ValidationError'); var ValidationError = require('../../ValidationError');
var IdentifiedElement = require('../../map/data/IdentifiedElement'); var IdentifiedElement = require('../../map/data/IdentifiedElement');
var Functions = require('../../Functions');
// noinspection JSUnusedLocalSymbols // noinspection JSUnusedLocalSymbols
var logger = require('../../logger'); var logger = require('../../logger');
...@@ -40,6 +42,9 @@ ElementExportPanel.prototype.init = function () { ...@@ -40,6 +42,9 @@ ElementExportPanel.prototype.init = function () {
var configuration = self.getConfiguration(); var configuration = self.getConfiguration();
var typeDiv = self._createSelectTypeDiv(configuration.getElementTypes()); var typeDiv = self._createSelectTypeDiv(configuration.getElementTypes());
element.appendChild(typeDiv); element.appendChild(typeDiv);
var submapDiv = Functions.createElement({type: "div", name: "submapTypes"});
submapDiv.appendChild(self._createSelectSubmapDiv(self.getProject().getModels()));
element.appendChild(submapDiv);
element.appendChild(self._createSelectColumnDiv(self.getAllColumns())); element.appendChild(self._createSelectColumnDiv(self.getAllColumns()));
return self.getServerConnector().getProjectStatistics(self.getProject().getProjectId()).then(function (statistics) { return self.getServerConnector().getProjectStatistics(self.getProject().getProjectId()).then(function (statistics) {
return self._createMiriamTypeDiv(statistics.getElementAnnotations()); return self._createMiriamTypeDiv(statistics.getElementAnnotations());
...@@ -66,6 +71,7 @@ ElementExportPanel.prototype.createResponseString = function () { ...@@ -66,6 +71,7 @@ ElementExportPanel.prototype.createResponseString = function () {
var types, miriamTypes; var types, miriamTypes;
var includedCompartmentIds = []; var includedCompartmentIds = [];
var excludedCompartmentIds = []; var excludedCompartmentIds = [];
var submapIds = self.getSelectedSubmapIds();
var models = self.getProject().getModels(); var models = self.getProject().getModels();
var elements = []; var elements = [];
...@@ -87,12 +93,15 @@ ElementExportPanel.prototype.createResponseString = function () { ...@@ -87,12 +93,15 @@ ElementExportPanel.prototype.createResponseString = function () {
var promises = []; var promises = [];
for (var i = 0; i < models.length; i++) { for (var i = 0; i < models.length; i++) {
promises.push(models[i].getAliases({ var model = models[i];
type: types, if (submapIds.length === 0 || $.inArray(model.getId(), submapIds) >= 0) {
complete: true, promises.push(model.getAliases({
includedCompartmentIds: includedCompartmentIds, type: types,
excludedCompartmentIds: excludedCompartmentIds complete: true,
})); includedCompartmentIds: includedCompartmentIds,
excludedCompartmentIds: excludedCompartmentIds
}));
}
} }
return Promise.all(promises); return Promise.all(promises);
}).then(function (aliasesByModel) { }).then(function (aliasesByModel) {
......
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