@eeacms/volto-arcgis-block 0.1.447 → 0.1.449

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/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.1.449](https://github.com/eea/volto-arcgis-block/compare/0.1.448...0.1.449) - 12 May 2026
8
+
9
+ ### [0.1.448](https://github.com/eea/volto-arcgis-block/compare/0.1.447...0.1.448) - 11 May 2026
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - (bug): fix for tickets CLMS-297970, CLMS-288681, CLMS-288445, and implement proxy switching [Unai Bolivar - [`ce3e215`](https://github.com/eea/volto-arcgis-block/commit/ce3e215ed660836bc0f94fcd06536993b448d1b8)]
14
+ - (bug): Area widget loads nuts and countries after using swipe widget [Unai Bolivar - [`324cee2`](https://github.com/eea/volto-arcgis-block/commit/324cee2be67845fd1170425180b5e6562c381fad)]
7
15
  ### [0.1.447](https://github.com/eea/volto-arcgis-block/compare/0.1.446...0.1.447) - 8 May 2026
8
16
 
9
17
  ### [0.1.446](https://github.com/eea/volto-arcgis-block/compare/0.1.445...0.1.446) - 7 May 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.447",
3
+ "version": "0.1.449",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -358,7 +358,18 @@ class AreaWidget extends React.Component {
358
358
  });
359
359
  }
360
360
 
361
+ resolveNutsGroupLayerState() {
362
+ if (!this.nutsGroupLayer || !this.props.map || !this.props.map.layers) {
363
+ return;
364
+ }
365
+
366
+ if (!this.props.map.layers.includes(this.nutsGroupLayer)) {
367
+ this.props.map.add(this.nutsGroupLayer);
368
+ }
369
+ }
370
+
361
371
  loadNutsService(id, levels) {
372
+ this.resolveNutsGroupLayerState();
362
373
  this.clearWidget();
363
374
  document.querySelector('.esri-attribution__powered-by').style.display =
364
375
  'flex';
@@ -374,6 +385,7 @@ class AreaWidget extends React.Component {
374
385
  }
375
386
 
376
387
  loadCountriesService(id) {
388
+ this.resolveNutsGroupLayerState();
377
389
  document.querySelector('.esri-attribution__powered-by').style.display =
378
390
  'flex';
379
391
  var layer = new FeatureLayer({
@@ -714,6 +714,7 @@ class MapViewer extends React.Component {
714
714
  }
715
715
  this.syncViewWidgetContainers();
716
716
  this.syncViewTask = null;
717
+ this.restorePanelScroll(true);
717
718
  });
718
719
  }
719
720
 
@@ -1552,6 +1553,33 @@ class MapViewer extends React.Component {
1552
1553
  this.processPendingWidgetActivation();
1553
1554
  }
1554
1555
 
1556
+ restorePanelScroll(skipTimeout) {
1557
+ let paneles = document.querySelector('div#paneles.panels');
1558
+ var selected_tab = document.querySelector('.tab-selected');
1559
+
1560
+ if (!paneles || !selected_tab) {
1561
+ return;
1562
+ }
1563
+
1564
+ let toc_panel_scrolls =
1565
+ JSON.parse(sessionStorage.getItem('toc_panel_scrolls')) ?? {};
1566
+ let scroll = toc_panel_scrolls[selected_tab.id];
1567
+ if (scroll !== undefined) {
1568
+ scroll = parseInt(scroll);
1569
+ if (skipTimeout) {
1570
+ if (paneles) {
1571
+ paneles.scrollTop = scroll;
1572
+ }
1573
+ } else {
1574
+ setTimeout(() => {
1575
+ if (paneles) {
1576
+ paneles.scrollTop = scroll;
1577
+ }
1578
+ }, 1000);
1579
+ }
1580
+ }
1581
+ }
1582
+
1555
1583
  componentWillUnmount() {
1556
1584
  this.isComponentMounted = false;
1557
1585
  this.viewTransitionTaskId += 1;
@@ -2173,6 +2201,7 @@ export const CheckUserID = ({ reference }) => {
2173
2201
  tax={reference.tax}
2174
2202
  catalogapi={reference.props.catalogapi}
2175
2203
  fetchCatalogApiDates={reference.props.fetchCatalogApiDates}
2204
+ restorePanelScroll={reference.restorePanelScroll}
2176
2205
  />
2177
2206
  </>
2178
2207
  )}
@@ -762,23 +762,6 @@ class MenuWidget extends React.Component {
762
762
  }
763
763
  }
764
764
 
765
- restorePanelScroll() {
766
- let paneles = document.querySelector('#paneles');
767
- var selected_tab = document.querySelector('.tab-selected');
768
-
769
- if (!paneles || !selected_tab) {
770
- return;
771
- }
772
-
773
- let toc_panel_scrolls =
774
- JSON.parse(sessionStorage.getItem('toc_panel_scrolls')) ?? {};
775
- let scroll = toc_panel_scrolls[selected_tab.id];
776
- if (scroll !== undefined) {
777
- scroll = parseInt(scroll);
778
- paneles.scrollTop = scroll;
779
- }
780
- }
781
-
782
765
  /**
783
766
  * Method that will be invoked when the
784
767
  * button is clicked. It controls the open
@@ -841,7 +824,7 @@ class MenuWidget extends React.Component {
841
824
  timeSliderContainer.style.display = 'block';
842
825
  }
843
826
 
844
- this.restorePanelScroll();
827
+ this.props.restorePanelScroll();
845
828
  }
846
829
 
847
830
  this.setState({ showMapMenu: true });
@@ -2307,10 +2290,10 @@ class MenuWidget extends React.Component {
2307
2290
  }
2308
2291
 
2309
2292
  getProxyBase = () => {
2310
- // const origin = window?.location?.origin || '';
2311
- // return origin ? `${origin}/ogcproxy/` : '/ogcproxy/';
2293
+ const origin = window?.location?.origin || '';
2294
+ return origin ? `${origin}/ogcproxy/` : '/ogcproxy/';
2312
2295
  // return 'https://clmsdemo.devel6cph.eea.europa.eu/ogcproxy/';
2313
- return 'https://land.copernicus.eu/ogcproxy/';
2296
+ // return 'https://land.copernicus.eu/ogcproxy/';
2314
2297
  };
2315
2298
 
2316
2299
  buildProxiedUrl(url) {
@@ -7653,7 +7636,7 @@ class MenuWidget extends React.Component {
7653
7636
  if (document.querySelector('.opacity-panel').style.display === 'block') {
7654
7637
  this.closeOpacity();
7655
7638
  }
7656
- this.restorePanelScroll();
7639
+ this.props.restorePanelScroll();
7657
7640
  }
7658
7641
  }
7659
7642
 
@@ -284,12 +284,9 @@ class UploadWidget extends React.Component {
284
284
  return queryService;
285
285
  }
286
286
  const pathName = (parsedUrl.pathname || '').toLowerCase();
287
- const pathSegments = pathName.split('/').filter(Boolean);
288
- const serviceMatch = pathSegments.find((segment) =>
289
- /^(wmts|wms|wfs)$/i.test(segment),
290
- );
291
- if (serviceMatch) {
292
- return serviceMatch.toUpperCase();
287
+ const pathServiceType = this.resolveServiceTypeFromPath(pathName);
288
+ if (pathServiceType) {
289
+ return pathServiceType;
293
290
  }
294
291
  return null;
295
292
  } catch (e) {
@@ -297,6 +294,23 @@ class UploadWidget extends React.Component {
297
294
  }
298
295
  };
299
296
 
297
+ resolveServiceTypeFromPath = (pathName) => {
298
+ const value = (pathName || '').toLowerCase();
299
+ if (!value) {
300
+ return null;
301
+ }
302
+ if (/\bwmts\b|\/wmts(?:[/._-]|$)/i.test(value)) {
303
+ return 'WMTS';
304
+ }
305
+ if (/\bwfs\b|\/wfs(?:[/._-]|$)/i.test(value)) {
306
+ return 'WFS';
307
+ }
308
+ if (/\bwms\b|\/wms(?:[/._-]|$)/i.test(value)) {
309
+ return 'WMS';
310
+ }
311
+ return null;
312
+ };
313
+
300
314
  isServiceTypeMatchingUrl = (serviceUrl, selectedServiceType) => {
301
315
  const encodedServiceType = this.getServiceTypeFromUrl(serviceUrl);
302
316
  if (!encodedServiceType) {
@@ -305,15 +319,30 @@ class UploadWidget extends React.Component {
305
319
  return encodedServiceType === selectedServiceType;
306
320
  };
307
321
 
322
+ clearUploadForm = (clearServiceType = false) => {
323
+ this.setState({
324
+ ...this.buildUploadResetState(),
325
+ ...(clearServiceType ? { selectedServiceType: '' } : {}),
326
+ });
327
+ if (this.fileInput && this.fileInput.current) {
328
+ this.fileInput.current.value = null;
329
+ }
330
+ };
331
+
332
+ handleServiceTypeMismatch = () => {
333
+ this.errorPopup('serviceTypeMismatch');
334
+ this.clearUploadForm(true);
335
+ };
336
+
308
337
  stripProtocol = (url) => {
309
338
  return (url || '').replace(/^https?:\/\//i, '');
310
339
  };
311
340
 
312
341
  getProxyBase = () => {
313
- // const origin = window?.location?.origin || '';
314
- // return origin ? `${origin}/ogcproxy/` : '/ogcproxy/';
342
+ const origin = window?.location?.origin || '';
343
+ return origin ? `${origin}/ogcproxy/` : '/ogcproxy/';
315
344
  // return 'https://clmsdemo.devel6cph.eea.europa.eu/ogcproxy/';
316
- return 'https://land.copernicus.eu/ogcproxy/';
345
+ // return 'https://land.copernicus.eu/ogcproxy/';
317
346
  };
318
347
 
319
348
  buildProxiedUrl = (url) => {
@@ -535,6 +564,15 @@ class UploadWidget extends React.Component {
535
564
  handleSelectLayers = async () => {
536
565
  const { serviceUrl, selectedServiceType } = this.state;
537
566
  const trimmedServiceUrl = (serviceUrl || '').trim();
567
+ if (
568
+ selectedServiceType &&
569
+ trimmedServiceUrl !== '' &&
570
+ this.isValidUrl(trimmedServiceUrl) &&
571
+ !this.isServiceTypeMatchingUrl(trimmedServiceUrl, selectedServiceType)
572
+ ) {
573
+ this.handleServiceTypeMismatch();
574
+ return;
575
+ }
538
576
  if (
539
577
  selectedServiceType === 'WFS' &&
540
578
  trimmedServiceUrl !== '' &&
@@ -560,6 +598,15 @@ class UploadWidget extends React.Component {
560
598
  const trimmedServiceUrl = (serviceUrl || '').trim();
561
599
  const selectedServiceType = this.state.selectedServiceType;
562
600
  const selectedFeatures = this.state.selectedFeatures;
601
+ if (
602
+ selectedServiceType &&
603
+ trimmedServiceUrl !== '' &&
604
+ this.isValidUrl(trimmedServiceUrl) &&
605
+ !this.isServiceTypeMatchingUrl(trimmedServiceUrl, selectedServiceType)
606
+ ) {
607
+ this.handleServiceTypeMismatch();
608
+ return;
609
+ }
563
610
  if (
564
611
  selectedServiceType &&
565
612
  trimmedServiceUrl !== '' &&
@@ -1025,6 +1072,16 @@ class UploadWidget extends React.Component {
1025
1072
  </div>
1026
1073
  </>
1027
1074
  )}
1075
+ {this.state.infoPopupType === 'serviceTypeMismatch' && (
1076
+ <>
1077
+ <span className="drawRectanglePopup-icon">
1078
+ <FontAwesomeIcon icon={['fas', 'info-circle']} />
1079
+ </span>
1080
+ <div className="drawRectanglePopup-text">
1081
+ Selected service type does not match the provided URL.
1082
+ </div>
1083
+ </>
1084
+ )}
1028
1085
  </div>
1029
1086
  </div>
1030
1087
  </div>