@eeacms/volto-arcgis-block 0.1.215 → 0.1.216

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,20 @@ 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
8
+
9
+ #### :house: Internal changes
10
+
11
+ - chore: husky, lint-staged use fixed versions [valentinab25 - [`693d7a8`](https://github.com/eea/volto-arcgis-block/commit/693d7a8ca3df506bb0dd45bb8385f1c0c06412ab)]
12
+ - chore: update docs, fix stylelint overrides [valentinab25 - [`88b048a`](https://github.com/eea/volto-arcgis-block/commit/88b048ac11bfc14559b0400e6b800ece6e403f55)]
13
+ - chore: update docs, fix stylelint overrides [valentinab25 - [`5e5149f`](https://github.com/eea/volto-arcgis-block/commit/5e5149f614c02a8bba5f4f14e47409851bb18a0b)]
14
+ - chore:volto 16 in tests, update docs, fix stylint overrides [valentinab25 - [`d8237c2`](https://github.com/eea/volto-arcgis-block/commit/d8237c2041848386cd33b5676edf8c8131f6d99a)]
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - hot activeLayersToHotspotData reactivated [masanchez85 - [`24537c0`](https://github.com/eea/volto-arcgis-block/commit/24537c01f62c2b6e8299dbfc2ce339995ec0df70)]
19
+ - CLMS-2704, CLMS-2684 (rollback) [masanchez85 - [`9abc9be`](https://github.com/eea/volto-arcgis-block/commit/9abc9be9d25ba20f683f275742138dbc51ec7baa)]
20
+ - Update README.md [ana-oprea - [`bd59982`](https://github.com/eea/volto-arcgis-block/commit/bd5998236e9f2cb8cb6b05e397bed10cbbd3e597)]
7
21
  ### [0.1.215](https://github.com/eea/volto-arcgis-block/compare/0.1.214...0.1.215) - 9 October 2023
8
22
 
9
23
  ### [0.1.214](https://github.com/eea/volto-arcgis-block/compare/0.1.213...0.1.214) - 5 October 2023
@@ -992,13 +1006,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
992
1006
  #### :hammer_and_wrench: Others
993
1007
 
994
1008
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
995
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
996
1009
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
997
1010
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
998
1011
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
999
1012
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
1000
- - 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)]
1001
- - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
1002
1013
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
1003
1014
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
1004
1015
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -1058,7 +1069,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1058
1069
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
1059
1070
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
1060
1071
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
1061
- - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
1062
1072
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
1063
1073
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
1064
1074
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -1078,7 +1088,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1078
1088
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
1079
1089
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
1080
1090
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
1081
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
1082
1091
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
1083
1092
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
1084
1093
 
@@ -1173,7 +1182,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1173
1182
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
1174
1183
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
1175
1184
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
1176
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
1177
1185
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
1178
1186
 
1179
1187
  #### :hammer_and_wrench: Others
@@ -1418,7 +1426,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1418
1426
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
1419
1427
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
1420
1428
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
1421
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
1422
1429
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
1423
1430
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
1424
1431
  - cleanup of unused code [bipoza - [`b167677`](https://github.com/eea/volto-arcgis-block/commit/b1676771f637f056cad50cb0bc186f2ea79e8517)]
package/DEVELOP.md CHANGED
@@ -16,12 +16,14 @@
16
16
 
17
17
  1. Go to http://localhost:3000
18
18
 
19
- 1. Happy hacking!
19
+ 1. Initialize git hooks
20
20
 
21
21
  ```Bash
22
- cd src/addons/volto-arcgis-block/
22
+ yarn prepare
23
23
  ```
24
24
 
25
+ 1. Happy hacking!
26
+
25
27
  ### Or add @eeacms/volto-arcgis-block to your Volto project
26
28
 
27
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
@@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
48
50
 
49
51
  1. Install
50
52
 
51
- yarn develop
53
+ make develop
52
54
  yarn
53
55
 
54
56
  1. Start backend
55
57
 
56
- docker pull plone
57
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
58
59
 
59
60
  ...wait for backend to setup and start - `Ready to handle requests`:
60
61
 
61
- docker logs -f plone
62
-
63
62
  ...you can also check http://localhost:8080/Plone
64
63
 
65
64
  1. Start frontend
package/Jenkinsfile CHANGED
@@ -42,21 +42,21 @@ pipeline {
42
42
  "ES lint": {
43
43
  node(label: 'docker') {
44
44
  sh '''docker pull plone/volto-addon-ci:15.x'''
45
- sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci:15.x eslint'''
45
+ sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:15.x eslint'''
46
46
  }
47
47
  },
48
48
 
49
49
  "Style lint": {
50
50
  node(label: 'docker') {
51
51
  sh '''docker pull plone/volto-addon-ci:15.x'''
52
- sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
52
+ sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci stylelint'''
53
53
  }
54
54
  },
55
55
 
56
56
  "Prettier": {
57
57
  node(label: 'docker') {
58
58
  sh '''docker pull plone/volto-addon-ci:15.x'''
59
- sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
59
+ sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci prettier'''
60
60
  }
61
61
  }
62
62
  )
@@ -87,7 +87,7 @@ pipeline {
87
87
  script {
88
88
  try {
89
89
  sh '''docker pull plone/volto-addon-ci:15.x'''
90
- sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e VOLTO=$VOLTO -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci:15.x'''
90
+ sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e VOLTO=$VOLTO -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:15.x'''
91
91
  sh '''rm -rf xunit-reports'''
92
92
  sh '''mkdir -p xunit-reports'''
93
93
  sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
package/Makefile CHANGED
@@ -97,12 +97,12 @@ stylelint: ## Stylelint
97
97
 
98
98
  .PHONY: stylelint-overrides
99
99
  stylelint-overrides:
100
- $(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
100
+ $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
101
101
 
102
102
  .PHONY: stylelint-fix
103
103
  stylelint-fix: ## Fix stylelint
104
104
  $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
105
- $(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
105
+ $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
106
106
 
107
107
  .PHONY: prettier
108
108
  prettier: ## Prettier
package/README.md CHANGED
@@ -82,7 +82,7 @@ const customBlocks = (config) => ({
82
82
  "@eeacms/volto-clms-theme"
83
83
  ],
84
84
  ````
85
- ![Style example volto-arcgis-block](docs/styles_example.gif)
85
+ ![Style example volto-arcgis-block](https://raw.githubusercontent.com/eea/volto-arcgis-block/master/docs/styles_example.gif)
86
86
 
87
87
  ## Release
88
88
 
package/RELEASE.md ADDED
@@ -0,0 +1,74 @@
1
+ ## Release
2
+
3
+ ### Automatic release using Jenkins
4
+
5
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
6
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
7
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
8
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
9
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
10
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
11
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
12
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
13
+
14
+ ### Manual release from the develop branch ( beta release )
15
+
16
+ #### Installation and configuration of release-it
17
+
18
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
19
+
20
+ ```
21
+ npm install -g release-it
22
+ ```
23
+
24
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
+
26
+ Release-it is a tool that automates 4 important steps in the release process:
27
+
28
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
29
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
30
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
+
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
+
35
+ ```
36
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
+ ```
38
+
39
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
+
41
+ ```
42
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
+ ```
44
+
45
+ #### Using release-it tool
46
+
47
+ There are 3 yarn scripts that can be run to do the release
48
+
49
+ ##### yarn release-beta
50
+
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
+
53
+ ```
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
+ ```
60
+
61
+ ##### yarn release-major-beta
62
+
63
+ Same as `yarn release-beta`, but with premajor version pre-selected.
64
+
65
+ ##### yarn release
66
+
67
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
+
69
+ #### Important notes
70
+
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
+
73
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.215",
3
+ "version": "0.1.216",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -71,7 +71,7 @@
71
71
  "@cypress/code-coverage": "^3.9.5",
72
72
  "babel-plugin-transform-class-properties": "^6.24.1",
73
73
  "md5": "^2.3.0",
74
- "husky": "*",
74
+ "husky": "^8.0.3",
75
75
  "lint-staged": "13.1.4"
76
76
  }
77
77
  }
@@ -233,8 +233,24 @@ class AreaWidget extends React.Component {
233
233
  });
234
234
  }
235
235
  if (this.props.download) {
236
- document.querySelector('.drawRectanglePopup-block').style.display =
237
- 'none';
236
+ if (extentGraphic && this.checkExtent(extentGraphic.geometry)) {
237
+ let popupToUpdate = document.querySelector(
238
+ '.drawRectanglePopup-block',
239
+ );
240
+ popupToUpdate.style.display = 'block';
241
+ popupToUpdate.innerHTML =
242
+ '<div class="drawRectanglePopup-content">' +
243
+ '<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
244
+ '<div class="drawRectanglePopup-text">' +
245
+ '<a style="color: black; cursor: pointer" href="https://land.copernicus.eu/en/how-to-guides/how-to-download-spatial-data/how-to-download-m2m" target="_blank" rel="noreferrer">To download the full dataset consult the "How to download M2M" How to guide.</a>' +
246
+ '</div>' +
247
+ '</div>';
248
+ } else {
249
+ let popupToUpdate = document.querySelector(
250
+ '.drawRectanglePopup-block',
251
+ );
252
+ popupToUpdate.style.display = 'none';
253
+ }
238
254
  }
239
255
  } else if (e.action === 'update') {
240
256
  if (extentGraphic) this.props.view.graphics.remove(extentGraphic);
@@ -260,6 +276,26 @@ class AreaWidget extends React.Component {
260
276
  infoPopupType: 'download',
261
277
  });
262
278
  }
279
+ if (this.props.download) {
280
+ if (extentGraphic && this.checkExtent(extentGraphic.geometry)) {
281
+ let popupToUpdate = document.querySelector(
282
+ '.drawRectanglePopup-block',
283
+ );
284
+ popupToUpdate.style.display = 'block';
285
+ popupToUpdate.innerHTML =
286
+ '<div class="drawRectanglePopup-content">' +
287
+ '<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
288
+ '<div class="drawRectanglePopup-text">' +
289
+ '<a style="color: black; cursor: pointer" href="https://land.copernicus.eu/en/how-to-guides/how-to-download-spatial-data/how-to-download-m2m" target="_blank" rel="noreferrer">To download the full dataset consult the "How to download M2M" How to guide.</a>' +
290
+ '</div>' +
291
+ '</div>';
292
+ } else {
293
+ let popupToUpdate = document.querySelector(
294
+ '.drawRectanglePopup-block',
295
+ );
296
+ popupToUpdate.style.display = 'none';
297
+ }
298
+ }
263
299
  this.props.updateArea({
264
300
  origin: { x: origin.longitude, y: origin.latitude },
265
301
  end: { x: p.longitude, y: p.latitude },
@@ -286,8 +322,13 @@ class AreaWidget extends React.Component {
286
322
  infoPopupType: 'area',
287
323
  });
288
324
  if (this.props.download) {
289
- document.querySelector('.drawRectanglePopup-block').style.display =
290
- 'block';
325
+ let popup = document.querySelector('.drawRectanglePopup-block');
326
+ popup.innerHTML =
327
+ '<div class="drawRectanglePopup-content">' +
328
+ '<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
329
+ '<div class="drawRectanglePopup-text">Select or draw an area of interest in the map to continue</div>' +
330
+ '</div>';
331
+ popup.style.display = 'block';
291
332
  }
292
333
  document.querySelector('.esri-attribution__powered-by').style.display =
293
334
  'none';
@@ -261,6 +261,7 @@ class MenuWidget extends React.Component {
261
261
  this.extentInitiated = false;
262
262
  this.prepareHotspotLayers = this.prepareHotspotLayers.bind(this);
263
263
  this.activeLayersToHotspotData = this.activeLayersToHotspotData.bind(this);
264
+ this.getLimitScale = this.getLimitScale.bind(this);
264
265
  // add zoomend listener to map to show/hide zoom in message
265
266
  this.view.watch('stationary', (isStationary) => {
266
267
  let snowAndIceInSessionStorage = sessionStorage.getItem('snowAndIce');
@@ -318,7 +319,8 @@ class MenuWidget extends React.Component {
318
319
  }
319
320
  }
320
321
  if (!this.visibleLayers) this.visibleLayers = {};
321
- this.handleRasterVectorLegend();
322
+ this.view.watch('scale', (newValue) => {});
323
+ //this.handleRasterVectorLegend();
322
324
  }
323
325
  });
324
326
 
@@ -1729,39 +1731,75 @@ class MenuWidget extends React.Component {
1729
1731
  this.setState({});
1730
1732
  }
1731
1733
 
1734
+ /**
1735
+ * Method to check resourceInfo object from layers and check max or min scale
1736
+ */
1737
+ getLimitScale(key, layerTitle) {
1738
+ //CLMS-2684
1739
+ const layerTitleToCompare = layerTitle.includes(' -')
1740
+ ? layerTitle.replace(' -', '').trim()
1741
+ : layerTitle.includes('raster')
1742
+ ? layerTitle
1743
+ : layerTitle;
1744
+ let scale;
1745
+ //let layerTitleToCompare = layerTitle;
1746
+ if (this.layers[key].resourceInfo) {
1747
+ this.layers[key].resourceInfo.layers.forEach((sublayer) => {
1748
+ if (
1749
+ sublayer.title.includes(layerTitleToCompare) &&
1750
+ layerTitle.includes('raster')
1751
+ ) {
1752
+ scale = sublayer.maxScale;
1753
+ } else if (
1754
+ sublayer.title.includes(layerTitleToCompare) &&
1755
+ layerTitle.includes('vector')
1756
+ ) {
1757
+ scale = sublayer.minScale;
1758
+ }
1759
+ });
1760
+ }
1761
+ return scale;
1762
+ }
1763
+
1732
1764
  /**
1733
1765
  * Method to show/hide a legend if the layer is active or not in the view
1734
1766
  */
1735
1767
  handleRasterVectorLegend() {
1736
- let zoom = this.view.get('zoom');
1737
- Object.keys(this.activeLayersJSON).forEach((key) => {
1768
+ //CLMS-2684
1769
+ //let zoom = this.view.get('zoom');
1770
+ /* let scale = this.view.scale;
1771
+ Object.keys(this.activeLayersJSON).forEach((key) => {
1738
1772
  let activeLayer = this.activeLayersJSON[key];
1739
1773
  let layerTitle = activeLayer.props.children[0].props.children;
1740
1774
  if (layerTitle.includes('raster')) {
1741
- if (zoom <= 11) {
1775
+ if (scale > this.getLimitScale(key, layerTitle)) {
1742
1776
  if (
1743
1777
  this.visibleLayers &&
1744
1778
  this.visibleLayers[key] &&
1745
1779
  this.visibleLayers[key][1] === 'eye'
1746
- )
1780
+ ){
1747
1781
  this.layers[key].visible = true;
1782
+ }
1748
1783
  } else {
1784
+ //debugger
1749
1785
  this.layers[key].visible = false;
1750
1786
  }
1751
1787
  } else if (layerTitle.includes('vector')) {
1752
- if (zoom >= 12) {
1788
+ if (scale < this.getLimitScale(key, layerTitle)) {
1753
1789
  if (
1754
1790
  this.visibleLayers &&
1755
1791
  this.visibleLayers[key] &&
1756
1792
  this.visibleLayers[key][1] === 'eye'
1757
- )
1793
+ ){
1758
1794
  this.layers[key].visible = true;
1795
+ }
1759
1796
  } else {
1797
+ //debugger
1760
1798
  this.layers[key].visible = false;
1761
1799
  }
1762
1800
  }
1763
1801
  this.setState({});
1764
- });
1802
+ }); */
1765
1803
  }
1766
1804
 
1767
1805
  async toggleLayer(elem) {
@@ -1772,7 +1810,6 @@ class MenuWidget extends React.Component {
1772
1810
  .getElementById(parentId)
1773
1811
  .closest('.map-menu-product-dropdown')
1774
1812
  .getAttribute('productid');
1775
-
1776
1813
  let group = this.getGroup(elem);
1777
1814
  if (elem.checked) {
1778
1815
  this.props.loadingHandler(true);