Skip to content

Commit

Permalink
add info about QWC2 version into help
Browse files Browse the repository at this point in the history
  • Loading branch information
vvmruder committed Nov 7, 2022
1 parent 7703858 commit a7b3b24
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 31 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
10 changes: 9 additions & 1 deletion app/js/Help.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
import React from 'react';

export function renderHelp() {
return (<div>QWC2 Demo build {process.env.BuildDate}</div>);
return (
<div>
<ul>
<li>QWC2 build {process.env.BuildDate}</li>
<li>QWC2 Version: {process.env.QWC2Version}</li>
<li>QWC2 Download Source: {process.env.QWC2DownloadSource}</li>
<li>QWC2 Repository URL: {process.env.QWC2RepoSource}</li>
</ul>
</div>);
}
76 changes: 48 additions & 28 deletions app/static/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -166,14 +146,6 @@
"icon": "list-alt"
}
},
{
"name": "TaskButton",
"cfg": {
"position": 6,
"task": "Editing",
"icon": "editing"
}
},
{
"name": "HomeButton",
"cfg": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -249,6 +265,10 @@
"printExternalLayers": true,
"gridInitiallyEnabled": false
}
},
{
"name": "Help",
"mapClickAction": "identify"
}
]
}
Expand Down
6 changes: 5 additions & 1 deletion app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit a7b3b24

Please sign in to comment.