@eeacms/volto-arcgis-block 0.1.216 → 0.1.218

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,7 +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.216](https://github.com/eea/volto-arcgis-block/compare/0.1.215...0.1.216) - 19 October 2023
7
+ ### [0.1.218](https://github.com/eea/volto-arcgis-block/compare/0.1.217...0.1.218) - 23 October 2023
8
+
9
+ ### [0.1.217](https://github.com/eea/volto-arcgis-block/compare/0.1.216...0.1.217) - 23 October 2023
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - use land.copernicus.eu tag [Mikel Larreategi - [`fbf56a8`](https://github.com/eea/volto-arcgis-block/commit/fbf56a8a1dcdd64d28081a1bcc985ab4249d12ae)]
14
+ ### [0.1.216](https://github.com/eea/volto-arcgis-block/compare/0.1.215...0.1.216) - 20 October 2023
8
15
 
9
16
  #### :house: Internal changes
10
17
 
@@ -1006,10 +1013,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1006
1013
  #### :hammer_and_wrench: Others
1007
1014
 
1008
1015
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
1016
+ - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
1009
1017
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
1010
1018
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
1011
1019
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
1012
1020
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
1021
+ - Revert "revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`64ab56e`](https://github.com/eea/volto-arcgis-block/commit/64ab56e0f1f8dddc26f26039509a028e34653e64)]
1022
+ - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
1013
1023
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
1014
1024
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
1015
1025
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -1069,6 +1079,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1069
1079
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
1070
1080
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
1071
1081
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
1082
+ - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
1072
1083
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
1073
1084
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
1074
1085
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -1088,6 +1099,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1088
1099
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
1089
1100
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
1090
1101
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
1102
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
1091
1103
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
1092
1104
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
1093
1105
 
@@ -1182,6 +1194,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1182
1194
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
1183
1195
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
1184
1196
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
1197
+ - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
1185
1198
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
1186
1199
 
1187
1200
  #### :hammer_and_wrench: Others
@@ -1426,6 +1439,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1426
1439
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
1427
1440
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
1428
1441
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
1442
+ - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
1429
1443
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
1430
1444
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
1431
1445
  - cleanup of unused code [bipoza - [`b167677`](https://github.com/eea/volto-arcgis-block/commit/b1676771f637f056cad50cb0bc186f2ea79e8517)]
package/Jenkinsfile CHANGED
@@ -4,7 +4,7 @@ pipeline {
4
4
  environment {
5
5
  GIT_NAME = "volto-arcgis-block"
6
6
  NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu"
8
8
  DEPENDENCIES = ""
9
9
  VOLTO = "15.16.0"
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.216",
3
+ "version": "0.1.218",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -32,6 +32,8 @@ class AreaWidget extends React.Component {
32
32
  'esri-icon-cursor-marquee esri-widget--button esri-widget esri-interactive';
33
33
  // Enable defaultPopup option to charge popup and highlifght feature
34
34
  this.props.mapViewer.view.popup.defaultPopupTemplateEnabled = true;
35
+ this.nutsUrl = '';
36
+ this.initFMI = this.initFMI.bind(this);
35
37
  }
36
38
 
37
39
  loader() {
@@ -145,8 +147,7 @@ class AreaWidget extends React.Component {
145
147
  var layer = new FeatureLayer({
146
148
  id: id,
147
149
  //url: this.props.urls.nutsHandler,
148
- url:
149
- 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/NUTS_2021_Improved/MapServer/',
150
+ url: this.nutsUrl,
150
151
  layerId: level,
151
152
  outFields: ['*'],
152
153
  popupEnabled: false,
@@ -339,6 +340,7 @@ class AreaWidget extends React.Component {
339
340
  */
340
341
  async componentDidMount() {
341
342
  await this.loader();
343
+ await this.initFMI();
342
344
  this.nutsGroupLayer = new GroupLayer({
343
345
  title: 'nuts',
344
346
  //opacity: 0.5,
@@ -414,6 +416,62 @@ class AreaWidget extends React.Component {
414
416
  this.props.download && this.props.view.ui.add(popup, 'top-right');
415
417
  }
416
418
 
419
+ async initFMI() {
420
+ let currentUrl = window.location.href.split('.eu');
421
+ let fetchUrl = '';
422
+ if (currentUrl[0] === 'https://land.copernicus') {
423
+ fetchUrl = 'https://land.copernicus.eu';
424
+ if (this.getAuthToken()) {
425
+ fetchUrl = fetchUrl + '/++api++/@registry';
426
+ } else {
427
+ fetchUrl = fetchUrl + '/++api++/@anon-registry';
428
+ }
429
+ } else if (currentUrl[0] === 'https://clmsdemo.devel6cph.eea') {
430
+ fetchUrl = 'https://clmsdemo.devel6cph.eea.europa.eu';
431
+ if (this.getAuthToken()) {
432
+ fetchUrl = fetchUrl + '/++api++/@registry';
433
+ } else {
434
+ fetchUrl = fetchUrl + '/++api++/@anon-registry';
435
+ }
436
+ } else {
437
+ fetchUrl = 'https://land.copernicus.eu/++api++/@anon-registry';
438
+ }
439
+ try {
440
+ let nutsResponse = await fetch(fetchUrl + this.props.urls.nutsHandler);
441
+ if (nutsResponse.status === 200) {
442
+ this.nutsUrl = await nutsResponse.json();
443
+ } else {
444
+ throw new Error(nutsResponse.status);
445
+ }
446
+ } catch (error) {
447
+ //console.error('There was a problem with the fetch operation:', error);
448
+ }
449
+ }
450
+ getAuthToken() {
451
+ let tokenResult = null;
452
+ if (this.getCookie('auth_token')) {
453
+ tokenResult = true;
454
+ } else {
455
+ tokenResult = false;
456
+ }
457
+ return tokenResult;
458
+ }
459
+ getCookie(name) {
460
+ var dc = document.cookie;
461
+ var prefix = name + '=';
462
+ var begin = dc.indexOf('; ' + prefix);
463
+ if (begin === -1) {
464
+ begin = dc.indexOf(prefix);
465
+ if (begin !== 0) return null;
466
+ } else {
467
+ begin += 2;
468
+ var end = document.cookie.indexOf(';', begin);
469
+ if (end === -1) {
470
+ end = dc.length;
471
+ }
472
+ }
473
+ return decodeURI(dc.substring(begin + prefix.length, end));
474
+ }
417
475
  /**
418
476
  * This method renders the component
419
477
  * @returns jsx
@@ -214,8 +214,7 @@ const config = {
214
214
  },
215
215
  ],
216
216
  Urls: {
217
- nutsHandler:
218
- 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/NUTS_2021_Improved/MapServer/',
217
+ nutsHandler: '/clms.downloadtool.fme_config_controlpanel.nuts_service',
219
218
  outsideEu:
220
219
  'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/World_countries_except_EU37/MapServer',
221
220
  all_present_lc_a_pol:
@@ -32,25 +32,26 @@ class UseCasesMapViewer extends React.Component {
32
32
  this.id = props.id;
33
33
  this.popupOnce = false;
34
34
  this.popupRegion = '';
35
+ this.initFMI = this.initFMI.bind(this);
35
36
  this.mapClass = classNames('map-container', {
36
37
  [`${props.customClass}`]: props.customClass || null,
37
38
  });
38
39
  this.spatialConfig = {
39
40
  id: 'spatialLayer',
40
- url: props.cfg.Services.SpatialCoverageLayer,
41
+ url: '',
41
42
  render: props.cfg.SpatialRenderer,
42
43
  showLegend: true,
43
44
  };
44
45
  this.regionConfig = {
45
46
  id: 'regionLayer',
46
- url: props.cfg.Services.RegionLayer,
47
+ url: '',
47
48
  render: props.cfg.RegionMarkerRenderer,
48
49
  label: props.cfg.RegionLabel,
49
50
  showLegend: false,
50
51
  };
51
52
  this.HighlightConfig = {
52
53
  id: 'HightlightLayer',
53
- url: props.cfg.Services.Highlight_service,
54
+ url: '',
54
55
  render: props.cfg.HightlightRenderer,
55
56
  showLegend: false,
56
57
  };
@@ -97,7 +98,7 @@ class UseCasesMapViewer extends React.Component {
97
98
  async componentDidMount() {
98
99
  loadCss();
99
100
  await this.loader();
100
-
101
+ await this.initFMI();
101
102
  this.basemap = new Basemap({
102
103
  title: 'Countries World',
103
104
  thumbnailUrl:
@@ -196,7 +197,84 @@ class UseCasesMapViewer extends React.Component {
196
197
  //react component to render itself again
197
198
  this.setState(() => ({ useCaseLevel: 1 }));
198
199
  }
199
-
200
+ async initFMI() {
201
+ let currentUrl = window.location.href.split('.eu');
202
+ let fetchUrl = '';
203
+ if (currentUrl[0] === 'https://land.copernicus') {
204
+ fetchUrl = 'https://land.copernicus.eu';
205
+ if (this.getAuthToken()) {
206
+ fetchUrl = fetchUrl + '/++api++/@registry';
207
+ } else {
208
+ fetchUrl = fetchUrl + '/++api++/@anon-registry';
209
+ }
210
+ } else if (currentUrl[0] === 'https://clmsdemo.devel6cph.eea') {
211
+ fetchUrl = 'https://clmsdemo.devel6cph.eea.europa.eu';
212
+ if (this.getAuthToken()) {
213
+ fetchUrl = fetchUrl + '/++api++/@registry';
214
+ } else {
215
+ fetchUrl = fetchUrl + '/++api++/@anon-registry';
216
+ }
217
+ } else {
218
+ fetchUrl = 'https://land.copernicus.eu/++api++/@anon-registry';
219
+ }
220
+ try {
221
+ let highlightResponse = await fetch(
222
+ fetchUrl + this.serviceCfg.Highlight_service,
223
+ );
224
+ if (highlightResponse.status === 200) {
225
+ this.HighlightConfig.url = await highlightResponse.json();
226
+ } else {
227
+ throw new Error(highlightResponse.status);
228
+ }
229
+ let regionResponse = await fetch(fetchUrl + this.serviceCfg.RegionLayer);
230
+ if (regionResponse.status === 200) {
231
+ this.regionConfig.url = await regionResponse.json();
232
+ } else {
233
+ throw new Error(regionResponse.status);
234
+ }
235
+ let spatialResponse = await fetch(
236
+ fetchUrl + this.serviceCfg.SpatialCoverageLayer,
237
+ );
238
+ if (spatialResponse.status === 200) {
239
+ this.spatialConfig.url = await spatialResponse.json();
240
+ } else {
241
+ throw new Error(spatialResponse.status);
242
+ }
243
+ let thumbnailResponse = await fetch(fetchUrl + this.thumbnail);
244
+ if (thumbnailResponse.status === 200) {
245
+ this.thumbnail = await thumbnailResponse.json();
246
+ } else {
247
+ throw new Error(thumbnailResponse.status);
248
+ }
249
+ } catch (error) {
250
+ //console.error('There was a problem with the fetch operation:', error);
251
+ }
252
+ }
253
+ getAuthToken() {
254
+ let tokenResult = null;
255
+ if (this.getCookie('auth_token')) {
256
+ tokenResult = true;
257
+ } else {
258
+ tokenResult = false;
259
+ }
260
+ return tokenResult;
261
+ }
262
+ getCookie(name) {
263
+ var dc = document.cookie;
264
+ var prefix = name + '=';
265
+ var begin = dc.indexOf('; ' + prefix);
266
+ if (begin === -1) {
267
+ begin = dc.indexOf(prefix);
268
+ if (begin !== 0) return null;
269
+ } else {
270
+ begin += 2;
271
+ var end = document.cookie.indexOf(';', begin);
272
+ if (end === -1) {
273
+ end = dc.length;
274
+ }
275
+ }
276
+ return decodeURI(dc.substring(begin + prefix.length, end));
277
+ }
200
278
  /**
201
279
  * This method will disable all the functionalities on the map
202
280
  * @param {MapView} view
@@ -34,15 +34,11 @@ const config = {
34
34
  ],
35
35
  },
36
36
  Services: {
37
- Highlight_service:
38
- 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/UseCasesWorldCountries/MapServer/1',
39
- RegionLayer:
40
- 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/UseCasesRegion_count/MapServer/0',
41
- SpatialCoverageLayer:
42
- 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/UseCasesSpatialCoverage/MapServer/0',
37
+ Highlight_service: '/clms.types.usecase_fme.highlight_service',
38
+ RegionLayer: '/clms.types.usecase_fme.region_layer',
39
+ SpatialCoverageLayer: '/clms.types.usecase_fme.spatial_coverage_layer',
43
40
  },
44
- Thumbnail:
45
- 'https://clmsdemo.devel6cph.eea.europa.eu/static/media/ccl-thumbnail-placeholder.2ccfd334.jpg',
41
+ Thumbnail: '/clms.types.usecase_fme.thumbnail',
46
42
 
47
43
  Codes: {
48
44
  EU: [