@eeacms/volto-arcgis-block 0.1.22 → 0.1.26

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,8 +4,71 @@ 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.26](https://github.com/eea/volto-arcgis-block/compare/0.1.25...0.1.26)
8
+
9
+ - Bug fixing [`#88`](https://github.com/eea/volto-arcgis-block/pull/88)
10
+ - Bugs n improvements [`#87`](https://github.com/eea/volto-arcgis-block/pull/87)
11
+ - Develop [`#86`](https://github.com/eea/volto-arcgis-block/pull/86)
12
+ - Time slider drag/drop [`#85`](https://github.com/eea/volto-arcgis-block/pull/85)
13
+ - Use cases [`#84`](https://github.com/eea/volto-arcgis-block/pull/84)
14
+ - Develop [`#81`](https://github.com/eea/volto-arcgis-block/pull/81)
15
+ - Downloadable dataset [`c48eea9`](https://github.com/eea/volto-arcgis-block/commit/c48eea93b0f71134f9aa8fee1f5d6b4cf7e1368b)
16
+ - add flattenToAppURL to send the correct url to the MapViewerConfig action [`ca5f684`](https://github.com/eea/volto-arcgis-block/commit/ca5f684ae683e0df249d3fab3534f579583f03a8)
17
+ - ESLint fix [`7f43112`](https://github.com/eea/volto-arcgis-block/commit/7f4311224483fb599e7cecfe65096166ed5f2026)
18
+ - Use case highlight [`2279a5a`](https://github.com/eea/volto-arcgis-block/commit/2279a5ad669172545588e9030e3cf49ca4e30dfa)
19
+
20
+ #### [0.1.25](https://github.com/eea/volto-arcgis-block/compare/0.1.24...0.1.25)
21
+
22
+ > 5 January 2022
23
+
24
+ - Develop [`#83`](https://github.com/eea/volto-arcgis-block/pull/83)
25
+ - Bugs n improvements [`#82`](https://github.com/eea/volto-arcgis-block/pull/82)
26
+ - ESLint fix [`c129348`](https://github.com/eea/volto-arcgis-block/commit/c129348ee3886e0419029dd2bfe835c28878444c)
27
+ - Filter by product and dataset [`c89711a`](https://github.com/eea/volto-arcgis-block/commit/c89711acf4f46c8426c7e34add2baf4debe67697)
28
+ - ESLint fix [`406842a`](https://github.com/eea/volto-arcgis-block/commit/406842a54f1964bf2b4b0e709719028a5a47a903)
29
+ - Timeslider bug fixing [`c7a8345`](https://github.com/eea/volto-arcgis-block/commit/c7a834538a54a8c48e2e34259d3d733a1194007a)
30
+
31
+ #### [0.1.24](https://github.com/eea/volto-arcgis-block/compare/0.1.23...0.1.24)
32
+
33
+ > 21 December 2021
34
+
35
+ - Develop [`#77`](https://github.com/eea/volto-arcgis-block/pull/77)
36
+ - Bugs n improvements [`#80`](https://github.com/eea/volto-arcgis-block/pull/80)
37
+ - The area array to a json object and added a unique_id to the cart [`#79`](https://github.com/eea/volto-arcgis-block/pull/79)
38
+ - Remove Global from legend [`#76`](https://github.com/eea/volto-arcgis-block/pull/76)
39
+ - ESLint fix [`974d62b`](https://github.com/eea/volto-arcgis-block/commit/974d62bd5b66025e12fa85dffcd0d1a5ae04cba4)
40
+ - ESLint fix [`5c4b0d7`](https://github.com/eea/volto-arcgis-block/commit/5c4b0d76de50edd85809c35449f2fb364a9e9312)
41
+ - ESLint fix [`d57d144`](https://github.com/eea/volto-arcgis-block/commit/d57d144fd0e3dbbbbc95195f289d50e6c4b03375)
42
+ - ESLint fix [`9eb0a0c`](https://github.com/eea/volto-arcgis-block/commit/9eb0a0c17d018ac1b25bde422ac149b46b146ff4)
43
+ - ESLint fix [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)
44
+ - Pixel info [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)
45
+ - NUTS bug fix [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)
46
+
47
+ #### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23)
48
+
49
+ > 17 December 2021
50
+
51
+ - Develop [`#75`](https://github.com/eea/volto-arcgis-block/pull/75)
52
+ - Use cases region highlight [`#71`](https://github.com/eea/volto-arcgis-block/pull/71)
53
+ - Bugs n improvements [`#74`](https://github.com/eea/volto-arcgis-block/pull/74)
54
+ - Add NUTS 2 in the Map viewer [`#72`](https://github.com/eea/volto-arcgis-block/pull/72)
55
+ - Mapviewer menu widget correction [`#73`](https://github.com/eea/volto-arcgis-block/pull/73)
56
+ - Update highlight service [`fbec327`](https://github.com/eea/volto-arcgis-block/commit/fbec3279c44900ec1100affed350a517133997fb)
57
+ - ESLint fix [`4a695e3`](https://github.com/eea/volto-arcgis-block/commit/4a695e39ab3d276483ad2922e7ee2b446826db2c)
58
+ - ESLint fix [`62e6a10`](https://github.com/eea/volto-arcgis-block/commit/62e6a1034a6317a0a45f682248ef1c1bc12081a6)
59
+ - NUTS layer order [`4942c25`](https://github.com/eea/volto-arcgis-block/commit/4942c25ef0fe7c7f239015f8d14910b3ac2238fe)
60
+ - Remove debugger [`bcbb107`](https://github.com/eea/volto-arcgis-block/commit/bcbb1076f80fe773ff3dd2ffb5dc038e5c8f4733)
61
+ - Update layers array key values to unique IDs [`066951d`](https://github.com/eea/volto-arcgis-block/commit/066951d571fc77a96b98cc0650d36d1a22665e49)
62
+ - Remove unused variable [`830349f`](https://github.com/eea/volto-arcgis-block/commit/830349f17e8549f8883acd805302ecb65d35dec4)
63
+ - Add individual region highlight [`6e4cb62`](https://github.com/eea/volto-arcgis-block/commit/6e4cb62d26a493da83e53a10bba8f64ea9df80e3)
64
+ - Update LegendWidget.jsx [`3273d53`](https://github.com/eea/volto-arcgis-block/commit/3273d53183ef17328ddfce7913910671eb5a43a9)
65
+ - Change legend text [`09eb6e0`](https://github.com/eea/volto-arcgis-block/commit/09eb6e08e4199cab914d6300c62af633876579cb)
66
+
7
67
  #### [0.1.22](https://github.com/eea/volto-arcgis-block/compare/0.1.21...0.1.22)
8
68
 
69
+ > 10 December 2021
70
+
71
+ - Develop [`#70`](https://github.com/eea/volto-arcgis-block/pull/70)
9
72
  - ESLint fix [`#69`](https://github.com/eea/volto-arcgis-block/pull/69)
10
73
  - Bugs n improvements [`#68`](https://github.com/eea/volto-arcgis-block/pull/68)
11
74
  - Change services URLs to discomap [`ed4dc62`](https://github.com/eea/volto-arcgis-block/commit/ed4dc62df3af66a71acbe981b3e74a4a621ef2c4)
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"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater"
8
8
  DEPENDENCIES = ""
9
9
  }
10
10
 
@@ -31,8 +31,8 @@ pipeline {
31
31
  when {
32
32
  allOf {
33
33
  environment name: 'CHANGE_ID', value: ''
34
- not { branch 'master' }
35
34
  not { changelog '.*^Automated release [0-9\\.]+$' }
35
+ not { branch 'master' }
36
36
  }
37
37
  }
38
38
  steps {
@@ -63,7 +63,10 @@ pipeline {
63
63
  when {
64
64
  allOf {
65
65
  environment name: 'CHANGE_ID', value: ''
66
- not { changelog '.*^Automated release [0-9\\.]+$' }
66
+ anyOf {
67
+ not { changelog '.*^Automated release [0-9\\.]+$' }
68
+ branch 'master'
69
+ }
67
70
  }
68
71
  }
69
72
  steps {
@@ -108,7 +111,10 @@ pipeline {
108
111
  when {
109
112
  allOf {
110
113
  environment name: 'CHANGE_ID', value: ''
111
- not { changelog '.*^Automated release [0-9\\.]+$' }
114
+ anyOf {
115
+ not { changelog '.*^Automated release [0-9\\.]+$' }
116
+ branch 'master'
117
+ }
112
118
  }
113
119
  }
114
120
  steps {
@@ -118,7 +124,7 @@ pipeline {
118
124
  node(label: 'docker') {
119
125
  script {
120
126
  try {
121
- sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
127
+ sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
122
128
  sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=test plone/volto-addon-ci cypress'''
123
129
  } finally {
124
130
  try {
@@ -136,7 +142,8 @@ pipeline {
136
142
  reportName: 'CypressCoverage',
137
143
  reportTitles: 'Integration Tests Code Coverage'])
138
144
  }
139
- archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
145
+ sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
146
+ archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
140
147
  stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
141
148
  }
142
149
  finally {
@@ -159,12 +166,16 @@ pipeline {
159
166
 
160
167
  stage('Report to SonarQube') {
161
168
  when {
169
+ allOf {
162
170
  environment name: 'CHANGE_ID', value: ''
163
171
  anyOf {
164
172
  branch 'master'
165
- branch 'develop'
173
+ allOf {
174
+ branch 'develop'
175
+ not { changelog '.*^Automated release [0-9\\.]+$' }
176
+ }
166
177
  }
167
- not { changelog '.*^Automated release [0-9\\.]+$' }
178
+ }
168
179
  }
169
180
  steps {
170
181
  node(label: 'swarm') {
package/README.md CHANGED
@@ -1,7 +1,18 @@
1
1
  # [WIP] Volto Arcgis Block
2
+
2
3
  [![Releases](https://img.shields.io/github/v/release/eea/volto-arcgis-block)](https://github.com/eea/volto-arcgis-block/releases)
4
+
3
5
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-arcgis-block%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-arcgis-block/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-master)
10
+
4
11
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-arcgis-block%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-arcgis-block/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-arcgis-block-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-arcgis-block-develop)
5
16
 
6
17
  ## ArcGIS Map integration for Volto blocks
7
18
  ****This product is in development, at this time it is not recommended to use it.***
@@ -64,4 +75,84 @@ const customBlocks = (config) => ({
64
75
  "@eeacms/volto-clms-theme"
65
76
  ],
66
77
  ````
67
- ![Style example volto-arcgis-block](docs/styles_example.gif)
78
+ ![Style example volto-arcgis-block](docs/styles_example.gif)
79
+
80
+ ## Release
81
+
82
+ ### Automatic release using Jenkins
83
+
84
+ * 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.
85
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
86
+ * 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.
87
+ * 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.
88
+ * 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.
89
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
90
+ * 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.
91
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
92
+
93
+ ### Manual release from the develop branch ( beta release )
94
+
95
+ #### Installation and configuration of release-it
96
+
97
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
98
+
99
+ ```
100
+ npm install -g release-it
101
+ ```
102
+
103
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
104
+
105
+ Release-it is a tool that automates 4 important steps in the release process:
106
+
107
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
108
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
109
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
110
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
111
+
112
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
113
+
114
+ ```
115
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
116
+ ```
117
+
118
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
119
+
120
+ ```
121
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
122
+ ```
123
+
124
+ #### Using release-it tool
125
+
126
+ There are 3 yarn scripts that can be run to do the release
127
+
128
+ ##### yarn release-beta
129
+
130
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
131
+
132
+ ```
133
+ ? Select increment (next version):
134
+ ❯ prepatch (0.1.1-beta.0)
135
+ preminor (0.2.0-beta.0)
136
+ premajor (1.0.0-beta.0)
137
+ Other, please specify...
138
+ ```
139
+
140
+ ##### yarn release-major-beta
141
+
142
+ Same as `yarn release-beta`, but with premajor version pre-selected.
143
+
144
+ ##### yarn release
145
+
146
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
147
+
148
+ #### Important notes
149
+
150
+ > 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.
151
+
152
+ > 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).
153
+
154
+
155
+ ## How to contribute
156
+
157
+ See [DEVELOP.md](https://github.com/eea/volto-arcgis-block/blob/master/DEVELOP.md).
158
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.22",
3
+ "version": "0.1.26",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -21,6 +21,8 @@
21
21
  "scripts": {
22
22
  "i18n": "NODE_ENV=production node src/i18n.js",
23
23
  "release": "release-it",
24
+ "release-major-beta": "release-it major --preRelease=beta",
25
+ "release-beta": "release-it --preRelease=beta",
24
26
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
25
27
  "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
26
28
  "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
@@ -38,7 +40,9 @@
38
40
  "@fortawesome/fontawesome-svg-core": "1.2.35",
39
41
  "@fortawesome/free-solid-svg-icons": "5.15.3",
40
42
  "@fortawesome/react-fontawesome": "0.1.14",
41
- "@eeacms/volto-clms-utils": "0.1.1"
43
+ "@eeacms/volto-clms-utils": "0.1.1",
44
+ "highcharts": "^9.3.2",
45
+ "highcharts-react-official": "^3.1.0"
42
46
  },
43
47
  "devDependencies": {
44
48
  "@cypress/code-coverage": "^3.9.5",
@@ -1,7 +1,4 @@
1
1
  import React, { createRef } from 'react';
2
- //import "@arcgis/core/assets/esri/css/main.css";
3
- //import "./css/ArcgisMap.css";
4
- //import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
2
  import { loadModules } from 'esri-loader';
6
3
 
7
4
  var Graphic,
@@ -111,6 +108,9 @@ class AreaWidget extends React.Component {
111
108
  nuts1handler(e) {
112
109
  this.loadNutsService(e.target.value, 1);
113
110
  }
111
+ nuts2handler(e) {
112
+ this.loadNutsService(e.target.value, 2);
113
+ }
114
114
  nuts3handler(e) {
115
115
  this.loadNutsService(e.target.value, 3);
116
116
  }
@@ -127,6 +127,18 @@ class AreaWidget extends React.Component {
127
127
  definitionExpression: 'LEVL_CODE=' + level,
128
128
  });
129
129
  this.nutsGroupLayer.add(layer);
130
+ let index = this.getHighestIndex();
131
+ this.props.map.reorder(this.nutsGroupLayer, index + 1);
132
+ }
133
+ getHighestIndex() {
134
+ let index = 0;
135
+ document.querySelectorAll('.active-layer').forEach((layer) => {
136
+ let value = parseInt(layer.getAttribute('layer-order'));
137
+ if (value > index) {
138
+ index = value;
139
+ }
140
+ });
141
+ return index;
130
142
  }
131
143
  rectanglehandler() {
132
144
  this.clearWidget();
@@ -187,33 +199,43 @@ class AreaWidget extends React.Component {
187
199
  });
188
200
  this.props.map.add(this.nutsGroupLayer);
189
201
  this.props.view.on('click', (event) => {
190
- this.props.view.hitTest(event).then((response) => {
191
- if (response.results.length > 0) {
192
- let graphic = response.results.filter((result) => {
193
- let layer;
194
- if ('nuts0 nuts1 nuts3'.includes(result.graphic.layer.id)) {
195
- layer = result.graphic;
196
- }
197
- return layer;
198
- })[0].graphic;
199
- if (graphic) {
200
- let geometry = graphic.geometry;
201
- if (geometry.type === 'polygon') {
202
- let nuts = graphic.attributes.NUTS_ID;
203
- this.props.updateArea(nuts);
204
- let symbol = new SimpleFillSymbol(
205
- 'solid',
206
- new SimpleLineSymbol('solid', new Color([232, 104, 80]), 2),
207
- new Color([232, 104, 80, 0.25]),
208
- );
209
- let highlight = new Graphic(geometry, symbol);
210
- this.props.view.graphics.removeAll();
211
- this.props.view.graphics.add(highlight);
202
+ if (
203
+ (this.props.mapViewer.activeWidget === this || this.props.download) &&
204
+ (this.props.mapViewer.activeWidget
205
+ ? !this.props.mapViewer.activeWidget.container.current.classList.contains(
206
+ 'info-container',
207
+ )
208
+ : true)
209
+ ) {
210
+ this.props.view.hitTest(event).then((response) => {
211
+ if (response.results.length > 0) {
212
+ let graphic = response.results.filter((result) => {
213
+ let layer;
214
+ if ('nuts0 nuts1 nuts2 nuts3'.includes(result.graphic.layer.id)) {
215
+ layer = result.graphic;
216
+ }
217
+ return layer;
218
+ })[0].graphic;
219
+ if (graphic) {
220
+ let geometry = graphic.geometry;
221
+ if (geometry.type === 'polygon') {
222
+ let nuts = graphic.attributes.NUTS_ID;
223
+ this.props.updateArea(nuts);
224
+ let symbol = new SimpleFillSymbol(
225
+ 'solid',
226
+ new SimpleLineSymbol('solid', new Color([232, 104, 80]), 2),
227
+ new Color([232, 104, 80, 0.25]),
228
+ );
229
+ let highlight = new Graphic(geometry, symbol);
230
+ this.props.view.graphics.removeAll();
231
+ this.props.view.graphics.add(highlight);
232
+ }
212
233
  }
213
234
  }
214
- }
215
- });
235
+ });
236
+ }
216
237
  });
238
+
217
239
  this.props.download
218
240
  ? this.props.view.ui.add(this.container)
219
241
  : this.props.view.ui.add(this.container.current, 'top-right');
@@ -284,6 +306,22 @@ class AreaWidget extends React.Component {
284
306
  <span>NUTS 1</span>
285
307
  </label>
286
308
  </div>
309
+ <div className="ccl-form-group">
310
+ <input
311
+ type="radio"
312
+ id="download_area_select_nuts2"
313
+ name="downloadAreaSelect"
314
+ value="nuts2"
315
+ className="ccl-checkbox ccl-required ccl-form-check-input"
316
+ onClick={this.nuts2handler.bind(this)}
317
+ ></input>
318
+ <label
319
+ className="ccl-form-radio-label"
320
+ htmlFor="download_area_select_nuts2"
321
+ >
322
+ <span>NUTS 2</span>
323
+ </label>
324
+ </div>
287
325
  <div className="ccl-form-group">
288
326
  <input
289
327
  type="radio"
@@ -15,7 +15,7 @@ class BasemapWidget extends React.Component {
15
15
  //not be showing the basemap panel
16
16
  this.state = { showMapMenu: false };
17
17
  this.menuClass =
18
- 'esri-icon-basemap esri-widget--button esri-widget esri-interactive esri-icon-basemap';
18
+ 'esri-icon-basemap esri-widget--button esri-widget esri-interactive';
19
19
  this.loadFirst = true;
20
20
  }
21
21