qwc2 2025.11.13 → 2025.11.18

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.
@@ -119,7 +119,7 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
119
119
  filteredSortedFeatures: _this.filteredSortedFeatures(features, state2),
120
120
  loadedLayer: selectedLayer,
121
121
  curEditConfig: editConfig,
122
- curFieldTranslations: fieldTranslations
122
+ fieldTranslations: fieldTranslations
123
123
  };
124
124
  });
125
125
  } else {
@@ -942,15 +942,22 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
942
942
  wmsName = _ref5[0],
943
943
  serviceConfigs = _ref5[1];
944
944
  return Object.entries(serviceConfigs).map(function (_ref6) {
945
- var _ref8, _ref9, _match$layer$translat, _match$layer$translat2, _match$sublayer;
946
945
  var _ref7 = _slicedToArray(_ref6, 2),
947
946
  layerName = _ref7[0],
948
947
  editConfig = _ref7[1];
949
948
  var match = LayerUtils.searchLayer(_this2.props.layers, 'wms_name', wmsName, 'name', layerName);
950
- if (!match) {
951
- return null;
949
+ var layerTitle = layerName;
950
+ if (match) {
951
+ var _ref8, _ref9, _match$layer$translat, _match$layer$translat2, _match$sublayer;
952
+ layerTitle = (_ref8 = (_ref9 = (_match$layer$translat = (_match$layer$translat2 = match.layer.translations) === null || _match$layer$translat2 === void 0 || (_match$layer$translat2 = _match$layer$translat2.layertree) === null || _match$layer$translat2 === void 0 ? void 0 : _match$layer$translat2[layerName]) !== null && _match$layer$translat !== void 0 ? _match$layer$translat : editConfig.layerTitle) !== null && _ref9 !== void 0 ? _ref9 : match === null || match === void 0 || (_match$sublayer = match.sublayer) === null || _match$sublayer === void 0 ? void 0 : _match$sublayer.title) !== null && _ref8 !== void 0 ? _ref8 : layerName;
953
+ } else {
954
+ var _this2$props$layers$f, _ref10, _translations$layertr, _translations$layertr2;
955
+ // Note: geometry-less tables are filtered from the theme sublayers
956
+ var translations = (_this2$props$layers$f = _this2.props.layers.find(function (layer) {
957
+ return layer.wms_name === wmsName;
958
+ })) === null || _this2$props$layers$f === void 0 ? void 0 : _this2$props$layers$f.translations;
959
+ layerTitle = (_ref10 = (_translations$layertr = translations === null || translations === void 0 || (_translations$layertr2 = translations.layertree) === null || _translations$layertr2 === void 0 ? void 0 : _translations$layertr2[layerName]) !== null && _translations$layertr !== void 0 ? _translations$layertr : editConfig.layerTitle) !== null && _ref10 !== void 0 ? _ref10 : layerName;
952
960
  }
953
- var layerTitle = (_ref8 = (_ref9 = (_match$layer$translat = (_match$layer$translat2 = match.layer.translations) === null || _match$layer$translat2 === void 0 || (_match$layer$translat2 = _match$layer$translat2.layertree) === null || _match$layer$translat2 === void 0 ? void 0 : _match$layer$translat2[layerName]) !== null && _match$layer$translat !== void 0 ? _match$layer$translat : editConfig.layerTitle) !== null && _ref9 !== void 0 ? _ref9 : match === null || match === void 0 || (_match$sublayer = match.sublayer) === null || _match$sublayer === void 0 ? void 0 : _match$sublayer.title) !== null && _ref8 !== void 0 ? _ref8 : layerName;
954
961
  var value = wmsName + "#" + layerName;
955
962
  return /*#__PURE__*/React.createElement("option", {
956
963
  key: value,
@@ -274,7 +274,8 @@ var ResizeableWindow = /*#__PURE__*/function (_React$Component) {
274
274
  width: width,
275
275
  height: height,
276
276
  docked: _this.props.initiallyDocked,
277
- detached: false
277
+ detached: false,
278
+ minimized: _this.props.initiallyMinimized || false
278
279
  };
279
280
  }
280
281
  if (_this.props.splitScreenWhenDocked && geometry.docked) {
@@ -537,6 +538,7 @@ _defineProperty(ResizeableWindow, "propTypes", {
537
538
  initialX: PropTypes.number,
538
539
  initialY: PropTypes.number,
539
540
  initiallyDocked: PropTypes.bool,
541
+ initiallyMinimized: PropTypes.bool,
540
542
  mapMargins: PropTypes.object,
541
543
  maxHeight: PropTypes.number,
542
544
  maxWidth: PropTypes.number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2025.11.13",
3
+ "version": "2025.11.18",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
package/plugins/API.js CHANGED
@@ -386,6 +386,7 @@ var API = /*#__PURE__*/function (_React$Component) {
386
386
  window.qwc2.CoordinatesUtils = CoordinatesUtils;
387
387
  window.qwc2.EditingInterface = EditingInterface;
388
388
  window.qwc2.EditingUtils = EditingUtils;
389
+ window.qwc2.LayerUtils = LayerUtils;
389
390
  window.qwc2.LocaleUtils = LocaleUtils;
390
391
  window.qwc2.MapUtils = MapUtils;
391
392
  window.qwc2.PermaLinkUtils = PermaLinkUtils;
@@ -348,7 +348,7 @@ var Editing = /*#__PURE__*/function (_React$Component) {
348
348
  // Get source layer's field configuration and build name-to-id mapping
349
349
  var sourceFields = (_this$props$editConfi = _this.props.editConfigs[mapName]) === null || _this$props$editConfi === void 0 || (_this$props$editConfi = _this$props$editConfi[layer]) === null || _this$props$editConfi === void 0 ? void 0 : _this$props$editConfi.fields;
350
350
  var sourceNameToIdMap = (sourceFields || []).reduce(function (res, field) {
351
- return _objectSpread(_objectSpread({}, res), {}, _defineProperty(_defineProperty({}, sourceFields.name, sourceFields.id), sourceFields.id, sourceFields.id));
351
+ return _objectSpread(_objectSpread({}, res), {}, _defineProperty(_defineProperty({}, field.name, field.id), field.id, field.id));
352
352
  }, {});
353
353
  var sourcePropertiesById = Object.entries(sourceProperties).reduce(function (res, _ref7) {
354
354
  var _ref8 = _slicedToArray(_ref7, 2),
@@ -427,12 +427,12 @@ var RedliningSupport = /*#__PURE__*/function (_React$Component) {
427
427
  evt.feature.setId(uuidv4());
428
428
  evt.feature.set('shape', _this.props.redlining.geomType);
429
429
  _this.updateFeatureStyle(evt.feature);
430
- _this.toggleFeatureMeasurements(ev.feature);
430
+ _this.toggleFeatureMeasurements(evt.feature);
431
431
  _this.selectFeatures([evt.feature]);
432
432
  }, _this);
433
433
  drawInteraction.on('drawend', function () {
434
434
  // Draw end
435
- _this.commitFeatures(_this.selectFeatures, _this.props.redlining, true);
435
+ _this.commitFeatures(_this.selectedFeatures, _this.props.redlining, true);
436
436
  _this.reset(_this.props.redlining);
437
437
  // Ughh... Apparently we need to wait 250ms for the 'singleclick' event processing to finish to avoid pick interactions picking up the current event
438
438
  setTimeout(function () {
@@ -346,7 +346,6 @@ export function computeExpressionFields(editConfig, feature, editIface, mapCrs,
346
346
  }, {});
347
347
  }
348
348
  // Evaluate expressions
349
- FeatureCache.clear();
350
349
  var mapPrefix = editConfig.editDataset.split(".")[0];
351
350
  parseExpressionsAsync(fieldExpressions, feature, editConfig, editIface, mapPrefix, mapCrs).then(function (result) {
352
351
  // Adjust values based on field type
@@ -1502,23 +1502,21 @@ var LayerUtils = {
1502
1502
  return null;
1503
1503
  },
1504
1504
  applyVisibilityPreset: function applyVisibilityPreset(layer, preset) {
1505
+ var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1505
1506
  var newLayer = _objectSpread({}, layer);
1507
+ var itempath = [].concat(_toConsumableArray(path.slice(1)), [newLayer.name]).join("/");
1506
1508
  if (newLayer.sublayers) {
1507
- var haveVisibileSublayer = false;
1509
+ newLayer.visibility = itempath in preset || path.length === 0;
1508
1510
  newLayer.sublayers = newLayer.sublayers.map(function (sublayer) {
1509
- var newSublayer = LayerUtils.applyVisibilityPreset(sublayer, preset);
1510
- haveVisibileSublayer || (haveVisibileSublayer = newSublayer.visibility === true);
1511
- return newSublayer;
1511
+ return LayerUtils.applyVisibilityPreset(sublayer, preset, [].concat(_toConsumableArray(path), [layer.name]));
1512
1512
  });
1513
- newLayer.visibility = haveVisibileSublayer;
1514
- if (newLayer.name in preset) {
1513
+ } else {
1514
+ if (itempath in preset) {
1515
1515
  newLayer.visibility = true;
1516
+ newLayer.style = preset[itempath];
1517
+ } else {
1518
+ newLayer.visibility = false;
1516
1519
  }
1517
- } else if (newLayer.name in preset) {
1518
- newLayer.visibility = true;
1519
- newLayer.style = preset[newLayer.name];
1520
- } else {
1521
- newLayer.visibility = false;
1522
1520
  }
1523
1521
  return newLayer;
1524
1522
  },
@@ -31,12 +31,12 @@ import ol from 'openlayers';
31
31
  import randomColor from 'randomcolor';
32
32
  import url from 'url';
33
33
  import { LayerRole } from '../actions/layers';
34
+ import StandardApp from '../components/StandardApp';
34
35
  import ConfigUtils from './ConfigUtils';
35
36
  import CoordinatesUtils from './CoordinatesUtils';
36
37
  import LayerUtils from './LayerUtils';
37
38
  import LocaleUtils from './LocaleUtils';
38
39
  import MiscUtils from './MiscUtils';
39
- import StandardApp from '../components/StandardApp';
40
40
  function strcmp(a, b) {
41
41
  var al = a.toLowerCase();
42
42
  var bl = b.toLowerCase();