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

Merge branch 'node-issue' into 'master'

nodejs 9 is not supported anymore

See merge request !1361
parents 20ead482 ee961258
Pipeline #48769 failed with stage
in 66 minutes and 41 seconds
......@@ -19,6 +19,8 @@ before_script:
#by default we configure postgres database
- mkdir /etc/minerva/
- cp test-postgres-db-ci.properties /etc/minerva/db.properties
- echo '-k' > ~/.curlrc
- touch /etc/apt/apt.conf.d/99verify-peer.conf && echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"
test:frontend:
stage: test
......@@ -151,7 +153,7 @@ test:frontend:
script: &test_backend_web_definition
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg git ant
- curl -sL https://deb.nodesource.com/setup_9.x | bash -
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
- mvn -DskipTests=true clean install -pl web -am
- mvn test -pl web
......@@ -327,7 +329,7 @@ build_war:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg git ant
- curl -sL https://deb.nodesource.com/setup_9.x | bash -
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
- ant maven-build-with-doc
- cp web/target/*.war minerva.war
......@@ -338,7 +340,7 @@ test:dependency_conflict:
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg git ant
- curl -sL https://deb.nodesource.com/setup_9.x | bash -
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
- mvn clean install -DskipTests=true
......
......@@ -15,6 +15,20 @@ minerva (16.1.0~alpha.0) stable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 9 Sep 2021 13:00:00 +0200
minerva (16.0.0~beta.3) stable; urgency=medium
* Bug fix: show genetic data overlays in InfoWindow even when no data is
available (#1562)
* Bug fix: speed of opening map is improved (#1558)
* Bug fix: typo (#1555)
* Bug fix: gene mapping with empty url caused issues when opening info window
(#1557)
* Bug fix: issues with exporting map to file or image fixed (#1561, #1560,
#1559)
* Bug fix: sometimes wrong icn numbers were attached to search results
(#1556)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 27 Sep 2021 14:00:00 +0200
minerva (16.0.0~beta.2) stable; urgency=medium
* Small improvement: backgrounds are separated from general overlays (#1532)
* Small improvement: layout of pin popup window is slitghly improved (#1493)
......
......@@ -154,11 +154,11 @@ public class ReconAnnotatorTest extends AnnotationTestFunctions {
@Test
public void testAnnotatingForOxygen() throws Exception {
SimpleMolecule molecule = new SimpleMolecule("id");
molecule.setName("o2");
molecule.setName("h2o");
reconAnnotator.annotateElement(molecule);
assertTrue(molecule.getMiriamData().size() > 0);
assertEquals(0, getWarnings().size());
assertEquals("O2", molecule.getFormula());
assertEquals("H2O", molecule.getFormula());
}
@Test
......
......@@ -1151,8 +1151,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var modelIds = [];
var modelElements = [];
var i;
var elementPosition = [];
for (i = 0; i < elements.length; i++) {
var element = elements[i];
elementPosition[element.getId()] = i;
if (modelElements[element.getModelId()] === undefined) {
modelIds.push(element.getModelId());
modelElements[element.getModelId()] = [];
......@@ -1168,7 +1170,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var result = [];
return Promise.all(promises).then(function (data) {
for (var i = 0; i < data.length; i++) {
result.push.apply(result, data[i]);
data[i].forEach(function (element) {
//preserve the order
result[elementPosition[element.getId()]] = element;
});
}
return result;
});
......
......@@ -492,14 +492,14 @@ AbstractInfoWindow.prototype._createTargetInfoDiv = function (params) {
};
showAllButton.style.display = "inline-block";
showAllButton.innerHTML = "Click to show all " + overlay.getName() + "s for ths element";
showAllButton.innerHTML = "Click to show all " + overlay.getName() + "s for this element";
showAllButton.onclick = function () {
toggleAll(true);
}
checkboxDiv.appendChild(showAllButton);
hideAllButton.style.display = "inline-block";
hideAllButton.innerHTML = "Click to hide all " + overlay.getName() + "s for ths element";
hideAllButton.innerHTML = "Click to hide all " + overlay.getName() + "s for this element";
hideAllButton.onclick = function () {
toggleAll(false);
}
......
......@@ -297,7 +297,7 @@ AliasInfoWindow.prototype.createChartDiv = function (params) {
result.appendChild(rows[i][j]);
}
}
result.appendChild( document.createElement("br"));
result.appendChild(document.createElement("br"));
return result;
});
};
......@@ -366,6 +366,12 @@ AliasInfoWindow.prototype.adjustPileupRangeVisibility = function (pileupRange) {
pileupRange.stop += Math.ceil((50 - dist) / 2);
}
if (pileupRange.stop < pileupRange.start) {
var tmp = pileupRange.stop;
pileupRange.stop = pileupRange.start;
pileupRange.start = tmp;
}
if (pileupRange.start < 0) {
pileupRange.stop -= pileupRange.start;
pileupRange.start = 0;
......@@ -414,8 +420,12 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
var promises = [];
var overlaysData = [];
overlays.forEach(function (overlay) {
var overlayGeneticInformation = [];
overlays.forEach(function (overlay, index) {
promises.push(overlay.getFullAliasesById(self.getAlias().getId()));
globalGeneVariants[index] = [];
overlayGeneticInformation[index] = (overlay.getType() === LayoutAlias.GENETIC_VARIANT);
if (overlay.getType() === LayoutAlias.GENETIC_VARIANT) {
geneticInformation = true;
promises.push(self.getCustomMap().getTopMap().getReferenceGenome(overlay.getGenomeType(),
......@@ -429,7 +439,7 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
logger.warn("Genome for " + overlay.getGenomeType() + ","
+ overlay.getGenomeVersion() + " not loaded");
}
}, function () {
}).catch(function () {
logger.warn("Genome for " + overlay.getGenomeType() + ","
+ overlay.getGenomeVersion() + " not loaded");
......@@ -457,18 +467,21 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
});
for (var k = 0; k < genome.getGeneMappings().length; k++) {
var mapping = genome.getGeneMappings()[k];
pileupSource.push({
viz: pileup.viz.genes(),
data: pileup.formats.bigBed({
url: mapping.getUrl()
}),
name: 'Genes ' + mapping.getName()
});
if (mapping.getUrl() === null || mapping.getUrl() === undefined) {
logger.warn("No url for gene mapping " + mapping.getName());
} else {
pileupSource.push({
viz: pileup.viz.genes(),
data: pileup.formats.bigBed({
url: mapping.getUrl()
}),
name: 'Genes ' + mapping.getName()
});
}
}
}
for (i = 0; i < overlaysData.length; i++) {
var data = overlaysData[i];
globalGeneVariants[i] = [];
if (data !== null && data !== undefined && data.getType() === LayoutAlias.GENETIC_VARIANT) {
var geneVariants = data.getGeneVariants();
for (var j = 0; j < geneVariants.length; j++) {
......@@ -491,9 +504,12 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
contentElement.innerHTML = "No reference genome defined for this MINERVA instance, cannot display variant data.";
}
} else {
for (i = 0; i < overlaysData.length; i++) {
if (globalGeneVariants[i].length > 0) {
var vcfContent = self.createVcfString(globalGeneVariants[i]);
for (i = 0; i < overlays.length; i++) {
var vcfContent = undefined;
if (overlayGeneticInformation[i]) {
vcfContent = self.createVcfString(globalGeneVariants[i]);
}
if (vcfContent !== undefined) {
pileupSource.push({
viz: pileup.viz.variants(),
data: pileup.formats.vcf({
......@@ -556,7 +572,7 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
zoomOut.appendTo(zoomControls);
}
result.appendChild( document.createElement("br"));
result.appendChild(document.createElement("br"));
return result;
} else {
return document.createElement("div");
......
......@@ -394,6 +394,10 @@ public class Project implements Serializable {
return topModel.getModel();
}
public ModelData getTopModelData() {
return topModel;
}
public void setTopModel(final ModelData topModel) {
this.topModel = topModel;
addModel(topModel);
......
......@@ -120,8 +120,17 @@ public class ModelController extends BaseController {
}
List<ModelData> result = new ArrayList<>();
Collection<ModelData> originalModels = modelService.getModelsByProjectId(project.getProjectId());
result.addAll(originalModels);
result.sort(ModelData.ID_COMPARATOR);
if (project.getTopModelData() != null) {
ModelData topModel = project.getTopModelData();
for (ModelData model : originalModels) {
if (!Objects.equals(model.getId(), topModel.getId())) {
result.add(model);
}
}
result.sort(ModelData.ID_COMPARATOR);
result.add(0,topModel);
}
return result;
}
......
......@@ -231,7 +231,10 @@ public class ModelService implements IModelService {
map.getSubmodels().clear();
map.getParentModels().clear();
for (final Element element : map.getElements()) {
for (Element element : map.getElements()) {
if (element.getGlyph() != null) {
Hibernate.initialize(element.getGlyph().getFile());
}
if (element instanceof Complex) {
((Complex) element).setElemets(new ArrayList<>());
}
......@@ -253,10 +256,8 @@ public class ModelService implements IModelService {
element.getCompartment().addElement(element);
}
}
for (final Element element : map.getElements()) {
dbUtils.detach(element);
}
dbUtils.detach(map);
dbUtils.getSessionForCurrentThread().clear();
return new ModelFullIndexed(map);
}
......
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