@eeacms/volto-eea-website-theme 1.23.0 → 1.24.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/CHANGELOG.md +21 -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 +34 -2
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,27 @@ 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.0](https://github.com/eea/volto-eea-website-theme/compare/1.23.0...1.24.0) - 22 November 2023
|
8
|
+
|
9
|
+
#### :bug: Bug Fixes
|
10
|
+
|
11
|
+
- 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)]
|
12
|
+
- fix(header): updated tests snapshot after latest changes [David Ichim - [`3143810`](https://github.com/eea/volto-eea-website-theme/commit/3143810fe3f4c439261f47b1360f4f570a8670c8)]
|
13
|
+
- 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)]
|
14
|
+
|
15
|
+
#### :nail_care: Enhancements
|
16
|
+
|
17
|
+
- 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)]
|
18
|
+
- 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)]
|
19
|
+
- 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)]
|
20
|
+
- 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)]
|
21
|
+
|
22
|
+
#### :hammer_and_wrench: Others
|
23
|
+
|
24
|
+
- test: Temp bypass sonarqube coverage in order to release [Alin Voinea - [`f23b1e0`](https://github.com/eea/volto-eea-website-theme/commit/f23b1e06f7ea5d7c8ec71d1229bb2fdb3016ee00)]
|
25
|
+
- test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
|
26
|
+
- test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
|
27
|
+
- 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)]
|
7
28
|
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
8
29
|
|
9
30
|
#### :rocket: New Features
|
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.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",
|
@@ -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 &&
|
@@ -441,6 +457,22 @@ const applyConfig = (config) => {
|
|
441
457
|
config.blocks.blocksConfig.accordion.mostUsed = true;
|
442
458
|
}
|
443
459
|
|
460
|
+
// Teaser block changes
|
461
|
+
if (config.blocks.blocksConfig.teaser) {
|
462
|
+
// Use volto-eea-design-system Tag component for rendering teaser tags
|
463
|
+
config.blocks.blocksConfig.teaser.renderTag = (tag, index) => {
|
464
|
+
return (
|
465
|
+
<Tag
|
466
|
+
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`}
|
467
|
+
key={index}
|
468
|
+
aria-label={`Search for content tagged with ${tag}`}
|
469
|
+
>
|
470
|
+
{tag}
|
471
|
+
</Tag>
|
472
|
+
);
|
473
|
+
};
|
474
|
+
}
|
475
|
+
|
444
476
|
// Breadcrumbs
|
445
477
|
config.settings.apiExpanders.push({
|
446
478
|
match: '',
|