@eeacms/volto-arcgis-block 0.1.455 → 0.1.456

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,12 @@ 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.456](https://github.com/eea/volto-arcgis-block/compare/0.1.455...0.1.456) - 11 June 2026
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-295764 (feat): loadable comented [Urkorue - [`fa3acd8`](https://github.com/eea/volto-arcgis-block/commit/fa3acd8c5827630e3e36e1d01f1339ddcfd5594c)]
12
+ - CLMS-295764 (feat): highchart comented [Urkorue - [`fde0d0d`](https://github.com/eea/volto-arcgis-block/commit/fde0d0d7aa446974f4cfc78868dc6c3dbd1cf109)]
7
13
  ### [0.1.455](https://github.com/eea/volto-arcgis-block/compare/0.1.454...0.1.455) - 9 June 2026
8
14
 
9
15
  ### [0.1.454](https://github.com/eea/volto-arcgis-block/compare/0.1.453...0.1.454) - 8 June 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.455",
3
+ "version": "0.1.456",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -1,7 +1,7 @@
1
1
  import React, { createRef } from 'react';
2
2
  import { loadModules } from 'esri-loader';
3
3
  import { Loader } from 'semantic-ui-react';
4
- import loadable from '@loadable/component';
4
+ //import loadable from '@loadable/component';
5
5
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable';
6
6
  // import { FontAwesomeIcon } from '@eeacms/volto-clms-utils/components';
7
7
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -10,7 +10,7 @@ var GeometryEngine, Graphic, esriRequest;
10
10
 
11
11
  // import Highcharts from 'highcharts';
12
12
 
13
- const HighchartsReact = loadable(() => import('highcharts-react-official'));
13
+ //const HighchartsReact = loadable(() => import('highcharts-react-official'));
14
14
  class InfoWidget extends React.Component {
15
15
  /**
16
16
  * Creator of the InfoWidget widget class
@@ -311,15 +311,22 @@ class InfoWidget extends React.Component {
311
311
  };
312
312
  break;
313
313
  case 'wmts':
314
- if (
315
- layers[index]?.ViewService &&
316
- layers[index].ViewService.toLowerCase().includes(
317
- 'cdse',
318
- )
319
- ) {
320
- properties = data;
314
+ // if (
315
+ // layers[index]?.ViewService &&
316
+ // layers[index].ViewService.toLowerCase().includes(
317
+ // 'cdse',
318
+ // )
319
+ // ) {
320
+ // properties = data;
321
+ // }
322
+ if (data.type === 'FeatureCollection') {
323
+ if (data.features.length) {
324
+ let obj = data.features.map((a) => {
325
+ return a.properties;
326
+ });
327
+ properties = this.transformWmtsData(obj);
328
+ }
321
329
  }
322
- properties = data;
323
330
  this.infoData[index] = {
324
331
  title: layer.title,
325
332
  data: properties,
@@ -570,14 +577,15 @@ class InfoWidget extends React.Component {
570
577
  }
571
578
 
572
579
  identifyWMTS(layer, event) {
573
- let layerId = this.getLayerName(layer);
580
+ let layerId = layer.activeLayer.id;
574
581
  let url = layer.featureInfoUrl ? layer.featureInfoUrl : layer.url;
582
+ let featureInfoUrl = url.replace('/cdse/', '/cdse/wms/');
575
583
  return this.wmsCapabilities(url).then((xml) => {
576
584
  let version = layer.version;
577
585
  let format = this.parseFormat(xml, layerId);
578
586
  let times = '';
579
587
  let nTimes = 1;
580
- return esriRequest(url, {
588
+ return esriRequest(featureInfoUrl, {
581
589
  responseType: 'html',
582
590
  sync: 'true',
583
591
  query: {
@@ -839,6 +847,49 @@ class InfoWidget extends React.Component {
839
847
  return values;
840
848
  }
841
849
 
850
+ transformWmtsData(obj) {
851
+ let values = { timeFields: {}, data: {}, variables: {}, tableData: {} };
852
+ let startField = Object.keys(obj[0]).find(
853
+ (a, i) =>
854
+ a.toUpperCase().includes('DATE') &&
855
+ !isNaN(parseInt(Object.values(obj[0])[i])),
856
+ );
857
+ values.timeFields['start'] = startField;
858
+ values.tableData['fields'] = Object.keys(obj[0]);
859
+ values.tableData['values'] = obj.map((a) => {
860
+ return Object.entries(a);
861
+ });
862
+ let fields = Object.keys(obj[0]).filter((a, i) => {
863
+ return (
864
+ !isNaN(parseInt(Object.values(obj[0])[i])) &&
865
+ a.toUpperCase() !== 'OBJECTID' &&
866
+ !a.toUpperCase().includes('DATE')
867
+ );
868
+ });
869
+ let field = fields[0];
870
+ values.variables = { options: fields, selected: field };
871
+ values.timeFields['values'] = obj.map((a, i) => {
872
+ let date = {};
873
+ Object.entries(obj[i]).forEach(([key, value]) => {
874
+ if (key === startField) {
875
+ date[key] = value;
876
+ }
877
+ });
878
+ return date;
879
+ });
880
+ values.data['outFields'] = field;
881
+ values.data['values'] = obj.map((a, i) => {
882
+ let x = {};
883
+ Object.entries(obj[i]).forEach(([key, value]) => {
884
+ if (fields.includes(key)) {
885
+ x[key] = parseFloat(value);
886
+ }
887
+ });
888
+ return x;
889
+ });
890
+ return values;
891
+ }
892
+
842
893
  addMarker(evt) {
843
894
  this.removeMarker();
844
895
  let lat = evt.mapPoint.latitude;
@@ -1367,14 +1418,14 @@ class InfoWidget extends React.Component {
1367
1418
  )}
1368
1419
  {this.state.pixelInfo && !noData && (
1369
1420
  <>
1370
- {this.loadVariableSelector(this.state.layerIndex)}
1421
+ {/* {this.loadVariableSelector(this.state.layerIndex)}
1371
1422
  {this.Highcharts && (
1372
1423
  <HighchartsReact
1373
1424
  highcharts={this.Highcharts}
1374
1425
  options={this.loadInfoChart(this.state.layerIndex)}
1375
1426
  />
1376
1427
  )}
1377
- {this.loadStatisticsSelector(this.state.layerIndex)}
1428
+ {this.loadStatisticsSelector(this.state.layerIndex)} */}
1378
1429
  {this.loadTimeInfoTable(this.state.layerIndex)}
1379
1430
  </>
1380
1431
  )}