@eeacms/volto-widget-geolocation 5.1.6 → 5.2.0
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/.eslintrc.js +65 -0
- package/CHANGELOG.md +28 -24
- package/cypress.config.js +3 -3
- package/jest-addon.config.js +16 -4
- package/jest.setup.js +65 -0
- package/package.json +2 -1
- package/src/components/manage/Widgets/GeolocationWidget.jsx +19 -25
- package/src/components/manage/Widgets/ListResults.jsx +1 -1
- package/src/components/manage/Widgets/public.less +1 -2
- package/.project.eslintrc.js +0 -48
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const projectRootPath = fs.realpathSync(__dirname + '/../../../');
|
|
4
|
+
|
|
5
|
+
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
6
|
+
let configFile;
|
|
7
|
+
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
|
|
8
|
+
configFile = `${projectRootPath}/tsconfig.json`;
|
|
9
|
+
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
|
|
10
|
+
configFile = `${projectRootPath}/jsconfig.json`;
|
|
11
|
+
|
|
12
|
+
if (configFile) {
|
|
13
|
+
const jsConfig = require(configFile).compilerOptions;
|
|
14
|
+
const pathsConfig = jsConfig.paths;
|
|
15
|
+
if (pathsConfig['@plone/volto'])
|
|
16
|
+
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
20
|
+
const reg = new AddonConfigurationRegistry(projectRootPath);
|
|
21
|
+
|
|
22
|
+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
+
const addonAliases = Object.keys(reg.packages).map((o) => [
|
|
24
|
+
o,
|
|
25
|
+
reg.packages[o].modulePath,
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
const addonExtenders = reg.getEslintExtenders().map((m) => require(m));
|
|
29
|
+
|
|
30
|
+
const defaultConfig = {
|
|
31
|
+
extends: `${voltoPath}/.eslintrc`,
|
|
32
|
+
settings: {
|
|
33
|
+
'import/resolver': {
|
|
34
|
+
alias: {
|
|
35
|
+
map: [
|
|
36
|
+
['@plone/volto', '@plone/volto/src'],
|
|
37
|
+
['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
|
|
38
|
+
...addonAliases,
|
|
39
|
+
['@package', `${__dirname}/src`],
|
|
40
|
+
['@root', `${__dirname}/src`],
|
|
41
|
+
['~', `${__dirname}/src`],
|
|
42
|
+
],
|
|
43
|
+
extensions: ['.js', '.jsx', '.json'],
|
|
44
|
+
},
|
|
45
|
+
'babel-plugin-root-import': {
|
|
46
|
+
rootPathSuffix: 'src',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
rules: {
|
|
51
|
+
'react/jsx-no-target-blank': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
allowReferrer: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const config = addonExtenders.reduce(
|
|
61
|
+
(acc, extender) => extender.modify(acc),
|
|
62
|
+
defaultConfig,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
module.exports = config;
|
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,37 @@ 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
|
-
### [5.
|
|
7
|
+
### [5.2.0](https://github.com/eea/volto-widget-geolocation/compare/5.1.7...5.2.0) - 19 February 2024
|
|
8
|
+
|
|
9
|
+
#### :nail_care: Enhancements
|
|
10
|
+
|
|
11
|
+
- change(button): of search to use volto styling for add item #66 from eea/advanced-search-ui [ichim-david - [`27a5cd2`](https://github.com/eea/volto-widget-geolocation/commit/27a5cd2cfec33b981a2339f0ad7d09b72be7ab78)]
|
|
12
|
+
- change(button): use volto add-item-button markup [David Ichim - [`2d6e58a`](https://github.com/eea/volto-widget-geolocation/commit/2d6e58a8c03699700cf97ac4046d009298dbbe33)]
|
|
13
|
+
|
|
14
|
+
#### :house: Internal changes
|
|
15
|
+
|
|
16
|
+
- chore: package.json [Alin Voinea - [`fcd4d11`](https://github.com/eea/volto-widget-geolocation/commit/fcd4d11684b804afd23e34a4f1157ecbcdac1f8a)]
|
|
17
|
+
- style: Automated code fix [eea-jenkins - [`200f248`](https://github.com/eea/volto-widget-geolocation/commit/200f2486589fc1ce5d890aecdccd2bdb2b120451)]
|
|
8
18
|
|
|
9
19
|
#### :hammer_and_wrench: Others
|
|
10
20
|
|
|
11
|
-
-
|
|
21
|
+
- Updated package version [David Ichim - [`65b98d1`](https://github.com/eea/volto-widget-geolocation/commit/65b98d1067fde38c3208775be637a3038f64ab34)]
|
|
22
|
+
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`93df3b7`](https://github.com/eea/volto-widget-geolocation/commit/93df3b7b12b5f17416c95ca1824d51570e04524e)]
|
|
23
|
+
- fix search button in metadata section [Teodor - [`3645338`](https://github.com/eea/volto-widget-geolocation/commit/3645338ddaab8ca8965cdfae4f2ba79837b88fec)]
|
|
24
|
+
- change UI for advanced search button [Teodor - [`1532b13`](https://github.com/eea/volto-widget-geolocation/commit/1532b131b1a4560ebe919252db31f7bb586792ab)]
|
|
25
|
+
### [5.1.7](https://github.com/eea/volto-widget-geolocation/compare/5.1.6...5.1.7) - 5 December 2023
|
|
26
|
+
|
|
27
|
+
#### :bug: Bug Fixes
|
|
28
|
+
|
|
29
|
+
- fix: css of advanced search - ref #260426 [Teodor Voicu - [`8ce7d1d`](https://github.com/eea/volto-widget-geolocation/commit/8ce7d1d916e8b7b1e6127a71f334e9935b5ede85)]
|
|
30
|
+
|
|
31
|
+
#### :house: Internal changes
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#### :hammer_and_wrench: Others
|
|
35
|
+
|
|
36
|
+
### [5.1.6](https://github.com/eea/volto-widget-geolocation/compare/5.1.5...5.1.6) - 22 October 2023
|
|
37
|
+
|
|
12
38
|
### [5.1.5](https://github.com/eea/volto-widget-geolocation/compare/5.1.4...5.1.5) - 17 October 2023
|
|
13
39
|
|
|
14
40
|
#### :house: Internal changes
|
|
@@ -33,7 +59,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
33
59
|
|
|
34
60
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`8bf8acb`](https://github.com/eea/volto-widget-geolocation/commit/8bf8acbca8df069456df12f1b4397cc7f19ebcdb)]
|
|
35
61
|
- test: Fix package.json scripts to use makefile [Alin Voinea - [`b01f153`](https://github.com/eea/volto-widget-geolocation/commit/b01f1535b57cb0c0a4e17c3b8e82e260635719df)]
|
|
36
|
-
- test: Fix eslint and yarn i18n [Alin Voinea - [`136fd03`](https://github.com/eea/volto-widget-geolocation/commit/136fd039d82952d5eb5481117d19715310b006a4)]
|
|
37
62
|
- i18n: Add en [Alin Voinea - [`05a2dc9`](https://github.com/eea/volto-widget-geolocation/commit/05a2dc91a4fa487d828586cc909d9d343c3d1506)]
|
|
38
63
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`0fce8cc`](https://github.com/eea/volto-widget-geolocation/commit/0fce8ccbcefc5f1b12b4248e962ce7ec1c822b5d)]
|
|
39
64
|
### [5.1.3](https://github.com/eea/volto-widget-geolocation/compare/5.1.2...5.1.3) - 10 August 2023
|
|
@@ -65,18 +90,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
65
90
|
- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`97afdc6`](https://github.com/eea/volto-widget-geolocation/commit/97afdc64e77ba6ed56a252dd425b13c0a9900601)]
|
|
66
91
|
- test: add unit tests for util - refs #253277 [ana-oprea - [`5904795`](https://github.com/eea/volto-widget-geolocation/commit/5904795ce51f8c5fc3a8e5cf6812a72b284586b0)]
|
|
67
92
|
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`ae96b0a`](https://github.com/eea/volto-widget-geolocation/commit/ae96b0a75fb6c418281a83fe45901d68b88c08f2)]
|
|
68
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e46d9a3`](https://github.com/eea/volto-widget-geolocation/commit/e46d9a3378b8991c38308bf820c85cb292628dc1)]
|
|
69
93
|
### [5.1.0](https://github.com/eea/volto-widget-geolocation/compare/5.0.3...5.1.0) - 27 March 2023
|
|
70
94
|
|
|
71
95
|
#### :hammer_and_wrench: Others
|
|
72
96
|
|
|
73
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`7155a34`](https://github.com/eea/volto-widget-geolocation/commit/7155a34e46cefc066790fa0d638be14e86e390c8)]
|
|
74
97
|
### [5.0.3](https://github.com/eea/volto-widget-geolocation/compare/5.0.2...5.0.3) - 2 March 2023
|
|
75
98
|
|
|
76
99
|
#### :hammer_and_wrench: Others
|
|
77
100
|
|
|
78
101
|
- map countrynames from taxonomy in geonames results [nileshgulia1 - [`444f50f`](https://github.com/eea/volto-widget-geolocation/commit/444f50fa31ac50f0e37675db80eceae0538f27d5)]
|
|
79
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`9cb2f2a`](https://github.com/eea/volto-widget-geolocation/commit/9cb2f2a7556d5688018cd148ef6957c6b904b6a3)]
|
|
80
102
|
### [5.0.2](https://github.com/eea/volto-widget-geolocation/compare/5.0.1...5.0.2) - 27 February 2023
|
|
81
103
|
|
|
82
104
|
#### :hammer_and_wrench: Others
|
|
@@ -84,12 +106,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
84
106
|
- fix proptype warning [nileshgulia1 - [`c9cc7c5`](https://github.com/eea/volto-widget-geolocation/commit/c9cc7c510d69fd980d6b8190144afdc3b1c3b594)]
|
|
85
107
|
- Merge pull request #49 from eea/country_mapping_fix [Nilesh - [`27f7405`](https://github.com/eea/volto-widget-geolocation/commit/27f7405212bc77bdeef2b12398cba9ccbfbcf3d4)]
|
|
86
108
|
- consume country names from country_mapping from backend if present [nileshgulia1 - [`ab91c4a`](https://github.com/eea/volto-widget-geolocation/commit/ab91c4a8bc5a80ee3d68f45194aaabfcf94394d5)]
|
|
87
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`df6a218`](https://github.com/eea/volto-widget-geolocation/commit/df6a218ce262fdec9d9733dfd924c60cdefca9b1)]
|
|
88
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`748246c`](https://github.com/eea/volto-widget-geolocation/commit/748246c00f5f10e1e1ddba7cebaa5bde289432e5)]
|
|
89
109
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`ee943bd`](https://github.com/eea/volto-widget-geolocation/commit/ee943bd7fb8c6e0e37114c3c7be70158973f1d7b)]
|
|
90
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`745dede`](https://github.com/eea/volto-widget-geolocation/commit/745dede703c8c625be24feb97fe8af156235cc60)]
|
|
91
|
-
- yarn 3 [Alin Voinea - [`71a7571`](https://github.com/eea/volto-widget-geolocation/commit/71a7571adcbc81480589ccce3959120d565e7015)]
|
|
92
|
-
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`5dff0ab`](https://github.com/eea/volto-widget-geolocation/commit/5dff0abc11b5397ac1ca85897a46bc37d0732c92)]
|
|
93
110
|
### [5.0.1](https://github.com/eea/volto-widget-geolocation/compare/5.0.0...5.0.1) - 16 November 2022
|
|
94
111
|
|
|
95
112
|
#### :hammer_and_wrench: Others
|
|
@@ -100,14 +117,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
100
117
|
#### :hammer_and_wrench: Others
|
|
101
118
|
|
|
102
119
|
- Cleanup [Alin Voinea - [`2b53756`](https://github.com/eea/volto-widget-geolocation/commit/2b5375660e6184a5875b7ac87eb17902cc7bfab9)]
|
|
103
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`24fc1be`](https://github.com/eea/volto-widget-geolocation/commit/24fc1be54e9b5f52473a704928e9770df981894a)]
|
|
104
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`41b6a2c`](https://github.com/eea/volto-widget-geolocation/commit/41b6a2cccb276db1e6f57bd4d28318628ef87a08)]
|
|
105
120
|
- update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`404894f`](https://github.com/eea/volto-widget-geolocation/commit/404894fcf6b5227a19f8292f881ce66476ce5e16)]
|
|
106
121
|
### [4.0.6](https://github.com/eea/volto-widget-geolocation/compare/4.0.5...4.0.6) - 30 June 2022
|
|
107
122
|
|
|
108
123
|
#### :hammer_and_wrench: Others
|
|
109
124
|
|
|
110
|
-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`c706ec9`](https://github.com/eea/volto-widget-geolocation/commit/c706ec94c0d51443d81a788c1c100e6cc268b034)]
|
|
111
125
|
### [4.0.5](https://github.com/eea/volto-widget-geolocation/compare/4.0.4...4.0.5) - 20 June 2022
|
|
112
126
|
|
|
113
127
|
#### :hammer_and_wrench: Others
|
|
@@ -123,40 +137,30 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
123
137
|
- eslint [nileshgulia1 - [`c91d86c`](https://github.com/eea/volto-widget-geolocation/commit/c91d86c33a4756373294d1779d01f19775b8363d)]
|
|
124
138
|
- fix filters [nileshgulia1 - [`9822e51`](https://github.com/eea/volto-widget-geolocation/commit/9822e5127bf0fb7e0a9957c63d78e7460d53cb5b)]
|
|
125
139
|
- fix searchWidget for coremetadata behaviour [nileshgulia1 - [`3e28cc7`](https://github.com/eea/volto-widget-geolocation/commit/3e28cc74195851ebc0537abb021032fc8429ab06)]
|
|
126
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`54c8b1c`](https://github.com/eea/volto-widget-geolocation/commit/54c8b1c85acdda12b1f026f8fa80fb63db7c9f9d)]
|
|
127
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`bc64abe`](https://github.com/eea/volto-widget-geolocation/commit/bc64abe6c60580fe7e99545f75e552e8b9af4975)]
|
|
128
140
|
### [4.0.3](https://github.com/eea/volto-widget-geolocation/compare/4.0.2...4.0.3) - 3 January 2022
|
|
129
141
|
|
|
130
142
|
### [4.0.2](https://github.com/eea/volto-widget-geolocation/compare/4.0.1...4.0.2) - 18 December 2021
|
|
131
143
|
|
|
132
144
|
#### :hammer_and_wrench: Others
|
|
133
145
|
|
|
134
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`22b1599`](https://github.com/eea/volto-widget-geolocation/commit/22b1599e3c0a9ea6848bbf13b6447e54987c5ac3)]
|
|
135
146
|
### [4.0.1](https://github.com/eea/volto-widget-geolocation/compare/4.0.0...4.0.1) - 10 December 2021
|
|
136
147
|
|
|
137
148
|
#### :hammer_and_wrench: Others
|
|
138
149
|
|
|
139
150
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`acaedb9`](https://github.com/eea/volto-widget-geolocation/commit/acaedb9198fac529c8db6c1dc744730d90abc4b5)]
|
|
140
|
-
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`150d263`](https://github.com/eea/volto-widget-geolocation/commit/150d263758c9651eba879292d92edd10efa0d864)]
|
|
141
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`d19460f`](https://github.com/eea/volto-widget-geolocation/commit/d19460f1beb0f9275220ade75bc5bb9d58571951)]
|
|
142
|
-
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`d77d8cf`](https://github.com/eea/volto-widget-geolocation/commit/d77d8cf8d04177df6f4564a78804b7a7e1ca5f67)]
|
|
143
|
-
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`1d5a574`](https://github.com/eea/volto-widget-geolocation/commit/1d5a5744b2bca35cd2a6d6ffe76c24a573cac62b)]
|
|
144
151
|
## [4.0.0](https://github.com/eea/volto-widget-geolocation/compare/3.0.3...4.0.0) - 24 September 2021
|
|
145
152
|
|
|
146
153
|
#### :hammer_and_wrench: Others
|
|
147
154
|
|
|
148
|
-
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`c374d87`](https://github.com/eea/volto-widget-geolocation/commit/c374d87267b340ba40cd61b53b24e8b9f135c974)]
|
|
149
155
|
### [3.0.3](https://github.com/eea/volto-widget-geolocation/compare/3.0.2...3.0.3) - 16 September 2021
|
|
150
156
|
|
|
151
157
|
#### :hammer_and_wrench: Others
|
|
152
158
|
|
|
153
|
-
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`f28a503`](https://github.com/eea/volto-widget-geolocation/commit/f28a503ea7ed70a857a1556d71ec50138086494b)]
|
|
154
159
|
### [3.0.2](https://github.com/eea/volto-widget-geolocation/compare/3.0.1...3.0.2) - 9 September 2021
|
|
155
160
|
|
|
156
161
|
#### :hammer_and_wrench: Others
|
|
157
162
|
|
|
158
163
|
- Fix volto-corsproxy dependency pin [Alin Voinea - [`ded8151`](https://github.com/eea/volto-widget-geolocation/commit/ded8151484d2d2406fafe3a3bfe3548a2d38b06a)]
|
|
159
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`045c761`](https://github.com/eea/volto-widget-geolocation/commit/045c761ff0958adea7ac2da3c28cbbf3dd6fcedb)]
|
|
160
164
|
### [3.0.1](https://github.com/eea/volto-widget-geolocation/compare/3.0.0...3.0.1) - 18 June 2021
|
|
161
165
|
|
|
162
166
|
## [3.0.0](https://github.com/eea/volto-widget-geolocation/compare/2.3.0...3.0.0) - 9 June 2021
|
package/cypress.config.js
CHANGED
|
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
|
|
|
2
2
|
|
|
3
3
|
module.exports = defineConfig({
|
|
4
4
|
viewportWidth: 1280,
|
|
5
|
-
defaultCommandTimeout:
|
|
5
|
+
defaultCommandTimeout: 8888,
|
|
6
6
|
chromeWebSecurity: false,
|
|
7
7
|
reporter: 'junit',
|
|
8
|
-
video:
|
|
8
|
+
video: false,
|
|
9
9
|
retries: {
|
|
10
|
-
runMode:
|
|
10
|
+
runMode: 2,
|
|
11
11
|
openMode: 0,
|
|
12
12
|
},
|
|
13
13
|
reporterOptions: {
|
package/jest-addon.config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
4
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
3
5
|
collectCoverageFrom: [
|
|
@@ -9,16 +11,21 @@ module.exports = {
|
|
|
9
11
|
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
|
|
10
12
|
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
|
|
11
13
|
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
12
|
-
'@package/(.*)$': '<rootDir>/src/$1',
|
|
13
|
-
'@root/(.*)$': '<rootDir>/src/$1',
|
|
14
|
+
'@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
15
|
+
'@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
14
16
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
15
17
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
16
|
-
'@plone/volto-slate':
|
|
18
|
+
'@plone/volto-slate$':
|
|
17
19
|
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
|
20
|
+
'@plone/volto-slate/(.*)$':
|
|
21
|
+
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
18
22
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
19
23
|
'load-volto-addons':
|
|
20
24
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
21
25
|
},
|
|
26
|
+
transformIgnorePatterns: [
|
|
27
|
+
'/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
|
|
28
|
+
],
|
|
22
29
|
transform: {
|
|
23
30
|
'^.+\\.js(x)?$': 'babel-jest',
|
|
24
31
|
'^.+\\.(png)$': 'jest-file',
|
|
@@ -33,4 +40,9 @@ module.exports = {
|
|
|
33
40
|
statements: 5,
|
|
34
41
|
},
|
|
35
42
|
},
|
|
36
|
-
|
|
43
|
+
...(process.env.JEST_USE_SETUP === 'ON' && {
|
|
44
|
+
setupFilesAfterEnv: [
|
|
45
|
+
'<rootDir>/node_modules/@eeacms/volto-widget-geolocation/jest.setup.js',
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
}
|
package/jest.setup.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
2
|
+
import configureStore from 'redux-mock-store';
|
|
3
|
+
import thunk from 'redux-thunk';
|
|
4
|
+
import { blocksConfig } from '@plone/volto/config/Blocks';
|
|
5
|
+
import installSlate from '@plone/volto-slate/index';
|
|
6
|
+
|
|
7
|
+
var mockSemanticComponents = jest.requireActual('semantic-ui-react');
|
|
8
|
+
var mockComponents = jest.requireActual('@plone/volto/components');
|
|
9
|
+
var config = jest.requireActual('@plone/volto/registry').default;
|
|
10
|
+
|
|
11
|
+
config.blocks.blocksConfig = {
|
|
12
|
+
...blocksConfig,
|
|
13
|
+
...config.blocks.blocksConfig,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
jest.doMock('semantic-ui-react', () => ({
|
|
17
|
+
__esModule: true,
|
|
18
|
+
...mockSemanticComponents,
|
|
19
|
+
Popup: ({ content, trigger }) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="popup">
|
|
22
|
+
<div className="trigger">{trigger}</div>
|
|
23
|
+
<div className="content">{content}</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
jest.doMock('@plone/volto/components', () => {
|
|
30
|
+
return {
|
|
31
|
+
__esModule: true,
|
|
32
|
+
...mockComponents,
|
|
33
|
+
SidebarPortal: ({ children }) => <div id="sidebar">{children}</div>,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
jest.doMock('@plone/volto/registry', () =>
|
|
38
|
+
[installSlate].reduce((acc, apply) => apply(acc), config),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const mockStore = configureStore([thunk]);
|
|
42
|
+
|
|
43
|
+
global.fetch = jest.fn(() =>
|
|
44
|
+
Promise.resolve({
|
|
45
|
+
json: () => Promise.resolve({}),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
global.store = mockStore({
|
|
50
|
+
intl: {
|
|
51
|
+
locale: 'en',
|
|
52
|
+
messages: {},
|
|
53
|
+
formatMessage: jest.fn(),
|
|
54
|
+
},
|
|
55
|
+
content: {
|
|
56
|
+
create: {},
|
|
57
|
+
subrequests: [],
|
|
58
|
+
},
|
|
59
|
+
connected_data_parameters: {},
|
|
60
|
+
screen: {
|
|
61
|
+
page: {
|
|
62
|
+
width: 768,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-widget-geolocation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "volto-widget-geolocation: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@cypress/code-coverage": "^3.10.0",
|
|
31
31
|
"@plone/scripts": "*",
|
|
32
32
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
33
|
+
"dotenv": "^16.3.2",
|
|
33
34
|
"husky": "^8.0.3",
|
|
34
35
|
"lint-staged": "^14.0.1",
|
|
35
36
|
"md5": "^2.3.0"
|
|
@@ -199,37 +199,31 @@ const GeolocationWidget = (props) => {
|
|
|
199
199
|
/>
|
|
200
200
|
</Grid.Column>
|
|
201
201
|
</Grid.Row>
|
|
202
|
-
<Grid.Row>
|
|
202
|
+
<Grid.Row stretched style={{ padding: '10px 0' }}>
|
|
203
203
|
<Grid.Column width="4">
|
|
204
204
|
<div className="wrapper">
|
|
205
|
-
<label
|
|
205
|
+
<label htmlFor="advanced-search-button ">
|
|
206
206
|
{intl.formatMessage(messages.search)}
|
|
207
207
|
</label>
|
|
208
208
|
</div>
|
|
209
209
|
</Grid.Column>
|
|
210
|
-
<Grid.Column
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
>
|
|
227
|
-
<Icon
|
|
228
|
-
name={zoomSVG}
|
|
229
|
-
size="26px"
|
|
230
|
-
title={intl.formatMessage(messages.search)}
|
|
231
|
-
/>
|
|
232
|
-
</Button>
|
|
210
|
+
<Grid.Column width="8" className="search-grid-column">
|
|
211
|
+
<div class="add-item-button-wrapper">
|
|
212
|
+
<Button
|
|
213
|
+
className="icon advanced-search-button"
|
|
214
|
+
onClick={(event) => {
|
|
215
|
+
setPopup(true);
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
}}
|
|
218
|
+
>
|
|
219
|
+
<Icon
|
|
220
|
+
name={zoomSVG}
|
|
221
|
+
size="16px"
|
|
222
|
+
title={intl.formatMessage(messages.search)}
|
|
223
|
+
/>
|
|
224
|
+
Search
|
|
225
|
+
</Button>
|
|
226
|
+
</div>
|
|
233
227
|
</Grid.Column>
|
|
234
228
|
<SidebarPopup open={isOpenPopup}>
|
|
235
229
|
<SearchGeoName
|
package/.project.eslintrc.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const projectRootPath = fs.existsSync('./project')
|
|
5
|
-
? fs.realpathSync('./project')
|
|
6
|
-
: fs.realpathSync('./../../../');
|
|
7
|
-
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
8
|
-
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
|
|
9
|
-
|
|
10
|
-
const pathsConfig = jsConfig.paths;
|
|
11
|
-
|
|
12
|
-
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
13
|
-
|
|
14
|
-
Object.keys(pathsConfig).forEach(pkg => {
|
|
15
|
-
if (pkg === '@plone/volto') {
|
|
16
|
-
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
20
|
-
const reg = new AddonConfigurationRegistry(projectRootPath);
|
|
21
|
-
|
|
22
|
-
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
-
const addonAliases = Object.keys(reg.packages).map(o => [
|
|
24
|
-
o,
|
|
25
|
-
reg.packages[o].modulePath,
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
module.exports = {
|
|
30
|
-
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
|
|
31
|
-
settings: {
|
|
32
|
-
'import/resolver': {
|
|
33
|
-
alias: {
|
|
34
|
-
map: [
|
|
35
|
-
['@plone/volto', '@plone/volto/src'],
|
|
36
|
-
...addonAliases,
|
|
37
|
-
['@package', `${__dirname}/src`],
|
|
38
|
-
['~', `${__dirname}/src`],
|
|
39
|
-
],
|
|
40
|
-
extensions: ['.js', '.jsx', '.json'],
|
|
41
|
-
},
|
|
42
|
-
'babel-plugin-root-import': {
|
|
43
|
-
rootPathSuffix: 'src',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|