Skip to content
Snippets Groups Projects
Commit 13884ba2 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: Show parents in map when path is used

parent 31e726f3
Branches
Tags
No related merge requests found
...@@ -438,7 +438,7 @@ var caosdb_map = new function () { ...@@ -438,7 +438,7 @@ var caosdb_map = new function () {
} else { } else {
pov = caosdb_map._get_id_POV(ids); pov = caosdb_map._get_id_POV(ids);
} }
return `SELECT ${selector}${datamodel.lat},${selector}${datamodel.lng} FROM ENTITY ${recordtype} ${pov} `; return `SELECT parent,${selector}${datamodel.lat},${selector}${datamodel.lng} FROM ENTITY ${recordtype} ${pov} `;
} }
...@@ -2229,4 +2229,4 @@ entity.`; ...@@ -2229,4 +2229,4 @@ entity.`;
$(document).ready(function () { $(document).ready(function () {
caosdb_modules.register(caosdb_map); caosdb_modules.register(caosdb_map);
}); });
\ No newline at end of file
...@@ -260,13 +260,13 @@ QUnit.test("_get_select_with_path ", function (assert) { ...@@ -260,13 +260,13 @@ QUnit.test("_get_select_with_path ", function (assert) {
assert.throws(() => caosdb_map._get_select_with_path(this.datamodel, []), /Supply at least a RecordType./, "missing value"); assert.throws(() => caosdb_map._get_select_with_path(this.datamodel, []), /Supply at least a RecordType./, "missing value");
assert.equal(caosdb_map._get_select_with_path( assert.equal(caosdb_map._get_select_with_path(
this.datamodel, this.datamodel,
["RealRT"]), "SELECT latitude,longitude FROM ENTITY RealRT WITH latitude AND longitude ", "RT only"); ["RealRT"]), "SELECT parent,latitude,longitude FROM ENTITY RealRT WITH latitude AND longitude ", "RT only");
assert.equal(caosdb_map._get_select_with_path( assert.equal(caosdb_map._get_select_with_path(
this.datamodel, this.datamodel,
["RealRT", "prop1"]), "SELECT prop1.latitude,prop1.longitude FROM ENTITY RealRT WITH prop1 WITH latitude AND longitude ", "RT with one prop"); ["RealRT", "prop1"]), "SELECT parent,prop1.latitude,prop1.longitude FROM ENTITY RealRT WITH prop1 WITH latitude AND longitude ", "RT with one prop");
assert.equal(caosdb_map._get_select_with_path( assert.equal(caosdb_map._get_select_with_path(
this.datamodel, this.datamodel,
["RealRT", "prop1", "prop2"]), "SELECT prop1.prop2.latitude,prop1.prop2.longitude FROM ENTITY RealRT WITH prop1 WITH prop2 WITH latitude AND longitude ", "RT with two props"); ["RealRT", "prop1", "prop2"]), "SELECT parent,prop1.prop2.latitude,prop1.prop2.longitude FROM ENTITY RealRT WITH prop1 WITH prop2 WITH latitude AND longitude ", "RT with two props");
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment