EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit af4cab45 authored by Lubomir Dolezal's avatar Lubomir Dolezal
Browse files

detailsDisplay allow to interpolate {{record.prop}}

parent ac5fe7e2
No related branches found
No related tags found
1 merge request!7Client performance improvements timeslider
......@@ -828,19 +828,33 @@
"description":"The displayed name of the config option.",
"type":"string"
},
"replace":{
"description":"Array of dotted style request parameters, which when this option is set, will be replaced too. For example changing layer name.",
"type":"array",
"items":{
"type":"object",
"properties":{
"target":{
"description":"The dotted path of the parameter. e.g: 'display.extraParameters.LAYERS'",
"type":"string"
"replace": {
"description": "Array of dotted style request parameters, which when this option is set, will be replaced too. For example changing layer name.",
"type": "array",
"items": {
"type": "object",
"properties": {
"target": {
"description": "The dotted path of the parameter. e.g: 'display.extraParameters.LAYERS'",
"type": "string"
},
"value": {
"description": "The actual value to be set.",
"type": "string"
"anyOf": [{
"description": "The actual value to be set.",
"type": "string"
},
{
"type": "object",
"properties": {
"template": {
"type": "string",
"description": "{{id}} prop template can be used to interpolate the value template by the layer model. For 'detailsDisplay', additionally a RecordModel can be used for source of interpolation if {{record.}} prefix is used. Example {{record.properties.title}}."
}
},
"description": "Options object for replacement value, currently only 'template' key is used."
}
]
}
}
}
......
......@@ -97,7 +97,7 @@ const RecordsDetailsModalView = ModalView.extend({
$('.modal-body').height(`calc(100% - ${restHeightCombined}px)`);
},
updateRecord(recordModel, searchModel) {
updateRecord(recordModel, searchModel, refreshOnlyRecordDetails=false) {
let time = recordModel.get('properties').time;
if (time instanceof Date) {
time = [time, time];
......@@ -139,7 +139,10 @@ const RecordsDetailsModalView = ModalView.extend({
iframeView: this.iframeView,
});
this.showChildView('content', detailsView);
if (refreshOnlyRecordDetails) {
// earlier exit for case when only RecordDetailsView should be redrawn
return;
}
this.filtersModel.set('area', recordModel.attributes.geometry);
this.mapModel.show(recordModel.attributes);
......@@ -160,7 +163,9 @@ const RecordsDetailsModalView = ModalView.extend({
this.$('.layer-options-dropdown').toggle(!!displayParams.options);
this.showChildView('layer-options', new LayerOptionsCoreView({
model: layerModel, useDetailsDisplay: true
model: layerModel,
useDetailsDisplay: true,
recordModel,
}));
},
......@@ -190,7 +195,7 @@ const RecordsDetailsModalView = ModalView.extend({
onIframeDisplayToggleChange() {
this.iframeDisplayEnabled = this.$('.iframe-display-toggle').is(':checked');
this.updateRecord(...this.records[this.currentRecordIndex]);
this.updateRecord(...this.records[this.currentRecordIndex], true);
},
replaceLayerParameters(option, model) {
if (typeof option.IdAttached != 'undefined') {
......
......@@ -146,7 +146,9 @@ const WPSModalView = ModalView.extend({
this.$('.is-selected').prop('checked', isSelectedForDownload);
this.$('.is-selected').parent().toggle(!!isRecordDownloadable(layerModel, recordModel));
this.showChildView('layer-options', new LayerOptionsCoreView({
model: layerModel, useDetailsDisplay: true
model: layerModel,
useDetailsDisplay: true,
recordModel,
}));
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment