@eeacms/volto-cca-policy 0.1.2 → 0.1.4
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
CHANGED
|
@@ -4,6 +4,14 @@ 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
|
+
### [0.1.4](https://github.com/eea/volto-cca-policy/compare/0.1.3...0.1.4) - 13 January 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Refs #158294 - Enable volto-embed (index.js is used, not policy.js). [GhitaB - [`55eecd1`](https://github.com/eea/volto-cca-policy/commit/55eecd1e58f9c9e987cb90eed4b0d02e7f22d3f9)]
|
|
12
|
+
- Refs #158294 - Enable volto-embed. [GhitaB - [`873ed39`](https://github.com/eea/volto-cca-policy/commit/873ed399cd02bd8c11b2006ea13d6dfc854c3395)]
|
|
13
|
+
### [0.1.3](https://github.com/eea/volto-cca-policy/compare/0.1.2...0.1.3) - 22 December 2022
|
|
14
|
+
|
|
7
15
|
### [0.1.2](https://github.com/eea/volto-cca-policy/compare/0.1.1...0.1.2) - 16 December 2022
|
|
8
16
|
|
|
9
17
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-cca-policy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "@eeacms/volto-cca-policy: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@cypress/code-coverage": "^3.10.0",
|
|
25
|
-
"@plone/scripts": "*",
|
|
26
25
|
"@eeacms/volto-eea-design-system": "*",
|
|
27
|
-
"
|
|
26
|
+
"@plone/scripts": "*",
|
|
28
27
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
29
28
|
"cypress-fail-fast": "^5.0.1",
|
|
30
|
-
"md5": "^2.3.0"
|
|
29
|
+
"md5": "^2.3.0",
|
|
30
|
+
"volto-subsites": "*"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"release": "release-it",
|
|
@@ -165,30 +165,35 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
|
165
165
|
role="listbox"
|
|
166
166
|
aria-label="language switcher"
|
|
167
167
|
>
|
|
168
|
-
{eea.languages.map((item, index) =>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
{eea.languages.map((item, index) => {
|
|
169
|
+
if (!config.settings.supportedLanguages.includes(item.code)) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return (
|
|
173
|
+
<Dropdown.Item
|
|
174
|
+
as="li"
|
|
175
|
+
key={index}
|
|
176
|
+
text={
|
|
177
|
+
<span>
|
|
178
|
+
{item.name}
|
|
179
|
+
<span className="country-code">
|
|
180
|
+
{item.code.toUpperCase()}
|
|
181
|
+
</span>
|
|
177
182
|
</span>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
)
|
|
183
|
+
}
|
|
184
|
+
onClick={() => {
|
|
185
|
+
const translation = find(translations, {
|
|
186
|
+
language: item.code,
|
|
187
|
+
});
|
|
188
|
+
const to = translation
|
|
189
|
+
? flattenToAppURL(translation['@id'])
|
|
190
|
+
: `/${item.code}`;
|
|
191
|
+
setLanguage(item.code);
|
|
192
|
+
history.push(to);
|
|
193
|
+
}}
|
|
194
|
+
></Dropdown.Item>
|
|
195
|
+
);
|
|
196
|
+
})}
|
|
192
197
|
</ul>
|
|
193
198
|
</Header.TopDropdownMenu>
|
|
194
199
|
)}
|
package/src/index.js
CHANGED
|
@@ -6,7 +6,12 @@ const applyConfig = (config) => {
|
|
|
6
6
|
// config.settings.supportedLanguages = config.settings.eea?.languages?.map(
|
|
7
7
|
// (item) => item.code,
|
|
8
8
|
// ) || ['en'];
|
|
9
|
-
config.settings.supportedLanguages = ['en', 'de', '
|
|
9
|
+
config.settings.supportedLanguages = ['en', 'de', 'fr', 'es', 'it'];
|
|
10
|
+
|
|
11
|
+
// Enable volto-embed
|
|
12
|
+
if (config.blocks.blocksConfig.maps) {
|
|
13
|
+
config.blocks.blocksConfig.maps.restricted = false;
|
|
14
|
+
}
|
|
10
15
|
|
|
11
16
|
return config;
|
|
12
17
|
};
|
package/src/policy.js
CHANGED
|
@@ -60,9 +60,10 @@ const applyConfig = (config) => {
|
|
|
60
60
|
config.settings.isMultilingual = true;
|
|
61
61
|
config.settings.defaultLanguage =
|
|
62
62
|
config.settings.eea?.defaultLanguage || 'en';
|
|
63
|
-
config.settings.supportedLanguages = config.settings.eea?.languages?.map(
|
|
64
|
-
|
|
65
|
-
) || ['en'];
|
|
63
|
+
// config.settings.supportedLanguages = config.settings.eea?.languages?.map(
|
|
64
|
+
// (item) => item.code,
|
|
65
|
+
// ) || ['en'];
|
|
66
|
+
config.settings.supportedLanguages = ['en', 'de', 'fr', 'es', 'it'];
|
|
66
67
|
|
|
67
68
|
// Block chooser
|
|
68
69
|
config.blocks.blocksConfig.image.mostUsed = false;
|
|
@@ -84,6 +85,11 @@ const applyConfig = (config) => {
|
|
|
84
85
|
config.blocks.blocksConfig.dividerBlock.mostUsed = true;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
// Enable volto-embed
|
|
89
|
+
if (config.blocks.blocksConfig.maps) {
|
|
90
|
+
config.blocks.blocksConfig.maps.restricted = false;
|
|
91
|
+
}
|
|
92
|
+
|
|
87
93
|
// Call to Action
|
|
88
94
|
if (config.blocks.blocksConfig.callToActionBlock) {
|
|
89
95
|
config.blocks.blocksConfig.callToActionBlock.mostUsed = true;
|