@eeacms/volto-arcgis-block 0.1.156 → 0.1.157

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.157](https://github.com/eea/volto-arcgis-block/compare/0.1.156...0.1.157) - 9 June 2023
8
+
7
9
  ### [0.1.156](https://github.com/eea/volto-arcgis-block/compare/0.1.155...0.1.156) - 8 June 2023
8
10
 
9
11
  #### :hammer_and_wrench: Others
@@ -727,13 +729,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
727
729
  #### :hammer_and_wrench: Others
728
730
 
729
731
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
730
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
731
732
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
732
733
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
733
734
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
734
735
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
735
- - 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)]
736
- - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
737
736
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
738
737
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
739
738
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -793,7 +792,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
793
792
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
794
793
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
795
794
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
796
- - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
797
795
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
798
796
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
799
797
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -813,7 +811,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
813
811
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
814
812
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
815
813
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
816
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
817
814
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
818
815
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
819
816
 
@@ -908,7 +905,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
908
905
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
909
906
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
910
907
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
911
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
912
908
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
913
909
 
914
910
  #### :hammer_and_wrench: Others
@@ -1153,7 +1149,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1153
1149
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
1154
1150
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
1155
1151
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
1156
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
1157
1152
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
1158
1153
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
1159
1154
  - cleanup of unused code [bipoza - [`b167677`](https://github.com/eea/volto-arcgis-block/commit/b1676771f637f056cad50cb0bc186f2ea79e8517)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.156",
3
+ "version": "0.1.157",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -119,6 +119,7 @@ class MapViewer extends React.Component {
119
119
  async componentDidMount() {
120
120
  loadCss();
121
121
  await this.loader();
122
+ this.state.url = window.location.href;
122
123
  await this.waitForDataFill();
123
124
 
124
125
  this.positronCompositeBasemap = new Basemap({
@@ -222,6 +223,35 @@ class MapViewer extends React.Component {
222
223
  });
223
224
  }
224
225
 
226
+ componentDidUpdate(prevProps, prevState) {
227
+ if (
228
+ !(
229
+ this.state.url === 'http://localhost:3000/en/map-viewer' ||
230
+ this.state.url ===
231
+ 'https://clmsdemo.devel6cph.eea.europa.eu/en/map-viewer' ||
232
+ this.state.url === 'https://clms-prod.eea.europa.eu/en/map-viewer'
233
+ )
234
+ ) {
235
+ sessionStorage.clear();
236
+ }
237
+
238
+ mapStatus = this.recoverState();
239
+
240
+ if (
241
+ mapStatus === null ||
242
+ (mapStatus.zoom === null && mapStatus.center === null) ||
243
+ Object.entries(mapStatus).length === 0
244
+ ) {
245
+ mapStatus = {};
246
+ mapStatus.zoom = this.mapCfg.zoom;
247
+ mapStatus.center = this.mapCfg.center;
248
+ mapStatus.activeLayers = this.mapCfg.activeLayers;
249
+ this.setCenterState(this.mapCfg.center);
250
+ this.setZoomState(this.mapCfg.zoom);
251
+ this.activeLayersHandler(this.mapCfg.activeLayers);
252
+ }
253
+ }
254
+
225
255
  componentWillUnmount() {
226
256
  // clean up
227
257
  if (this.view) {
@@ -492,6 +492,30 @@ class MenuWidget extends React.Component {
492
492
  return decodeURI(dc.substring(begin + prefix.length, end));
493
493
  }
494
494
 
495
+ storePanelScroll() {
496
+ let paneles = document.querySelector('#paneles');
497
+ var selected_tab = document.querySelector('.tab-selected');
498
+ let toc_panel_scrolls =
499
+ JSON.parse(sessionStorage.getItem('toc_panel_scrolls')) || {};
500
+ toc_panel_scrolls[selected_tab.id] = paneles.scrollTop;
501
+ sessionStorage.setItem(
502
+ 'toc_panel_scrolls',
503
+ JSON.stringify(toc_panel_scrolls),
504
+ );
505
+ }
506
+
507
+ restorePanelScroll() {
508
+ let paneles = document.querySelector('#paneles');
509
+ var selected_tab = document.querySelector('.tab-selected');
510
+ let toc_panel_scrolls =
511
+ JSON.parse(sessionStorage.getItem('toc_panel_scrolls')) || {};
512
+ let scroll = toc_panel_scrolls[selected_tab.id];
513
+ if (scroll) {
514
+ scroll = parseInt(scroll);
515
+ paneles.scrollTop = scroll;
516
+ }
517
+ }
518
+
495
519
  /**
496
520
  * Method that will be invoked when the
497
521
  * button is clicked. It controls the open
@@ -532,6 +556,7 @@ class MenuWidget extends React.Component {
532
556
  if (document.contains(document.querySelector('.timeslider-container')))
533
557
  document.querySelector('.timeslider-container').style.display =
534
558
  'block';
559
+ this.restorePanelScroll();
535
560
 
536
561
  // By invoking the setState, we notify the state we want to reach
537
562
  // and ensure that the component is rendered again
@@ -3156,6 +3181,7 @@ class MenuWidget extends React.Component {
3156
3181
  */
3157
3182
  toggleTab(e) {
3158
3183
  if (!e.currentTarget.classList.contains('tab-selected')) {
3184
+ this.storePanelScroll();
3159
3185
  var tabsel = document.querySelector('.tab-selected');
3160
3186
  var tab = e.currentTarget;
3161
3187
  var panelsel = document.querySelector('.panel-selected');
@@ -3177,6 +3203,7 @@ class MenuWidget extends React.Component {
3177
3203
  if (document.querySelector('.opacity-panel').style.display === 'block') {
3178
3204
  this.closeOpacity();
3179
3205
  }
3206
+ this.restorePanelScroll();
3180
3207
  }
3181
3208
  }
3182
3209