Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Une nouvelle version du portail de gestion des comptes externes sera mise en production lundi 09 août. Elle permettra d'allonger la validité d'un compte externe jusqu'à 3 ans. Pour plus de détails sur cette version consulter : https://doc-si.inria.fr/x/FCeS

Commit 987b107f authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Clone: Every key in seg must be an object

When the seg[key] is not an object, we convert it to an object such as seg[key] = {'val': value}.
e-values were stored that way (without object).
parent ce221b32
...@@ -488,7 +488,7 @@ Clone.prototype = { ...@@ -488,7 +488,7 @@ Clone.prototype = {
computeEValue: function () { computeEValue: function () {
var e = this.seg['_evalue']; var e = this.seg['_evalue'];
if (typeof(e) != 'undefined') if (typeof(e) != 'undefined')
this.eValue = parseFloat(e) this.eValue = parseFloat(e['val'])
else else
this.eValue = undefined this.eValue = undefined
}, },
......
...@@ -594,16 +594,19 @@ Model_loader.prototype = { ...@@ -594,16 +594,19 @@ Model_loader.prototype = {
var newSeg = {}; var newSeg = {};
for (key in seg) { for (key in seg) {
var firstChar = key.substring(0, 1); var firstChar = key.substring(0, 1);
if ((segMapping.indexOf(firstChar) != -1 && typeof seg[firstChar] != 'object') if (segMapping.indexOf(firstChar) != -1 && typeof seg[firstChar] != 'object') {
|| typeof seg[key] != 'object') {
if (typeof newSeg[firstChar] == 'undefined') { if (typeof newSeg[firstChar] == 'undefined') {
newSeg[firstChar] = this.getConvertedSeg(seg, firstChar); newSeg[firstChar] = this.getConvertedSeg(seg, firstChar);
} }
key = firstChar
} else { } else {
newSeg[key] = seg[key]; newSeg[key] = seg[key];
} }
if (typeof newSeg[key] == 'object') { if (typeof newSeg[key] == 'object') {
newSeg[key] = this.getConvertedSegNames(newSeg[key]) newSeg[key] = this.getConvertedSegNames(newSeg[key])
} else {
// We must have an object
newSeg[key] = {'val': newSeg[key]}
} }
} }
return newSeg; return newSeg;
......
...@@ -8,6 +8,7 @@ test("model: convert", function () { ...@@ -8,6 +8,7 @@ test("model: convert", function () {
"3start": 3, "3start": 3,
"3": "J", "3": "J",
"4": "D", "4": "D",
"score": 42,
"5": {"name": "V", "stop": 0}, "5": {"name": "V", "stop": 0},
"cdr3": {"start": 0, "end": 3} "cdr3": {"start": 0, "end": 3}
}; };
...@@ -18,7 +19,7 @@ test("model: convert", function () { ...@@ -18,7 +19,7 @@ test("model: convert", function () {
deepEqual(m.getConvertedSeg(seg, "3"), {"name": "J", "start": 3}, "getConvertedSeg: Ok"); deepEqual(m.getConvertedSeg(seg, "3"), {"name": "J", "start": 3}, "getConvertedSeg: Ok");
deepEqual(m.convertSeg(json_clone3.seg), {"5": {"stop": 5}, "4": {"name": "IGHD2*03"}, "3": {"name": "IGHV4*01", "start": 15}, "junction": {"productive": false, "start": 2, "stop": 13}}, "convertSeg: Ok"); deepEqual(m.convertSeg(json_clone3.seg), {"5": {"stop": 5}, "4": {"name": "IGHD2*03"}, "3": {"name": "IGHV4*01", "start": 15}, "junction": {"productive": false, "start": 2, "stop": 13}}, "convertSeg: Ok");
deepEqual(m.convertSeg(seg), {"3": {"name": "J", "start": 3}, "4": {"name": "D", "start": 1, "stop": 2}, "5": {"name": "V", "stop": 0}, "cdr3": {"start": 0, "stop": 3}}, "convertSeg: Ok"); deepEqual(m.convertSeg(seg), {"3": {"name": "J", "start": 3}, "4": {"name": "D", "start": 1, "stop": 2}, "5": {"name": "V", "stop": 0}, "score": {"val": 42}, "cdr3": {"start": 0, "stop": 3}}, "convertSeg: Ok");
}); });
test("model : load", function() { test("model : load", function() {
......
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