From a7b3b24aeab42e932a737b1df33b5b11f0c18fa1 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Mon, 7 Nov 2022 23:57:24 +0100 Subject: [PATCH] add info about QWC2 version into help --- Dockerfile | 4 ++- app/js/Help.jsx | 10 +++++- app/static/config.json | 76 ++++++++++++++++++++++++++---------------- app/webpack.config.js | 6 +++- 4 files changed, 65 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1c97f7c..410fb1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM node:${NODE_VERSION} as base ARG QWC2_VERSION_HASH="86ba224001cd3c9813ad645f4ccf4de7a17db801" ARG QWC2_DOWNLOAD_PATH="https://github.com/qgis/qwc2/archive/$QWC2_VERSION_HASH.zip" +ARG QWC2_REPO_VERSION_URL="https://github.com/qgis/qwc2/tree/$QWC2_VERSION_HASH" RUN apt-get update && apt-get install -y \ bash \ curl && \ @@ -11,7 +12,8 @@ RUN apt-get update && apt-get install -y \ rm $QWC2_VERSION_HASH.zip && \ mv qwc2-$QWC2_VERSION_HASH /qwc2 && \ echo "$QWC2_VERSION_HASH" > /qwc2/.qwc2.version.txt && \ - echo "$QWC2_DOWNLOAD_PATH" > /qwc2/.qwc2.download_source.txt + echo "$QWC2_DOWNLOAD_PATH" > /qwc2/.qwc2.download_source.txt && \ + echo "$QWC2_REPO_VERSION_URL" > /qwc2/.qwc2.repo_source.txt COPY ./app/.yarnrc /qwc2 diff --git a/app/js/Help.jsx b/app/js/Help.jsx index f84232f..41cf44b 100644 --- a/app/js/Help.jsx +++ b/app/js/Help.jsx @@ -9,5 +9,13 @@ import React from 'react'; export function renderHelp() { - return (
QWC2 Demo build {process.env.BuildDate}
); + return ( +
+ +
); } diff --git a/app/static/config.json b/app/static/config.json index 404f3bc..88071eb 100644 --- a/app/static/config.json +++ b/app/static/config.json @@ -34,30 +34,10 @@ {"label": "Swisstopo WMTS", "value": "https://wmts10.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml"} ], "projections": [ - { - "code": "EPSG:32632", - "proj": "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs", - "label": "WGS 84 / UTM zone 32N" - }, - { - "code": "EPSG:21781", - "proj": "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs", - "label": "CH1903 / LV03" - }, { "code": "EPSG:2056", "proj": "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs", "label": "CH1903+ / LV95" - }, - { - "code": "EPSG:25832", - "proj": "+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", - "label": "ETRS89 / UTM 32N" - }, - { - "code": "EPSG:31983", - "proj": "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", - "label": "SIRGAS 2000 / UTM zone 23S" } ], "plugins": { @@ -166,14 +146,6 @@ "icon": "list-alt" } }, - { - "name": "TaskButton", - "cfg": { - "position": 6, - "task": "Editing", - "icon": "editing" - } - }, { "name": "HomeButton", "cfg": { @@ -204,6 +176,50 @@ "position": 0 } }, + { + "name": "TopBar", + "cfg": { + "menuItems": [ + {"key": "ThemeSwitcher", "icon": "themes"}, + {"key": "LayerTree", "icon": "layers"}, + {"key": "LayerCatalog", "icon": "catalog"}, + {"key": "Share", "icon": "share"}, + {"key": "Bookmark", "icon": "bookmark"}, + {"key": "Tools", "icon": "tools", "subitems": [ + {"key": "Identify", "icon": "identify_region", "mode": "Region"}, + {"key": "TimeManager", "icon": "clock"}, + {"key": "Measure", "icon": "measure"}, + {"key": "Redlining", "icon": "draw"}, + {"key": "Editing", "icon": "editing"}, + {"key": "FeatureForm", "icon": "featureform"}, + {"key": "AttributeTable", "icon": "editing"}, + {"key": "DxfExport", "icon": "dxfexport"}, + {"key": "RasterExport", "icon": "rasterexport"} + ]}, + {"key": "Print", "icon": "print"}, + {"key": "Help", "icon": "info"}, + {"key": "ExternalLink", "icon": "link", "url": "http://example.com?extent=$e$", "target": "iframe"} + ], + "toolbarItems": [ + {"key": "Measure", "mode": "LineString", "icon": "measure_line"}, + {"key": "Measure", "mode": "Polygon", "icon": "measure_polygon"}, + {"key": "Print", "icon": "print"}, + {"key": "Identify", "icon": "identify_region", "mode": "Region"}, + {"key": "FeatureForm", "icon": "featureform"} + ], + "searchOptions": { + "minScaleDenom": 1000, + "showProviderSelection": true, + "providerSelectionAllowAll": true, + "zoomToLayers": false, + "showProvidersInPlaceholder": false + }, + "appMenuClearsTask": true, + "appMenuFilterField": true, + "appMenuVisibleOnStartup": false, + "logoUrl": "/" + } + }, { "name": "BottomBar", "cfg": { @@ -249,6 +265,10 @@ "printExternalLayers": true, "gridInitiallyEnabled": false } + }, + { + "name": "Help", + "mapClickAction": "identify" } ] } diff --git a/app/webpack.config.js b/app/webpack.config.js index 595644e..08261cf 100644 --- a/app/webpack.config.js +++ b/app/webpack.config.js @@ -1,5 +1,6 @@ const webpack = require('webpack'); const path = require('path'); +const fs = require('fs'); const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require("html-webpack-plugin"); @@ -56,7 +57,10 @@ module.exports = (env, argv) => { new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(argv.mode), - BuildDate: JSON.stringify(buildDate) + BuildDate: JSON.stringify(buildDate), + QWC2Version: JSON.stringify(fs.readFileSync('/qwc2/.qwc2.version.txt', 'utf8')), + QWC2DownloadSource: JSON.stringify(fs.readFileSync('/qwc2/.qwc2.download_source.txt', 'utf8')), + QWC2RepoSource: JSON.stringify(fs.readFileSync('/qwc2/.qwc2.repo_source.txt', 'utf8')) } }), new webpack.NormalModuleReplacementPlugin(/openlayers$/, "/qwc2/libs/openlayers"),