@eeacms/volto-eea-design-system 1.60.7 → 1.61.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/.gitleaks.toml +101 -0
- package/CHANGELOG.md +24 -36
- package/README.md +59 -0
- package/RELEASE.md +1 -1
- package/package.json +1 -1
- package/src/ui/Card/Card.stories.jsx +1 -1
- package/src/ui/Card/PublicationCard.stories.jsx +1 -1
- package/src/ui/Card/RelatedContent/RelatedContent.stories.jsx +1 -1
- package/src/ui/Header/Header.jsx +7 -1
- package/src/ui/Header/Header.test.jsx +55 -0
- package/src/ui/Header/HeaderSearchPopUp.js +7 -1
- package/src/ui/Header/HeaderSearchPopUp.test.js +49 -0
- package/src/ui/Header/useAISummaryToggle.js +60 -0
package/.gitleaks.toml
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
title = "Betterleaks config"
|
|
2
|
+
|
|
3
|
+
[extend]
|
|
4
|
+
useDefault = true
|
|
5
|
+
|
|
6
|
+
[[rules]]
|
|
7
|
+
id = "secret-literal-assignment"
|
|
8
|
+
description = "Secret-like literal assignment in source, YAML, env and config files"
|
|
9
|
+
regex = '''(?i)([A-Za-z0-9_.-]*(?:password|passwd|pwd|api[_-]?key|apikey|access[_-]?key|secret[_-]?access[_-]?key|private[_-]?key|client[_-]?secret|consumer[_-]?key|consumer[_-]?secret|(?:auth|access|refresh|session|api|bearer|id|jwt|csrf|xsrf|oauth)[_-]?token|translate[_-]?auth|translation[_-]?auth|auth[_-]?password|auth[_-]?key|auth[_-]?credentials|database[_-]?url|connection[_-]?string)[A-Za-z0-9_.-]*)[ \t]*[:=][ \t]*["'']?([^"''[:space:]#{}$.][^"''\n#{}]{2,})["'']?'''
|
|
10
|
+
secretGroup = 2
|
|
11
|
+
keywords = [
|
|
12
|
+
"password",
|
|
13
|
+
"passwd",
|
|
14
|
+
"pwd",
|
|
15
|
+
"api_key",
|
|
16
|
+
"apikey",
|
|
17
|
+
"access_key",
|
|
18
|
+
"private_key",
|
|
19
|
+
"client_secret",
|
|
20
|
+
"consumer_key",
|
|
21
|
+
"consumer_secret",
|
|
22
|
+
"auth_token",
|
|
23
|
+
"access_token",
|
|
24
|
+
"refresh_token",
|
|
25
|
+
"session_token",
|
|
26
|
+
"api_token",
|
|
27
|
+
"bearer_token",
|
|
28
|
+
"id_token",
|
|
29
|
+
"jwt_token",
|
|
30
|
+
"csrf_token",
|
|
31
|
+
"xsrf_token",
|
|
32
|
+
"oauth_token",
|
|
33
|
+
"translate_auth",
|
|
34
|
+
"translation_auth",
|
|
35
|
+
"auth_password",
|
|
36
|
+
"auth_key",
|
|
37
|
+
"auth_credentials",
|
|
38
|
+
"database_url",
|
|
39
|
+
"connection_string"
|
|
40
|
+
]
|
|
41
|
+
tags = ["literal-secret"]
|
|
42
|
+
|
|
43
|
+
[[rules]]
|
|
44
|
+
id = "env-short-secret-assignment"
|
|
45
|
+
description = "Uppercase env-style PASS/TOKEN/SECRET assignment"
|
|
46
|
+
regex = '''\b((?:PASS|TOKEN|SECRET|[A-Z0-9_]*(?:_PASS|_TOKEN|_SECRET|PASS_|TOKEN_|SECRET_)[A-Z0-9_]*))[ \t]*[:=][ \t]*["'']?([^"''[:space:]#{}$.][^"''\n#{}]{2,})["'']?'''
|
|
47
|
+
secretGroup = 2
|
|
48
|
+
keywords = [
|
|
49
|
+
"PASS",
|
|
50
|
+
"TOKEN",
|
|
51
|
+
"SECRET"
|
|
52
|
+
]
|
|
53
|
+
tags = ["env", "literal-secret"]
|
|
54
|
+
|
|
55
|
+
[[rules]]
|
|
56
|
+
id = "standalone-sk-token"
|
|
57
|
+
description = "Standalone sk-* token not attached to a secret-like variable name"
|
|
58
|
+
regex = '''(?i)\b(sk-[A-Za-z0-9][A-Za-z0-9_-]{20,})\b'''
|
|
59
|
+
secretGroup = 1
|
|
60
|
+
entropy = 2.5
|
|
61
|
+
keywords = ["sk-"]
|
|
62
|
+
tags = ["standalone-token", "generic"]
|
|
63
|
+
|
|
64
|
+
[[rules]]
|
|
65
|
+
id = "dotenv-only-jest-setup"
|
|
66
|
+
description = ".env may only contain the committed Jest setup lines"
|
|
67
|
+
path = '''(?i)(^|/)\.env$'''
|
|
68
|
+
regex = '''(?m)^(.+)$'''
|
|
69
|
+
secretGroup = 1
|
|
70
|
+
tags = ["file", "dotenv"]
|
|
71
|
+
[[rules.allowlists]]
|
|
72
|
+
regexTarget = "match"
|
|
73
|
+
regexes = [
|
|
74
|
+
'''^JEST_USE_SETUP=OFF # Jest configuration variables: ON, OFF\r?$''',
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[[rules]]
|
|
78
|
+
id = "forbidden-secret-file"
|
|
79
|
+
description = "Forbidden secret-bearing file committed to repository"
|
|
80
|
+
path = '''(?i)(^|/)(\.env\..*|\.npmrc|\.pypirc|id_rsa|id_ed25519|.*\.(pem|key|p12|pfx|jks|kubeconfig))$'''
|
|
81
|
+
regex = '''(?s).{1,}'''
|
|
82
|
+
tags = ["file", "secret-file"]
|
|
83
|
+
|
|
84
|
+
[[allowlists]]
|
|
85
|
+
description = "Allow Jenkins SonarQube token environment variable reference"
|
|
86
|
+
regexTarget = "match"
|
|
87
|
+
regexes = [
|
|
88
|
+
'''SONAR_AUTH_TOKEN''',
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[[allowlists]]
|
|
92
|
+
description = "Allow generated documentation assets"
|
|
93
|
+
paths = [
|
|
94
|
+
'''^docs/assets/''',
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[allowlists]]
|
|
98
|
+
description = "Semantic UI flag stylesheet uses ISO country-code selectors like `.pw:before` (Palau), not credentials"
|
|
99
|
+
paths = [
|
|
100
|
+
'''(^|/)theme/themes/eea/elements/flag\.overrides$''',
|
|
101
|
+
]
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ 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
|
+
### [1.61.0](https://github.com/eea/volto-eea-design-system/compare/1.60.8...1.61.0) - 7 September 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: tie header search icon to the AI summary preference - refs #307513 [Miu Razvan - [`7476093`](https://github.com/eea/volto-eea-design-system/commit/747609399df476b6092b49e91760db5068c0010b)]
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fixes
|
|
14
|
+
|
|
15
|
+
- fix: Add betterleaks github action - refs #304517 [dobri1408 - [`dd4b4da`](https://github.com/eea/volto-eea-design-system/commit/dd4b4da5ef18454ac76c1cbff1e2a7d5baa5c550)]
|
|
16
|
+
|
|
17
|
+
#### :house: Internal changes
|
|
18
|
+
|
|
19
|
+
- chore(gitleaks): allowlist flag.overrides stylesheet [Claudia Ifrim - [`d3ac637`](https://github.com/eea/volto-eea-design-system/commit/d3ac637ed1396c04e600971abf50b26ae3bcdaa3)]
|
|
20
|
+
|
|
21
|
+
#### :hammer_and_wrench: Others
|
|
22
|
+
|
|
23
|
+
- test: pin Chromium version 149 to work with Cypress [valentinab25 - [`0be5062`](https://github.com/eea/volto-eea-design-system/commit/0be5062d18dcff0350c7e37a2b42ae82be66cd63)]
|
|
24
|
+
### [1.60.8](https://github.com/eea/volto-eea-design-system/compare/1.60.7...1.60.8) - 11 June 2026
|
|
25
|
+
|
|
26
|
+
#### :bug: Bug Fixes
|
|
27
|
+
|
|
28
|
+
- fix: PublicationCard and RelatedContent storybook - refs #302975 [Alin Voinea - [`4a36cba`](https://github.com/eea/volto-eea-design-system/commit/4a36cba7d1fc10393877aac3680e9b1a778f6154)]
|
|
29
|
+
- fix: Card storybook - refs #302975 [Alin Voinea - [`c2b6437`](https://github.com/eea/volto-eea-design-system/commit/c2b6437d165b8648c5e66e2337f1a3444f51e6f5)]
|
|
30
|
+
|
|
7
31
|
### [1.60.7](https://github.com/eea/volto-eea-design-system/compare/1.60.6...1.60.7) - 9 June 2026
|
|
8
32
|
|
|
9
33
|
#### :bug: Bug Fixes
|
|
@@ -83,8 +107,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
83
107
|
|
|
84
108
|
#### :house: Internal changes
|
|
85
109
|
|
|
86
|
-
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`a2500ee`](https://github.com/eea/volto-eea-design-system/commit/a2500ee91c3d926183403b7e55ef717f697eb736)]
|
|
87
|
-
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`79058be`](https://github.com/eea/volto-eea-design-system/commit/79058be6ad228970127ee388bbc78ad69b92465b)]
|
|
88
110
|
|
|
89
111
|
#### :hammer_and_wrench: Others
|
|
90
112
|
|
|
@@ -121,7 +143,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
121
143
|
#### :hammer_and_wrench: Others
|
|
122
144
|
|
|
123
145
|
- add rule for eeacms/countup to jest-config.js [David Ichim - [`59244c2`](https://github.com/eea/volto-eea-design-system/commit/59244c2e85447766e9e2a051e080652d93f67458)]
|
|
124
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`314266b`](https://github.com/eea/volto-eea-design-system/commit/314266bd8131b8ade427f23f81a084714f0104af)]
|
|
125
146
|
### [1.40.0](https://github.com/eea/volto-eea-design-system/compare/1.39.1...1.40.0) - 4 November 2025
|
|
126
147
|
|
|
127
148
|
### [1.39.1](https://github.com/eea/volto-eea-design-system/compare/1.39.0...1.39.1) - 22 September 2025
|
|
@@ -197,10 +218,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
197
218
|
|
|
198
219
|
#### :hammer_and_wrench: Others
|
|
199
220
|
|
|
200
|
-
- Add Sonarqube tag using fise-frontend addons list [EEA Jenkins - [`d3a993f`](https://github.com/eea/volto-eea-design-system/commit/d3a993f7c9f687d709e1c8bc48b4972aca7a161e)]
|
|
201
221
|
- Fix with sed the issue from line 714 missing } [David Ichim - [`e4e10a0`](https://github.com/eea/volto-eea-design-system/commit/e4e10a0a8a82c1fa20dcff9fa8178a6a938a7fd5)]
|
|
202
222
|
- Fixed link for don't use more than six colors [David Ichim - [`f42c698`](https://github.com/eea/volto-eea-design-system/commit/f42c69895258291ef72c0299e348f5671b2c127b)]
|
|
203
|
-
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`a8fa4e1`](https://github.com/eea/volto-eea-design-system/commit/a8fa4e157f6351939fd6ee126f733efc1adf6dfe)]
|
|
204
223
|
- lint fix [David Ichim - [`5d4d60a`](https://github.com/eea/volto-eea-design-system/commit/5d4d60ac305b8694fec64a9cce625a1015e8486f)]
|
|
205
224
|
### [1.36.3](https://github.com/eea/volto-eea-design-system/compare/1.36.2...1.36.3) - 4 March 2025
|
|
206
225
|
|
|
@@ -234,7 +253,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
234
253
|
#### :hammer_and_wrench: Others
|
|
235
254
|
|
|
236
255
|
- Update package.json [Ichim David - [`40ae6a7`](https://github.com/eea/volto-eea-design-system/commit/40ae6a70377c54256f7365a12bded4e25b0c322e)]
|
|
237
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`b433236`](https://github.com/eea/volto-eea-design-system/commit/b433236f3e264304c86082281da90384da7ab0ff)]
|
|
238
256
|
### [1.34.1](https://github.com/eea/volto-eea-design-system/compare/1.34.0...1.34.1) - 14 October 2024
|
|
239
257
|
|
|
240
258
|
### [1.34.0](https://github.com/eea/volto-eea-design-system/compare/1.33.1...1.34.0) - 11 October 2024
|
|
@@ -316,7 +334,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
316
334
|
|
|
317
335
|
#### :hammer_and_wrench: Others
|
|
318
336
|
|
|
319
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`dfa1d1b`](https://github.com/eea/volto-eea-design-system/commit/dfa1d1bd53ae63b20aa0ef64c37bf71faf376290)]
|
|
320
337
|
### [1.31.0](https://github.com/eea/volto-eea-design-system/compare/1.23.8...1.31.0) - 22 May 2024
|
|
321
338
|
|
|
322
339
|
#### :boom: Breaking Change
|
|
@@ -345,7 +362,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
345
362
|
|
|
346
363
|
#### :hammer_and_wrench: Others
|
|
347
364
|
|
|
348
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`2ccf437`](https://github.com/eea/volto-eea-design-system/commit/2ccf4372f93d56ce3cc8bfd66de5c9fbb2698cf4)]
|
|
349
365
|
### [1.23.5](https://github.com/eea/volto-eea-design-system/compare/1.23.4...1.23.5) - 5 April 2024
|
|
350
366
|
|
|
351
367
|
#### :nail_care: Enhancements
|
|
@@ -381,8 +397,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
381
397
|
- Update package.json version to 1.23.0 [David Ichim - [`4b2eeee`](https://github.com/eea/volto-eea-design-system/commit/4b2eeee398b771ac80111e1755f67273c8940ced)]
|
|
382
398
|
- fixed merge conflict [David Ichim - [`efe0f4b`](https://github.com/eea/volto-eea-design-system/commit/efe0f4b7df1782f5143e1bee31c997801427d35c)]
|
|
383
399
|
- Update react-slick version to 0.30.1 [David Ichim - [`62d4570`](https://github.com/eea/volto-eea-design-system/commit/62d457014866fc075a3203fd0f9e66354aa73fe5)]
|
|
384
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`c6c74f0`](https://github.com/eea/volto-eea-design-system/commit/c6c74f049ee787632b8ad0ec0f28531ac4d0f20f)]
|
|
385
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`d3d7793`](https://github.com/eea/volto-eea-design-system/commit/d3d779363caa10f384d829a7e4242c5d54268099)]
|
|
386
400
|
### [1.23.0](https://github.com/eea/volto-eea-design-system/compare/1.22.7...1.23.0) - 19 February 2024
|
|
387
401
|
|
|
388
402
|
### [1.22.7](https://github.com/eea/volto-eea-design-system/compare/1.22.6...1.22.7) - 22 January 2024
|
|
@@ -468,11 +482,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
468
482
|
- Add dropdown test case to Header component [David Ichim - [`9ea3234`](https://github.com/eea/volto-eea-design-system/commit/9ea3234c2c0f1c819c7c2b54a75c56cda7812c56)]
|
|
469
483
|
- Remove unused import in Header.test.jsx [David Ichim - [`082069e`](https://github.com/eea/volto-eea-design-system/commit/082069e1f057786e0f1fb00c98d54b8e03b5d9c5)]
|
|
470
484
|
- Added some tests for TopDropdownMenu mobile and dropdown interaction [David Ichim - [`9d24488`](https://github.com/eea/volto-eea-design-system/commit/9d24488c1e97b2b1b14bd9bd8cb6f5b68414794b)]
|
|
471
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`eadf018`](https://github.com/eea/volto-eea-design-system/commit/eadf018aa1f32d310619ce4ef08f9b11950a20dc)]
|
|
472
485
|
- Lint fix [David Ichim - [`e29fd50`](https://github.com/eea/volto-eea-design-system/commit/e29fd50ee73477007dcf94a268596e6c11176d7b)]
|
|
473
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`947cb92`](https://github.com/eea/volto-eea-design-system/commit/947cb929c01ebb6f46bf124833fe1fec0f385edb)]
|
|
474
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`8356dfe`](https://github.com/eea/volto-eea-design-system/commit/8356dfe929039dcd165af0692cbbfc771a0f7fb4)]
|
|
475
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`e38f17e`](https://github.com/eea/volto-eea-design-system/commit/e38f17ed735e743e59df7d06ca723c1218bdb569)]
|
|
476
486
|
### [1.20.0](https://github.com/eea/volto-eea-design-system/compare/1.19.0...1.20.0) - 2 November 2023
|
|
477
487
|
|
|
478
488
|
#### :rocket: New Features
|
|
@@ -505,9 +515,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
505
515
|
|
|
506
516
|
#### :house: Internal changes
|
|
507
517
|
|
|
508
|
-
- chore: [JENKINS] do not run tests on PR comments [valentinab25 - [`51b68fc`](https://github.com/eea/volto-eea-design-system/commit/51b68fc76a956996e01521b784262c67e7094d35)]
|
|
509
|
-
- chore: [JENKINS] add comment step [valentinab25 - [`5022758`](https://github.com/eea/volto-eea-design-system/commit/50227587db2c72d17e26e7b66f28d4c09b760873)]
|
|
510
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`a70ca64`](https://github.com/eea/volto-eea-design-system/commit/a70ca642918f578d6737d975e4769bac8312f48d)]
|
|
511
518
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`59ecb8e`](https://github.com/eea/volto-eea-design-system/commit/59ecb8e28b259472303324f9655b0cbbcbbf9c23)]
|
|
512
519
|
|
|
513
520
|
#### :hammer_and_wrench: Others
|
|
@@ -633,7 +640,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
633
640
|
|
|
634
641
|
#### :hammer_and_wrench: Others
|
|
635
642
|
|
|
636
|
-
- test: Fix eslint and yarn i18n [Alin Voinea - [`331149f`](https://github.com/eea/volto-eea-design-system/commit/331149f5eb16a9cc6f2d996f7b793909773063c2)]
|
|
637
643
|
- i18n: Add en [Alin Voinea - [`4584295`](https://github.com/eea/volto-eea-design-system/commit/458429530d993c27cfb962ddfe2f376f3568bf01)]
|
|
638
644
|
- Release 1.17.0 [Alin Voinea - [`e3c25ee`](https://github.com/eea/volto-eea-design-system/commit/e3c25eeeca5e863244faae396b5aa915d0702633)]
|
|
639
645
|
- test: add unit tests for DS components - refs #254313 [ana-oprea - [`0c4d4d1`](https://github.com/eea/volto-eea-design-system/commit/0c4d4d118b8e13082c576dc5c2dce6a715f49006)]
|
|
@@ -743,7 +749,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
743
749
|
#### :hammer_and_wrench: Others
|
|
744
750
|
|
|
745
751
|
- Release 1.14.0 [Alin Voinea - [`cb9084f`](https://github.com/eea/volto-eea-design-system/commit/cb9084fb2246dc1b729e12a419a26daa12c26f7a)]
|
|
746
|
-
- test: [JENKINS] set pipe fail [valentinab25 - [`1cdfc39`](https://github.com/eea/volto-eea-design-system/commit/1cdfc39d08f1ae301dea57f1e4be5265c4a4c6f9)]
|
|
747
752
|
- test: try storybook upload [valentinab25 - [`6d5833d`](https://github.com/eea/volto-eea-design-system/commit/6d5833d4419d00f1ac04c9eb78a0884214f9a494)]
|
|
748
753
|
- test: remove useless code [valentinab25 - [`2c14b0c`](https://github.com/eea/volto-eea-design-system/commit/2c14b0ce4596cfc11a81b9762677596d1861acfe)]
|
|
749
754
|
### [1.13.2](https://github.com/eea/volto-eea-design-system/compare/1.13.1...1.13.2) - 13 June 2023
|
|
@@ -782,7 +787,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
782
787
|
|
|
783
788
|
#### :house: Internal changes
|
|
784
789
|
|
|
785
|
-
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`fb2b166`](https://github.com/eea/volto-eea-design-system/commit/fb2b166d64f95a1c183901abfe0fe0254d1bbc7a)]
|
|
786
790
|
|
|
787
791
|
#### :house: Documentation changes
|
|
788
792
|
|
|
@@ -1116,7 +1120,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1116
1120
|
|
|
1117
1121
|
- Release 1.0.0-beta.5 [Alin Voinea - [`e4417e1`](https://github.com/eea/volto-eea-design-system/commit/e4417e121477511c350ae3fbe4e70aadb445ed86)]
|
|
1118
1122
|
- better useOnScreen hook [Andrei Grigore - [`c214b6b`](https://github.com/eea/volto-eea-design-system/commit/c214b6b76443f81c795ce2f3aa457562ec088b30)]
|
|
1119
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b227cf8`](https://github.com/eea/volto-eea-design-system/commit/b227cf8a8c44b9d91e9fda8a7999fb0a42bacdca)]
|
|
1120
1123
|
- feature(mobile): increased performance by lazy loading footer images #303 from eea/increase_performance [ichim-david - [`80d1df1`](https://github.com/eea/volto-eea-design-system/commit/80d1df1c459680331d486f9e8e6a95c9db0adbf6)]
|
|
1121
1124
|
- prettier [David Ichim - [`a7f8384`](https://github.com/eea/volto-eea-design-system/commit/a7f838470c1bcc4e2be115d514d92a1b686a5e9b)]
|
|
1122
1125
|
- fixed less build failure due to changes in footer.less [David Ichim - [`190bc8c`](https://github.com/eea/volto-eea-design-system/commit/190bc8cfa88191b45808f1e27c6e2737ee3d15b1)]
|
|
@@ -1187,7 +1190,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1187
1190
|
|
|
1188
1191
|
#### :house: Internal changes
|
|
1189
1192
|
|
|
1190
|
-
- chore(docusaurus): ignore website/.yarn [Giorgos Stamatis - [`0b33ffd`](https://github.com/eea/volto-eea-design-system/commit/0b33ffd1dda61b126e3cc5ff48888124d6aee41b)]
|
|
1191
1193
|
- style(header): react syntax fix [Antonis Tarantilis - [`3add127`](https://github.com/eea/volto-eea-design-system/commit/3add1271c785a92bea0ef925d7bc562cef1e0d92)]
|
|
1192
1194
|
|
|
1193
1195
|
#### :house: Documentation changes
|
|
@@ -1384,7 +1386,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1384
1386
|
|
|
1385
1387
|
- Release 1.0.0-alpha.10 [Alin Voinea - [`7014d08`](https://github.com/eea/volto-eea-design-system/commit/7014d080ce114bd0bc039abeecbd7229333b0971)]
|
|
1386
1388
|
- Add variable definitions [kreafox - [`293fe65`](https://github.com/eea/volto-eea-design-system/commit/293fe65e2f24e6290e1286229169a77f9be4750e)]
|
|
1387
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`ef58a6f`](https://github.com/eea/volto-eea-design-system/commit/ef58a6f5ad8deea26b1395a86778fe1159b7617b)]
|
|
1388
1389
|
- Back to dev [Alin Voinea - [`31d4616`](https://github.com/eea/volto-eea-design-system/commit/31d461662b9184a7bbe190e86f3c47fab39229fe)]
|
|
1389
1390
|
### [1.0.0-alpha.9](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.8...1.0.0-alpha.9) - 28 December 2022
|
|
1390
1391
|
|
|
@@ -1442,7 +1443,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1442
1443
|
- bump package version [David Ichim - [`b4628be`](https://github.com/eea/volto-eea-design-system/commit/b4628bed134abc76e38a243d4e98143e19cef989)]
|
|
1443
1444
|
- feature(docusaurus, storybook): logos selection for sites plus inverted options #253 from eea/doc-logo-page [ichim-david - [`dbfc90d`](https://github.com/eea/volto-eea-design-system/commit/dbfc90d035dc40e9d4054347f00fde4de486d63d)]
|
|
1444
1445
|
- (feat): Add ability to disable the language select from website top menu - refs #158616 [dobri1408 - [`411c8e4`](https://github.com/eea/volto-eea-design-system/commit/411c8e4afaf0b2b9edfdeeecdca22aa4cc41f329)]
|
|
1445
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`c4769e9`](https://github.com/eea/volto-eea-design-system/commit/c4769e987d525f5dcafac8e6cf8a89fd8111667d)]
|
|
1446
1446
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`92feea0`](https://github.com/eea/volto-eea-design-system/commit/92feea09796c9ef0530f65fa1d34139905133215)]
|
|
1447
1447
|
- Proof reading page header section [ichim-david - [`230239e`](https://github.com/eea/volto-eea-design-system/commit/230239e1b22734fb8606656985bc5e513731e244)]
|
|
1448
1448
|
### [1.0.0-alpha.7](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.6...1.0.0-alpha.7) - 16 December 2022
|
|
@@ -1474,7 +1474,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1474
1474
|
#### :hammer_and_wrench: Others
|
|
1475
1475
|
|
|
1476
1476
|
- Release 1.0.0-alpha.7 [Alin Voinea - [`7e66bcc`](https://github.com/eea/volto-eea-design-system/commit/7e66bcc296b389bc55073e7f99681534977dce3a)]
|
|
1477
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`ce47e9b`](https://github.com/eea/volto-eea-design-system/commit/ce47e9b163bcb4eda988e3a87718b54ffbd3f99f)]
|
|
1478
1477
|
- added back descriptionDistance variable until package release [David Ichim - [`3af811a`](https://github.com/eea/volto-eea-design-system/commit/3af811a8d86a132e16de118697ba5a4302a8a4da)]
|
|
1479
1478
|
- Back to dev [Alin Voinea - [`cb531c9`](https://github.com/eea/volto-eea-design-system/commit/cb531c933c907bdbb88c9de0f1df2eb7ce899a4c)]
|
|
1480
1479
|
- Proper paths if the package is not installed, but in development [Tiberiu Ichim - [`7a2655f`](https://github.com/eea/volto-eea-design-system/commit/7a2655f7cf9d3c687f172eefcf2b4cff4b12f832)]
|
|
@@ -1562,7 +1561,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1562
1561
|
#### :hammer_and_wrench: Others
|
|
1563
1562
|
|
|
1564
1563
|
- feature(Docusaurus): Updates on color palette information including thematic websites #231 from eea/refactor-docusaurus [ichim-david - [`ec7843d`](https://github.com/eea/volto-eea-design-system/commit/ec7843dea07f626dc1c71ae1baa8bb5b0caa52f3)]
|
|
1565
|
-
- Upgrade Jenkinsfile storybook to yarn 3 [Alin Voinea - [`d20de8d`](https://github.com/eea/volto-eea-design-system/commit/d20de8d6e21a14660b7b5125a80218a8a6f19e62)]
|
|
1566
1564
|
- Back to dev [Alin Voinea - [`563fbc5`](https://github.com/eea/volto-eea-design-system/commit/563fbc5fac0d4b0295690d0a3a4e04271753f18a)]
|
|
1567
1565
|
- perf(docusaurus): added remixicon and roboto locally [Giorgos Stamatis - [`b67b1a7`](https://github.com/eea/volto-eea-design-system/commit/b67b1a72bc9cdc7c62a25967e81b430f8b62d558)]
|
|
1568
1566
|
### [1.0.0-alpha.4](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.3...1.0.0-alpha.4) - 22 November 2022
|
|
@@ -1655,7 +1653,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1655
1653
|
- modified left value of full width classes with toolbars [David Ichim - [`70d82d4`](https://github.com/eea/volto-eea-design-system/commit/70d82d47fbc2c00a3a709de0d5c087c8443a1eae)]
|
|
1656
1654
|
- WIP settings column grid width when using full size class [David Ichim - [`affc7ac`](https://github.com/eea/volto-eea-design-system/commit/affc7ac99527aa92d5a192d90dc8c9ec46a66404)]
|
|
1657
1655
|
- fix eslint [Miu Razvan - [`30c52e4`](https://github.com/eea/volto-eea-design-system/commit/30c52e4eb443555ca44c1b35df064e73d52c0a8b)]
|
|
1658
|
-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`76a41c7`](https://github.com/eea/volto-eea-design-system/commit/76a41c786995fd54afe4d1c345de939f683ffa70)]
|
|
1659
1656
|
- fix broken variable call for contentBox.variables introduced in previous commit by mistake [David Ichim - [`d249c11`](https://github.com/eea/volto-eea-design-system/commit/d249c1160d19bedb174a2fde3fdab48d9ce297d4)]
|
|
1660
1657
|
- clean up [Miu Razvan - [`89f3cb3`](https://github.com/eea/volto-eea-design-system/commit/89f3cb33d70a14806a953f0acd1807e94169ee5c)]
|
|
1661
1658
|
- Feature(container): flexible container size #260 from eea/feature-flexible-container [ichim-david - [`8f84c5b`](https://github.com/eea/volto-eea-design-system/commit/8f84c5b67afe9cbe01b2a44a8f92a9a554e1036a)]
|
|
@@ -1757,7 +1754,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1757
1754
|
|
|
1758
1755
|
#### :nail_care: Enhancements
|
|
1759
1756
|
|
|
1760
|
-
- change(jenkins): added yarn policy for storybook building [ichim-david - [`3d1b844`](https://github.com/eea/volto-eea-design-system/commit/3d1b844efeea40b99c00c9aa97089e0a0be58a57)]
|
|
1761
1757
|
- change(docusaurus): typography updates [ichim-david - [`60a93a4`](https://github.com/eea/volto-eea-design-system/commit/60a93a4aece4e478ae13c2dfe697fd3703aa178a)]
|
|
1762
1758
|
- change(accordion): allow customization of accordion title with css variables [David Ichim - [`15e7d27`](https://github.com/eea/volto-eea-design-system/commit/15e7d27f02c640df582f51a51ef36e645723f842)]
|
|
1763
1759
|
- change(content-box): added css variables that will set text color and background for children [David Ichim - [`86cac53`](https://github.com/eea/volto-eea-design-system/commit/86cac531cc94386b6022e1be80dba826b39f2443)]
|
|
@@ -1792,7 +1788,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1792
1788
|
#### :hammer_and_wrench: Others
|
|
1793
1789
|
|
|
1794
1790
|
- Merge pull request #243 from eea/develop [ichim-david - [`576564c`](https://github.com/eea/volto-eea-design-system/commit/576564ce395ee6ac9e74bcb19d5c4f0b4cd3c33b)]
|
|
1795
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`4a5be6e`](https://github.com/eea/volto-eea-design-system/commit/4a5be6eec78dae230626e61ea2c77e7f3c62510d)]
|
|
1796
1791
|
- Back to dev [Alin Voinea - [`b251255`](https://github.com/eea/volto-eea-design-system/commit/b251255a7ed14d8290717726d86eaf54b87aa2d4)]
|
|
1797
1792
|
### [0.9.0](https://github.com/eea/volto-eea-design-system/compare/0.8.1...0.9.0) - 19 September 2022
|
|
1798
1793
|
|
|
@@ -2548,10 +2543,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2548
2543
|
#### :hammer_and_wrench: Others
|
|
2549
2544
|
|
|
2550
2545
|
- prettier changes [David Ichim - [`134da52`](https://github.com/eea/volto-eea-design-system/commit/134da52549b9d5eac5a12b7ad3005073500ac2c4)]
|
|
2551
|
-
- [JENKINSFILE] remove debug, add error per stage [valentinab25 - [`903eecd`](https://github.com/eea/volto-eea-design-system/commit/903eecdb6bcbb8d73cff5e447d80c85e2a2c906d)]
|
|
2552
|
-
- [JENKINSFILE] mention comment author in comment [valentinab25 - [`39a26aa`](https://github.com/eea/volto-eea-design-system/commit/39a26aa1ff0f35e93e8df9f442c29c5ab79ff493)]
|
|
2553
|
-
- [JENKINSFILE] format PR comments [valentinab25 - [`739438c`](https://github.com/eea/volto-eea-design-system/commit/739438c64950c745d630d1998314a2bed595b23a)]
|
|
2554
|
-
- [JENKINSFILE] Add failure comment, no jenkins fail [valentinab25 - [`c325bf1`](https://github.com/eea/volto-eea-design-system/commit/c325bf14f3fb0da150f2a56cda0a9f03d8d8a628)]
|
|
2555
2546
|
### [0.2.3](https://github.com/eea/volto-eea-design-system/compare/0.2.2...0.2.3) - 29 April 2022
|
|
2556
2547
|
|
|
2557
2548
|
#### :rocket: New Features
|
|
@@ -2976,7 +2967,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2976
2967
|
- set profile section overflow to auto [nileshgulia1 - [`71ab47f`](https://github.com/eea/volto-eea-design-system/commit/71ab47f89a433233c14b394c3824e607dd18a393)]
|
|
2977
2968
|
- remove segment custom width [nileshgulia1 - [`1d3ea40`](https://github.com/eea/volto-eea-design-system/commit/1d3ea40f98bbdc1eab95b4da739a659b5e29ec16)]
|
|
2978
2969
|
- fix profile section css overflow [nileshgulia1 - [`db5126f`](https://github.com/eea/volto-eea-design-system/commit/db5126fc902e191d1e18fb7e4c54877c8d8786e6)]
|
|
2979
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`647a6e3`](https://github.com/eea/volto-eea-design-system/commit/647a6e3e2093f2c4884c356eb148453551c8f33f)]
|
|
2980
2970
|
- fix warning related to proptype [nileshgulia1 - [`946c6c6`](https://github.com/eea/volto-eea-design-system/commit/946c6c6bc9dece0985ae4b9f9cad6ece2be0ff2c)]
|
|
2981
2971
|
- removed override already present in card.less [ichim-david - [`50d2ab2`](https://github.com/eea/volto-eea-design-system/commit/50d2ab26f85c8f409da02ec128cc1df34848ca69)]
|
|
2982
2972
|
- update [Miu Razvan - [`bbcab87`](https://github.com/eea/volto-eea-design-system/commit/bbcab87ef4c8475f347f0daf4ab7e428e69c2316)]
|
|
@@ -3063,7 +3053,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
3063
3053
|
- remove segment custom width [nileshgulia1 - [`4a60d84`](https://github.com/eea/volto-eea-design-system/commit/4a60d84d5fe76578b7760aa1dad6eef9a20916a7)]
|
|
3064
3054
|
- Reformat header.less [Tiberiu Ichim - [`1f99dfc`](https://github.com/eea/volto-eea-design-system/commit/1f99dfc82c165304ca5600ce5138c1233615ab69)]
|
|
3065
3055
|
- fix profile section css overflow [nileshgulia1 - [`8fd2654`](https://github.com/eea/volto-eea-design-system/commit/8fd265413149f1b5e033dffa0fbcb5ef5ecad15f)]
|
|
3066
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6051724`](https://github.com/eea/volto-eea-design-system/commit/6051724437a38675e659c797bb5586ef81286ec0)]
|
|
3067
3056
|
- fix warning related to proptype [nileshgulia1 - [`824b9be`](https://github.com/eea/volto-eea-design-system/commit/824b9beff77aae139882cd50a1d670a02ec6f723)]
|
|
3068
3057
|
- refactor breadcrumbs component, make it functional and customizable [nileshgulia1 - [`4ec374e`](https://github.com/eea/volto-eea-design-system/commit/4ec374e20565eb0a5aed0ff67a02cd6f77eba1f0)]
|
|
3069
3058
|
- removed override already present in card.less [ichim-david - [`93c4e5a`](https://github.com/eea/volto-eea-design-system/commit/93c4e5aac9cc85ff2cc6c04180f6655d5f5616dc)]
|
|
@@ -3632,7 +3621,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
3632
3621
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`3af46d2`](https://github.com/eea/volto-eea-design-system/commit/3af46d2b14fa0b1ef44736f25b0f9ac93b23d18d)]
|
|
3633
3622
|
- Refs #140454 updated eea-design-system readme with extra info on package contents [David Ichim - [`d2efc3d`](https://github.com/eea/volto-eea-design-system/commit/d2efc3ddae7b91efc82cf3bce8fb8e42d696a780)]
|
|
3634
3623
|
- Refs #140454 add h1 to the list of elements that are max 800px and centered [David Ichim - [`7d3c30f`](https://github.com/eea/volto-eea-design-system/commit/7d3c30f409aa4cb43810839f8960589456cc1b2e)]
|
|
3635
|
-
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`8d657d0`](https://github.com/eea/volto-eea-design-system/commit/8d657d056cde5163cfe90ac66bc973f55d82e5e9)]
|
|
3636
3624
|
### [0.1.0](https://github.com/eea/volto-eea-design-system/compare/0.0.1...0.1.0) - 17 November 2021
|
|
3637
3625
|
|
|
3638
3626
|
#### :hammer_and_wrench: Others
|
package/README.md
CHANGED
|
@@ -119,6 +119,65 @@ See [RELEASE.md](https://github.com/eea/volto-eea-design-system/blob/master/RELE
|
|
|
119
119
|
|
|
120
120
|
See [DEVELOP.md](https://github.com/eea/volto-eea-design-system/blob/master/DEVELOP.md).
|
|
121
121
|
|
|
122
|
+
## Secret Scanning
|
|
123
|
+
|
|
124
|
+
This repository uses the Betterleaks GitHub Action to scan the current
|
|
125
|
+
repository content on every push and pull request. The scan uses the rules in
|
|
126
|
+
`.gitleaks.toml` and uploads a `betterleaks-report` artifact when a finding is
|
|
127
|
+
detected.
|
|
128
|
+
|
|
129
|
+
If the optional SMTP secrets are configured, failed scans also send an email to
|
|
130
|
+
the last commit committer. The workflow expects these repository or
|
|
131
|
+
organization secrets:
|
|
132
|
+
|
|
133
|
+
- `SMTP_URL`
|
|
134
|
+
- `SMTP_PORT` (optional, defaults to `25`)
|
|
135
|
+
- `SMTP_EMAIL`
|
|
136
|
+
- `SMTP_PASSWORD` (optional if the SMTP server does not require authentication)
|
|
137
|
+
|
|
138
|
+
Port `465` is sent with direct TLS; other ports use the default SMTP handshake.
|
|
139
|
+
The email includes a short finding summary from the redacted Betterleaks report,
|
|
140
|
+
including the redacted matched line from each finding.
|
|
141
|
+
|
|
142
|
+
There are three common outcomes:
|
|
143
|
+
|
|
144
|
+
1. **Everything is OK.** The `Betterleaks / Scan for secrets` check is green and
|
|
145
|
+
no action is needed. Regular references to runtime values are OK, for example:
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
const tokenFromCookie = req.universalCookies.get('auth_token');
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
2. **A real secret was found.** The check is red and the workflow log asks you to
|
|
152
|
+
download the `betterleaks-report` artifact. Open the artifact from the GitHub
|
|
153
|
+
Actions run and check the reported file, line and rule. Remove the committed
|
|
154
|
+
value, move it to the proper secret store, and rotate it if it was exposed.
|
|
155
|
+
A report entry looks like this:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"RuleID": "secret-literal-assignment",
|
|
160
|
+
"File": "src/config.js",
|
|
161
|
+
"StartLine": 12,
|
|
162
|
+
"Secret": "[REDACTED]"
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
3. **The finding is a false positive.** Keep the value only if it is clearly not
|
|
167
|
+
sensitive, such as a test fixture, placeholder, or public example. Add
|
|
168
|
+
`betterleaks:allow` on the same line and include a short explanation in the
|
|
169
|
+
pull request.
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
const testPassword = 'admin'; //betterleaks:allow
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
password: "admin" #betterleaks:allow
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Do not add `betterleaks:allow` to real credentials.
|
|
180
|
+
|
|
122
181
|
## Copyright and license
|
|
123
182
|
|
|
124
183
|
The Initial Owner of the Original Code is European Environment Agency (EEA).
|
package/RELEASE.md
CHANGED
|
@@ -33,7 +33,7 @@ Release-it is a tool that automates 4 important steps in the release process:
|
|
|
33
33
|
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
34
34
|
|
|
35
35
|
```
|
|
36
|
-
export GITHUB_TOKEN=
|
|
36
|
+
export GITHUB_TOKEN="${GITHUB_TOKEN}"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ let cardData = {
|
|
|
21
21
|
"State of Europe's environment",
|
|
22
22
|
],
|
|
23
23
|
imgUrl: [
|
|
24
|
-
'https://www.eea.europa.eu/
|
|
24
|
+
'https://www.eea.europa.eu/en/topics/at-a-glance/economy-and-resources/@@images/image/preview',
|
|
25
25
|
'https://www.eea.europa.eu/en/topics/at-a-glance/health/@@images/image/preview',
|
|
26
26
|
'https://www.eea.europa.eu/en/topics/at-a-glance/nature/@@images/image/preview',
|
|
27
27
|
'https://www.eea.europa.eu/en/topics/at-a-glance/climate/@@images/image/preview',
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Card, Image, Container } from 'semantic-ui-react';
|
|
3
3
|
|
|
4
4
|
const imageUrl =
|
|
5
|
-
'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/
|
|
5
|
+
'https://www.eea.europa.eu/en/analysis/publications/eea-eionet-strategy-2021-2030/@@images/preview_image/preview';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/Card/Publication',
|
|
@@ -3,7 +3,7 @@ import RelatedContent from './RelatedContent';
|
|
|
3
3
|
import { Container, Tab } from 'semantic-ui-react';
|
|
4
4
|
|
|
5
5
|
const imageUrl =
|
|
6
|
-
'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/
|
|
6
|
+
'https://www.eea.europa.eu/en/analysis/publications/eea-eionet-strategy-2021-2030/@@images/preview_image/preview';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Components/Card/Publication',
|
package/src/ui/Header/Header.jsx
CHANGED
|
@@ -16,6 +16,7 @@ import burgerIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/asse
|
|
|
16
16
|
|
|
17
17
|
import HeaderSearchPopUp from './HeaderSearchPopUp';
|
|
18
18
|
import HeaderMenuPopUp from './HeaderMenuPopUp';
|
|
19
|
+
import { useAISummaryToggle } from './useAISummaryToggle';
|
|
19
20
|
import { findBestMatchingMenuItem, isMenuItemActive } from './utils';
|
|
20
21
|
import PropTypes from 'prop-types';
|
|
21
22
|
import omit from 'lodash/omit';
|
|
@@ -166,7 +167,12 @@ const Main = ({
|
|
|
166
167
|
state.reduxAsyncConnect?.headerSettings?.useAISearchIcon || false,
|
|
167
168
|
);
|
|
168
169
|
|
|
169
|
-
const
|
|
170
|
+
const [aiSummaryEnabled] = useAISummaryToggle();
|
|
171
|
+
|
|
172
|
+
// The AI sparkle only shows when the AI search icon is configured and
|
|
173
|
+
// the user has not opted out of AI summaries.
|
|
174
|
+
const searchIcon =
|
|
175
|
+
useAISearchIcon && aiSummaryEnabled ? aiSearchIcon : searchSVG;
|
|
170
176
|
|
|
171
177
|
const itemsLayouts =
|
|
172
178
|
menuItemsLayouts || config.settings?.menuItemsLayouts || {};
|
|
@@ -770,3 +770,58 @@ test('menu click outside behavior with different active states', async () => {
|
|
|
770
770
|
expect(burgerButton).toHaveAttribute('aria-expanded', 'false');
|
|
771
771
|
expect(searchButton).toHaveAttribute('aria-expanded', 'false');
|
|
772
772
|
});
|
|
773
|
+
|
|
774
|
+
describe('header search icon and AI summary state', () => {
|
|
775
|
+
const renderMain = () =>
|
|
776
|
+
renderWithProvider(
|
|
777
|
+
<Router history={createMemoryHistory()}>
|
|
778
|
+
<Header>
|
|
779
|
+
<Header.Main
|
|
780
|
+
pathname="/test"
|
|
781
|
+
menuItems={[
|
|
782
|
+
{ '@id': '/test', url: '/test', title: 'Test', items: [] },
|
|
783
|
+
]}
|
|
784
|
+
renderGlobalMenuItem={(item) => (
|
|
785
|
+
<a href={item.url} title={item.title}>
|
|
786
|
+
{item.title}
|
|
787
|
+
</a>
|
|
788
|
+
)}
|
|
789
|
+
/>
|
|
790
|
+
</Header>
|
|
791
|
+
</Router>,
|
|
792
|
+
);
|
|
793
|
+
|
|
794
|
+
beforeEach(() => {
|
|
795
|
+
window.localStorage.clear();
|
|
796
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = false;
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
it('shows the plain magnifier when useAISearchIcon is false', () => {
|
|
800
|
+
const { container } = renderMain();
|
|
801
|
+
expect(container.querySelector('img[alt="Global search"]')).toHaveAttribute(
|
|
802
|
+
'src',
|
|
803
|
+
'search-line.svg',
|
|
804
|
+
);
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
it('shows the AI sparkle when useAISearchIcon is true and AI summaries are enabled', () => {
|
|
808
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = true;
|
|
809
|
+
|
|
810
|
+
const { container } = renderMain();
|
|
811
|
+
expect(container.querySelector('img[alt="Global search"]')).toHaveAttribute(
|
|
812
|
+
'src',
|
|
813
|
+
'ai-search.svg',
|
|
814
|
+
);
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
it('shows the plain magnifier when useAISearchIcon is true but AI summaries are disabled', () => {
|
|
818
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = true;
|
|
819
|
+
window.localStorage.setItem('eea-ai-summary-enabled', '0');
|
|
820
|
+
|
|
821
|
+
const { container } = renderMain();
|
|
822
|
+
expect(container.querySelector('img[alt="Global search"]')).toHaveAttribute(
|
|
823
|
+
'src',
|
|
824
|
+
'search-line.svg',
|
|
825
|
+
);
|
|
826
|
+
});
|
|
827
|
+
});
|
|
@@ -9,6 +9,7 @@ import { handleEnterKeyPress } from '@eeacms/volto-eea-design-system/helpers';
|
|
|
9
9
|
|
|
10
10
|
import searchSVG from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/search-line.svg';
|
|
11
11
|
import aiSearchIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/ai-search.svg';
|
|
12
|
+
import { useAISummaryToggle } from './useAISummaryToggle';
|
|
12
13
|
|
|
13
14
|
const getRandomItems = (arr, max) => {
|
|
14
15
|
return (
|
|
@@ -96,7 +97,12 @@ function HeaderSearchPopUp({
|
|
|
96
97
|
state.reduxAsyncConnect?.headerSettings?.useAISearchIcon || false,
|
|
97
98
|
);
|
|
98
99
|
|
|
99
|
-
const
|
|
100
|
+
const [aiSummaryEnabled] = useAISummaryToggle();
|
|
101
|
+
|
|
102
|
+
// The AI sparkle only shows when the AI search icon is configured and
|
|
103
|
+
// the user has not opted out of AI summaries.
|
|
104
|
+
const searchIcon =
|
|
105
|
+
useAISearchIcon && aiSummaryEnabled ? aiSearchIcon : searchSVG;
|
|
100
106
|
|
|
101
107
|
useEffect(() => {
|
|
102
108
|
setVisibileSuggestions(getRandomItems(suggestions, maxToShow));
|
|
@@ -248,4 +248,53 @@ describe('HeaderSearchPopUp', () => {
|
|
|
248
248
|
expect(screen.getByPlaceholderText('Search')).toBeInTheDocument();
|
|
249
249
|
expect(screen.queryByText('Suggestions Title')).not.toBeInTheDocument();
|
|
250
250
|
});
|
|
251
|
+
|
|
252
|
+
describe('search icon and AI summary state', () => {
|
|
253
|
+
beforeEach(() => {
|
|
254
|
+
window.localStorage.clear();
|
|
255
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = false;
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const renderPopup = () =>
|
|
259
|
+
render(
|
|
260
|
+
<Provider store={mockStore}>
|
|
261
|
+
<Router history={history}>
|
|
262
|
+
<HeaderSearchPopUp
|
|
263
|
+
headerSearchBox={sampleHeaderSearchBox}
|
|
264
|
+
onClose={mockOnClose}
|
|
265
|
+
triggerRefs={[]}
|
|
266
|
+
/>
|
|
267
|
+
</Router>
|
|
268
|
+
</Provider>,
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
it('shows the plain magnifier when useAISearchIcon is false', () => {
|
|
272
|
+
const { container } = renderPopup();
|
|
273
|
+
expect(container.querySelector('img')).toHaveAttribute(
|
|
274
|
+
'src',
|
|
275
|
+
'search-line.svg',
|
|
276
|
+
);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('shows the AI sparkle when useAISearchIcon is true and AI summaries are enabled', () => {
|
|
280
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = true;
|
|
281
|
+
|
|
282
|
+
const { container } = renderPopup();
|
|
283
|
+
expect(container.querySelector('img')).toHaveAttribute(
|
|
284
|
+
'src',
|
|
285
|
+
'ai-search.svg',
|
|
286
|
+
);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('shows the plain magnifier when useAISearchIcon is true but AI summaries are disabled', () => {
|
|
290
|
+
mockState.reduxAsyncConnect.headerSettings.useAISearchIcon = true;
|
|
291
|
+
window.localStorage.setItem('eea-ai-summary-enabled', '0');
|
|
292
|
+
|
|
293
|
+
const { container } = renderPopup();
|
|
294
|
+
expect(container.querySelector('img')).toHaveAttribute(
|
|
295
|
+
'src',
|
|
296
|
+
'search-line.svg',
|
|
297
|
+
);
|
|
298
|
+
});
|
|
299
|
+
});
|
|
251
300
|
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Summary opt-in/opt-out state.
|
|
5
|
+
*
|
|
6
|
+
* Shared contract with the AI summary gating in
|
|
7
|
+
* @eeacms/volto-searchlib (lib/aiSummaryToggle):
|
|
8
|
+
* - the header search icons in this addon use the state to decide between
|
|
9
|
+
* the AI sparkle and the plain magnifier
|
|
10
|
+
* - the advanced-search AI Summary box (volto-searchlib) hosts the
|
|
11
|
+
* user-facing opt-in/opt-out controls
|
|
12
|
+
* - localStorage key: `eea-ai-summary-enabled` ("1" on, "0" off, default on)
|
|
13
|
+
* - CustomEvent `eea:ai-summary-toggle` (detail: boolean) for same-tab sync
|
|
14
|
+
* - native `storage` event for cross-tab sync
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const AI_SUMMARY_STORAGE_KEY = 'eea-ai-summary-enabled';
|
|
18
|
+
export const AI_SUMMARY_TOGGLE_EVENT = 'eea:ai-summary-toggle';
|
|
19
|
+
|
|
20
|
+
export const readAISummaryEnabled = (storage = window.localStorage) =>
|
|
21
|
+
storage.getItem(AI_SUMMARY_STORAGE_KEY) !== '0';
|
|
22
|
+
|
|
23
|
+
export const writeAISummaryEnabled = (
|
|
24
|
+
enabled,
|
|
25
|
+
storage = window.localStorage,
|
|
26
|
+
) => {
|
|
27
|
+
storage.setItem(AI_SUMMARY_STORAGE_KEY, enabled ? '1' : '0');
|
|
28
|
+
window.dispatchEvent(
|
|
29
|
+
new CustomEvent(AI_SUMMARY_TOGGLE_EVENT, { detail: enabled }),
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const useAISummaryToggle = () => {
|
|
34
|
+
const [enabled, setEnabled] = useState(readAISummaryEnabled);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const onToggleEvent = (event) => {
|
|
38
|
+
if (typeof event?.detail === 'boolean') setEnabled(event.detail);
|
|
39
|
+
};
|
|
40
|
+
const onStorageEvent = (event) => {
|
|
41
|
+
if (event.key === AI_SUMMARY_STORAGE_KEY) {
|
|
42
|
+
setEnabled(event.newValue !== '0');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
window.addEventListener(AI_SUMMARY_TOGGLE_EVENT, onToggleEvent);
|
|
46
|
+
window.addEventListener('storage', onStorageEvent);
|
|
47
|
+
return () => {
|
|
48
|
+
window.removeEventListener(AI_SUMMARY_TOGGLE_EVENT, onToggleEvent);
|
|
49
|
+
window.removeEventListener('storage', onStorageEvent);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
const toggle = useCallback(() => {
|
|
54
|
+
const next = !readAISummaryEnabled();
|
|
55
|
+
writeAISummaryEnabled(next);
|
|
56
|
+
setEnabled(next);
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
return [enabled, toggle];
|
|
60
|
+
};
|