@eeacms/volto-arcgis-block 0.1.109 → 0.1.110

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,10 +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.110](https://github.com/eea/volto-arcgis-block/compare/0.1.109...0.1.110) - 28 February 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Update package.json [Amanda Rodriguez - [`5c523ea`](https://github.com/eea/volto-arcgis-block/commit/5c523eaa749576db2080f7d6dba08c46b32ace32)]
12
+ - ES Lint fix [Amanda Rodriguez - [`bacaca5`](https://github.com/eea/volto-arcgis-block/commit/bacaca5eee7e9d7e03ccb8c8b5f4aa40be0d122e)]
13
+ - CLMS-1758 [Amanda Rodriguez - [`0d43bc6`](https://github.com/eea/volto-arcgis-block/commit/0d43bc6e64ece410eeda3dbfb2ba4245ea4d2dc8)]
14
+ - CLMS-1827 [Amanda Rodriguez - [`1b589c7`](https://github.com/eea/volto-arcgis-block/commit/1b589c7661392692fa534f8c9061b9f11e7c4328)]
7
15
  ### [0.1.109](https://github.com/eea/volto-arcgis-block/compare/0.1.108...0.1.109) - 28 February 2023
8
16
 
9
17
  #### :hammer_and_wrench: Others
10
18
 
19
+ - Merge pull request #306 from eea/develop [Unai Bolivar - [`0772fe3`](https://github.com/eea/volto-arcgis-block/commit/0772fe31cacc0c5e2cbeb369775c98535ec2b64b)]
11
20
  - CLMS 1581 & CLMS 1771 pushing both tickets [ujbolivar - [`dd1a580`](https://github.com/eea/volto-arcgis-block/commit/dd1a580d32faff6754121dd49415030920543c72)]
12
21
  - CLMS-1771 FIX: Area widget opened by default if user is logged in and downloadTag exists [ujbolivar - [`f629491`](https://github.com/eea/volto-arcgis-block/commit/f629491531dec0dd09234b41184413b3d2e54768)]
13
22
  - CLMS-1581 FIX: Hotspot widget stays open after applying filters, and unchecking one hotspotlayer even though another hotspot layer is still checked [ujbolivar - [`e5b18d6`](https://github.com/eea/volto-arcgis-block/commit/e5b18d6477e6bc0dcc7f048835d7ce97483bc9d4)]
@@ -437,10 +446,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
437
446
  #### :hammer_and_wrench: Others
438
447
 
439
448
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
449
+ - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
440
450
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
441
451
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
442
452
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
443
453
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
454
+ - 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)]
455
+ - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
444
456
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
445
457
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
446
458
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -500,6 +512,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
500
512
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
501
513
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
502
514
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
515
+ - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
503
516
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
504
517
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
505
518
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -519,6 +532,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
519
532
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
520
533
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
521
534
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
535
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
522
536
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
523
537
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
524
538
 
@@ -613,6 +627,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
613
627
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
614
628
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
615
629
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
630
+ - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
616
631
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
617
632
 
618
633
  #### :hammer_and_wrench: Others
@@ -857,6 +872,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
857
872
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
858
873
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
859
874
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
875
+ - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
860
876
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
861
877
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
862
878
  - 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.109",
3
+ "version": "0.1.110",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -42,7 +42,8 @@
42
42
  "@fortawesome/react-fontawesome": "0.1.14",
43
43
  "@eeacms/volto-clms-utils": "*",
44
44
  "highcharts": "^9.3.2",
45
- "highcharts-react-official": "^3.1.0"
45
+ "highcharts-react-official": "^3.1.0",
46
+ "react-datepicker": "4.10.0"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@cypress/code-coverage": "^3.9.5",
@@ -1142,6 +1142,23 @@ class MenuWidget extends React.Component {
1142
1142
  )}
1143
1143
  </label>
1144
1144
  <div className="map-menu-icons">
1145
+ {!this.props.download && dataset.IsTimeSeries && (
1146
+ <Popup
1147
+ trigger={
1148
+ <span
1149
+ className="map-menu-icon"
1150
+ onClick={() => this.checkTimeLayer(dataset)}
1151
+ onKeyDown={() => this.checkTimeLayer(dataset)}
1152
+ tabIndex="0"
1153
+ role="button"
1154
+ >
1155
+ <FontAwesomeIcon icon={['far', 'clock']} />
1156
+ </span>
1157
+ }
1158
+ content={'Show time slider'}
1159
+ {...popupSettings}
1160
+ />
1161
+ )}
1145
1162
  {!this.props.download && (
1146
1163
  <a
1147
1164
  href={dataset.DatasetURL}
@@ -2578,6 +2595,25 @@ class MenuWidget extends React.Component {
2578
2595
  }
2579
2596
  }
2580
2597
 
2598
+ checkTimeLayer(dataset) {
2599
+ let id = dataset.DatasetId;
2600
+ let checkbox = document
2601
+ .querySelector('[datasetid="' + id + '"]')
2602
+ .querySelector('.map-dataset-checkbox input');
2603
+ if (!checkbox.checked) {
2604
+ checkbox.click();
2605
+ }
2606
+ document.getElementById('active_label').click();
2607
+ if (!document.querySelector('.timeslider-container')) {
2608
+ let layerId = document
2609
+ .querySelector('[datasetid="' + id + '"] input')
2610
+ .getAttribute('defcheck');
2611
+ setTimeout(() => {
2612
+ this.showTimeSlider(document.getElementById(layerId), false);
2613
+ }, 100);
2614
+ }
2615
+ }
2616
+
2581
2617
  /**
2582
2618
  * This method renders the component
2583
2619
  * @returns jsx
@@ -1,6 +1,8 @@
1
1
  import React, { createRef } from 'react';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
3
  import { loadModules } from 'esri-loader';
4
+ import DatePicker from 'react-datepicker';
5
+ import 'react-datepicker/dist/react-datepicker.css';
4
6
  var TimeSlider;
5
7
  var TimeExtent;
6
8
  var esriRequest;
@@ -199,7 +201,7 @@ class TimesliderWidget extends React.Component {
199
201
  loop: false,
200
202
  labelFormatFunction: (value, type, element, layout) => {
201
203
  if (!this.TimesliderWidget.fullTimeExtent) {
202
- element.innerText = 'loading...';
204
+ element.innerText = 'Loading...';
203
205
  return;
204
206
  }
205
207
  if (value) {
@@ -497,12 +499,10 @@ class TimesliderWidget extends React.Component {
497
499
  }
498
500
 
499
501
  applyDate() {
500
- let start = document.querySelector('#date_start').valueAsDate;
501
- start = start
502
- ? new Date(start)
503
- : this.TimesliderWidget.fullTimeExtent.start;
504
- let end = document.querySelector('#date_end').valueAsDate;
505
- end = end ? new Date(end) : this.TimesliderWidget.fullTimeExtent.end;
502
+ let start = this.state.inputStart;
503
+ start = start ? start : this.TimesliderWidget.fullTimeExtent.start;
504
+ let end = this.state.inputEnd;
505
+ end = end ? end : this.TimesliderWidget.fullTimeExtent.end;
506
506
  this.props.time.elem.setAttribute('time-start', new Date(start).getTime());
507
507
  this.props.time.elem.setAttribute('time-end', new Date(end).getTime());
508
508
  this.setState({
@@ -531,11 +531,11 @@ class TimesliderWidget extends React.Component {
531
531
  }
532
532
  }
533
533
 
534
- handleInputChange(e) {
535
- if (e.currentTarget.id === 'date_start') {
536
- this.setState({ inputStart: e.currentTarget.value });
537
- } else if (e.currentTarget.id === 'date_end') {
538
- this.setState({ inputEnd: e.currentTarget.value });
534
+ handleInputChange(e, input) {
535
+ if (input === 'date_start') {
536
+ this.setState({ inputStart: this.formatDate(e) });
537
+ } else if (input === 'date_end') {
538
+ this.setState({ inputEnd: this.formatDate(e) });
539
539
  }
540
540
  }
541
541
 
@@ -593,8 +593,11 @@ class TimesliderWidget extends React.Component {
593
593
  <FontAwesomeIcon icon={['fas', 'calendar']} />
594
594
  {this.state.dateStart && this.state.dateEnd ? (
595
595
  <>
596
- {this.state.dateStart.toLocaleDateString('en-gb')} -{' '}
597
- {this.state.dateEnd.toLocaleDateString('en-gb')}{' '}
596
+ {new Date(this.state.dateStart).toLocaleDateString(
597
+ 'en-gb',
598
+ )}{' '}
599
+ -{' '}
600
+ {new Date(this.state.dateEnd).toLocaleDateString('en-gb')}{' '}
598
601
  </>
599
602
  ) : (
600
603
  <>Select temporal interval to download</>
@@ -633,32 +636,46 @@ class TimesliderWidget extends React.Component {
633
636
  )}
634
637
  <div className="timeslider-calendar-row">
635
638
  <label htmlFor="start">From</label>
636
- <input
637
- type="date"
639
+ <DatePicker
638
640
  id="date_start"
639
- min={timeStart}
640
- max={
641
- Date.parse(inputEnd) < Date.parse(timeEnd)
642
- ? inputEnd
643
- : timeEnd
641
+ minDate={new Date(timeStart)}
642
+ maxDate={
643
+ new Date(
644
+ Date.parse(inputEnd) < Date.parse(timeEnd)
645
+ ? inputEnd
646
+ : timeEnd,
647
+ )
644
648
  }
645
- value={inputStart}
646
- onChange={(e) => this.handleInputChange(e)}
649
+ selected={new Date(inputStart)}
650
+ onChange={(e) => this.handleInputChange(e, 'date_start')}
651
+ includeDates={this.TimesliderWidget.stops.dates}
652
+ dateFormat="dd/MM/yyyy"
653
+ calendarStartDay={1}
654
+ showMonthDropdown
655
+ showYearDropdown
656
+ dropdownMode="select"
647
657
  />
648
658
  </div>
649
659
  <div className="timeslider-calendar-row">
650
660
  <label htmlFor="start">To</label>
651
- <input
652
- type="date"
661
+ <DatePicker
653
662
  id="date_end"
654
- min={
655
- Date.parse(inputStart) > Date.parse(timeStart)
656
- ? inputStart
657
- : timeStart
663
+ minDate={
664
+ new Date(
665
+ Date.parse(inputStart) > Date.parse(timeStart)
666
+ ? inputStart
667
+ : timeStart,
668
+ )
658
669
  }
659
- max={timeEnd}
660
- value={inputEnd}
661
- onChange={(e) => this.handleInputChange(e)}
670
+ maxDate={new Date(timeEnd)}
671
+ selected={new Date(inputEnd)}
672
+ onChange={(e) => this.handleInputChange(e, 'date_end')}
673
+ includeDates={this.TimesliderWidget.stops.dates}
674
+ dateFormat="dd/MM/yyyy"
675
+ calendarStartDay={1}
676
+ showMonthDropdown
677
+ showYearDropdown
678
+ dropdownMode="select"
662
679
  />
663
680
  </div>
664
681
  <button
@@ -926,8 +926,12 @@
926
926
  flex: 1;
927
927
  }
928
928
 
929
- .timeslider-calendar-row input {
929
+ .timeslider-calendar-row .react-datepicker-wrapper {
930
930
  flex: 3;
931
+ }
932
+
933
+ .timeslider-calendar-row .react-datepicker-wrapper input {
934
+ width: 100%;
931
935
  padding: 0.5rem;
932
936
  border: 1px solid #dadada;
933
937
  }
@@ -938,6 +942,48 @@
938
942
  font-size: 0.875rem;
939
943
  }
940
944
 
945
+ .react-datepicker__header {
946
+ background-color: #a0b128 !important;
947
+ }
948
+
949
+ .react-datepicker__header select {
950
+ border: none;
951
+ }
952
+
953
+ .react-datepicker__navigation {
954
+ width: auto !important;
955
+ }
956
+
957
+ .react-datepicker__navigation--previous {
958
+ margin-left: 0.5rem;
959
+ }
960
+
961
+ .react-datepicker__navigation--next {
962
+ margin-right: 0.5rem;
963
+ }
964
+
965
+ .react-datepicker__navigation-icon::before {
966
+ border-color: white !important;
967
+ }
968
+
969
+ .react-datepicker__header__dropdown {
970
+ margin-top: 0.25rem;
971
+ }
972
+
973
+ .react-datepicker__day--selected {
974
+ background-color: #a0b128 !important;
975
+ color: white !important;
976
+ }
977
+
978
+ .react-datepicker__day--keyboard-selected {
979
+ background-color: #a0b12833 !important;
980
+ }
981
+
982
+ .react-datepicker__current-month,
983
+ .react-datepicker__day-name {
984
+ color: white !important;
985
+ }
986
+
941
987
  /* Scale */
942
988
  .esri-scale-bar {
943
989
  z-index: 0;