From fd72ed2f373726edcff96069630bd44dc1969aaf Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Fri, 14 Jul 2017 16:35:02 +0200 Subject: [PATCH] getLightAliases method removed --- frontend-js/src/main/js/ServerConnector.js | 12 +++--------- frontend-js/src/main/js/map/data/MapModel.js | 5 ++++- frontend-js/src/test/js/ServerConnector-test.js | 6 +++--- .../columns=id,bounds,modelId&token=MOCK_TOKEN_ID& | 1 - .../all/bioEntities/elements/token=MOCK_TOKEN_ID& | 1 + 5 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/columns=id,bounds,modelId&token=MOCK_TOKEN_ID& create mode 100644 frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/token=MOCK_TOKEN_ID& diff --git a/frontend-js/src/main/js/ServerConnector.js b/frontend-js/src/main/js/ServerConnector.js index b5eda78f45..b897f69c82 100644 --- a/frontend-js/src/main/js/ServerConnector.js +++ b/frontend-js/src/main/js/ServerConnector.js @@ -813,9 +813,11 @@ ServerConnector.getReactions = function(params) { }; ServerConnector.getAliases = function(params) { - // aliasIds, projectId, columns var self = this; var queryParams = {}; + if (params.ids === undefined) { + params.ids = [] + } var filterParams = { id : params.ids, columns : params.columns, @@ -866,14 +868,6 @@ ServerConnector.getComments = function(params) { }); }; -ServerConnector.getLightAliases = function(aliasIds, projectId) { - return this.getAliases({ - ids : aliasIds, - projectId : projectId, - columns : "id,bounds,modelId" - }); -}; - ServerConnector.getSessionData = function(project) { if (this._sessionData === undefined) { this._sessionData = new SessionData(project); diff --git a/frontend-js/src/main/js/map/data/MapModel.js b/frontend-js/src/main/js/map/data/MapModel.js index 92e408b074..c4d70ff174 100644 --- a/frontend-js/src/main/js/map/data/MapModel.js +++ b/frontend-js/src/main/js/map/data/MapModel.js @@ -295,7 +295,10 @@ MapModel.prototype.getMissingElements = function(elements) { ids : aliasIds }); } else { - aliasPromise = ServerConnector.getLightAliases(aliasIds); + aliasPromise = ServerConnector.getAliases({ + ids : aliasIds, + columns : "id,bounds,modelId" + }); } } diff --git a/frontend-js/src/test/js/ServerConnector-test.js b/frontend-js/src/test/js/ServerConnector-test.js index 7093188f2b..8b377f2027 100644 --- a/frontend-js/src/test/js/ServerConnector-test.js +++ b/frontend-js/src/test/js/ServerConnector-test.js @@ -66,11 +66,11 @@ describe('ServerConnector', function() { }); it('getElements with empty list of ids', function() { - return ServerConnector.getLightAliases([]).then(function(result) { - assert.equal(result.length, 2); + return ServerConnector.getAliases({}).then(function(result) { + assert.equal(result.length, 30); var reaction = result[0]; assert.ok(reaction instanceof Alias); - assert.equal(reaction.getId(), 329176); + assert.equal(reaction.getId(), 329160); assert.equal(reaction.getModelId(), 15781); }); }); diff --git a/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/columns=id,bounds,modelId&token=MOCK_TOKEN_ID& b/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/columns=id,bounds,modelId&token=MOCK_TOKEN_ID& deleted file mode 100644 index 40bfb945c3..0000000000 --- a/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/columns=id,bounds,modelId&token=MOCK_TOKEN_ID& +++ /dev/null @@ -1 +0,0 @@ -[{"modelId":15781,"bounds":{"x":683.0,"y":132.0,"width":70.0,"height":25.0},"id":329176},{"modelId":15781,"bounds":{"x":11.0,"y":236.0,"width":118.0,"height":66.0},"id":329166}] \ No newline at end of file diff --git a/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/token=MOCK_TOKEN_ID& b/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/token=MOCK_TOKEN_ID& new file mode 100644 index 0000000000..20ce836d17 --- /dev/null +++ b/frontend-js/testFiles/apiCalls/projects/sample/models/all/bioEntities/elements/token=MOCK_TOKEN_ID& @@ -0,0 +1 @@ +[{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"ADP","bounds":{"x":819.0,"width":70.0,"y":134.0,"height":25.0},"formula":null,"id":329160,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":329158,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s14","bounds":{"x":279.0,"width":80.0,"y":233.0,"height":40.0},"formula":null,"id":329159,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"RNA","abbreviation":null,"compartmentId":null,"name":"s5","bounds":{"x":0.0,"width":90.0,"y":118.5,"height":25.0},"formula":null,"id":329168,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[{"idObject":860352,"name":"622","type":"Entrez Gene","link":"http://www.ncbi.nlm.nih.gov/gene/622","summary":null}],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"BDH1","bounds":{"x":1225.7682370820667,"width":80.0,"y":66.0,"height":40.0},"formula":null,"id":329170,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[{"idObject":860340,"name":"REACT_2390.1","type":"Reactome","link":"http://www.reactome.org/PathwayBrowser/#REACT_2390.1","summary":null}],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"NADH","bounds":{"x":1214.2682370820667,"width":70.0,"y":128.5000000000009,"height":25.0},"formula":null,"id":329163,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Antisense RNA","abbreviation":null,"compartmentId":null,"name":"s6","bounds":{"x":101.0,"width":90.0,"y":129.5,"height":25.0},"formula":null,"id":329167,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s3","bounds":{"x":289.0,"width":80.0,"y":39.0,"height":40.0},"formula":null,"id":329157,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"D-beta hydroxybutyrate","bounds":{"x":1022.7317629179333,"width":140.0,"y":209.5,"height":25.0},"formula":null,"id":329181,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"gfsdhj","bounds":{"x":160.0,"width":119.0,"y":332.0,"height":63.0},"formula":null,"id":329171,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"s9","bounds":{"x":455.0,"width":70.0,"y":169.5,"height":25.0},"formula":null,"id":329161,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Degraded","abbreviation":null,"compartmentId":null,"name":"s13","bounds":{"x":401.0,"width":30.0,"y":235.0,"height":30.0},"formula":null,"id":329175,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Drug","abbreviation":null,"compartmentId":null,"name":"s10","bounds":{"x":0.0,"width":80.0,"y":186.0,"height":30.0},"formula":null,"id":329177,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[{"idObject":860341,"name":"REACT_5224.1","type":"Reactome","link":"http://www.reactome.org/PathwayBrowser/#REACT_5224.1","summary":null}],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"acetoacetate","bounds":{"x":1044.7317629179333,"width":140.0,"y":27.50000000000091,"height":25.0},"formula":null,"id":329164,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s22","bounds":{"x":712.0,"width":80.0,"y":384.0,"height":40.0},"formula":null,"id":329174,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"ATP","bounds":{"x":683.0,"width":70.0,"y":132.0,"height":25.0},"formula":null,"id":329176,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Ion","abbreviation":null,"compartmentId":null,"name":"s8","bounds":{"x":358.5,"width":25.0,"y":125.5,"height":25.0},"formula":null,"id":329165,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Phenotype","abbreviation":null,"compartmentId":null,"name":"s7","bounds":{"x":213.0,"width":80.0,"y":128.0,"height":30.0},"formula":null,"id":329172,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s2","bounds":{"x":165.0,"width":80.0,"y":43.0,"height":50.0},"formula":null,"id":329179,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s22","bounds":{"x":918.0,"width":80.0,"y":427.0,"height":40.0},"formula":null,"id":329162,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Complex","abbreviation":null,"compartmentId":null,"name":"s12","bounds":{"x":271.0,"width":101.0,"y":207.0,"height":164.0},"formula":null,"id":329158,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"description of S1\r\nthird line","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s1","bounds":{"x":12.0,"width":80.0,"y":6.0,"height":40.0},"formula":null,"id":329173,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Unknown","abbreviation":null,"compartmentId":null,"name":"s11","bounds":{"x":105.0,"width":70.0,"y":203.5,"height":25.0},"formula":null,"id":329169,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"GDP","bounds":{"x":959.0,"width":70.0,"y":271.0,"height":25.0},"formula":null,"id":329156,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s4","bounds":{"x":419.0,"width":80.0,"y":45.0,"height":40.0},"formula":null,"id":329182,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"GTP","bounds":{"x":849.0,"width":70.0,"y":309.0,"height":25.0},"formula":null,"id":329180,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[{"idObject":860353,"name":"REACT_5847.1","type":"Reactome","link":"http://www.reactome.org/PathwayBrowser/#REACT_5847.1","summary":null}],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Ion","abbreviation":null,"compartmentId":null,"name":"H+","bounds":{"x":1243.7682370820667,"width":25.0,"y":12.50000000000091,"height":25.0},"formula":null,"id":329184,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s23","bounds":{"x":695.0,"width":80.0,"y":239.0,"height":40.0},"formula":null,"id":329178,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Simple molecule","abbreviation":null,"compartmentId":null,"name":"NAD+","bounds":{"x":1197.2682370820667,"width":70.0,"y":287.5,"height":25.0},"formula":null,"id":329185,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":"CNC","formerSymbols":[],"notes":"ymbol: CNC\r\nghfjkghfdjkghkdf\r\nfdghjkfdhgjkdfgjhdf\r\njdsfkljsdklfjsdf\r\nsjdkfjsdklfjkl\r\ndsjfkjl\r\nsdfkkjfskldjfkls\r\n\nRecName: Full=Sodium/calcium exchanger 1; AltName: Full=Na(+)/Ca(2+)-exchange protein 1; Flags: Precursor;","references":[{"idObject":860342,"name":"REACT_20130","type":"Reactome","link":"http://www.reactome.org/PathwayBrowser/#REACT_20130","summary":null},{"idObject":860343,"name":"2141","type":"HGNC","link":"http://www.genenames.org/cgi-bin/gene_symbol_report?hgnc_id=2141","summary":null},{"idObject":860344,"name":"6546","type":"Kegg Genes","link":null,"summary":null},{"idObject":860345,"name":"NP_001106272.1","type":"RefSeq","link":"http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NP_001106272.1","summary":null},{"idObject":860346,"name":"NP_001106271.1","type":"RefSeq","link":"http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NP_001106271.1","summary":null},{"idObject":860347,"name":"NP_001106273.1","type":"RefSeq","link":"http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NP_001106273.1","summary":null},{"idObject":860348,"name":"NP_001239553.1","type":"RefSeq","link":"http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NP_001239553.1","summary":null},{"idObject":860349,"name":"PA314","type":"PharmGKB Pathways","link":"http://www.pharmgkb.org/pathway/PA314","summary":null},{"idObject":860350,"name":"NP_066920.1","type":"RefSeq","link":"http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NP_066920.1","summary":null},{"idObject":860351,"name":"6546","type":"Entrez Gene","link":"http://www.ncbi.nlm.nih.gov/gene/6546","summary":null}],"modelId":15781,"synonyms":["CNC","NCX1"],"fullName":"Carney complex, multiple neoplasia and lentiginosis","complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"CNC","bounds":{"x":11.0,"width":118.0,"y":236.0,"height":66.0},"formula":null,"id":329166,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]},{"symbol":null,"formerSymbols":[],"notes":"","references":[],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"s23","bounds":{"x":656.0,"width":80.0,"y":42.0,"height":40.0},"formula":null,"id":329183,"linkedSubmodel":null,"hierarchyVisibilityLevel":[]}] \ No newline at end of file -- GitLab