@eeacms/volto-arcgis-block 0.1.372 → 0.1.374

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,13 @@ 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.374](https://github.com/eea/volto-arcgis-block/compare/0.1.373...0.1.374) - 9 July 2025
8
+
9
+ ### [0.1.373](https://github.com/eea/volto-arcgis-block/compare/0.1.372...0.1.373) - 8 July 2025
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`fa8e13d`](https://github.com/eea/volto-arcgis-block/commit/fa8e13da184b9a9146cb65aca7a89c05fb0261ba)]
7
14
  ### [0.1.372](https://github.com/eea/volto-arcgis-block/compare/0.1.371...0.1.372) - 26 June 2025
8
15
 
9
16
  #### :hammer_and_wrench: Others
package/Jenkinsfile CHANGED
@@ -9,7 +9,7 @@ pipeline {
9
9
  environment {
10
10
  GIT_NAME = "volto-arcgis-block"
11
11
  NAMESPACE = "@eeacms"
12
- SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu,ask.copernicus.eu"
12
+ SONARQUBE_TAGS = "volto.eea.europa.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu,ask.copernicus.eu"
13
13
  DEPENDENCIES = ""
14
14
  BACKEND_PROFILES = "eea.kitkat:testing"
15
15
  BACKEND_ADDONS = "clms.addon,clms.types,clms.downloadtool,clms.statstool"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.372",
3
+ "version": "0.1.374",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -230,6 +230,11 @@ class AreaWidget extends React.Component {
230
230
  });
231
231
  this.props.uploadFileHandler(true);
232
232
  }
233
+ if (id === 'coordinates') {
234
+ document.querySelector('.coordinateWindow').style.display = 'block';
235
+ } else {
236
+ document.querySelector('.coordinateWindow').style.display = 'none';
237
+ }
233
238
  }
234
239
  nuts0handler(e) {
235
240
  this.loadNutsService(e.target.value, [0]);
@@ -986,6 +991,90 @@ class AreaWidget extends React.Component {
986
991
  });
987
992
  this.nutsRadioButton(event.target.value);
988
993
  }
994
+ addCoordinates() {
995
+ this.clearWidget();
996
+ let pointNorth = !isNaN(document.getElementById('menu-north').value)
997
+ ? Number(document.getElementById('menu-north').value)
998
+ : 0;
999
+ let pointSouth = !isNaN(document.getElementById('menu-south').value)
1000
+ ? Number(document.getElementById('menu-south').value)
1001
+ : 0;
1002
+ let pointEast = !isNaN(document.getElementById('menu-east').value)
1003
+ ? Number(document.getElementById('menu-east').value)
1004
+ : 0;
1005
+ let pointWest = !isNaN(document.getElementById('menu-west').value)
1006
+ ? Number(document.getElementById('menu-west').value)
1007
+ : 0;
1008
+ let pointNE = [pointNorth, pointEast];
1009
+ let pointSW = [pointSouth, pointWest];
1010
+ var fillSymbol = {
1011
+ type: 'simple-fill',
1012
+ color: [255, 255, 255, 0.5],
1013
+ outline: {
1014
+ color: [0, 0, 0],
1015
+ width: 1,
1016
+ },
1017
+ };
1018
+ let extentGraphic = new Graphic({
1019
+ geometry: new Extent({
1020
+ xmin: Math.min(pointNE[1], pointSW[1]),
1021
+ xmax: Math.max(pointNE[1], pointSW[1]),
1022
+ ymin: Math.min(pointNE[0], pointSW[0]),
1023
+ ymax: Math.max(pointNE[0], pointSW[0]),
1024
+ spatialReference: { wkid: 4326 },
1025
+ }),
1026
+ symbol: fillSymbol,
1027
+ });
1028
+ let outSpatialReference = new SpatialReference({
1029
+ wkid: 102100,
1030
+ });
1031
+ let graphicProjection = projection.project(
1032
+ extentGraphic.geometry,
1033
+ outSpatialReference,
1034
+ );
1035
+ if (extentGraphic && this.checkExtent(graphicProjection)) {
1036
+ this.setState({
1037
+ showInfoPopup: true,
1038
+ infoPopupType: 'fullDataset',
1039
+ });
1040
+ this.props.uploadFileHandler(true);
1041
+ } else {
1042
+ this.setState({
1043
+ showInfoPopup: true,
1044
+ infoPopupType: 'download',
1045
+ });
1046
+ this.props.uploadFileHandler(true);
1047
+ }
1048
+ this.props.updateArea({
1049
+ origin: {
1050
+ x: extentGraphic.geometry.xmin,
1051
+ y: extentGraphic.geometry.ymin,
1052
+ },
1053
+ end: { x: extentGraphic.geometry.xmax, y: extentGraphic.geometry.ymax },
1054
+ });
1055
+ this.props.view.graphics.add(extentGraphic);
1056
+ }
1057
+ openCoordinates(event) {
1058
+ this.clearWidget();
1059
+ this.nutsRadioButton(event.target.value);
1060
+ }
1061
+ closeCoordinates() {
1062
+ if (
1063
+ document.querySelector('.coordinateContainer').style.display === 'none'
1064
+ ) {
1065
+ document.querySelector('.coordinateContainer').style.display = 'block';
1066
+ document.querySelector('.coordinateWindow').style.height = '13rem';
1067
+ document
1068
+ .querySelector('.closeCoordinates')
1069
+ .classList.replace('esri-icon-up-arrow', 'esri-icon-close');
1070
+ } else {
1071
+ document.querySelector('.coordinateContainer').style.display = 'none';
1072
+ document.querySelector('.coordinateWindow').style.height = '2rem';
1073
+ document
1074
+ .querySelector('.closeCoordinates')
1075
+ .classList.replace('esri-icon-close', 'esri-icon-up-arrow');
1076
+ }
1077
+ }
989
1078
  clearWidget() {
990
1079
  window.document.querySelector('.pan-container').style.display = 'none';
991
1080
  this.props.mapViewer.view.popup.close();
@@ -1272,7 +1361,7 @@ class AreaWidget extends React.Component {
1272
1361
  </fieldset>
1273
1362
  </div>
1274
1363
  <div className="area-header">
1275
- Area selection options for custom download:
1364
+ Area selection for custom download:
1276
1365
  </div>
1277
1366
  <div className="area-header2">
1278
1367
  <div className="area-dot">·</div>
@@ -1436,6 +1525,27 @@ class AreaWidget extends React.Component {
1436
1525
  </label>
1437
1526
  </div>
1438
1527
  </div>
1528
+ <div className="ccl-form-group">
1529
+ <div className="rectangle-block">
1530
+ <div className="area-dot">·</div>
1531
+ <input
1532
+ type="radio"
1533
+ id="download_area_select_coordinates"
1534
+ name="downloadAreaSelect"
1535
+ value="coordinates"
1536
+ className="ccl-radio ccl-required ccl-form-check-input area-radio"
1537
+ onClick={this.openCoordinates.bind(this)}
1538
+ ></input>
1539
+ <label
1540
+ className="ccl-form-radio-label"
1541
+ htmlFor="download_area_select_coordinates"
1542
+ >
1543
+ <span className="coordinates-header">
1544
+ Add coordinates
1545
+ </span>
1546
+ </label>
1547
+ </div>
1548
+ </div>
1439
1549
  </fieldset>
1440
1550
  </div>
1441
1551
  <div className="area-header2">
@@ -1461,9 +1571,7 @@ class AreaWidget extends React.Component {
1461
1571
  >
1462
1572
  <div className="field">
1463
1573
  <label className="file-upload">
1464
- <span>
1465
- File formats supported: shp(zip), geojson, CSV
1466
- </span>
1574
+ <span>Valid formats: shp, geojson, CSV</span>
1467
1575
  <input
1468
1576
  type="file"
1469
1577
  name="file"
@@ -1629,6 +1737,85 @@ class AreaWidget extends React.Component {
1629
1737
  </div>
1630
1738
  )}
1631
1739
  </div>
1740
+ <div className="coordinateWindow">
1741
+ <div className="coordinateHeader">
1742
+ Add new coordinates
1743
+ <div
1744
+ className="esri-icon-close esri-interactive closeCoordinates"
1745
+ onClick={this.closeCoordinates.bind(this)}
1746
+ onKeyDown={this.closeCoordinates.bind(this)}
1747
+ tabIndex="0"
1748
+ role="button"
1749
+ ></div>
1750
+ </div>
1751
+ <div className="coordinateContainer">
1752
+ <div className="coordinateSubContainer">
1753
+ <div className="coordinateSubContainerTitle">NE</div>
1754
+ <div>
1755
+ Lat:
1756
+ <input
1757
+ type="text"
1758
+ id="menu-north"
1759
+ maxLength="9"
1760
+ placeholder="00.000000"
1761
+ className="coordinateInput"
1762
+ />
1763
+ </div>
1764
+ <div>
1765
+ Lon:
1766
+ <input
1767
+ type="text"
1768
+ id="menu-east"
1769
+ maxLength="9"
1770
+ placeholder="00.000000"
1771
+ className="coordinateInput"
1772
+ />
1773
+ </div>
1774
+ </div>
1775
+ <div className="coordinateSubContainer">
1776
+ <div className="coordinateSubContainerTitle">SW</div>
1777
+ <div>
1778
+ Lat:
1779
+ <input
1780
+ type="text"
1781
+ id="menu-south"
1782
+ maxLength="9"
1783
+ placeholder="00.000000"
1784
+ className="coordinateInput"
1785
+ />
1786
+ </div>
1787
+ <div>
1788
+ Lon:
1789
+ <input
1790
+ type="text"
1791
+ id="menu-west"
1792
+ maxLength="9"
1793
+ placeholder="00.000000"
1794
+ className="coordinateInput"
1795
+ />
1796
+ </div>
1797
+ </div>
1798
+ <button
1799
+ aria-label="Search"
1800
+ className="button menu-search-button-coordinatess"
1801
+ onClick={() => this.addCoordinates()}
1802
+ onKeyDown={(e) => {
1803
+ if (
1804
+ !e.altKey &&
1805
+ e.code !== 'Tab' &&
1806
+ !e.ctrlKey &&
1807
+ e.code !== 'Delete' &&
1808
+ !e.shiftKey &&
1809
+ !e.code.startsWith('F')
1810
+ ) {
1811
+ this.addCoordinates();
1812
+ }
1813
+ }}
1814
+ >
1815
+ Add this area to the map
1816
+ </button>
1817
+ </div>
1818
+ </div>
1632
1819
  </>
1633
1820
  );
1634
1821
  }
@@ -49,7 +49,7 @@ export const AddCartItem = ({
49
49
  let check = document.querySelector('.area-panel input:checked')?.value;
50
50
  let fileUpload = sessionStorage.getItem('fileUploadLayer') ? true : false;
51
51
  let area = {};
52
- if (check === 'area' || fileUpload) {
52
+ if (check === 'area' || fileUpload || check === 'coordinates') {
53
53
  let graphics = mapViewer.view.graphics;
54
54
  if (graphics.length === 0) {
55
55
  area = '';
@@ -100,7 +100,7 @@ export const AddCartItem = ({
100
100
  let isMapServer = dataset?.ViewService?.toLowerCase().endsWith('/mapserver')
101
101
  ? true
102
102
  : false;
103
- if (check === 'area' || fileUpload) {
103
+ if (check === 'area' || fileUpload || check === 'coordinates') {
104
104
  areaExtent = new Extent({
105
105
  xmin: Math.min(areaData?.end?.x, areaData?.origin?.x),
106
106
  xmax: Math.max(areaData?.end?.x, areaData?.origin?.x),
@@ -468,6 +468,75 @@ label.ccl-form-radio-label span.nuts-menu-icon {
468
468
  color: red;
469
469
  font-size: 15px;
470
470
  }
471
+
472
+ .coordinateWindow {
473
+ position: absolute;
474
+ right: 23rem;
475
+ bottom: 2rem;
476
+ display: none;
477
+ width: 23rem;
478
+ height: 13rem;
479
+ background-color: white;
480
+ }
481
+
482
+ .coordinateHeader {
483
+ display: flex;
484
+ justify-content: space-between;
485
+ padding: 0.5rem;
486
+ background-color: #a0b128;
487
+ color: white;
488
+ }
489
+
490
+ .closeCoordinates {
491
+ width: 1.4rem;
492
+ height: 1.4rem;
493
+ padding: 0.2rem;
494
+ margin-right: 0.2rem;
495
+ }
496
+
497
+ .closeCoordinates:hover {
498
+ background-color: #7c8921;
499
+ }
500
+
501
+ .coordinateContainer {
502
+ display: block;
503
+ padding-right: 1rem;
504
+ padding-left: 1rem;
505
+ margin-top: 1rem;
506
+ }
507
+
508
+ .coordinateSubContainer {
509
+ display: flex;
510
+ flex-direction: row;
511
+ justify-content: space-between;
512
+ margin-top: 2rem;
513
+ margin-right: 0.5rem;
514
+ margin-left: 0.3rem;
515
+ }
516
+
517
+ .coordinateSubContainerTitle {
518
+ width: 1rem;
519
+ }
520
+
521
+ .menu-search-button-coordinatess {
522
+ padding: 0.2rem;
523
+ padding-right: 0.7rem;
524
+ padding-left: 0.7rem;
525
+ border: none;
526
+ margin-top: 1.5rem;
527
+ margin-left: 8.5rem;
528
+ background-color: #a0b128;
529
+ color: white;
530
+ }
531
+
532
+ .coordinateInput {
533
+ width: 6rem;
534
+ border-width: 1px;
535
+ border-style: solid;
536
+ border-color: #a0b128 !important;
537
+ margin-left: 0.5rem;
538
+ }
539
+
471
540
  /* WMS Upload */
472
541
  div.upload-container.esri-component
473
542
  > div.right-panel