Skip to content

Commit ee68d99

Browse files
authored
Merge pull request #262 from gtt-project/next
Prepares for release v5.0.1
2 parents 3297a7e + 90682d9 commit ee68d99

File tree

7 files changed

+122
-68
lines changed

7 files changed

+122
-68
lines changed

app/helpers/gtt_map_helper.rb

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ module GttMapHelper
55
def map_form_field(form, map, field: :geojson, bounds: nil, edit_mode: nil, upload: true, rotation: 0)
66
safe_join [
77
form.hidden_field(field, id: 'geom'),
8-
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload, rotation: rotation)
8+
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload, rotation: rotation, show: false)
99
]
1010
end
1111

1212
def map_tag(map: nil, layers: map&.layers,
1313
geom: map.json, bounds: map.bounds,
1414
edit: nil, popup: nil, upload: true,
15-
collapsed: false, rotation: map&.rotation)
15+
collapsed: false, rotation: map&.rotation,
16+
show: true)
1617

1718
data = {
1819
geom: geom.is_a?(String) ? geom : geom.to_json,
@@ -39,9 +40,39 @@ def map_tag(map: nil, layers: map&.layers,
3940
content_tag(:div, "", data: data, id: uid, class: 'ol-map',
4041
style: (collapsed ? "display: none" : "display: block")),
4142
javascript_tag("
43+
var contentObserver = () => {
44+
const target = document.getElementById('#{uid}');
45+
const observerCallback = function(mutations) {
46+
mutations.forEach(function(mutation) {
47+
if (mutation.removedNodes.length) {
48+
mutation.removedNodes.forEach(function(node) {
49+
if (node === target) {
50+
observer.disconnect();
51+
let event = new Event('contentUpdated');
52+
document.dispatchEvent(event);
53+
}
54+
});
55+
}
56+
});
57+
};
58+
const observer = new MutationObserver(observerCallback);
59+
const config = {
60+
childList: true,
61+
subtree: true
62+
};
63+
observer.observe(document.body, config);
64+
}
65+
if (!#{show}) {
66+
document.addEventListener('contentUpdated', function(){
67+
var target = document.getElementById('#{uid}');
68+
window.createGttClient(target);
69+
contentObserver();
70+
}, { once: true });
71+
}
4272
document.addEventListener('DOMContentLoaded', function(){
4373
var target = document.getElementById('#{uid}');
4474
window.createGttClient(target);
75+
contentObserver();
4576
});
4677
")
4778
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div id="dialog-geojson-upload" title="<%= l(:title_geojson_upload) %>" style="display:none;">
2-
<textarea placeholder="<%= l(:placeholder_geojson_upload) %>" class="ui-widget ui-state-default ui-corner-all"></textarea>
2+
<textarea name="<%= l(:title_geojson_upload) %>" placeholder="<%= l(:placeholder_geojson_upload) %>" class="ui-widget ui-state-default ui-corner-all"></textarea>
33
<input type="file" id="file-selector" accept=".json,.geojson">
44
</div>

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
author_url 'https://github.com/georepublic'
99
url 'https://github.com/gtt-project/redmine_gtt'
1010
description 'Adds location-based task management and maps'
11-
version '5.0.0'
11+
version '5.0.1'
1212

1313
requires_redmine :version_or_higher => '5.0.0'
1414

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redmine_gtt",
3-
"version": "3.0.0",
3+
"version": "5.0.1",
44
"description": "Plugin that adds spatial capabilities to Redmine",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1"
@@ -21,26 +21,26 @@
2121
"homepage": "https://github.com/gtt-project/redmine_gtt#readme",
2222
"dependencies": {
2323
"@juggle/resize-observer": "^3.4.0",
24-
"@mdi/font": "^7.2.96",
24+
"@mdi/font": "^7.3.67",
2525
"fontfaceobserver": "^2.3.0",
2626
"geojson": "^0.5.0",
27-
"ol": "^7.4.0",
28-
"ol-ext": "^4.0.8",
29-
"ol-mapbox-style": "^10.6.0"
27+
"ol": "^8.1.0",
28+
"ol-ext": "^4.0.11",
29+
"ol-mapbox-style": "^12.0.0"
3030
},
3131
"devDependencies": {
32-
"@types/fontfaceobserver": "^2.1.0",
33-
"@types/geojson": "^7946.0.10",
34-
"@types/jquery": "^3.5.16",
35-
"@types/jqueryui": "^1.12.17",
32+
"@types/fontfaceobserver": "^2.1.1",
33+
"@types/geojson": "^7946.0.11",
34+
"@types/jquery": "^3.5.22",
35+
"@types/jqueryui": "^1.12.18",
3636
"@types/ol-ext": "npm:@siedlerchr/types-ol-ext",
3737
"css-loader": "^6.8.1",
38-
"sass": "^1.63.5",
38+
"sass": "^1.69.0",
3939
"sass-loader": "^13.3.2",
4040
"style-loader": "^3.3.3",
41-
"ts-loader": "^9.4.3",
42-
"typescript": "^5.1.3",
43-
"webpack": "^5.87.0",
41+
"ts-loader": "^9.5.0",
42+
"typescript": "^5.2.2",
43+
"webpack": "^5.88.2",
4444
"webpack-cli": "^5.1.4"
4545
}
4646
}

src/components/gtt-client/init/layers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { OrderFunction } from 'ol/render';
1111

1212
import Ordering from 'ol-ext/render/Ordering';
1313
import Mask from 'ol-ext/filter/Mask';
14-
import { applyStyle } from 'ol-mapbox-style';
14+
import { applyStyle, applyBackground } from 'ol-mapbox-style';
1515

1616
import { ILayerObject } from '../interfaces';
1717
import { updateForm } from "../helpers";
@@ -88,6 +88,7 @@ function createLayers(this: any): void {
8888
// Apply style URL if provided
8989
if ("styleUrl" in layerOptions) {
9090
applyStyle(layer as any, layerOptions.styleUrl);
91+
applyBackground(layer as any, layerOptions.styleUrl);
9192
}
9293

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

185187
// Listen to the moveend event and show message when zoom level is too low
186188
let previousZoom = this.map.getView().getZoom();

src/styles/scss/app.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
--ol-brand-color: #34495e;
1313
}
1414

15+
// attribution styles
16+
.ol-attribution:not(.ol-collapsed) {
17+
background-color: rgba(255, 255, 255, 0.75);
18+
}
19+
20+
.ol-attribution a {
21+
color: #666666;
22+
text-decoration: none;
23+
}
24+
1525
.ol-control button:hover {
1626
background-color: #3f5872;
1727
}

yarn.lock

Lines changed: 61 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
resolved "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz"
9494
integrity sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==
9595

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

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

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

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

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

144-
"@types/jqueryui@^1.12.17":
145-
version "1.12.17"
146-
resolved "https://registry.yarnpkg.com/@types/jqueryui/-/jqueryui-1.12.17.tgz#afc9b3c12456995989a8562c67c9f631e79b60fc"
147-
integrity sha512-rqiCaZO7d1rAcJVXNSV6MYwt42oB4ArTRr0QbU3f4+Siv0d6m9uRkhiKHpc6oL9NFJKDxzIIDvUeMXTtlJFFaA==
144+
"@types/jquery@^3.5.22":
145+
version "3.5.22"
146+
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.22.tgz#893273736f5695a520986c019c873b75b157f26a"
147+
integrity sha512-ISQFeUK5GwRftLK4PVvKTWEVCxZ2BpaqBz0TWkIq5w4vGojxZP9+XkqgcPjxoqmPeew+HLyWthCBvK7GdF5NYA==
148+
dependencies:
149+
"@types/sizzle" "*"
150+
151+
"@types/jqueryui@^1.12.18":
152+
version "1.12.18"
153+
resolved "https://registry.yarnpkg.com/@types/jqueryui/-/jqueryui-1.12.18.tgz#5112277df93534dfd99388e8b9258f63f007bf5e"
154+
integrity sha512-crlmH8kFzIiU+4aBFgvYUjykSaOTP5RDw7NqkFkcSNWFAF/SMPrr7sY1uNXDEhite/2pEwUoZlufQoy87A22LA==
148155
dependencies:
149156
"@types/jquery" "*"
150157

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

914-
ol-ext@^4.0.8:
915-
version "4.0.8"
916-
resolved "https://registry.npmjs.org/ol-ext/-/ol-ext-4.0.8.tgz"
917-
integrity sha512-O0q4HmvrB+r0VOC3SAp9jEYSFN6Z3j1kSxRZxPK3VadArWjF27PXF+TGHj7HidzBy84jEre5/vDSv8oJbECbyA==
921+
ol-ext@^4.0.11:
922+
version "4.0.11"
923+
resolved "https://registry.yarnpkg.com/ol-ext/-/ol-ext-4.0.11.tgz#402334d79bfc0a4705dea4805d080e7bdf79936f"
924+
integrity sha512-zorUn71RsahiA/kbf+tRDbv19wqdLCclxd3gkjsFMnqCbdgl+P59CSJCqMO4O7b2bvaHrw5FEmep7FNFnGGQXg==
918925

919-
ol-mapbox-style@^10.1.0, ol-mapbox-style@^10.6.0:
920-
version "10.6.0"
921-
resolved "https://registry.yarnpkg.com/ol-mapbox-style/-/ol-mapbox-style-10.6.0.tgz#89ac864160a374d936a59f7d1c969d4dc1d0a46b"
922-
integrity sha512-s86QhCoyyKVRsYkvPzzdWd///bhYh3onWrBq4lNXnCd9G/hS6AoK023kn4zlDESVlTBDTWLz8vhOistp0M3TXA==
926+
ol-mapbox-style@^12.0.0:
927+
version "12.0.0"
928+
resolved "https://registry.yarnpkg.com/ol-mapbox-style/-/ol-mapbox-style-12.0.0.tgz#614941894880c1f929cf96705517d6f59ecff12e"
929+
integrity sha512-rrIFh1BuXdMfl9XwKobpz7sKLAVchseowQlGdgN3WRbCnovSdTeC5RSw1lgnC334kY74y9CQ7cY2WOR5nbnpHg==
923930
dependencies:
924931
"@mapbox/mapbox-gl-style-spec" "^13.23.1"
925932
mapbox-to-css-font "^2.4.1"
926-
ol "^7.3.0"
927933

928-
ol@^7.3.0, ol@^7.4.0:
929-
version "7.4.0"
930-
resolved "https://registry.yarnpkg.com/ol/-/ol-7.4.0.tgz#935436c0843d1f939972e076d4fcb130530ce9d7"
931-
integrity sha512-bgBbiah694HhC0jt8ptEFNRXwgO8d6xWH3G97PCg4bmn9Li5nLLbi59oSrvqUI6VPVwonPQF1YcqJymxxyMC6A==
934+
ol@^8.1.0:
935+
version "8.1.0"
936+
resolved "https://registry.yarnpkg.com/ol/-/ol-8.1.0.tgz#6f3259855cb331a6fa9cbf363aa69d37bba7306a"
937+
integrity sha512-cx3SH2plpFS9fM8pp1nCypgQXGJD7Mcb1E3mEySmy5XEw1DUEo+kkNzgtAZz5qupekqi7aU9iBJEjCoMfqvO2Q==
932938
dependencies:
933939
earcut "^2.2.3"
934940
geotiff "^2.0.7"
935-
ol-mapbox-style "^10.1.0"
936941
pbf "3.2.1"
937942
rbush "^3.0.1"
938943

@@ -1170,10 +1175,10 @@ sass-loader@^13.3.2:
11701175
dependencies:
11711176
neo-async "^2.6.2"
11721177

1173-
sass@^1.63.5:
1174-
version "1.63.5"
1175-
resolved "https://registry.yarnpkg.com/sass/-/sass-1.63.5.tgz#6e1900b12576e3e74a8ab0a9d8607cacbe584ef1"
1176-
integrity sha512-Q6c5gs482oezdAp+0fWF9cRisvpy7yfYb64knID0OE8AnMgtkluRPfpGMFjeD4/+M4+6QpJZCU6JRSxbjiktkg==
1178+
sass@^1.69.0:
1179+
version "1.69.0"
1180+
resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.0.tgz#5195075371c239ed556280cf2f5944d234f42679"
1181+
integrity sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==
11771182
dependencies:
11781183
chokidar ">=3.0.0 <4.0.0"
11791184
immutable "^4.0.0"
@@ -1198,9 +1203,9 @@ schema-utils@^3.2.0:
11981203
ajv-keywords "^3.5.2"
11991204

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

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

1274+
source-map@^0.7.4:
1275+
version "0.7.4"
1276+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
1277+
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
1278+
12691279
stackblur-canvas@^2.0.0:
12701280
version "2.5.0"
12711281
resolved "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.5.0.tgz"
@@ -1340,20 +1350,21 @@ to-regex-range@^5.0.1:
13401350
dependencies:
13411351
is-number "^7.0.0"
13421352

1343-
ts-loader@^9.4.3:
1344-
version "9.4.3"
1345-
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.4.3.tgz#55cfa7c28dd82a2de968ae45c3adb75fb888b27e"
1346-
integrity sha512-n3hBnm6ozJYzwiwt5YRiJZkzktftRpMiBApHaJPoWLA+qetQBAXkHqCLM6nwSdRDimqVtA5ocIkcTRLMTt7yzA==
1353+
ts-loader@^9.5.0:
1354+
version "9.5.0"
1355+
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.5.0.tgz#f0a51dda37cc4d8e43e6cb14edebbc599b0c3aa2"
1356+
integrity sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==
13471357
dependencies:
13481358
chalk "^4.1.0"
13491359
enhanced-resolve "^5.0.0"
13501360
micromatch "^4.0.0"
13511361
semver "^7.3.4"
1362+
source-map "^0.7.4"
13521363

1353-
typescript@^5.1.3:
1354-
version "5.1.3"
1355-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
1356-
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
1364+
typescript@^5.2.2:
1365+
version "5.2.2"
1366+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
1367+
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
13571368

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

1430-
webpack@^5.87.0:
1431-
version "5.87.0"
1432-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.87.0.tgz#df8a9c094c6037f45e0d77598f9e59d33ca3a98c"
1433-
integrity sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw==
1441+
webpack@^5.88.2:
1442+
version "5.88.2"
1443+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e"
1444+
integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==
14341445
dependencies:
14351446
"@types/eslint-scope" "^3.7.3"
14361447
"@types/estree" "^1.0.0"

0 commit comments

Comments
 (0)