@eeacms/volto-eea-website-theme 1.34.0 → 2.0.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.
Files changed (54) hide show
  1. package/.eslintrc.js +7 -2
  2. package/CHANGELOG.md +44 -20
  3. package/docker-compose.yml +1 -1
  4. package/jest-addon.config.js +3 -0
  5. package/package.json +2 -1
  6. package/src/components/manage/Blocks/LayoutSettings/index.js +3 -1
  7. package/src/components/manage/Blocks/Title/index.js +3 -1
  8. package/src/components/manage/Blocks/Title/schema.js +3 -1
  9. package/src/components/theme/Banner/View.jsx +12 -5
  10. package/src/components/theme/DraftBackground/DraftBackground.jsx +1 -0
  11. package/src/components/theme/DraftBackground/DraftBackground.test.jsx +85 -0
  12. package/src/config.js +2 -0
  13. package/src/customizations/@plone/volto-slate/blocks/Text/TextBlockView.jsx +32 -0
  14. package/src/customizations/@plone/volto-slate/editor/render.jsx +75 -0
  15. package/src/customizations/@plone/volto-slate/elementEditor/utils.js +76 -75
  16. package/src/customizations/volto/components/manage/Blocks/Grid/Edit.jsx +70 -0
  17. package/src/customizations/volto/components/manage/Blocks/Grid/View.jsx +61 -0
  18. package/src/customizations/volto/components/manage/Blocks/Grid/readme.md +1 -0
  19. package/src/customizations/volto/components/manage/Blocks/Image/Edit.jsx +82 -23
  20. package/src/customizations/volto/components/manage/Blocks/Image/Edit.test.jsx +10 -3
  21. package/src/customizations/volto/components/manage/Blocks/Image/View.jsx +110 -111
  22. package/src/customizations/volto/components/manage/Blocks/Image/schema.js +17 -2
  23. package/src/customizations/volto/components/manage/Blocks/LeadImage/Edit.jsx +35 -14
  24. package/src/customizations/volto/components/manage/Blocks/LeadImage/View.jsx +65 -79
  25. package/src/customizations/volto/components/manage/Display/Display.jsx +306 -0
  26. package/src/customizations/volto/components/manage/Display/Readme.md +1 -0
  27. package/src/customizations/volto/components/manage/Sidebar/SidebarPopup copy.jsx +82 -0
  28. package/src/customizations/volto/components/manage/Toolbar/More.jsx +541 -0
  29. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +3 -1
  30. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +24 -14
  31. package/src/customizations/volto/components/manage/Widgets/README.md +1 -0
  32. package/src/customizations/volto/components/manage/Workflow/README.txt +1 -0
  33. package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +324 -0
  34. package/src/customizations/volto/components/manage/Workflow/Workflow.test.jsx +81 -0
  35. package/src/customizations/volto/components/theme/Comments/Comments.jsx +1 -2
  36. package/src/customizations/volto/components/theme/ContactForm/ContactForm.jsx +1 -1
  37. package/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx +1 -0
  38. package/src/index.js +21 -16
  39. package/src/middleware/ok.js +4 -2
  40. package/src/middleware/voltoCustom.js +4 -2
  41. package/src/slate.js +10 -8
  42. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/README.txt +0 -1
  43. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/StyleMenu.jsx +0 -157
  44. package/src/customizations/@plone/volto-slate/editor/plugins/StyleMenu/utils.js +0 -168
  45. package/src/customizations/volto/components/manage/Add/Add.jsx +0 -498
  46. package/src/customizations/volto/components/manage/Add/readme.md +0 -1
  47. package/src/customizations/volto/components/manage/Contents/ContentsPropertiesModal.jsx +0 -232
  48. package/src/customizations/volto/components/manage/Form/Form.jsx +0 -810
  49. package/src/customizations/volto/components/manage/Form/Form.test.jsx +0 -1124
  50. package/src/customizations/volto/components/manage/Form/ModalForm.jsx +0 -326
  51. package/src/customizations/volto/components/manage/Sharing/Sharing.jsx +0 -528
  52. package/src/customizations/volto/components/manage/Sharing/Sharing.test.jsx +0 -72
  53. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.test.jsx +0 -193
  54. package/src/customizations/volto/components/theme/AppExtras/AppExtras.jsx +0 -27
package/.eslintrc.js CHANGED
@@ -48,8 +48,13 @@ const defaultConfig = {
48
48
  },
49
49
  },
50
50
  rules: {
51
- 'react/jsx-no-target-blank': 'off',
52
- },
51
+ 'react/jsx-no-target-blank': [
52
+ 'error',
53
+ {
54
+ allowReferrer: true,
55
+ },
56
+ ],
57
+ }
53
58
  };
54
59
 
55
60
  const config = addonExtenders.reduce(
package/CHANGELOG.md CHANGED
@@ -4,7 +4,50 @@ 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.33.2](https://github.com/eea/volto-eea-website-theme/compare/1.33.1...1.33.2) - 13 April 2024
7
+ ### [2.0.0](https://github.com/eea/volto-eea-website-theme/compare/1.34.0...2.0.0) - 10 May 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: Volto 17 support - refs #259049 [Teodor Voicu - [`79ce620`](https://github.com/eea/volto-eea-website-theme/commit/79ce6202469523c21462a86cb72b93016b10a2b6)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix(draft_image): added fixes from 1.x.x branch [David Ichim - [`b62de0a`](https://github.com/eea/volto-eea-website-theme/commit/b62de0a8fd9c953210f4b371b5117d70f9e04040)]
16
+
17
+ #### :nail_care: Enhancements
18
+
19
+ - change(draft_image): added comments to DraftBackground code [David Ichim - [`0cb4304`](https://github.com/eea/volto-eea-website-theme/commit/0cb430424281f0d0a78e2f9b1326b6bc4128a6f3)]
20
+ - refactor: Disable data figure and plotly chart - refs #269278 [dobri1408 - [`d8fd0da`](https://github.com/eea/volto-eea-website-theme/commit/d8fd0dab10aceebf57cff5c1e777b795117b5a04)]
21
+ - change(draft-image): to remove image when published date is set to the future [David Ichim - [`9b9e023`](https://github.com/eea/volto-eea-website-theme/commit/9b9e0232fe6cd624c19dc87bc8152477f1ee83fd)]
22
+ - refactor: Move all customizations from volto-eea-website-policy [alin - [`07650fe`](https://github.com/eea/volto-eea-website-theme/commit/07650fe1c55571ec628dbe2cf8394709f0c7ae2d)]
23
+
24
+ #### :house: Internal changes
25
+
26
+ - style: Automated code fix [eea-jenkins - [`e671c83`](https://github.com/eea/volto-eea-website-theme/commit/e671c834773f9091e1dafb8ec7a1cbea88e53ee2)]
27
+ - style: Automated code fix [eea-jenkins - [`5156bb5`](https://github.com/eea/volto-eea-website-theme/commit/5156bb54b48f9731278ea860847a019fff10a84f)]
28
+
29
+ #### :hammer_and_wrench: Others
30
+
31
+ - Bump package version to 2.0.0 to signal major release due to Volto 17 jump [David Ichim - [`ffe3049`](https://github.com/eea/volto-eea-website-theme/commit/ffe3049b3b656093a44f05044dbe7cd63bac495f)]
32
+ ### [1.34.0](https://github.com/eea/volto-eea-website-theme/compare/1.33.2...1.34.0) - 9 May 2024
33
+
34
+ #### :bug: Bug Fixes
35
+
36
+ - fix: Make sure effectiveDate is not null/undefined [alin - [`43400bc`](https://github.com/eea/volto-eea-website-theme/commit/43400bcce422049d9d38f17c7cc29e88062da902)]
37
+ - fix: DraftBackground for effectiveDate in the future [alin - [`da7fa80`](https://github.com/eea/volto-eea-website-theme/commit/da7fa806e5d6edbb7b016f0356d5a886b75ba892)]
38
+
39
+ #### :nail_care: Enhancements
40
+
41
+ - refactor: Disable data figure and plotly chart - refs #269278 [dobri1408 - [`002ef00`](https://github.com/eea/volto-eea-website-theme/commit/002ef003ad872ea8dd5c74acf74a85ca1fd1992b)]
42
+ - change(draft-image): show draft image for items with publishing date in the future [David Ichim - [`59a3873`](https://github.com/eea/volto-eea-website-theme/commit/59a387364f40d8d66a747921ccff946e7f8814e1)]
43
+
44
+ #### :hammer_and_wrench: Others
45
+
46
+ - Release 1.34.0 [alin - [`92cc065`](https://github.com/eea/volto-eea-website-theme/commit/92cc065730f44412a04b2df7159c540d858f4607)]
47
+ - Revert "Release 1.40.0" [alin - [`c1a4f30`](https://github.com/eea/volto-eea-website-theme/commit/c1a4f3042a91ebb4a1d674914d3bccf68954c94f)]
48
+ - Revert "fix: DraftBackground for effectiveDate in the future" [alin - [`ed2ca9b`](https://github.com/eea/volto-eea-website-theme/commit/ed2ca9b5881c6991d82bb2a8d3f0fe8e29f1a6d7)]
49
+ - Release 1.40.0 [alin - [`210f833`](https://github.com/eea/volto-eea-website-theme/commit/210f83384b6401f7c9a0e08070d69dd1fed690b1)]
50
+ ### [1.33.2](https://github.com/eea/volto-eea-website-theme/compare/1.33.1...1.33.2) - 16 April 2024
8
51
 
9
52
  #### :bug: Bug Fixes
10
53
 
@@ -12,7 +55,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
12
55
 
13
56
  #### :hammer_and_wrench: Others
14
57
 
15
- - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`adc6730`](https://github.com/eea/volto-eea-website-theme/commit/adc6730e21a37afb865b842182624401de6a29f5)]
16
58
  ### [1.33.1](https://github.com/eea/volto-eea-website-theme/compare/1.33.0...1.33.1) - 4 April 2024
17
59
 
18
60
  #### :bug: Bug Fixes
@@ -146,8 +188,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
146
188
 
147
189
  - bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)]
148
190
  - merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)]
149
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)]
150
- - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)]
151
191
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)]
152
192
  - fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
153
193
  - remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
@@ -242,11 +282,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
242
282
  - test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
243
283
  - test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
244
284
  - Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)]
245
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
246
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
247
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
248
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
249
- - test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
250
285
  ### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
251
286
 
252
287
  #### :rocket: New Features
@@ -259,7 +294,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
259
294
 
260
295
  #### :house: Internal changes
261
296
 
262
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
263
297
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
264
298
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
265
299
 
@@ -445,7 +479,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
445
479
 
446
480
  #### :house: Internal changes
447
481
 
448
- - chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
449
482
 
450
483
  #### :hammer_and_wrench: Others
451
484
 
@@ -601,7 +634,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
601
634
 
602
635
  #### :hammer_and_wrench: Others
603
636
 
604
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
605
637
  ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
606
638
 
607
639
  #### :bug: Bug Fixes
@@ -748,7 +780,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
748
780
 
749
781
  - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
750
782
  - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
751
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
752
783
  ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
753
784
 
754
785
  #### :hammer_and_wrench: Others
@@ -782,7 +813,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
782
813
 
783
814
  - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
784
815
  - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
785
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
786
816
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
787
817
  ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
788
818
 
@@ -792,7 +822,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
792
822
 
793
823
  #### :hammer_and_wrench: Others
794
824
 
795
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
796
825
  - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
797
826
  - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
798
827
  ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
@@ -803,7 +832,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
803
832
 
804
833
  #### :hammer_and_wrench: Others
805
834
 
806
- - yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
807
835
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
808
836
 
809
837
  #### :rocket: New Features
@@ -844,7 +872,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
844
872
  - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
845
873
  - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
846
874
  - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
847
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
848
875
  ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
849
876
 
850
877
  #### :nail_care: Enhancements
@@ -892,7 +919,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
892
919
 
893
920
  #### :hammer_and_wrench: Others
894
921
 
895
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
896
922
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
897
923
 
898
924
  #### :hammer_and_wrench: Others
@@ -1160,7 +1186,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1160
1186
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
1161
1187
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
1162
1188
  - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
1163
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
1164
1189
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
1165
1190
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
1166
1191
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -1202,5 +1227,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1202
1227
 
1203
1228
  #### :hammer_and_wrench: Others
1204
1229
 
1205
- - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
1206
1230
  - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
@@ -15,7 +15,7 @@ services:
15
15
  args:
16
16
  ADDON_NAME: "${ADDON_NAME}"
17
17
  ADDON_PATH: "${ADDON_PATH}"
18
- VOLTO_VERSION: ${VOLTO_VERSION:-16}
18
+ VOLTO_VERSION: ${VOLTO_VERSION:-17}
19
19
  ports:
20
20
  - "3000:3000"
21
21
  - "3001:3001"
@@ -14,6 +14,8 @@ module.exports = {
14
14
  '@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
15
15
  '@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
16
16
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
17
+ '@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
18
+ '@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
17
19
  '@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
18
20
  '@plone/volto-slate$':
19
21
  '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
@@ -28,6 +30,7 @@ module.exports = {
28
30
  ],
29
31
  transform: {
30
32
  '^.+\\.js(x)?$': 'babel-jest',
33
+ '^.+\\.ts(x)?$': 'babel-jest',
31
34
  '^.+\\.(png)$': 'jest-file',
32
35
  '^.+\\.(jpg)$': 'jest-file',
33
36
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.34.0",
3
+ "version": "2.0.0",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -34,6 +34,7 @@
34
34
  "babel-plugin-transform-class-properties": "^6.24.1",
35
35
  "dotenv": "^16.3.2",
36
36
  "husky": "^8.0.3",
37
+ "jsonwebtoken": "9.0.0",
37
38
  "lint-staged": "^14.0.1",
38
39
  "md5": "^2.3.0",
39
40
  "postcss-less": "6.0.0"
@@ -3,7 +3,7 @@ import LayoutSettingsView from './LayoutSettingsView';
3
3
  import LayoutSettingsEdit from './LayoutSettingsEdit';
4
4
  import BlockSettingsSchema from '@plone/volto/components/manage/Blocks/Block/Schema';
5
5
 
6
- export default (config) => {
6
+ const applyConfig = (config) => {
7
7
  config.blocks.blocksConfig.layoutSettings = {
8
8
  id: 'layoutSettings',
9
9
  title: 'Layout settings',
@@ -19,3 +19,5 @@ export default (config) => {
19
19
 
20
20
  return config;
21
21
  };
22
+
23
+ export default applyConfig;
@@ -1,7 +1,7 @@
1
1
  import Edit from './Edit';
2
2
  import View from './View';
3
3
 
4
- export default (config) => {
4
+ const applyConfig = (config) => {
5
5
  config.blocks.blocksConfig.title = {
6
6
  ...config.blocks.blocksConfig.title,
7
7
  edit: Edit,
@@ -12,3 +12,5 @@ export default (config) => {
12
12
 
13
13
  return config;
14
14
  };
15
+
16
+ export default applyConfig;
@@ -54,7 +54,7 @@ const RSSLink = {
54
54
  required: [],
55
55
  };
56
56
 
57
- export default {
57
+ const titleSchema = {
58
58
  title: 'Page header',
59
59
  fieldsets: [
60
60
  {
@@ -175,3 +175,5 @@ export default {
175
175
 
176
176
  required: [],
177
177
  };
178
+
179
+ export default titleSchema;
@@ -89,6 +89,9 @@ const View = (props) => {
89
89
  const copyrightPrefix =
90
90
  config.blocks.blocksConfig.title.copyrightPrefix || '';
91
91
 
92
+ const contentTypesWithoutHeaderImage =
93
+ config.settings?.eea?.contentTypesWithoutHeaderImage || [];
94
+
92
95
  // Set dates
93
96
  const getDate = useCallback(
94
97
  (hidden, key) => {
@@ -96,10 +99,10 @@ const View = (props) => {
96
99
  },
97
100
  [metadata],
98
101
  );
99
- const creationDate = useMemo(() => getDate(hideCreationDate, 'created'), [
100
- getDate,
101
- hideCreationDate,
102
- ]);
102
+ const creationDate = useMemo(
103
+ () => getDate(hideCreationDate, 'created'),
104
+ [getDate, hideCreationDate],
105
+ );
103
106
  const publishingDate = useMemo(
104
107
  () => getDate(hidePublishingDate, 'effective'),
105
108
  [getDate, hidePublishingDate],
@@ -110,7 +113,11 @@ const View = (props) => {
110
113
  );
111
114
 
112
115
  // Set image source
113
- const image = getImageSource(metadata['image']);
116
+ const image = contentTypesWithoutHeaderImage.includes(
117
+ props.properties['@type'],
118
+ )
119
+ ? false
120
+ : getImageSource(metadata['image']);
114
121
  // Get type
115
122
  const type = metadata.type_title || friendlyId(metadata['@type']);
116
123
 
@@ -68,6 +68,7 @@ export const checkIfPublished = (props) => {
68
68
  return true;
69
69
  return false;
70
70
  };
71
+
71
72
  const DraftBackground = (props) => {
72
73
  let draftClass = 'wf-state-is-draft';
73
74
  if (checkIfPublished(props)) {
@@ -0,0 +1,85 @@
1
+ import { checkIfPublished } from './DraftBackground';
2
+ describe('checkIfPublished', () => {
3
+ it('should return true if contentId does not match pathname', () => {
4
+ const props = {
5
+ contentId: '/page1',
6
+ pathname: '/page2',
7
+ };
8
+
9
+ expect(checkIfPublished(props)).toBe(true);
10
+ });
11
+
12
+ it('should return false if effective date is in the future', () => {
13
+ const futureDate = new Date();
14
+ futureDate.setDate(futureDate.getDate() + 10);
15
+ const props = {
16
+ contentId: '/page1',
17
+ pathname: '/page1',
18
+ content: {
19
+ effective: futureDate.toISOString(),
20
+ },
21
+ };
22
+ expect(checkIfPublished(props)).toBe(false);
23
+ });
24
+
25
+ it('should return true if review_state is published', () => {
26
+ const props = {
27
+ contentId: '/page1',
28
+ pathname: '/page1',
29
+ review_state: 'published',
30
+ };
31
+ expect(checkIfPublished(props)).toBe(true);
32
+ });
33
+
34
+ it('should return true if review_state is null and parent is published', () => {
35
+ const props = {
36
+ contentId: '/page1',
37
+ pathname: '/page1',
38
+ review_state: null,
39
+ content: {
40
+ parent: {
41
+ review_state: 'published',
42
+ },
43
+ },
44
+ };
45
+ expect(checkIfPublished(props)).toBe(true);
46
+ });
47
+
48
+ it('should return true if review_state is null and parent is empty', () => {
49
+ const props = {
50
+ contentId: '/page1',
51
+ pathname: '/page1',
52
+ review_state: null,
53
+ content: {
54
+ parent: {},
55
+ },
56
+ };
57
+ expect(checkIfPublished(props)).toBe(true);
58
+ });
59
+
60
+ it('should return true if review_state is null and parent review_state is null', () => {
61
+ const props = {
62
+ contentId: '/page1',
63
+ pathname: '/page1',
64
+ review_state: null,
65
+ content: {
66
+ parent: {
67
+ review_state: null,
68
+ },
69
+ },
70
+ };
71
+ expect(checkIfPublished(props)).toBe(true);
72
+ });
73
+
74
+ it('should return false if review_state is not published and effective date is not in the future', () => {
75
+ const props = {
76
+ contentId: '/page1',
77
+ pathname: '/page1',
78
+ review_state: 'private',
79
+ content: {
80
+ effective: '2023-01-01T00:00:00Z',
81
+ },
82
+ };
83
+ expect(checkIfPublished(props)).toBe(false);
84
+ });
85
+ });
package/src/config.js CHANGED
@@ -342,3 +342,5 @@ export const colors = [
342
342
  '#F9F9F9',
343
343
  '#FFFFFF',
344
344
  ];
345
+
346
+ export const contentTypesWithoutHeaderImage = ['Image'];
@@ -0,0 +1,32 @@
1
+ import {
2
+ serializeNodes,
3
+ serializeNodesToText,
4
+ } from '@plone/volto-slate/editor/render';
5
+ import config from '@plone/volto/registry';
6
+ import { isEqual } from 'lodash';
7
+ import Slugger from 'github-slugger';
8
+ import { normalizeString } from '@plone/volto/helpers';
9
+
10
+ const TextBlockView = (props) => {
11
+ const { id, data, styling = {} } = props;
12
+ const { value, override_toc } = data;
13
+ const metadata = props.metadata || props.properties;
14
+ const { topLevelTargetElements } = config.settings.slate;
15
+
16
+ const getAttributes = (node, path) => {
17
+ const res = { ...styling };
18
+ if (node.type && isEqual(path, [0])) {
19
+ if (topLevelTargetElements.includes(node.type) || override_toc) {
20
+ const text = serializeNodesToText([node] || []);
21
+ const slug = Slugger.slug(normalizeString(text));
22
+ res.id = slug || id;
23
+ res['data-block'] = id;
24
+ }
25
+ }
26
+ return res;
27
+ };
28
+
29
+ return serializeNodes(value, getAttributes, { metadata: metadata });
30
+ };
31
+
32
+ export default TextBlockView;
@@ -1,9 +1,19 @@
1
1
  import React from 'react';
2
2
  import { renderToStaticMarkup } from 'react-dom/server';
3
+ import { useLocation } from 'react-router-dom';
4
+ import { toast } from 'react-toastify';
5
+ import { useIntl } from 'react-intl';
6
+ import { useSelector } from 'react-redux';
3
7
  import { Node, Text } from 'slate';
4
8
  import cx from 'classnames';
5
9
  import { isEmpty, isEqual, omit } from 'lodash';
10
+ import { UniversalLink, Toast } from '@plone/volto/components';
11
+ import { messages, addAppURL } from '@plone/volto/helpers';
12
+ import useClipboard from '@plone/volto/hooks/clipboard/useClipboard';
6
13
  import config from '@plone/volto/registry';
14
+ import linkSVG from '@plone/volto/icons/link.svg';
15
+
16
+ import '@plone/volto-slate/editor/less/slate.less';
7
17
 
8
18
  const OMITTED = ['editor', 'path'];
9
19
 
@@ -177,3 +187,68 @@ export const serializeNodesToText = (nodes) => {
177
187
 
178
188
  export const serializeNodesToHtml = (nodes) =>
179
189
  renderToStaticMarkup(serializeNodes(nodes));
190
+
191
+ export const renderLinkElement = (tagName) => {
192
+ function LinkElement({
193
+ attributes,
194
+ children,
195
+ mode = 'edit',
196
+ className = null,
197
+ }) {
198
+ const { slate = {} } = config.settings;
199
+ const Tag = tagName;
200
+ const slug = attributes.id || '';
201
+ const location = useLocation();
202
+ const token = useSelector((state) => state.userSession.token);
203
+ const appPathname = addAppURL(location.pathname);
204
+ // eslint-disable-next-line no-unused-vars
205
+ const [copied, copy, setCopied] = useClipboard(
206
+ appPathname.concat(`#${slug}`),
207
+ );
208
+ const intl = useIntl();
209
+ return !token || slate.useLinkedHeadings === false ? (
210
+ <Tag {...attributes} className={className} tabIndex={0}>
211
+ {children}
212
+ </Tag>
213
+ ) : (
214
+ <Tag {...attributes} className={className} tabIndex={0}>
215
+ {children}
216
+ {mode === 'view' && slug && (
217
+ <UniversalLink
218
+ className="anchor"
219
+ aria-hidden="true"
220
+ tabIndex={-1}
221
+ href={`#${slug}`}
222
+ >
223
+ <style>
224
+ {/* Prettify the unstyled flash of the link icon on development */}
225
+ {`
226
+ a.anchor svg {
227
+ height: var(--anchor-svg-height, 24px);
228
+ }
229
+ `}
230
+ </style>
231
+ <svg
232
+ {...linkSVG.attributes}
233
+ dangerouslySetInnerHTML={{ __html: linkSVG.content }}
234
+ height={null}
235
+ onClick={() => {
236
+ copy();
237
+
238
+ toast.info(
239
+ <Toast
240
+ info
241
+ title={intl.formatMessage(messages.success)}
242
+ content={intl.formatMessage(messages.urlClipboardCopy)}
243
+ />,
244
+ );
245
+ }}
246
+ ></svg>
247
+ </UniversalLink>
248
+ )}
249
+ </Tag>
250
+ );
251
+ }
252
+ LinkElement.displayName = `${tagName}LinkElement`;
253
+ return LinkElement;
254
+ };