diff --git a/CHANGELOG b/CHANGELOG index 24780dd5c7759ea8ad30c3c80efd911e97444924..26dc263825d2b3fc5b07bde2e7d6e7893bb67e5e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +minerva (11.0.10) stable; urgency=medium + * Bug fix: link from overview image to search result was broken + + -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 16 Apr 2018 15:00:00 +0200 + minerva (11.0.9) stable; urgency=medium * Bug fix: some comment couldn't be loaded * Bug fix: when adding comment it didn't appear on map immediately diff --git a/frontend-js/src/main/js/gui/OverviewDialog.js b/frontend-js/src/main/js/gui/OverviewDialog.js index 7237b783f1ba296c4c56dd13fc759c2625fc5f07..cc287d49a28feb8271dded7bff2ceac6b5d2b5a9 100644 --- a/frontend-js/src/main/js/gui/OverviewDialog.js +++ b/frontend-js/src/main/js/gui/OverviewDialog.js @@ -197,8 +197,9 @@ OverviewDialog.prototype.openLink = function(link) { self.showOverview(link.imageLinkId); } else if (link.type === "OverviewSearchLink") { logger.debug("Sending search query. Query: " + link.query); - GuiConnector.search(link.query); - $(self.getElement()).dialog("close"); + return map.getOverlayByName("search").searchByQuery(link.query, false, true).then(function(){ + $(self.getElement()).dialog("close"); + }); } else { logger.warn("Unknown type of link: " + link.type + ". Don't know what to do... LinkId: " + link.idObject); } diff --git a/frontend-js/src/test/js/gui/OverviewDialog-test.js b/frontend-js/src/test/js/gui/OverviewDialog-test.js index 02fd8ab3ae0fc51989d32cce3beb388b34976e03..fca8679415ccd68ab2f866a672c80cd6285c4d7f 100644 --- a/frontend-js/src/test/js/gui/OverviewDialog-test.js +++ b/frontend-js/src/test/js/gui/OverviewDialog-test.js @@ -12,17 +12,17 @@ var chai = require('chai'); var assert = chai.assert; var logger = require('../logger'); -describe('OverviewDialog', function() { +describe('OverviewDialog', function () { - it('open image', function() { + it('open image', function () { helper.setUrl("http://test/?id=complex_model_with_images"); - return ServerConnector.getProject().then(function(project) { + return ServerConnector.getProject().then(function (project) { var options = helper.createOptions(project); var map = new CustomMap(options); var dialog = new OverviewDialog({ - element : testDiv, - customMap : map + element: testDiv, + customMap: map }); dialog.showOverview(project.getOverviewImages()[1].idObject); @@ -30,15 +30,15 @@ describe('OverviewDialog', function() { }); }); - it('open invalid image', function() { + it('open invalid image', function () { helper.setUrl("http://test/?id=complex_model_with_images"); - return ServerConnector.getProject().then(function(project) { + return ServerConnector.getProject().then(function (project) { var options = helper.createOptions(project); var map = new CustomMap(options); var dialog = new OverviewDialog({ - element : testDiv, - customMap : map + element: testDiv, + customMap: map }); dialog.showOverview(-1123); @@ -46,22 +46,22 @@ describe('OverviewDialog', function() { }); }); - describe('openLink', function() { - it('link to map', function() { + describe('openLink', function () { + it('link to map', function () { helper.setUrl("http://test/?id=complex_model_with_images"); - return ServerConnector.getProject().then(function(project) { + return ServerConnector.getProject().then(function (project) { var options = helper.createOptions(project); var map = new CustomMap(options); var dialog = new OverviewDialog({ - element : testDiv, - customMap : map + element: testDiv, + customMap: map }); - + dialog.openLink({ - type : "OverviewModelLink", - modelLinkId : map.getId(), - latLng : new google.maps.LatLng(1, 34) + type: "OverviewModelLink", + modelLinkId: map.getId(), + latLng: new google.maps.LatLng(1, 34) }); assert.equal(logger.getWarnings().length, 0); assert.equal(1, map.getGoogleMap().getCenter().lat()); @@ -69,6 +69,29 @@ describe('OverviewDialog', function() { dialog.destroy(); }); }); + it('link to search result', function () { + var overlay, dialog; + return ServerConnector.getProject().then(function (project) { + var options = helper.createOptions(project); + var map = new CustomMap(options); + overlay = helper.createSearchDbOverlay(map); + + dialog = new OverviewDialog({ + element: testDiv, + customMap: map + }); + + return dialog.openLink({ + type: "OverviewSearchLink", + query: "s1" + }); + }).then(function () { + assert.equal(logger.getWarnings().length, 0); + var query = overlay.decodeQuery(overlay.getQueries()[0]); + assert.equal(query.query, "s1"); + dialog.destroy(); + }); + }); }); }); diff --git a/persist/src/db/11.0.10/fix_db_20180416.sql b/persist/src/db/11.0.10/fix_db_20180416.sql new file mode 100644 index 0000000000000000000000000000000000000000..a33b6ad89d4881c84fb355b8c56d309760e66b70 --- /dev/null +++ b/persist/src/db/11.0.10/fix_db_20180416.sql @@ -0,0 +1 @@ +-- empty file to force directory to be commited to git repo