@eeacms/volto-eea-website-theme 1.23.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/cypress.config.js +3 -3
- package/package.json +2 -1
- package/src/components/manage/Blocks/Title/schema.js +40 -1
- package/src/components/theme/Banner/View.jsx +2 -1
- package/src/customizations/volto/components/manage/Blocks/Image/Edit.jsx +9 -6
- package/src/customizations/volto/components/manage/Blocks/Image/View.jsx +9 -6
- package/src/customizations/volto/components/manage/Blocks/LeadImage/Edit.jsx +8 -4
- package/src/customizations/volto/components/manage/Blocks/LeadImage/View.jsx +8 -5
- package/src/customizations/volto/components/manage/Blocks/LeadImage/schema.js +0 -1
- package/src/customizations/volto/components/theme/Header/Header.jsx +53 -50
- package/src/helpers/schema-utils.js +40 -34
- package/src/index.js +38 -2
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,41 @@ 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.24.1](https://github.com/eea/volto-eea-website-theme/compare/1.24.0...1.24.1) - 27 November 2023
|
8
|
+
|
9
|
+
#### :nail_care: Enhancements
|
10
|
+
|
11
|
+
- change(header): added commented option on how you could add a * option to affect any page that has no layout [David Ichim - [`22f670f`](https://github.com/eea/volto-eea-website-theme/commit/22f670fc6b5876b89c526920226f02558cd84572)]
|
12
|
+
|
13
|
+
#### :hammer_and_wrench: Others
|
14
|
+
|
15
|
+
- Revert "test: Temp bypass sonarqube coverage in order to release" [Alin Voinea - [`5c304d5`](https://github.com/eea/volto-eea-website-theme/commit/5c304d573f59e49daa96f92a74f0573fd00205ea)]
|
16
|
+
### [1.24.0](https://github.com/eea/volto-eea-website-theme/compare/1.23.0...1.24.0) - 22 November 2023
|
17
|
+
|
18
|
+
#### :bug: Bug Fixes
|
19
|
+
|
20
|
+
- fix(tabs): check if schema has properties, data and schemaExtender when trying to modify the tab schema [David Ichim - [`93edc3f`](https://github.com/eea/volto-eea-website-theme/commit/93edc3f8db0cd09f3aa63a12ef881326e9b676af)]
|
21
|
+
- fix(header): updated tests snapshot after latest changes [David Ichim - [`3143810`](https://github.com/eea/volto-eea-website-theme/commit/3143810fe3f4c439261f47b1360f4f570a8670c8)]
|
22
|
+
- fix(header): eu logo alt text and text top menu dropdowns are now read by screen readers [David Ichim - [`6ed4642`](https://github.com/eea/volto-eea-website-theme/commit/6ed4642819e7d2aa8c2a1d5d4e34e42dbef3a652)]
|
23
|
+
|
24
|
+
#### :nail_care: Enhancements
|
25
|
+
|
26
|
+
- change(tests): commented out rss test since title block config is missing [David Ichim - [`85cc1e4`](https://github.com/eea/volto-eea-website-theme/commit/85cc1e4662e6df8a73a6fa7fd06b6d555c04327c)]
|
27
|
+
- change(card): added aria-label for tag Search for content tagged with *tag* [David Ichim - [`c40eb1a`](https://github.com/eea/volto-eea-website-theme/commit/c40eb1ae91c6e7509d0e0fe647b413136b67b7b4)]
|
28
|
+
- change(card): render listing card tags using our Tag component instead of label #256134 [David Ichim - [`13994e8`](https://github.com/eea/volto-eea-website-theme/commit/13994e866068673329082c2f33f9d565d3a4cbf7)]
|
29
|
+
- change(header): add language top menu only if condition for multilingual or hasLanguageDropdown is set [David Ichim - [`7649bd3`](https://github.com/eea/volto-eea-website-theme/commit/7649bd3781dbf71fc4992d48cfd90654117bb19a)]
|
30
|
+
|
31
|
+
#### :hammer_and_wrench: Others
|
32
|
+
|
33
|
+
- test: Temp bypass sonarqube coverage in order to release [Alin Voinea - [`f23b1e0`](https://github.com/eea/volto-eea-website-theme/commit/f23b1e06f7ea5d7c8ec71d1229bb2fdb3016ee00)]
|
34
|
+
- test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
|
35
|
+
- test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
|
36
|
+
- 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)]
|
37
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
|
38
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
|
39
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
|
40
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
|
41
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
|
7
42
|
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
8
43
|
|
9
44
|
#### :rocket: New Features
|
@@ -16,6 +51,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
16
51
|
|
17
52
|
#### :house: Internal changes
|
18
53
|
|
54
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
|
19
55
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
|
20
56
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
|
21
57
|
|
@@ -201,6 +237,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
201
237
|
|
202
238
|
#### :house: Internal changes
|
203
239
|
|
240
|
+
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
|
204
241
|
|
205
242
|
#### :hammer_and_wrench: Others
|
206
243
|
|
@@ -356,6 +393,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
356
393
|
|
357
394
|
#### :hammer_and_wrench: Others
|
358
395
|
|
396
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
|
359
397
|
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
|
360
398
|
|
361
399
|
#### :bug: Bug Fixes
|
@@ -502,6 +540,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
502
540
|
|
503
541
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
504
542
|
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
|
543
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
|
505
544
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
506
545
|
|
507
546
|
#### :hammer_and_wrench: Others
|
@@ -535,6 +574,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
535
574
|
|
536
575
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
537
576
|
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
|
577
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
|
538
578
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
|
539
579
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
540
580
|
|
@@ -544,6 +584,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
544
584
|
|
545
585
|
#### :hammer_and_wrench: Others
|
546
586
|
|
587
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
547
588
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
548
589
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
549
590
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
@@ -554,6 +595,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
554
595
|
|
555
596
|
#### :hammer_and_wrench: Others
|
556
597
|
|
598
|
+
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
557
599
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
558
600
|
|
559
601
|
#### :rocket: New Features
|
@@ -594,6 +636,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
594
636
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
595
637
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
596
638
|
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
|
639
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
|
597
640
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
598
641
|
|
599
642
|
#### :nail_care: Enhancements
|
@@ -641,6 +684,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
641
684
|
|
642
685
|
#### :hammer_and_wrench: Others
|
643
686
|
|
687
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
644
688
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
645
689
|
|
646
690
|
#### :hammer_and_wrench: Others
|
@@ -908,6 +952,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
908
952
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
909
953
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
910
954
|
- 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)]
|
955
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
|
911
956
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
912
957
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
913
958
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
@@ -949,4 +994,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
949
994
|
|
950
995
|
#### :hammer_and_wrench: Others
|
951
996
|
|
997
|
+
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
952
998
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eeacms/volto-eea-website-theme",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.24.1",
|
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",
|
@@ -23,6 +23,7 @@
|
|
23
23
|
"url": "git@github.com:eea/volto-eea-website-theme.git"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
+
"@eeacms/volto-block-style": "*",
|
26
27
|
"@eeacms/volto-eea-design-system": "*",
|
27
28
|
"@eeacms/volto-group-block": "*",
|
28
29
|
"volto-subsites": "*"
|
@@ -1,3 +1,13 @@
|
|
1
|
+
import alignTopSVG from '@plone/volto/icons/move-up.svg';
|
2
|
+
import alignCenterSVG from '@plone/volto/icons/row.svg';
|
3
|
+
import alignBottomSVG from '@plone/volto/icons/move-down.svg';
|
4
|
+
|
5
|
+
const ALIGN_INFO_MAP_IMAGE_POSITION = {
|
6
|
+
'has--bg--top': [alignTopSVG, 'Top'],
|
7
|
+
'has--bg--center': [alignCenterSVG, 'Center'],
|
8
|
+
'has--bg--bottom': [alignBottomSVG, 'Bottom'],
|
9
|
+
};
|
10
|
+
|
1
11
|
const infoSchema = {
|
2
12
|
title: 'Info',
|
3
13
|
fieldsets: [
|
@@ -69,6 +79,11 @@ export default {
|
|
69
79
|
title: 'Copyright',
|
70
80
|
fields: ['copyright', 'copyrightIcon', 'copyrightPosition'],
|
71
81
|
},
|
82
|
+
{
|
83
|
+
id: 'styling',
|
84
|
+
title: 'Styles',
|
85
|
+
fields: ['styles'],
|
86
|
+
},
|
72
87
|
],
|
73
88
|
properties: {
|
74
89
|
hideContentType: {
|
@@ -129,10 +144,34 @@ export default {
|
|
129
144
|
},
|
130
145
|
copyrightPosition: {
|
131
146
|
title: 'Align',
|
132
|
-
widget: '
|
147
|
+
widget: 'style_align',
|
133
148
|
actions: ['left', 'right'],
|
134
149
|
defaultValue: 'left',
|
135
150
|
},
|
151
|
+
styles: {
|
152
|
+
widget: 'object',
|
153
|
+
title: 'Styling',
|
154
|
+
schema: {
|
155
|
+
fieldsets: [
|
156
|
+
{
|
157
|
+
id: 'default',
|
158
|
+
title: 'Default',
|
159
|
+
fields: ['bg'],
|
160
|
+
},
|
161
|
+
],
|
162
|
+
properties: {
|
163
|
+
bg: {
|
164
|
+
title: 'Image position',
|
165
|
+
widget: 'style_align',
|
166
|
+
actions: Object.keys(ALIGN_INFO_MAP_IMAGE_POSITION),
|
167
|
+
actionsInfoMap: ALIGN_INFO_MAP_IMAGE_POSITION,
|
168
|
+
defaultValue: 'has--bg--center',
|
169
|
+
},
|
170
|
+
},
|
171
|
+
required: [],
|
172
|
+
},
|
173
|
+
},
|
136
174
|
},
|
175
|
+
|
137
176
|
required: [],
|
138
177
|
};
|
@@ -81,6 +81,7 @@ const View = (props) => {
|
|
81
81
|
copyrightPosition,
|
82
82
|
rssLinks,
|
83
83
|
subtitle,
|
84
|
+
styles,
|
84
85
|
// contentType,
|
85
86
|
} = props.data;
|
86
87
|
const copyrightPrefix =
|
@@ -112,7 +113,7 @@ const View = (props) => {
|
|
112
113
|
const type = metadata.type_title || friendlyId(metadata['@type']);
|
113
114
|
|
114
115
|
return (
|
115
|
-
<Banner {...props} image={image}>
|
116
|
+
<Banner {...props} image={image} styles={styles}>
|
116
117
|
<Banner.Content
|
117
118
|
actions={
|
118
119
|
<>
|
@@ -266,12 +266,15 @@ class Edit extends Component {
|
|
266
266
|
{data.url ? (
|
267
267
|
<>
|
268
268
|
<img
|
269
|
-
className={cx(
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
269
|
+
className={cx(
|
270
|
+
{
|
271
|
+
'full-width': data.align === 'full',
|
272
|
+
large: data.size === 'l',
|
273
|
+
medium: data.size === 'm',
|
274
|
+
small: data.size === 's',
|
275
|
+
},
|
276
|
+
data?.styles?.objectPosition,
|
277
|
+
)}
|
275
278
|
src={
|
276
279
|
isInternalURL(data.url)
|
277
280
|
? // Backwards compat in the case that the block is storing the full server URL
|
@@ -61,12 +61,15 @@ export const View = (props) => {
|
|
61
61
|
const image = (
|
62
62
|
<>
|
63
63
|
<img
|
64
|
-
className={cx(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
className={cx(
|
65
|
+
{
|
66
|
+
'full-width': data.align === 'full',
|
67
|
+
large: data.size === 'l',
|
68
|
+
medium: data.size === 'm',
|
69
|
+
small: data.size === 's',
|
70
|
+
},
|
71
|
+
data?.styles?.objectPosition,
|
72
|
+
)}
|
70
73
|
src={
|
71
74
|
isInternalURL(data.url)
|
72
75
|
? // Backwards compat in the case that the block is storing the full server URL
|
@@ -84,8 +84,7 @@ class Edit extends Component {
|
|
84
84
|
const placeholder =
|
85
85
|
this.props.data.placeholder ||
|
86
86
|
this.props.intl.formatMessage(messages.ImageBlockInputPlaceholder);
|
87
|
-
const { copyright, copyrightIcon, copyrightPosition } = data;
|
88
|
-
|
87
|
+
const { copyright, copyrightIcon, copyrightPosition, styles } = data;
|
89
88
|
return (
|
90
89
|
<div
|
91
90
|
className={cx(
|
@@ -97,7 +96,9 @@ class Edit extends Component {
|
|
97
96
|
)}
|
98
97
|
>
|
99
98
|
<div
|
100
|
-
className={
|
99
|
+
className={cx(
|
100
|
+
`image-block-container ${data?.align ? data?.align : ''}`,
|
101
|
+
)}
|
101
102
|
>
|
102
103
|
{!properties.image && (
|
103
104
|
<Message>
|
@@ -110,7 +111,10 @@ class Edit extends Component {
|
|
110
111
|
{properties.image && (
|
111
112
|
<div className="image-block">
|
112
113
|
<img
|
113
|
-
className={cx(
|
114
|
+
className={cx(
|
115
|
+
{ 'full-width': data.align === 'full' },
|
116
|
+
styles?.objectPosition,
|
117
|
+
)}
|
114
118
|
src={
|
115
119
|
properties.image.data
|
116
120
|
? `data:${properties.image['content-type']};base64,${properties.image.data}`
|
@@ -18,7 +18,7 @@ import { flattenToAppURL } from '@plone/volto/helpers';
|
|
18
18
|
*/
|
19
19
|
const View = (props) => {
|
20
20
|
const { data, properties } = props;
|
21
|
-
const { copyright, copyrightIcon, copyrightPosition } = data;
|
21
|
+
const { copyright, copyrightIcon, copyrightPosition, styles } = data;
|
22
22
|
|
23
23
|
// const [hovering, setHovering] = React.useState(false);
|
24
24
|
const [viewLoaded, setViewLoaded] = React.useState(false);
|
@@ -40,9 +40,9 @@ const View = (props) => {
|
|
40
40
|
)}
|
41
41
|
>
|
42
42
|
<div
|
43
|
-
className={
|
44
|
-
data?.align ? data?.align : ''
|
45
|
-
}
|
43
|
+
className={cx(
|
44
|
+
`image-block-container ${data?.align ? data?.align : ''}`,
|
45
|
+
)}
|
46
46
|
>
|
47
47
|
{properties.image && (
|
48
48
|
<>
|
@@ -50,7 +50,10 @@ const View = (props) => {
|
|
50
50
|
const image = (
|
51
51
|
<div className="image-block">
|
52
52
|
<img
|
53
|
-
className={cx(
|
53
|
+
className={cx(
|
54
|
+
{ 'full-width': data.align === 'full' },
|
55
|
+
styles?.objectPosition,
|
56
|
+
)}
|
54
57
|
src={flattenToAppURL(properties.image.download)}
|
55
58
|
alt={properties.image_caption || ''}
|
56
59
|
/>
|
@@ -92,21 +92,22 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
92
92
|
{isHomePageInverse && <BodyClass className="homepage" />}
|
93
93
|
<Header.TopHeader>
|
94
94
|
<Header.TopItem className="official-union">
|
95
|
-
<Image src={eeaFlag} alt="
|
95
|
+
<Image src={eeaFlag} alt="European Union flag"></Image>
|
96
96
|
<Header.TopDropdownMenu
|
97
97
|
text="An official website of the European Union | How do you know?"
|
98
98
|
tabletText="EEA information systems"
|
99
|
-
mobileText=" "
|
99
|
+
mobileText="EEA information systems"
|
100
100
|
icon="chevron down"
|
101
101
|
aria-label="dropdown"
|
102
|
-
|
102
|
+
classNameHeader="mobile-sr-only"
|
103
103
|
viewportWidth={width}
|
104
104
|
>
|
105
|
-
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
|
106
105
|
<div
|
107
106
|
className="content"
|
108
107
|
onClick={(evt) => evt.stopPropagation()}
|
109
108
|
onKeyDown={(evt) => evt.stopPropagation()}
|
109
|
+
tabIndex={0}
|
110
|
+
role={'presentation'}
|
110
111
|
>
|
111
112
|
<p>
|
112
113
|
All official European Union website addresses are in the{' '}
|
@@ -129,9 +130,10 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
129
130
|
<Header.TopDropdownMenu
|
130
131
|
id="theme-sites"
|
131
132
|
text={headerOpts.partnerLinks.title}
|
133
|
+
aria-label={headerOpts.partnerLinks.title}
|
132
134
|
viewportWidth={width}
|
133
135
|
>
|
134
|
-
<div className="wrapper">
|
136
|
+
<div className="wrapper" tabIndex={0} role={'presentation'}>
|
135
137
|
{headerOpts.partnerLinks.links.map((item, index) => (
|
136
138
|
<Dropdown.Item key={index}>
|
137
139
|
<a
|
@@ -150,53 +152,54 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
150
152
|
</Header.TopItem>
|
151
153
|
)}
|
152
154
|
|
153
|
-
{config.settings.isMultilingual &&
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
<ul
|
169
|
-
className="wrapper language-list"
|
170
|
-
role="listbox"
|
171
|
-
aria-label="language switcher"
|
155
|
+
{config.settings.isMultilingual &&
|
156
|
+
config.settings.supportedLanguages.length > 1 &&
|
157
|
+
config.settings.hasLanguageDropdown && (
|
158
|
+
<Header.TopDropdownMenu
|
159
|
+
id="language-switcher"
|
160
|
+
className="item"
|
161
|
+
text={`${language.toUpperCase()}`}
|
162
|
+
mobileText={`${language.toUpperCase()}`}
|
163
|
+
icon={
|
164
|
+
<Image
|
165
|
+
src={globeIcon}
|
166
|
+
alt="language dropdown globe icon"
|
167
|
+
></Image>
|
168
|
+
}
|
169
|
+
viewportWidth={width}
|
172
170
|
>
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
171
|
+
<ul
|
172
|
+
className="wrapper language-list"
|
173
|
+
role="listbox"
|
174
|
+
aria-label="language switcher"
|
175
|
+
>
|
176
|
+
{eea.languages.map((item, index) => (
|
177
|
+
<Dropdown.Item
|
178
|
+
as="li"
|
179
|
+
key={index}
|
180
|
+
text={
|
181
|
+
<span>
|
182
|
+
{item.name}
|
183
|
+
<span className="country-code">
|
184
|
+
{item.code.toUpperCase()}
|
185
|
+
</span>
|
182
186
|
</span>
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
</
|
198
|
-
|
199
|
-
)}
|
187
|
+
}
|
188
|
+
onClick={() => {
|
189
|
+
const translation = find(translations, {
|
190
|
+
language: item.code,
|
191
|
+
});
|
192
|
+
const to = translation
|
193
|
+
? flattenToAppURL(translation['@id'])
|
194
|
+
: `/${item.code}`;
|
195
|
+
setLanguage(item.code);
|
196
|
+
history.push(to);
|
197
|
+
}}
|
198
|
+
></Dropdown.Item>
|
199
|
+
))}
|
200
|
+
</ul>
|
201
|
+
</Header.TopDropdownMenu>
|
202
|
+
)}
|
200
203
|
</Header.TopHeader>
|
201
204
|
<Header.Main
|
202
205
|
pathname={pathname}
|
@@ -1,8 +1,11 @@
|
|
1
|
-
import { cloneDeep } from 'lodash';
|
2
1
|
import imageNarrowSVG from '@eeacms/volto-eea-website-theme/icons/image-narrow.svg';
|
3
2
|
import imageFitSVG from '@plone/volto/icons/image-fit.svg';
|
4
3
|
import imageWideSVG from '@plone/volto/icons/image-wide.svg';
|
5
4
|
import imageFullSVG from '@plone/volto/icons/image-full.svg';
|
5
|
+
import alignTopSVG from '@plone/volto/icons/move-up.svg';
|
6
|
+
import alignCenterSVG from '@plone/volto/icons/row.svg';
|
7
|
+
import alignBottomSVG from '@plone/volto/icons/move-down.svg';
|
8
|
+
import { addStyling } from '@plone/volto/helpers';
|
6
9
|
|
7
10
|
export const ALIGN_INFO_MAP = {
|
8
11
|
narrow_width: [imageNarrowSVG, 'Narrow width'],
|
@@ -10,45 +13,48 @@ export const ALIGN_INFO_MAP = {
|
|
10
13
|
wide_width: [imageWideSVG, 'Wide width'],
|
11
14
|
full: [imageFullSVG, 'Full width'],
|
12
15
|
};
|
16
|
+
const ALIGN_INFO_MAP_IMAGE_POSITION = {
|
17
|
+
'has--object-position--top': [alignTopSVG, 'Top'],
|
18
|
+
'has--object-position--center': [alignCenterSVG, 'Center'],
|
19
|
+
'has--object-position--bottom': [alignBottomSVG, 'Bottom'],
|
20
|
+
};
|
13
21
|
|
14
|
-
export const addStylingFieldsetSchemaEnhancer = (
|
15
|
-
const
|
22
|
+
export const addStylingFieldsetSchemaEnhancer = (props) => {
|
23
|
+
const schema = addStyling(props);
|
24
|
+
schema.properties.styles.schema.properties.size = {
|
25
|
+
widget: 'style_align',
|
26
|
+
title: 'Section size',
|
27
|
+
actions: Object.keys(ALIGN_INFO_MAP),
|
28
|
+
actionsInfoMap: ALIGN_INFO_MAP,
|
29
|
+
};
|
16
30
|
|
17
|
-
|
18
|
-
|
31
|
+
schema.properties.styles.schema.fieldsets[0].fields = [
|
32
|
+
...schema.properties.styles.schema.fieldsets[0].fields,
|
33
|
+
'size',
|
34
|
+
];
|
19
35
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
widget: 'style_align',
|
39
|
-
title: 'Section size',
|
40
|
-
actions: Object.keys(ALIGN_INFO_MAP),
|
41
|
-
actionsInfoMap: ALIGN_INFO_MAP,
|
42
|
-
},
|
43
|
-
},
|
44
|
-
required: [],
|
45
|
-
},
|
46
|
-
};
|
47
|
-
return resSchema;
|
48
|
-
}
|
36
|
+
return schema;
|
37
|
+
};
|
38
|
+
|
39
|
+
export const addStylingFieldsetSchemaEnhancerImagePosition = (props) => {
|
40
|
+
const schema = addStyling(props);
|
41
|
+
|
42
|
+
schema.properties.styles.schema.properties.objectPosition = {
|
43
|
+
title: 'Image position',
|
44
|
+
widget: 'style_align',
|
45
|
+
actions: Object.keys(ALIGN_INFO_MAP_IMAGE_POSITION),
|
46
|
+
actionsInfoMap: ALIGN_INFO_MAP_IMAGE_POSITION,
|
47
|
+
defaultValue: 'has--object-position--center',
|
48
|
+
};
|
49
|
+
|
50
|
+
schema.properties.styles.schema.fieldsets[0].fields = [
|
51
|
+
...schema.properties.styles.schema.fieldsets[0].fields,
|
52
|
+
'objectPosition',
|
53
|
+
];
|
49
54
|
|
50
55
|
return schema;
|
51
56
|
};
|
57
|
+
|
52
58
|
export const getVoltoStyles = (props) => {
|
53
59
|
// return an object with same key and value for cx class setting
|
54
60
|
const styles = props ? props : {};
|
package/src/index.js
CHANGED
@@ -8,10 +8,15 @@ import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Wi
|
|
8
8
|
import { TopicsWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TopicsWidget';
|
9
9
|
import { Icon } from '@plone/volto/components';
|
10
10
|
import { getBlocks } from '@plone/volto/helpers';
|
11
|
+
import Tag from '@eeacms/volto-eea-design-system/ui/Tag/Tag';
|
12
|
+
|
13
|
+
import {
|
14
|
+
addStylingFieldsetSchemaEnhancer,
|
15
|
+
addStylingFieldsetSchemaEnhancerImagePosition,
|
16
|
+
} from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
|
11
17
|
|
12
18
|
import installLayoutSettingsBlock from '@eeacms/volto-eea-website-theme/components/manage/Blocks/LayoutSettings';
|
13
19
|
import installCustomTitle from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title';
|
14
|
-
import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
|
15
20
|
|
16
21
|
import FlexGroup from '@eeacms/volto-eea-website-theme/components/manage/Blocks/GroupBlockTemplate/FlexGroup/FlexGroup';
|
17
22
|
import BaseTag from './components/theme/BaseTag';
|
@@ -23,6 +28,7 @@ import voltoCustomMiddleware from './middleware/voltoCustom';
|
|
23
28
|
import installSlate from './slate';
|
24
29
|
|
25
30
|
import * as eea from './config';
|
31
|
+
import React from 'react';
|
26
32
|
|
27
33
|
const restrictedBlocks = [
|
28
34
|
'__grid', // Grid/Teaser block (kitconcept)
|
@@ -60,7 +66,7 @@ function tabVariationCustomization(tabs_block_variations, config) {
|
|
60
66
|
config.blocks.blocksConfig.tabs_block.schemaEnhancer = (props) => {
|
61
67
|
const schema = (oldSchemaEnhancer ? oldSchemaEnhancer(props) : props)
|
62
68
|
.schema;
|
63
|
-
const oldSchemaExtender = schema.properties
|
69
|
+
const oldSchemaExtender = schema.properties?.data?.schemaExtender;
|
64
70
|
schema.properties.data.schemaExtender = (schema, child) => {
|
65
71
|
const innerSchema = oldSchemaExtender
|
66
72
|
? oldSchemaExtender(schema, child)
|
@@ -132,6 +138,16 @@ const applyConfig = (config) => {
|
|
132
138
|
config.blocks.blocksConfig[block].restricted = true;
|
133
139
|
}
|
134
140
|
});
|
141
|
+
|
142
|
+
//Apply the image position style for image and leadimage blocks
|
143
|
+
if (config.blocks.blocksConfig.leadimage) {
|
144
|
+
config.blocks.blocksConfig.leadimage.schemaEnhancer = addStylingFieldsetSchemaEnhancerImagePosition;
|
145
|
+
}
|
146
|
+
|
147
|
+
if (config.blocks.blocksConfig.image) {
|
148
|
+
config.blocks.blocksConfig.image.schemaEnhancer = addStylingFieldsetSchemaEnhancerImagePosition;
|
149
|
+
}
|
150
|
+
|
135
151
|
// Set Languages in nextcloud-video-block
|
136
152
|
if (
|
137
153
|
config?.blocks?.blocksConfig?.nextCloudVideo?.subtitlesLanguages &&
|
@@ -397,6 +413,10 @@ const applyConfig = (config) => {
|
|
397
413
|
'/en/about': {
|
398
414
|
hideChildrenFromNavigation: false,
|
399
415
|
},
|
416
|
+
// if you want to set default settings for all menu items that don't have a specific path
|
417
|
+
// '*': {
|
418
|
+
// hideChildrenFromNavigation: false,
|
419
|
+
// },
|
400
420
|
};
|
401
421
|
|
402
422
|
// layout settings
|
@@ -441,6 +461,22 @@ const applyConfig = (config) => {
|
|
441
461
|
config.blocks.blocksConfig.accordion.mostUsed = true;
|
442
462
|
}
|
443
463
|
|
464
|
+
// Teaser block changes
|
465
|
+
if (config.blocks.blocksConfig.teaser) {
|
466
|
+
// Use volto-eea-design-system Tag component for rendering teaser tags
|
467
|
+
config.blocks.blocksConfig.teaser.renderTag = (tag, index) => {
|
468
|
+
return (
|
469
|
+
<Tag
|
470
|
+
href={`https://www.eea.europa.eu/en/advanced-search?filters[0][field]=topic&filters[0][values][0]=${tag}&filters[0][type]=any&filters[1][field]=language&filters[1][type]=any&filters[1][values][0]=en&filters[2][field]=issued.date&filters[2][values][0]=Last 5 years&filters[2][type]=any&sort-field=issued.date&sort-direction=desc`}
|
471
|
+
key={index}
|
472
|
+
aria-label={`Search for content tagged with ${tag}`}
|
473
|
+
>
|
474
|
+
{tag}
|
475
|
+
</Tag>
|
476
|
+
);
|
477
|
+
};
|
478
|
+
}
|
479
|
+
|
444
480
|
// Breadcrumbs
|
445
481
|
config.settings.apiExpanders.push({
|
446
482
|
match: '',
|