Commit 56161f4c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1487-adding-advanced-map-root-map-is-loaded-as-submap' into 'master'

Resolve "Adding advanced map - ROOT map is loaded as submap"

Closes #1487

See merge request !1319
parents 537d7388 dfaf8482
Pipeline #43382 passed with stage
in 17 minutes and 45 seconds
......@@ -20,7 +20,10 @@ minerva (16.0.0~beta.1) stable; urgency=medium
* Bug fix: adding user with already existing login and changing his
privileges occured with error (#1507)
* Bug fix: export model as model could cause an issue (#1500, #1502)
* Bug fix: problem with export as image with data overlays (#1503, #1498)
* Bug fix: problem with export as image with data overlays (#1503, #1498,
#1496)
* Bug fix: chrome autofill is disabled for "Search: " in admin panel tables
* Bug fix: top map was not selected properly sometimes (#1487)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 9 Jun 2021 15:00:00 +0200
......
......@@ -128,6 +128,8 @@ Admin.prototype.init = function () {
return Promise.all(promises).then(function () {
$(window).trigger('resize');
}).then(function () {
$("div.dataTables_filter").wrap("<form>");
$("div.dataTables_filter").closest("form").attr("autocomplete", "off");
return self.checkAvailableVersion();
});
};
......
......@@ -796,10 +796,7 @@ public class ProjectRestImpl extends BaseRestImpl {
if (key.equalsIgnoreCase("description")) {
background.setDescription((String) value);
} else if (key.equalsIgnoreCase("id")) {
if (!Objects.equals(value , overlayId)) {
logger.error("!!!!!!!!!!!!!!!!!");
logger.error(value);
logger.error(overlayId);
if (!Objects.equals(value, overlayId)) {
throw new QueryException("cannot change id");
}
} else if (key.equalsIgnoreCase("name")) {
......
......@@ -113,8 +113,16 @@ public class ModelRestImpl extends BaseRestImpl {
private List<Map<String, Object>> createData(Project project) throws QueryException {
List<Map<String, Object>> result = new ArrayList<>();
Collection<ModelData> originalModels = getModelService().getModelsByProjectId(project.getProjectId());
List<ModelData> models = new ArrayList<>(originalModels);
List<ModelData> models = new ArrayList<>();
if (project.getTopModel() != null) {
ModelData topModel = project.getTopModel().getModelData();
for (ModelData model : originalModels) {
if (!Objects.equals(model.getId(), topModel.getId())) {
models.add(model);
}
}
result.add(getModel(topModel));
}
models.sort(ModelData.ID_COMPARATOR);
for (ModelData model2 : models) {
result.add(getModel(model2));
......
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