@eeacms/volto-arcgis-block 0.1.252 → 0.1.254

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,19 @@ 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.254](https://github.com/eea/volto-arcgis-block/compare/0.1.253...0.1.254) - 29 January 2024
8
+
9
+ ### [0.1.253](https://github.com/eea/volto-arcgis-block/compare/0.1.252...0.1.253) - 29 January 2024
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - arcgis rollback [Unai Bolivar - [`10c2f5b`](https://github.com/eea/volto-arcgis-block/commit/10c2f5b527d398019360b83bf92dec04e76c1951)]
14
+ - arcgis rollback attempted again [Unai Bolivar - [`a2e8d8a`](https://github.com/eea/volto-arcgis-block/commit/a2e8d8a9ce184c69af4941403863a8af3bf9a50c)]
15
+ - Removed .eslintrc added by auto commit in favor of the existing eslintrc [David Ichim - [`06f72ad`](https://github.com/eea/volto-arcgis-block/commit/06f72ad9295ac0779ecbc302413c2f6fc930db95)]
16
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`3342be4`](https://github.com/eea/volto-arcgis-block/commit/3342be4ece40d845b0dea9b74d95f98981af42dc)]
17
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`71ba8d5`](https://github.com/eea/volto-arcgis-block/commit/71ba8d55b836cda0a52198c16f7d95da4324c711)]
18
+ - arcgis rollback revised [Unai Bolivar - [`5a7954d`](https://github.com/eea/volto-arcgis-block/commit/5a7954de4cf0009a26804e707f850c855f9a09d8)]
19
+ - arcgis rollback [Unai Bolivar - [`80def4b`](https://github.com/eea/volto-arcgis-block/commit/80def4b1c3605d118cc54863ee131080f9887be2)]
7
20
  ### [0.1.252](https://github.com/eea/volto-arcgis-block/compare/0.1.251...0.1.252) - 25 January 2024
8
21
 
9
22
  #### :hammer_and_wrench: Others
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2024-01-25T07:53:02.154Z\n"
4
+ "POT-Creation-Date: 2024-01-25T15:51:08.167Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "MIME-Version: 1.0\n"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.252",
3
+ "version": "0.1.254",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -389,115 +389,61 @@ class InfoWidget extends React.Component {
389
389
  identifyWMS(layer, event) {
390
390
  let layerId = this.getLayerName(layer);
391
391
  let url = layer.featureInfoUrl ? layer.featureInfoUrl : layer.url;
392
- if (this?.props?.hotspotData) {
393
- for (let key in this.props.hotspotData) {
394
- let item = this.props.hotspotData[key];
395
- for (let prop in item) {
396
- if (prop === layerId) {
397
- return esriRequest(url, {
398
- responseType: 'html',
399
- sync: 'true',
400
- query: {
401
- request: 'GetFeatureInfo',
402
- service: 'WMS',
403
- version: '1.3.0',
404
- SRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
405
- CRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
406
- BBOX:
407
- '' +
408
- this.props.view.extent.xmin +
409
- ', ' +
410
- this.props.view.extent.ymin +
411
- ', ' +
412
- this.props.view.extent.xmax +
413
- ', ' +
414
- this.props.view.extent.ymax,
415
- HEIGHT: this.props.view.height,
416
- WIDTH: this.props.view.width,
417
- X: event.screenPoint.x,
418
- Y: event.screenPoint.y,
419
- QUERY_LAYERS: layerId,
420
- INFO_FORMAT: 'application/json',
421
- TIME: '/',
422
- FEATURE_COUNT: '' + 1,
423
- },
424
- })
425
- .then((response) => {
426
- let format = response.requestOptions.query.INFO_FORMAT;
427
- let data;
428
- if (format.includes('text')) {
429
- data = new window.DOMParser().parseFromString(
430
- response.data,
431
- 'text/html',
432
- );
433
- } else if (format.includes('json')) {
434
- data = JSON.parse(response.data);
435
- }
436
- return data;
437
- })
438
- .then((data) => {
439
- return data;
440
- });
441
- }
442
- }
392
+ return this.wmsCapabilities(url).then((xml) => {
393
+ let version = this.parseCapabilities(xml, 'wms_capabilities')[0]
394
+ .attributes['version'];
395
+ let format = this.parseFormat(xml, layerId);
396
+ let times = '';
397
+ let nTimes = 1;
398
+ if (layer.isTimeSeries) {
399
+ times = this.parseTime(xml, layerId);
400
+ nTimes = times.length;
443
401
  }
444
- } else {
445
- return this.wmsCapabilities(url).then((xml) => {
446
- let version = this.parseCapabilities(xml, 'wms_capabilities')[0]
447
- .attributes['version'];
448
- let format = this.parseFormat(xml);
449
- let times = '';
450
- let nTimes = 1;
451
- if (layer.isTimeSeries) {
452
- times = this.parseTime(xml, layerId);
453
- nTimes = times.length;
454
- }
455
- return esriRequest(url, {
456
- responseType: 'html',
457
- sync: 'true',
458
- query: {
459
- request: 'GetFeatureInfo',
460
- service: 'WMS',
461
- version: version,
462
- SRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
463
- CRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
464
- BBOX:
465
- '' +
466
- this.props.view.extent.xmin +
467
- ', ' +
468
- this.props.view.extent.ymin +
469
- ', ' +
470
- this.props.view.extent.xmax +
471
- ', ' +
472
- this.props.view.extent.ymax,
473
- HEIGHT: this.props.view.height,
474
- WIDTH: this.props.view.width,
475
- X: event.screenPoint.x,
476
- Y: event.screenPoint.y,
477
- QUERY_LAYERS: layerId,
478
- INFO_FORMAT: format,
479
- TIME: times ? times[0] + '/' + times[nTimes - 1] : '',
480
- FEATURE_COUNT: '' + nTimes,
481
- },
402
+ return esriRequest(url, {
403
+ responseType: 'html',
404
+ sync: 'true',
405
+ query: {
406
+ request: 'GetFeatureInfo',
407
+ service: 'WMS',
408
+ version: version,
409
+ SRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
410
+ CRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
411
+ BBOX:
412
+ '' +
413
+ this.props.view.extent.xmin +
414
+ ', ' +
415
+ this.props.view.extent.ymin +
416
+ ', ' +
417
+ this.props.view.extent.xmax +
418
+ ', ' +
419
+ this.props.view.extent.ymax,
420
+ HEIGHT: this.props.view.height,
421
+ WIDTH: this.props.view.width,
422
+ X: event.screenPoint.x,
423
+ Y: event.screenPoint.y,
424
+ QUERY_LAYERS: layerId,
425
+ INFO_FORMAT: format,
426
+ TIME: times ? times[0] + '/' + times[nTimes - 1] : '',
427
+ FEATURE_COUNT: '' + nTimes,
428
+ },
429
+ })
430
+ .then((response) => {
431
+ let format = response.requestOptions.query.INFO_FORMAT;
432
+ let data;
433
+ if (format.includes('text')) {
434
+ data = new window.DOMParser().parseFromString(
435
+ response.data,
436
+ 'text/html',
437
+ );
438
+ } else if (format.includes('json')) {
439
+ data = JSON.parse(response.data);
440
+ }
441
+ return data; // Added return statement
482
442
  })
483
- .then((response) => {
484
- let format = response.requestOptions.query.INFO_FORMAT;
485
- let data;
486
- if (format.includes('text')) {
487
- data = new window.DOMParser().parseFromString(
488
- response.data,
489
- 'text/html',
490
- );
491
- } else if (format.includes('json')) {
492
- data = JSON.parse(response.data);
493
- }
494
- return data;
495
- })
496
- .then((data) => {
497
- return data;
498
- });
499
- });
500
- }
443
+ .then((data) => {
444
+ return data;
445
+ });
446
+ });
501
447
  }
502
448
 
503
449
  wmsCapabilities(url) {
@@ -1,7 +1,5 @@
1
1
  import React, { createRef } from 'react';
2
2
  import './css/ArcgisMap.css';
3
- import { loadModules } from 'esri-loader';
4
- var watchUtils;
5
3
  class LoadingSpinner extends React.Component {
6
4
  constructor(props) {
7
5
  super(props);
@@ -16,12 +14,6 @@ class LoadingSpinner extends React.Component {
16
14
  this.listenForLayerChanges = this.listenForLayerChanges.bind(this);
17
15
  }
18
16
 
19
- loader() {
20
- return loadModules(['esri/core/watchUtils']).then(([_watchUtils]) => {
21
- watchUtils = _watchUtils;
22
- });
23
- }
24
-
25
17
  listenForLayerChanges() {
26
18
  this.props.view.map.layers.on('change', (event) => {
27
19
  if (event.added.length > 0)
@@ -62,25 +54,12 @@ class LoadingSpinner extends React.Component {
62
54
  }
63
55
 
64
56
  async componentDidMount() {
65
- await this.loader();
66
- //this.props.view.when(() => {
67
- // this.props.view.ui.add(this.container.current, 'manual');
68
- // this.listenForLayerChanges();
69
- //});
70
- watchUtils.when(this.props.view, 'ready', (isReady) => {
71
- if (isReady) {
72
- this.props.view.ui.add(this.container.current, 'manual');
73
- this.listenForLayerChanges();
74
- }
57
+ this.props.view.when(() => {
58
+ this.props.view.ui.add(this.container.current, 'manual');
59
+ this.listenForLayerChanges();
75
60
  });
76
61
  }
77
62
 
78
- componentDidUpdate(prevState) {
79
- // if (this.state.loading !== prevState.loading) {
80
- // this.showLoading();
81
- // }
82
- }
83
-
84
63
  render() {
85
64
  return (
86
65
  <div
package/.eslintrc.js DELETED
@@ -1,55 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const projectRootPath = fs.existsSync('./project')
5
- ? fs.realpathSync('./project')
6
- : fs.realpathSync('./../../../');
7
- const packageJson = require(path.join(projectRootPath, 'package.json'));
8
- const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
9
-
10
- const pathsConfig = jsConfig.paths;
11
-
12
- let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
13
-
14
- Object.keys(pathsConfig).forEach(pkg => {
15
- if (pkg === '@plone/volto') {
16
- voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
17
- }
18
- });
19
- const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
20
- const reg = new AddonConfigurationRegistry(projectRootPath);
21
-
22
- // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
23
- const addonAliases = Object.keys(reg.packages).map(o => [
24
- o,
25
- reg.packages[o].modulePath,
26
- ]);
27
-
28
-
29
- module.exports = {
30
- extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
31
- settings: {
32
- 'import/resolver': {
33
- alias: {
34
- map: [
35
- ['@plone/volto', '@plone/volto/src'],
36
- ...addonAliases,
37
- ['@package', `${__dirname}/src`],
38
- ['~', `${__dirname}/src`],
39
- ],
40
- extensions: ['.js', '.jsx', '.json'],
41
- },
42
- 'babel-plugin-root-import': {
43
- rootPathSuffix: 'src',
44
- },
45
- },
46
- },
47
- rules: {
48
- 'react/jsx-no-target-blank': [
49
- 'error',
50
- {
51
- allowReferrer: true,
52
- },
53
- ],
54
- }
55
- };
@@ -1,46 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const projectRootPath = fs.realpathSync('./project'); // __dirname
5
- const packageJson = require(path.join(projectRootPath, 'package.json'));
6
- const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
7
-
8
- const pathsConfig = jsConfig.paths;
9
-
10
- let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
11
-
12
- Object.keys(pathsConfig).forEach(pkg => {
13
- if (pkg === '@plone/volto') {
14
- voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
15
- }
16
- });
17
- const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
18
- const reg = new AddonConfigurationRegistry(projectRootPath);
19
-
20
- // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
21
- const addonAliases = Object.keys(reg.packages).map(o => [
22
- o,
23
- reg.packages[o].modulePath,
24
- ]);
25
-
26
-
27
- module.exports = {
28
- extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
29
- settings: {
30
- 'import/resolver': {
31
- alias: {
32
- map: [
33
- ['@plone/volto', '@plone/volto/src'],
34
- ...addonAliases,
35
- ['@package', `${__dirname}/src`],
36
- ['~', `${__dirname}/src`],
37
- ],
38
- extensions: ['.js', '.jsx', '.json'],
39
- },
40
- 'babel-plugin-root-import': {
41
- rootPathSuffix: 'src',
42
- },
43
- },
44
- },
45
- };
46
-