@eeacms/volto-arcgis-block 0.1.219 → 0.1.220

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,8 @@ 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.220](https://github.com/eea/volto-arcgis-block/compare/0.1.219...0.1.220) - 24 October 2023
8
+
7
9
  ### [0.1.219](https://github.com/eea/volto-arcgis-block/compare/0.1.218...0.1.219) - 24 October 2023
8
10
 
9
11
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.219",
3
+ "version": "0.1.220",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -419,20 +419,9 @@ class AreaWidget extends React.Component {
419
419
  async initFMI() {
420
420
  let currentUrl = window.location.href.split('.eu');
421
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
- }
422
+ if (currentUrl[0] === 'https://clmsdemo.devel6cph.eea') {
423
+ fetchUrl =
424
+ 'https://clmsdemo.devel6cph.eea.europa.eu/++api++/@anon-registry';
436
425
  } else {
437
426
  fetchUrl = 'https://land.copernicus.eu/++api++/@anon-registry';
438
427
  }
@@ -447,31 +436,6 @@ class AreaWidget extends React.Component {
447
436
  //console.error('There was a problem with the fetch operation:', error);
448
437
  }
449
438
  }
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
- }
475
439
  /**
476
440
  * This method renders the component
477
441
  * @returns jsx
@@ -200,20 +200,9 @@ class UseCasesMapViewer extends React.Component {
200
200
  async initFMI() {
201
201
  let currentUrl = window.location.href.split('.eu');
202
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
- }
203
+ if (currentUrl[0] === 'https://clmsdemo.devel6cph.eea') {
204
+ fetchUrl =
205
+ 'https://clmsdemo.devel6cph.eea.europa.eu/++api++/@anon-registry';
217
206
  } else {
218
207
  fetchUrl = 'https://land.copernicus.eu/++api++/@anon-registry';
219
208
  }
@@ -250,31 +239,6 @@ class UseCasesMapViewer extends React.Component {
250
239
  //console.error('There was a problem with the fetch operation:', error);
251
240
  }
252
241
  }
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
- }
278
242
  /**
279
243
  * This method will disable all the functionalities on the map
280
244
  * @param {MapView} view