qwc2 2026.8.7 → 2026.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/bookmark.js +0 -15
- package/actions/localConfig.js +0 -7
- package/components/BookmarkPanel.js +121 -124
- package/components/Icon.js +2 -0
- package/components/IdentifyViewer.js +62 -35
- package/components/StandardApp.js +0 -5
- package/components/map3d/Map3D.js +10 -8
- package/components/style/BookmarkPanel.css +2 -0
- package/components/style/Icon.css +4 -0
- package/components/widgets/InputContainer.js +2 -29
- package/components/widgets/style/InputContainer.css +2 -1
- package/package.json +1 -1
- package/plugins/Bookmark.js +25 -19
- package/plugins/BottomBar.js +2 -2
- package/plugins/Identify.js +113 -23
- package/plugins/MapFilter.js +48 -34
- package/plugins/VisibilityPreset.js +34 -23
- package/reducers/localConfig.js +2 -21
- package/scripts/themesConfig.js +4 -0
- package/scripts/themesConfig.py +2 -0
- package/static/translations/bg-BG.json +11 -6
- package/static/translations/ca-ES.json +11 -6
- package/static/translations/cs-CZ.json +11 -6
- package/static/translations/de-CH.json +11 -6
- package/static/translations/de-DE.json +11 -6
- package/static/translations/en-US.json +11 -6
- package/static/translations/es-ES.json +11 -6
- package/static/translations/fi-FI.json +11 -6
- package/static/translations/fr-FR.json +11 -6
- package/static/translations/hu-HU.json +11 -6
- package/static/translations/it-IT.json +11 -6
- package/static/translations/ja-JP.json +11 -6
- package/static/translations/nl-NL.json +11 -6
- package/static/translations/no-NO.json +11 -6
- package/static/translations/pl-PL.json +11 -6
- package/static/translations/pt-BR.json +11 -6
- package/static/translations/pt-PT.json +11 -6
- package/static/translations/ro-RO.json +11 -6
- package/static/translations/ru-RU.json +11 -6
- package/static/translations/sv-SE.json +11 -6
- package/static/translations/tr-TR.json +11 -6
- package/static/translations/tsconfig.json +11 -6
- package/static/translations/uk-UA.json +11 -6
- package/utils/LayerUtils.js +18 -5
- package/utils/PermaLinkUtils.js +254 -286
- package/utils/ServiceLayerUtils.js +2 -0
package/actions/bookmark.js
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
import bookmarkReducer from '../reducers/bookmark';
|
|
10
10
|
import ReducerIndex from '../reducers/index';
|
|
11
|
-
import { getBookmarks, getVisibilityPresets } from '../utils/PermaLinkUtils';
|
|
12
11
|
ReducerIndex.register("bookmark", bookmarkReducer);
|
|
13
12
|
export var SET_BOOKMARKS = 'SET_BOOKMARKS';
|
|
14
13
|
export var SET_VISIBILITY_PRESETS = 'SET_VISIBILITY_PRESETS';
|
|
@@ -23,18 +22,4 @@ export function setVisibilityPresets(visibilityPresets) {
|
|
|
23
22
|
type: SET_VISIBILITY_PRESETS,
|
|
24
23
|
visibilityPresets: visibilityPresets
|
|
25
24
|
};
|
|
26
|
-
}
|
|
27
|
-
export function refreshBookmarks() {
|
|
28
|
-
return function (dispatch) {
|
|
29
|
-
getBookmarks(function (bookmarks) {
|
|
30
|
-
return dispatch(setBookmarks(bookmarks));
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function refreshVisibilityPresets() {
|
|
35
|
-
return function (dispatch) {
|
|
36
|
-
getVisibilityPresets(function (presets) {
|
|
37
|
-
return dispatch(setVisibilityPresets(presets));
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
25
|
}
|
package/actions/localConfig.js
CHANGED
|
@@ -13,7 +13,6 @@ export var LOCAL_CONFIG_LOADED = 'LOCAL_CONFIG_LOADED';
|
|
|
13
13
|
export var SET_STARTUP_PARAMETERS = 'SET_STARTUP_PARAMETERS';
|
|
14
14
|
export var SET_COLOR_SCHEME = 'SET_COLOR_SCHEME';
|
|
15
15
|
export var SET_USER_INFO_FIELDS = 'SET_USER_INFO_FIELDS';
|
|
16
|
-
export var SET_PERMALINK_PARAMETERS = 'SET_PERMALINK_PARAMETERS';
|
|
17
16
|
export var REGISTER_CUSTOM_PLUGIN = 'REGISTER_CUSTOM_PLUGIN';
|
|
18
17
|
export var UNREGISTER_CUSTOM_PLUGIN = 'UNREGISTER_CUSTOM_PLUGIN';
|
|
19
18
|
export function localConfigLoaded(config) {
|
|
@@ -43,12 +42,6 @@ export function setUserInfoFields(fields) {
|
|
|
43
42
|
fields: fields
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
export function setPermalinkParameters(params) {
|
|
47
|
-
return {
|
|
48
|
-
type: SET_PERMALINK_PARAMETERS,
|
|
49
|
-
params: params
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
45
|
export function registerCustomPlugin(name, availableIn3D) {
|
|
53
46
|
return {
|
|
54
47
|
type: REGISTER_CUSTOM_PLUGIN,
|
|
@@ -31,15 +31,6 @@ import ConfigUtils from '../utils/ConfigUtils';
|
|
|
31
31
|
import LocaleUtils from '../utils/LocaleUtils';
|
|
32
32
|
import MiscUtils from '../utils/MiscUtils';
|
|
33
33
|
import './style/BookmarkPanel.css';
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Allows managing user bookmarks.
|
|
37
|
-
* or user visibility presets if `visibilityPresetsMode` is true.
|
|
38
|
-
*
|
|
39
|
-
* Bookmarks are only allowed for authenticated users.
|
|
40
|
-
*
|
|
41
|
-
* Requires `permalinkServiceUrl` to point to a `qwc-permalink-service`.
|
|
42
|
-
*/
|
|
43
34
|
var BookmarkPanel = /*#__PURE__*/function (_React$Component) {
|
|
44
35
|
function BookmarkPanel() {
|
|
45
36
|
var _this;
|
|
@@ -49,193 +40,202 @@ var BookmarkPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
49
40
|
}
|
|
50
41
|
_this = _callSuper(this, BookmarkPanel, [].concat(args));
|
|
51
42
|
_defineProperty(_this, "state", {
|
|
52
|
-
renameBookmark: null,
|
|
53
43
|
currentBookmark: null,
|
|
44
|
+
rename: false,
|
|
54
45
|
busy: false
|
|
55
46
|
});
|
|
56
47
|
_defineProperty(_this, "bookmarkClicked", function (ev, bookmark) {
|
|
57
|
-
if (_this.state.
|
|
48
|
+
if (_this.state.rename) {
|
|
58
49
|
// pass
|
|
59
50
|
} else if (_this.props.openOnClick) {
|
|
60
51
|
_this.props.onOpen(bookmark.key, ev.button === 1);
|
|
61
|
-
} else if (_this.state.currentBookmark === bookmark
|
|
52
|
+
} else if (_this.state.currentBookmark === bookmark) {
|
|
62
53
|
_this.setState({
|
|
63
54
|
currentBookmark: null,
|
|
64
55
|
description: ""
|
|
65
56
|
});
|
|
66
57
|
} else {
|
|
67
58
|
_this.setState({
|
|
68
|
-
currentBookmark: bookmark
|
|
59
|
+
currentBookmark: bookmark,
|
|
69
60
|
description: bookmark.description
|
|
70
61
|
});
|
|
71
62
|
}
|
|
72
63
|
});
|
|
73
64
|
_defineProperty(_this, "bookmarkDoubleClicked", function (ev, bookmark) {
|
|
74
|
-
if (!_this.state.
|
|
65
|
+
if (!_this.state.rename) {
|
|
75
66
|
_this.props.onOpen(bookmark.key, false);
|
|
76
67
|
}
|
|
77
68
|
});
|
|
78
|
-
_defineProperty(_this, "updateBookmarkName", function (text) {
|
|
79
|
-
_this.setState({
|
|
80
|
-
busy: true
|
|
81
|
-
});
|
|
82
|
-
_this.props.onRename(_this.state.renameBookmark, text, function (success) {
|
|
83
|
-
if (!success) {
|
|
84
|
-
var _this$props$translati;
|
|
85
|
-
/* eslint-disable-next-line */
|
|
86
|
-
alert((_this$props$translati = _this.props.translations) === null || _this$props$translati === void 0 ? void 0 : _this$props$translati.savefailed);
|
|
87
|
-
}
|
|
88
|
-
_this.props.onRefresh();
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
69
|
_defineProperty(_this, "addBookmark", function () {
|
|
92
|
-
var _this$props$translati2;
|
|
93
70
|
_this.setState({
|
|
94
71
|
busy: true
|
|
95
72
|
});
|
|
96
|
-
_this.props.
|
|
73
|
+
_this.props.bookmarkIface.create(_this.props.translations["new"], function (success, key) {
|
|
97
74
|
if (!success) {
|
|
98
|
-
var _this$props$translati3;
|
|
99
75
|
/* eslint-disable-next-line */
|
|
100
|
-
alert(
|
|
76
|
+
alert(_this.props.translations.addfailed);
|
|
77
|
+
_this.setState({
|
|
78
|
+
busy: false
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
_this.props.bookmarkIface.getList(function (bookmarks) {
|
|
82
|
+
_this.props.setList(bookmarks);
|
|
83
|
+
_this.setState({
|
|
84
|
+
rename: true,
|
|
85
|
+
currentBookmark: bookmarks.find(function (bk) {
|
|
86
|
+
return bk.key === key;
|
|
87
|
+
}),
|
|
88
|
+
busy: false
|
|
89
|
+
});
|
|
90
|
+
});
|
|
101
91
|
}
|
|
102
|
-
_this.props.onRefresh();
|
|
103
|
-
});
|
|
104
|
-
_this.setState({
|
|
105
|
-
description: "",
|
|
106
|
-
currentBookmark: null
|
|
107
92
|
});
|
|
108
93
|
});
|
|
109
|
-
_defineProperty(_this, "updateBookmark", function (
|
|
94
|
+
_defineProperty(_this, "updateBookmark", function (bookmark, params) {
|
|
95
|
+
var updateData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
96
|
+
// eslint-disable-next-line no-alert
|
|
97
|
+
if (updateData && !confirm(_this.props.translations.confirmOverwrite)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
110
100
|
_this.setState({
|
|
111
101
|
busy: true
|
|
112
102
|
});
|
|
113
|
-
|
|
114
|
-
return bk.key === key;
|
|
115
|
-
}).description;
|
|
116
|
-
_this.props.onUpdate(key, description, function (success) {
|
|
103
|
+
_this.props.bookmarkIface.update(bookmark.key, params, updateData, function (success) {
|
|
117
104
|
if (!success) {
|
|
118
|
-
var _this$props$translati4;
|
|
119
105
|
/* eslint-disable-next-line */
|
|
120
|
-
alert(
|
|
106
|
+
alert(_this.props.translations.savefailed);
|
|
107
|
+
_this.setState({
|
|
108
|
+
busy: false
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
_this.props.bookmarkIface.getList(function (bookmarks) {
|
|
112
|
+
_this.props.setList(bookmarks);
|
|
113
|
+
_this.setState({
|
|
114
|
+
rename: false,
|
|
115
|
+
currentBookmark: bookmarks.find(function (bk) {
|
|
116
|
+
return bk.key === bookmark.key;
|
|
117
|
+
}),
|
|
118
|
+
busy: false
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
121
|
}
|
|
122
|
-
_this.props.onRefresh();
|
|
123
122
|
});
|
|
124
123
|
});
|
|
125
|
-
_defineProperty(_this, "removeBookmark", function (
|
|
124
|
+
_defineProperty(_this, "removeBookmark", function (bookmark) {
|
|
125
|
+
// eslint-disable-next-line no-alert
|
|
126
|
+
if (!confirm(_this.props.translations.confirmDelete)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
126
129
|
_this.setState({
|
|
127
130
|
busy: true
|
|
128
131
|
});
|
|
129
|
-
_this.props.
|
|
132
|
+
_this.props.bookmarkIface["delete"](bookmark.key, function (success) {
|
|
130
133
|
if (!success) {
|
|
131
|
-
var _this$props$translati5;
|
|
132
134
|
/* eslint-disable-next-line */
|
|
133
|
-
alert(
|
|
135
|
+
alert(_this.props.translations.removefailed);
|
|
136
|
+
_this.setState({
|
|
137
|
+
busy: false
|
|
138
|
+
});
|
|
134
139
|
}
|
|
135
|
-
_this.props.
|
|
140
|
+
_this.props.bookmarkIface.getList(function (bookmarks) {
|
|
141
|
+
_this.props.setList(bookmarks);
|
|
142
|
+
_this.setState({
|
|
143
|
+
rename: false,
|
|
144
|
+
currentBookmark: null,
|
|
145
|
+
busy: false
|
|
146
|
+
});
|
|
147
|
+
});
|
|
136
148
|
});
|
|
137
149
|
});
|
|
138
150
|
return _this;
|
|
139
151
|
}
|
|
140
152
|
_inherits(BookmarkPanel, _React$Component);
|
|
141
153
|
return _createClass(BookmarkPanel, [{
|
|
142
|
-
key: "componentDidUpdate",
|
|
143
|
-
value: function componentDidUpdate(prevProps) {
|
|
144
|
-
// Check exact identity of bookmarks array to reset busy state in all cases
|
|
145
|
-
if (prevProps.bookmarks !== this.props.bookmarks) {
|
|
146
|
-
this.setState({
|
|
147
|
-
renameBookmark: null,
|
|
148
|
-
busy: false
|
|
149
|
-
});
|
|
150
|
-
// Select a recently added bookmark
|
|
151
|
-
var addedBookmark = this.props.bookmarks.find(function (bookmark) {
|
|
152
|
-
return !prevProps.bookmarks.some(function (prevBookmark) {
|
|
153
|
-
return prevBookmark.key === bookmark.key;
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
if (addedBookmark) {
|
|
157
|
-
this.setState({
|
|
158
|
-
renameBookmark: addedBookmark.key,
|
|
159
|
-
currentBookmark: null
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
154
|
key: "render",
|
|
166
155
|
value: function render() {
|
|
167
|
-
var
|
|
168
|
-
_this$props$translati7,
|
|
169
|
-
_this$props$translati8,
|
|
170
|
-
_this2 = this,
|
|
171
|
-
_this$props$translati9,
|
|
172
|
-
_this$props$translati0,
|
|
173
|
-
_this$props$translati1,
|
|
174
|
-
_this$props$translati10,
|
|
175
|
-
_this$props$translati11;
|
|
156
|
+
var _this2 = this;
|
|
176
157
|
var username = ConfigUtils.getConfigProp("username");
|
|
158
|
+
var hasPublicBookmarksCap = ConfigUtils.getConfigProp("capabilities", null, []).includes("public_bookmarks");
|
|
177
159
|
var currentBookmark = this.state.currentBookmark;
|
|
178
160
|
var buttonsDisabled = !currentBookmark || this.state.busy;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
role: "body"
|
|
182
|
-
}, " ", (_this$props$translati6 = this.props.translations) === null || _this$props$translati6 === void 0 ? void 0 : _this$props$translati6.notloggedin) : /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
var updatable = currentBookmark === null || currentBookmark === void 0 ? void 0 : currentBookmark.own;
|
|
162
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
183
163
|
className: "bookmark-body",
|
|
184
164
|
role: "body"
|
|
185
165
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
186
166
|
className: "bookmark-header"
|
|
187
|
-
}, /*#__PURE__*/React.createElement("span", null,
|
|
167
|
+
}, /*#__PURE__*/React.createElement("span", null, this.props.translations.title), username ? /*#__PURE__*/React.createElement("button", {
|
|
188
168
|
className: "button",
|
|
189
169
|
onClick: this.addBookmark,
|
|
190
|
-
title:
|
|
170
|
+
title: this.props.translations["new"]
|
|
191
171
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
192
172
|
icon: "plus"
|
|
193
|
-
}))), !this.props.openOnClick ? /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
})) : null), !this.props.openOnClick ? /*#__PURE__*/React.createElement("div", {
|
|
194
174
|
className: "bookmark-actions controlgroup"
|
|
195
175
|
}, /*#__PURE__*/React.createElement("button", {
|
|
196
176
|
className: "button",
|
|
197
177
|
disabled: buttonsDisabled,
|
|
198
178
|
onClick: function onClick() {
|
|
199
|
-
return _this2.props.onOpen(currentBookmark, false);
|
|
179
|
+
return _this2.props.onOpen(currentBookmark.key, false);
|
|
200
180
|
},
|
|
201
|
-
title:
|
|
181
|
+
title: this.props.translations.open
|
|
202
182
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
203
183
|
icon: "folder-open"
|
|
204
|
-
})),
|
|
184
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
205
185
|
className: "button",
|
|
206
186
|
disabled: buttonsDisabled,
|
|
207
187
|
onClick: function onClick() {
|
|
208
|
-
return _this2.props.onOpen(currentBookmark, true);
|
|
188
|
+
return _this2.props.onOpen(currentBookmark.key, true);
|
|
209
189
|
},
|
|
210
|
-
title:
|
|
190
|
+
title: this.props.translations.openTab
|
|
211
191
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
212
192
|
icon: "open_link"
|
|
213
|
-
}))
|
|
193
|
+
})), this.props.onZoomToExtent ? /*#__PURE__*/React.createElement("button", {
|
|
214
194
|
className: "button",
|
|
215
195
|
disabled: buttonsDisabled,
|
|
216
196
|
onClick: function onClick() {
|
|
217
|
-
return _this2.props.onZoomToExtent(currentBookmark);
|
|
197
|
+
return _this2.props.onZoomToExtent(currentBookmark.key);
|
|
218
198
|
},
|
|
219
|
-
title:
|
|
199
|
+
title: this.props.translations.zoomToExtent
|
|
220
200
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
221
201
|
icon: "zoom"
|
|
222
202
|
})) : null, /*#__PURE__*/React.createElement("button", {
|
|
223
203
|
className: "button",
|
|
224
|
-
disabled:
|
|
204
|
+
disabled: !updatable,
|
|
225
205
|
onClick: function onClick() {
|
|
226
|
-
return _this2.updateBookmark(currentBookmark);
|
|
206
|
+
return _this2.updateBookmark(currentBookmark, {}, true);
|
|
227
207
|
},
|
|
228
|
-
title:
|
|
208
|
+
title: this.props.translations.update
|
|
229
209
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
230
210
|
icon: "save"
|
|
231
211
|
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
232
212
|
className: "bookmark-list"
|
|
233
213
|
}, this.props.bookmarks.map(function (bookmark) {
|
|
234
|
-
var _this2$props$translat;
|
|
235
214
|
var itemclasses = classnames({
|
|
236
215
|
"bookmark-list-item": true,
|
|
237
|
-
"bookmark-list-item-active": currentBookmark === bookmark.key
|
|
216
|
+
"bookmark-list-item-active": (currentBookmark === null || currentBookmark === void 0 ? void 0 : currentBookmark.key) === bookmark.key
|
|
238
217
|
});
|
|
218
|
+
var renaming = (currentBookmark === null || currentBookmark === void 0 ? void 0 : currentBookmark.key) === bookmark.key && _this2.state.rename;
|
|
219
|
+
var publicIcon = null;
|
|
220
|
+
if (bookmark.own && hasPublicBookmarksCap) {
|
|
221
|
+
publicIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
222
|
+
disabled: _this2.state.busy,
|
|
223
|
+
icon: "public",
|
|
224
|
+
inactive: !bookmark["public"],
|
|
225
|
+
onClick: function onClick(ev) {
|
|
226
|
+
_this2.updateBookmark(bookmark, {
|
|
227
|
+
"public": !bookmark["public"]
|
|
228
|
+
});
|
|
229
|
+
MiscUtils.killEvent(ev);
|
|
230
|
+
},
|
|
231
|
+
title: _this2.props.translations.togglePublic
|
|
232
|
+
});
|
|
233
|
+
} else if (bookmark["public"]) {
|
|
234
|
+
publicIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
235
|
+
icon: "public",
|
|
236
|
+
title: _this2.props.translations["public"]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
239
|
return /*#__PURE__*/React.createElement("div", {
|
|
240
240
|
className: itemclasses,
|
|
241
241
|
key: bookmark.key,
|
|
@@ -248,13 +248,17 @@ var BookmarkPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
248
248
|
onDoubleClick: function onDoubleClick(ev) {
|
|
249
249
|
return _this2.bookmarkDoubleClicked(ev, bookmark);
|
|
250
250
|
},
|
|
251
|
-
title:
|
|
252
|
-
},
|
|
251
|
+
title: _this2.props.translations.lastUpdate + ": " + bookmark.date
|
|
252
|
+
}, renaming ? /*#__PURE__*/React.createElement(InputContainer, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
253
253
|
focusOnRef: true,
|
|
254
|
-
onChange:
|
|
254
|
+
onChange: function onChange(text) {
|
|
255
|
+
return _this2.updateBookmark(bookmark, {
|
|
256
|
+
description: text
|
|
257
|
+
});
|
|
258
|
+
},
|
|
255
259
|
onNoChange: function onNoChange() {
|
|
256
260
|
return _this2.setState({
|
|
257
|
-
|
|
261
|
+
rename: false
|
|
258
262
|
});
|
|
259
263
|
},
|
|
260
264
|
role: "input",
|
|
@@ -264,49 +268,42 @@ var BookmarkPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
264
268
|
icon: "ok",
|
|
265
269
|
onClick: MiscUtils.killEvent,
|
|
266
270
|
role: "suffix"
|
|
267
|
-
})) : /*#__PURE__*/React.createElement("span", null, bookmark.description),
|
|
271
|
+
})) : /*#__PURE__*/React.createElement("span", null, bookmark.description), !renaming ? publicIcon : null, bookmark.own && !renaming ? [/*#__PURE__*/React.createElement(Icon, {
|
|
272
|
+
disabled: _this2.state.busy,
|
|
268
273
|
icon: "draw",
|
|
274
|
+
key: "draw",
|
|
269
275
|
onClick: function onClick(ev) {
|
|
270
276
|
_this2.setState({
|
|
271
|
-
|
|
272
|
-
|
|
277
|
+
currentBookmark: bookmark,
|
|
278
|
+
rename: true
|
|
273
279
|
});
|
|
274
280
|
MiscUtils.killEvent(ev);
|
|
275
281
|
},
|
|
276
282
|
title: LocaleUtils.tr("common.rename")
|
|
277
|
-
})
|
|
283
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
278
284
|
disabled: _this2.state.busy,
|
|
279
285
|
icon: "trash",
|
|
286
|
+
key: "trash",
|
|
280
287
|
onClick: function onClick(ev) {
|
|
281
|
-
_this2.removeBookmark(bookmark
|
|
288
|
+
_this2.removeBookmark(bookmark);
|
|
282
289
|
MiscUtils.killEvent(ev);
|
|
283
290
|
},
|
|
284
291
|
title: LocaleUtils.tr("common.delete")
|
|
285
|
-
}) : null);
|
|
292
|
+
})] : null);
|
|
286
293
|
}), isEmpty(this.props.bookmarks) ? /*#__PURE__*/React.createElement("div", {
|
|
287
294
|
className: "bookmark-list-item-empty"
|
|
288
|
-
},
|
|
295
|
+
}, this.props.translations.noitems) : null));
|
|
289
296
|
}
|
|
290
297
|
}]);
|
|
291
298
|
}(React.Component);
|
|
292
299
|
_defineProperty(BookmarkPanel, "availableIn3D", true);
|
|
293
300
|
_defineProperty(BookmarkPanel, "propTypes", {
|
|
301
|
+
bookmarkIface: PropTypes.object,
|
|
294
302
|
bookmarks: PropTypes.array,
|
|
295
|
-
onAdd: PropTypes.func,
|
|
296
303
|
onOpen: PropTypes.func,
|
|
297
|
-
onRefresh: PropTypes.func,
|
|
298
|
-
onRemove: PropTypes.func,
|
|
299
|
-
onRename: PropTypes.func,
|
|
300
|
-
onUpdate: PropTypes.func,
|
|
301
304
|
onZoomToExtent: PropTypes.func,
|
|
302
|
-
/** Whether to directly open the bookmark on click / middle click, instead of showing dedicated open buttons. */
|
|
303
305
|
openOnClick: PropTypes.bool,
|
|
304
|
-
|
|
305
|
-
showZoomToExtent: PropTypes.bool,
|
|
306
|
+
setList: PropTypes.func,
|
|
306
307
|
translations: PropTypes.objectOf(PropTypes.string)
|
|
307
308
|
});
|
|
308
|
-
_defineProperty(BookmarkPanel, "defaultProps", {
|
|
309
|
-
showOpenTab: true,
|
|
310
|
-
showZoomToExtent: false
|
|
311
|
-
});
|
|
312
309
|
export default BookmarkPanel;
|
package/components/Icon.js
CHANGED
|
@@ -38,6 +38,7 @@ var Icon = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
var classes = classnames(_defineProperty(_defineProperty(_defineProperty({
|
|
39
39
|
icon: true,
|
|
40
40
|
icon_disabled: this.props.disabled,
|
|
41
|
+
icon_inactive: this.props.inactive,
|
|
41
42
|
icon_clickable: !!this.props.onClick || !!this.props.onMouseDown || !!this.props.onPointerDown
|
|
42
43
|
}, "icon-" + this.props.icon, true), "icon_" + this.props.size, !!this.props.size), this.props.className, !!this.props.className));
|
|
43
44
|
var tabIndex = undefined;
|
|
@@ -85,6 +86,7 @@ _defineProperty(Icon, "propTypes", {
|
|
|
85
86
|
className: PropTypes.string,
|
|
86
87
|
disabled: PropTypes.bool,
|
|
87
88
|
icon: PropTypes.string,
|
|
89
|
+
inactive: PropTypes.bool,
|
|
88
90
|
onClick: PropTypes.func,
|
|
89
91
|
onMouseDown: PropTypes.func,
|
|
90
92
|
onMouseUp: PropTypes.func,
|
|
@@ -363,11 +363,35 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
363
363
|
_defineProperty(_this, "storeIdentifyResults", function () {
|
|
364
364
|
return new Promise(function (resolve) {
|
|
365
365
|
return resolve({
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
state: {
|
|
367
|
+
identifyResults: _this.serializeResults(),
|
|
368
|
+
currentResultDisplayMode: _this.props.resultDisplayMode
|
|
369
|
+
}
|
|
368
370
|
});
|
|
369
371
|
});
|
|
370
372
|
});
|
|
373
|
+
_defineProperty(_this, "serializeResults", function () {
|
|
374
|
+
return Object.fromEntries(Object.entries(_this.state.resultTree).map(function (_ref10) {
|
|
375
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
376
|
+
layerid = _ref11[0],
|
|
377
|
+
features = _ref11[1];
|
|
378
|
+
var _layerid$split = layerid.split("#", 2),
|
|
379
|
+
_layerid$split2 = _slicedToArray(_layerid$split, 2),
|
|
380
|
+
layerUrl = _layerid$split2[0],
|
|
381
|
+
layerName = _layerid$split2[1];
|
|
382
|
+
var match = LayerUtils.searchLayer(_this.props.layers, 'url', layerUrl, 'name', layerName);
|
|
383
|
+
if (match && match.sublayer.primary_key) {
|
|
384
|
+
return [layerid, {
|
|
385
|
+
key: match.sublayer.primary_key,
|
|
386
|
+
values: features.map(function (feature) {
|
|
387
|
+
return MiscUtils.isNumeric(feature.id) ? Number(feature.id) : feature.id;
|
|
388
|
+
})
|
|
389
|
+
}];
|
|
390
|
+
} else {
|
|
391
|
+
return [layerid, features];
|
|
392
|
+
}
|
|
393
|
+
}));
|
|
394
|
+
});
|
|
371
395
|
_defineProperty(_this, "getCurrentResultFeature", function () {
|
|
372
396
|
var _this$state$resultTre, _this$state$resultTre2, _this$state$resultTre3, _this$state$currentRe;
|
|
373
397
|
return (_this$state$resultTre = (_this$state$resultTre2 = _this.state.resultTree[(_this$state$currentRe = _this.state.currentResult) === null || _this$state$currentRe === void 0 ? void 0 : _this$state$currentRe.layerid]) === null || _this$state$resultTre2 === void 0 || (_this$state$resultTre3 = _this$state$resultTre2.find) === null || _this$state$resultTre3 === void 0 ? void 0 : _this$state$resultTre3.call(_this$state$resultTre2, function (feature) {
|
|
@@ -490,10 +514,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
490
514
|
});
|
|
491
515
|
if (exporter) {
|
|
492
516
|
if (!_this.props.exportGeometry) {
|
|
493
|
-
json = Object.entries(json).reduce(function (res,
|
|
494
|
-
var
|
|
495
|
-
layerId =
|
|
496
|
-
features =
|
|
517
|
+
json = Object.entries(json).reduce(function (res, _ref14) {
|
|
518
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
519
|
+
layerId = _ref15[0],
|
|
520
|
+
features = _ref15[1];
|
|
497
521
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, layerId, features.map(function (feature) {
|
|
498
522
|
return MiscUtils.objectOmit(feature, ['geometry']);
|
|
499
523
|
})));
|
|
@@ -521,10 +545,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
521
545
|
style: {
|
|
522
546
|
maxHeight: _this.state.currentResult ? '10em' : 'initial'
|
|
523
547
|
}
|
|
524
|
-
}, Object.entries(_this.state.resultTree).map(function (
|
|
525
|
-
var
|
|
526
|
-
layerid =
|
|
527
|
-
features =
|
|
548
|
+
}, Object.entries(_this.state.resultTree).map(function (_ref16) {
|
|
549
|
+
var _ref17 = _slicedToArray(_ref16, 2),
|
|
550
|
+
layerid = _ref17[0],
|
|
551
|
+
features = _ref17[1];
|
|
528
552
|
if (features.length === 0) {
|
|
529
553
|
return null;
|
|
530
554
|
}
|
|
@@ -805,20 +829,20 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
805
829
|
_defineProperty(_this, "renderResultsTable", function () {
|
|
806
830
|
return /*#__PURE__*/React.createElement("div", {
|
|
807
831
|
className: "identify-results-tables"
|
|
808
|
-
}, Object.entries(_this.state.resultTree).map(function (
|
|
809
|
-
var
|
|
810
|
-
layerid =
|
|
811
|
-
features =
|
|
832
|
+
}, Object.entries(_this.state.resultTree).map(function (_ref18) {
|
|
833
|
+
var _ref19 = _slicedToArray(_ref18, 2),
|
|
834
|
+
layerid = _ref19[0],
|
|
835
|
+
features = _ref19[1];
|
|
812
836
|
if (features.length === 0 || _this.state.selectedLayer && layerid !== _this.state.selectedLayer) {
|
|
813
837
|
return null;
|
|
814
838
|
}
|
|
815
839
|
var fields = {};
|
|
816
840
|
features.map(function (feature) {
|
|
817
|
-
Object.entries(feature.properties).map(function (
|
|
818
|
-
var
|
|
819
|
-
attr =
|
|
820
|
-
value =
|
|
821
|
-
if (!(attr in fields)) {
|
|
841
|
+
Object.entries(feature.properties).map(function (_ref20) {
|
|
842
|
+
var _ref21 = _slicedToArray(_ref20, 2),
|
|
843
|
+
attr = _ref21[0],
|
|
844
|
+
value = _ref21[1];
|
|
845
|
+
if (!(attr in fields) && !['htmlContent', 'htmlContentInline'].includes(attr)) {
|
|
822
846
|
fields[attr] = {
|
|
823
847
|
id: attr,
|
|
824
848
|
name: attr
|
|
@@ -1061,10 +1085,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1061
1085
|
}, /*#__PURE__*/React.createElement("option", {
|
|
1062
1086
|
disabled: true,
|
|
1063
1087
|
value: ""
|
|
1064
|
-
}, LocaleUtils.tr("identify.selectreport")), Object.entries(_this.state.reports).map(function (
|
|
1065
|
-
var
|
|
1066
|
-
layername =
|
|
1067
|
-
reports =
|
|
1088
|
+
}, LocaleUtils.tr("identify.selectreport")), Object.entries(_this.state.reports).map(function (_ref23) {
|
|
1089
|
+
var _ref24 = _slicedToArray(_ref23, 2),
|
|
1090
|
+
layername = _ref24[0],
|
|
1091
|
+
reports = _ref24[1];
|
|
1068
1092
|
return reports.map(function (report, idx) {
|
|
1069
1093
|
return /*#__PURE__*/React.createElement("option", {
|
|
1070
1094
|
key: layername + "::" + idx,
|
|
@@ -1328,6 +1352,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1328
1352
|
key: "componentDidMount",
|
|
1329
1353
|
value: function componentDidMount() {
|
|
1330
1354
|
this.updateResultTree();
|
|
1355
|
+
this.props.innerRef(this);
|
|
1331
1356
|
}
|
|
1332
1357
|
}, {
|
|
1333
1358
|
key: "componentDidUpdate",
|
|
@@ -1360,6 +1385,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1360
1385
|
}, {
|
|
1361
1386
|
key: "componentWillUnmount",
|
|
1362
1387
|
value: function componentWillUnmount() {
|
|
1388
|
+
this.props.innerRef(null);
|
|
1363
1389
|
this.props.removeLayer("__identifyviewerhighlight");
|
|
1364
1390
|
unregisterPermalinkDataStoreHook("identifyresultstate");
|
|
1365
1391
|
}
|
|
@@ -1369,10 +1395,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1369
1395
|
var _this2 = this;
|
|
1370
1396
|
var body = null;
|
|
1371
1397
|
var resultTree = this.state.selectedLayer !== '' ? _defineProperty({}, this.state.selectedLayer, this.state.resultTree[this.state.selectedLayer]) : this.state.resultTree;
|
|
1372
|
-
var flatResults = Object.entries(resultTree).map(function (
|
|
1373
|
-
var
|
|
1374
|
-
layerid =
|
|
1375
|
-
features =
|
|
1398
|
+
var flatResults = Object.entries(resultTree).map(function (_ref27) {
|
|
1399
|
+
var _ref28 = _slicedToArray(_ref27, 2),
|
|
1400
|
+
layerid = _ref28[0],
|
|
1401
|
+
features = _ref28[1];
|
|
1376
1402
|
return features.map(function (feature) {
|
|
1377
1403
|
return [layerid, feature];
|
|
1378
1404
|
});
|
|
@@ -1400,10 +1426,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1400
1426
|
} else if (this.props.resultDisplayMode === 'flat') {
|
|
1401
1427
|
body = /*#__PURE__*/React.createElement("div", {
|
|
1402
1428
|
className: "identify-flat-results-list"
|
|
1403
|
-
}, Object.entries(resultTree).map(function (
|
|
1404
|
-
var
|
|
1405
|
-
layerid =
|
|
1406
|
-
features =
|
|
1429
|
+
}, Object.entries(resultTree).map(function (_ref29) {
|
|
1430
|
+
var _ref30 = _slicedToArray(_ref29, 2),
|
|
1431
|
+
layerid = _ref30[0],
|
|
1432
|
+
features = _ref30[1];
|
|
1407
1433
|
return features.map(function (feature) {
|
|
1408
1434
|
return _this2.renderResultAttributes(layerid, feature, 'identify-result-frame');
|
|
1409
1435
|
});
|
|
@@ -1417,10 +1443,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1417
1443
|
body = /*#__PURE__*/React.createElement("div", {
|
|
1418
1444
|
className: "identify-compare-results",
|
|
1419
1445
|
style: _style
|
|
1420
|
-
}, results.map(function (
|
|
1421
|
-
var
|
|
1422
|
-
layerid =
|
|
1423
|
-
feature =
|
|
1446
|
+
}, results.map(function (_ref31) {
|
|
1447
|
+
var _ref32 = _slicedToArray(_ref31, 2),
|
|
1448
|
+
layerid = _ref32[0],
|
|
1449
|
+
feature = _ref32[1];
|
|
1424
1450
|
return _this2.renderResultAttributes(layerid, feature, 'identify-result-frame');
|
|
1425
1451
|
}));
|
|
1426
1452
|
} else if (this.state.currentPage < flatResults.length) {
|
|
@@ -1455,6 +1481,7 @@ _defineProperty(IdentifyViewer, "propTypes", {
|
|
|
1455
1481
|
highlightAllResults: PropTypes.bool,
|
|
1456
1482
|
identifyResults: PropTypes.object,
|
|
1457
1483
|
iframeDialogsInitiallyDocked: PropTypes.bool,
|
|
1484
|
+
innerRef: PropTypes.func,
|
|
1458
1485
|
layers: PropTypes.array,
|
|
1459
1486
|
longAttributesDisplay: PropTypes.oneOf(['ellipsis', 'wrap']),
|
|
1460
1487
|
map: PropTypes.object,
|
|
@@ -40,7 +40,6 @@ import deepmerge from 'deepmerge';
|
|
|
40
40
|
import { register as olProj4Register } from 'ol/proj/proj4';
|
|
41
41
|
import Proj4js from 'proj4';
|
|
42
42
|
import PropTypes from 'prop-types';
|
|
43
|
-
import { refreshBookmarks, refreshVisibilityPresets } from '../actions/bookmark';
|
|
44
43
|
import { localConfigLoaded, setStartupParameters, setColorScheme } from '../actions/localConfig';
|
|
45
44
|
import { changeLocale } from '../actions/locale';
|
|
46
45
|
import { setCurrentTask } from '../actions/task';
|
|
@@ -337,10 +336,6 @@ var StandardApp = /*#__PURE__*/function (_React$Component2) {
|
|
|
337
336
|
var colorScheme = initialParams.style || storedColorScheme || ConfigUtils.getConfigProp("defaultColorScheme");
|
|
338
337
|
StandardApp.store.dispatch(setColorScheme(colorScheme));
|
|
339
338
|
|
|
340
|
-
// Load all bookmarks & visiblity presets
|
|
341
|
-
StandardApp.store.dispatch(refreshBookmarks());
|
|
342
|
-
StandardApp.store.dispatch(refreshVisibilityPresets());
|
|
343
|
-
|
|
344
339
|
// Resolve permalink and restore settings
|
|
345
340
|
resolvePermaLink(initialParams, function (params, state, success) {
|
|
346
341
|
StandardApp.store.dispatch(setStartupParameters(params, state));
|