diff --git a/app/api/src/crud/crud_customization.py b/app/api/src/crud/crud_customization.py index 4dde0c74f..72430dee2 100644 --- a/app/api/src/crud/crud_customization.py +++ b/app/api/src/crud/crud_customization.py @@ -54,6 +54,7 @@ async def build_layer_category_obj(self, db: AsyncSession, layer_name: str): "access_token", "max_resolution", "max_resolution", + "doc_url" ]: if getattr(layer, key) is not None: layer_attributes[key] = getattr(layer, key) diff --git a/app/client/src/components/indicators/Indicators.vue b/app/client/src/components/indicators/Indicators.vue index ac42bb6b7..7aa7ace1a 100644 --- a/app/client/src/components/indicators/Indicators.vue +++ b/app/client/src/components/indicators/Indicators.vue @@ -19,8 +19,30 @@ layer.get('showOptions') === true }" > - - + + + + + + {{ $t(`map.tooltips.openDocumentation`) }} + + - +

{{ translate("layerName", layer.get("name")) }}

@@ -129,6 +151,12 @@ :styleDialogStatus="styleDialogStatus" > + ({ indicatorLayers: [], @@ -174,7 +204,9 @@ export default { currentItem: null, styleDialogKey: 0, styleDialogStatus: false, - timePickerDialogStatus: false + timePickerDialogStatus: false, + showDocumentationDialog: false, + selectedDocumentationLayer: null }), mounted() { EventBus.$on("updateStyleDialogStatusForLayerOrder", value => { @@ -391,6 +423,10 @@ export default { } else { return false; } + }, + openDocumentation(layer) { + this.showDocumentationDialog = true; + this.selectedDocumentationLayer = layer; } }, watch: { diff --git a/app/client/src/components/isochrones/IsochroneThematicData.vue b/app/client/src/components/isochrones/IsochroneThematicData.vue index 5ea5827c9..ea3535414 100644 --- a/app/client/src/components/isochrones/IsochroneThematicData.vue +++ b/app/client/src/components/isochrones/IsochroneThematicData.vue @@ -462,7 +462,8 @@ export default { pois: amenity ? this.$t(`pois.${amenity}`) : amenity }; let value = numberSeparator( - this.getString(parseInt(sumPois[amenity])) + this.getString(parseInt(sumPois[amenity])), + this.$i18n.locale ); obj[`isochrone-${calculation.id}`] = value || "-"; if (poisObj[amenity]) { diff --git a/app/client/src/components/other/DocumentationDialog.vue b/app/client/src/components/other/DocumentationDialog.vue index a455e2ff2..8b2790c70 100644 --- a/app/client/src/components/other/DocumentationDialog.vue +++ b/app/client/src/components/other/DocumentationDialog.vue @@ -32,7 +32,7 @@ @@ -62,12 +62,23 @@ export default { this.$emit("close"); } } + }, + getDocUrl() { + //DE: plan4better.de/docs/heatmap-connectivity + //EN: plan4better.de/en/docs/heatmap-connectivity + let docUrl = this.item.get("docUrl"); + if (docUrl.includes("/en/docs") && this.$i18n.locale === "de") { + docUrl = docUrl.replace("/en/docs", "/docs"); + } else if (!docUrl.includes("/en/docs") && this.$i18n.locale === "en") { + docUrl = docUrl.replace("/docs", "/en/docs"); + } + return docUrl; } }, methods: { openDocInNetTab() { if (!this.item) return; - const url = this.item.mapLayer.get("docUrl"); + const url = this.getDocUrl; if (url) { window.open(url, "_blank"); } @@ -83,6 +94,7 @@ export default { overflow: hidden; margin: 15px auto; max-width: 800px; + height: 530px; } iframe { diff --git a/app/client/src/factory/layer.js b/app/client/src/factory/layer.js index e66ce16d5..e45487034 100644 --- a/app/client/src/factory/layer.js +++ b/app/client/src/factory/layer.js @@ -57,7 +57,8 @@ export const LayerFactory = { layerOrderKey: 1, queryable: lConf.queryable, displayInLayerList: lConf.display_in_layer_list || true, - legendGraphicUrls: lConf.legend_urls || null + legendGraphicUrls: lConf.legend_urls || null, + docUrl: lConf.doc_url || null }; if (lConf.min_resolution) { lOpts.minResolution = lConf.min_resolution;