Skip to content

Commit

Permalink
Merge pull request #262 from gtt-project/next
Browse files Browse the repository at this point in the history
Prepares for release v5.0.1
  • Loading branch information
dkastl authored Oct 19, 2023
2 parents 3297a7e + 90682d9 commit ee68d99
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 68 deletions.
35 changes: 33 additions & 2 deletions app/helpers/gtt_map_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ module GttMapHelper
def map_form_field(form, map, field: :geojson, bounds: nil, edit_mode: nil, upload: true, rotation: 0)
safe_join [
form.hidden_field(field, id: 'geom'),
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload, rotation: rotation)
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload, rotation: rotation, show: false)
]
end

def map_tag(map: nil, layers: map&.layers,
geom: map.json, bounds: map.bounds,
edit: nil, popup: nil, upload: true,
collapsed: false, rotation: map&.rotation)
collapsed: false, rotation: map&.rotation,
show: true)

data = {
geom: geom.is_a?(String) ? geom : geom.to_json,
Expand All @@ -39,9 +40,39 @@ def map_tag(map: nil, layers: map&.layers,
content_tag(:div, "", data: data, id: uid, class: 'ol-map',
style: (collapsed ? "display: none" : "display: block")),
javascript_tag("
var contentObserver = () => {
const target = document.getElementById('#{uid}');
const observerCallback = function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.removedNodes.length) {
mutation.removedNodes.forEach(function(node) {
if (node === target) {
observer.disconnect();
let event = new Event('contentUpdated');
document.dispatchEvent(event);
}
});
}
});
};
const observer = new MutationObserver(observerCallback);
const config = {
childList: true,
subtree: true
};
observer.observe(document.body, config);
}
if (!#{show}) {
document.addEventListener('contentUpdated', function(){
var target = document.getElementById('#{uid}');
window.createGttClient(target);
contentObserver();
}, { once: true });
}
document.addEventListener('DOMContentLoaded', function(){
var target = document.getElementById('#{uid}');
window.createGttClient(target);
contentObserver();
});
")
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="dialog-geojson-upload" title="<%= l(:title_geojson_upload) %>" style="display:none;">
<textarea placeholder="<%= l(:placeholder_geojson_upload) %>" class="ui-widget ui-state-default ui-corner-all"></textarea>
<textarea name="<%= l(:title_geojson_upload) %>" placeholder="<%= l(:placeholder_geojson_upload) %>" class="ui-widget ui-state-default ui-corner-all"></textarea>
<input type="file" id="file-selector" accept=".json,.geojson">
</div>
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
author_url 'https://github.com/georepublic'
url 'https://github.com/gtt-project/redmine_gtt'
description 'Adds location-based task management and maps'
version '5.0.0'
version '5.0.1'

requires_redmine :version_or_higher => '5.0.0'

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redmine_gtt",
"version": "3.0.0",
"version": "5.0.1",
"description": "Plugin that adds spatial capabilities to Redmine",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -21,26 +21,26 @@
"homepage": "https://github.com/gtt-project/redmine_gtt#readme",
"dependencies": {
"@juggle/resize-observer": "^3.4.0",
"@mdi/font": "^7.2.96",
"@mdi/font": "^7.3.67",
"fontfaceobserver": "^2.3.0",
"geojson": "^0.5.0",
"ol": "^7.4.0",
"ol-ext": "^4.0.8",
"ol-mapbox-style": "^10.6.0"
"ol": "^8.1.0",
"ol-ext": "^4.0.11",
"ol-mapbox-style": "^12.0.0"
},
"devDependencies": {
"@types/fontfaceobserver": "^2.1.0",
"@types/geojson": "^7946.0.10",
"@types/jquery": "^3.5.16",
"@types/jqueryui": "^1.12.17",
"@types/fontfaceobserver": "^2.1.1",
"@types/geojson": "^7946.0.11",
"@types/jquery": "^3.5.22",
"@types/jqueryui": "^1.12.18",
"@types/ol-ext": "npm:@siedlerchr/types-ol-ext",
"css-loader": "^6.8.1",
"sass": "^1.63.5",
"sass": "^1.69.0",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"ts-loader": "^9.4.3",
"typescript": "^5.1.3",
"webpack": "^5.87.0",
"ts-loader": "^9.5.0",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
4 changes: 3 additions & 1 deletion src/components/gtt-client/init/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { OrderFunction } from 'ol/render';

import Ordering from 'ol-ext/render/Ordering';
import Mask from 'ol-ext/filter/Mask';
import { applyStyle } from 'ol-mapbox-style';
import { applyStyle, applyBackground } from 'ol-mapbox-style';

import { ILayerObject } from '../interfaces';
import { updateForm } from "../helpers";
Expand Down Expand Up @@ -88,6 +88,7 @@ function createLayers(this: any): void {
// Apply style URL if provided
if ("styleUrl" in layerOptions) {
applyStyle(layer as any, layerOptions.styleUrl);
applyBackground(layer as any, layerOptions.styleUrl);
}

setLayerProperties(layer, config);
Expand Down Expand Up @@ -181,6 +182,7 @@ function addVectorLayer(this: any, features: Feature<Geometry>[] | null): void {
});
this.vector.set('title', 'Features');
this.vector.set('displayInLayerSwitcher', false);
this.vector.on('prerender', () => this.map.flushDeclutterItems());

// Listen to the moveend event and show message when zoom level is too low
let previousZoom = this.map.getView().getZoom();
Expand Down
10 changes: 10 additions & 0 deletions src/styles/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
--ol-brand-color: #34495e;
}

// attribution styles
.ol-attribution:not(.ol-collapsed) {
background-color: rgba(255, 255, 255, 0.75);
}

.ol-attribution a {
color: #666666;
text-decoration: none;
}

.ol-control button:hover {
background-color: #3f5872;
}
Expand Down
111 changes: 61 additions & 50 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
resolved "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz"
integrity sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==

"@mdi/font@^7.2.96":
version "7.2.96"
resolved "https://registry.yarnpkg.com/@mdi/font/-/font-7.2.96.tgz#af800d9fe3b424f85ad45e9baa755bd003ab4986"
integrity sha512-e//lmkmpFUMZKhmCY9zdjRe4zNXfbOIJnn6xveHbaV2kSw5aJ5dLXUxcRt1Gxfi7ZYpFLUWlkG2MGSFAiqAu7w==
"@mdi/font@^7.3.67":
version "7.3.67"
resolved "https://registry.yarnpkg.com/@mdi/font/-/font-7.3.67.tgz#faa344a04c9d02f608c891a01134084febeb42db"
integrity sha512-SWxvzRbUQRfewlIV+OF4/YF4DkeTjMWoT8Hh9yeU/5UBVdJZj9Uf4a9+cXjknSIhIaMxZ/4N1O/s7ojApOOGjg==

"@petamoriken/float16@^3.4.7":
version "3.8.0"
Expand Down Expand Up @@ -124,27 +124,34 @@
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz"
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==

"@types/fontfaceobserver@^2.1.0":
version "2.1.0"
resolved "https://registry.npmjs.org/@types/fontfaceobserver/-/fontfaceobserver-2.1.0.tgz"
integrity sha512-Vqf183RAiFdIjUi4asKqogf2HIfLDnxn+dQo9GCpnsU5QrrsLMA2bkJU1dHRudQlizLybWD61Csd1zAgUQ3JKQ==
"@types/fontfaceobserver@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@types/fontfaceobserver/-/fontfaceobserver-2.1.1.tgz#8953914e602d571b3d675d0e061a95bf5f2a029a"
integrity sha512-ur2vdKw6m/2Ks1LHFCZxjgXyiXDwM9iThH+vQ4pBoxvoU06UhZ/j+vHnE8eKwsRooBRdGrkNBXSZ4k92JANhAQ==

"@types/geojson@^7946.0.10":
version "7946.0.10"
resolved "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz"
integrity sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==
"@types/geojson@^7946.0.11":
version "7946.0.11"
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.11.tgz#012c17cb2256ad8de78560da851ab914a7b9b40e"
integrity sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==

"@types/jquery@*", "@types/jquery@^3.5.16":
"@types/jquery@*":
version "3.5.16"
resolved "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz"
integrity sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==
dependencies:
"@types/sizzle" "*"

"@types/jqueryui@^1.12.17":
version "1.12.17"
resolved "https://registry.yarnpkg.com/@types/jqueryui/-/jqueryui-1.12.17.tgz#afc9b3c12456995989a8562c67c9f631e79b60fc"
integrity sha512-rqiCaZO7d1rAcJVXNSV6MYwt42oB4ArTRr0QbU3f4+Siv0d6m9uRkhiKHpc6oL9NFJKDxzIIDvUeMXTtlJFFaA==
"@types/jquery@^3.5.22":
version "3.5.22"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.22.tgz#893273736f5695a520986c019c873b75b157f26a"
integrity sha512-ISQFeUK5GwRftLK4PVvKTWEVCxZ2BpaqBz0TWkIq5w4vGojxZP9+XkqgcPjxoqmPeew+HLyWthCBvK7GdF5NYA==
dependencies:
"@types/sizzle" "*"

"@types/jqueryui@^1.12.18":
version "1.12.18"
resolved "https://registry.yarnpkg.com/@types/jqueryui/-/jqueryui-1.12.18.tgz#5112277df93534dfd99388e8b9258f63f007bf5e"
integrity sha512-crlmH8kFzIiU+4aBFgvYUjykSaOTP5RDw7NqkFkcSNWFAF/SMPrr7sY1uNXDEhite/2pEwUoZlufQoy87A22LA==
dependencies:
"@types/jquery" "*"

Expand Down Expand Up @@ -911,28 +918,26 @@ normalize-path@^3.0.0, normalize-path@~3.0.0:
resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==

ol-ext@^4.0.8:
version "4.0.8"
resolved "https://registry.npmjs.org/ol-ext/-/ol-ext-4.0.8.tgz"
integrity sha512-O0q4HmvrB+r0VOC3SAp9jEYSFN6Z3j1kSxRZxPK3VadArWjF27PXF+TGHj7HidzBy84jEre5/vDSv8oJbECbyA==
ol-ext@^4.0.11:
version "4.0.11"
resolved "https://registry.yarnpkg.com/ol-ext/-/ol-ext-4.0.11.tgz#402334d79bfc0a4705dea4805d080e7bdf79936f"
integrity sha512-zorUn71RsahiA/kbf+tRDbv19wqdLCclxd3gkjsFMnqCbdgl+P59CSJCqMO4O7b2bvaHrw5FEmep7FNFnGGQXg==

ol-mapbox-style@^10.1.0, ol-mapbox-style@^10.6.0:
version "10.6.0"
resolved "https://registry.yarnpkg.com/ol-mapbox-style/-/ol-mapbox-style-10.6.0.tgz#89ac864160a374d936a59f7d1c969d4dc1d0a46b"
integrity sha512-s86QhCoyyKVRsYkvPzzdWd///bhYh3onWrBq4lNXnCd9G/hS6AoK023kn4zlDESVlTBDTWLz8vhOistp0M3TXA==
ol-mapbox-style@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/ol-mapbox-style/-/ol-mapbox-style-12.0.0.tgz#614941894880c1f929cf96705517d6f59ecff12e"
integrity sha512-rrIFh1BuXdMfl9XwKobpz7sKLAVchseowQlGdgN3WRbCnovSdTeC5RSw1lgnC334kY74y9CQ7cY2WOR5nbnpHg==
dependencies:
"@mapbox/mapbox-gl-style-spec" "^13.23.1"
mapbox-to-css-font "^2.4.1"
ol "^7.3.0"

ol@^7.3.0, ol@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/ol/-/ol-7.4.0.tgz#935436c0843d1f939972e076d4fcb130530ce9d7"
integrity sha512-bgBbiah694HhC0jt8ptEFNRXwgO8d6xWH3G97PCg4bmn9Li5nLLbi59oSrvqUI6VPVwonPQF1YcqJymxxyMC6A==
ol@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/ol/-/ol-8.1.0.tgz#6f3259855cb331a6fa9cbf363aa69d37bba7306a"
integrity sha512-cx3SH2plpFS9fM8pp1nCypgQXGJD7Mcb1E3mEySmy5XEw1DUEo+kkNzgtAZz5qupekqi7aU9iBJEjCoMfqvO2Q==
dependencies:
earcut "^2.2.3"
geotiff "^2.0.7"
ol-mapbox-style "^10.1.0"
pbf "3.2.1"
rbush "^3.0.1"

Expand Down Expand Up @@ -1170,10 +1175,10 @@ sass-loader@^13.3.2:
dependencies:
neo-async "^2.6.2"

sass@^1.63.5:
version "1.63.5"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.63.5.tgz#6e1900b12576e3e74a8ab0a9d8607cacbe584ef1"
integrity sha512-Q6c5gs482oezdAp+0fWF9cRisvpy7yfYb64knID0OE8AnMgtkluRPfpGMFjeD4/+M4+6QpJZCU6JRSxbjiktkg==
sass@^1.69.0:
version "1.69.0"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.0.tgz#5195075371c239ed556280cf2f5944d234f42679"
integrity sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
Expand All @@ -1198,9 +1203,9 @@ schema-utils@^3.2.0:
ajv-keywords "^3.5.2"

semver@^7.3.4, semver@^7.3.8:
version "7.5.1"
resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz"
integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==
version "7.5.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e"
integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==
dependencies:
lru-cache "^6.0.0"

Expand Down Expand Up @@ -1266,6 +1271,11 @@ source-map@^0.6.0:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==

stackblur-canvas@^2.0.0:
version "2.5.0"
resolved "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.5.0.tgz"
Expand Down Expand Up @@ -1340,20 +1350,21 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

ts-loader@^9.4.3:
version "9.4.3"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.4.3.tgz#55cfa7c28dd82a2de968ae45c3adb75fb888b27e"
integrity sha512-n3hBnm6ozJYzwiwt5YRiJZkzktftRpMiBApHaJPoWLA+qetQBAXkHqCLM6nwSdRDimqVtA5ocIkcTRLMTt7yzA==
ts-loader@^9.5.0:
version "9.5.0"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.5.0.tgz#f0a51dda37cc4d8e43e6cb14edebbc599b0c3aa2"
integrity sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^5.0.0"
micromatch "^4.0.0"
semver "^7.3.4"
source-map "^0.7.4"

typescript@^5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
typescript@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==

update-browserslist-db@^1.0.10:
version "1.0.11"
Expand Down Expand Up @@ -1427,10 +1438,10 @@ webpack-sources@^3.2.3:
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==

webpack@^5.87.0:
version "5.87.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.87.0.tgz#df8a9c094c6037f45e0d77598f9e59d33ca3a98c"
integrity sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw==
webpack@^5.88.2:
version "5.88.2"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e"
integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==
dependencies:
"@types/eslint-scope" "^3.7.3"
"@types/estree" "^1.0.0"
Expand Down

0 comments on commit ee68d99

Please sign in to comment.