@eeacms/volto-eea-website-policy 1.5.0 → 1.6.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 +24 -0
- package/package.json +1 -1
- package/src/index.js +19 -58
- package/src/components/Blocks/LayoutSettings/LayoutSettingsEdit.jsx +0 -32
- package/src/components/Blocks/LayoutSettings/LayoutSettingsView.jsx +0 -15
- package/src/components/Blocks/LayoutSettings/edit.less +0 -4
- package/src/components/Blocks/LayoutSettings/index.js +0 -24
- package/src/components/Blocks/LayoutSettings/schema.js +0 -31
- package/src/components/Blocks/icons/image-narrow.svg +0 -5
- package/src/components/Blocks/schema-utils.js +0 -16
- package/src/components/Blocks/schema.js +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.6.1](https://github.com/eea/volto-eea-website-policy/compare/1.6.0...1.6.1) - 23 May 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- other: restrict volto-datablocks blocks [Miu Razvan - [`6f39568`](https://github.com/eea/volto-eea-website-policy/commit/6f39568c8f53ce46707279715e57ee50c897d49f)]
|
|
12
|
+
### [1.6.0](https://github.com/eea/volto-eea-website-policy/compare/1.5.0...1.6.0) - 22 May 2023
|
|
13
|
+
|
|
14
|
+
#### :nail_care: Enhancements
|
|
15
|
+
|
|
16
|
+
- change(blocks): moved most used block config within eea-website-theme [David Ichim - [`b18d5ce`](https://github.com/eea/volto-eea-website-policy/commit/b18d5ce958c7e7f814969df8051d65c49133ca88)]
|
|
17
|
+
- change(blocks): moved layout settings block within volto-eea-website-theme #48 from eea/252559-policy-refactoring [ichim-david - [`45fee8e`](https://github.com/eea/volto-eea-website-policy/commit/45fee8e68d1a18d7be77f33a8207524ae6f7d220)]
|
|
18
|
+
- change(blocks): moved layout settings block from volto-eea-policy to volto-eea-website-theme [David Ichim - [`37bc97d`](https://github.com/eea/volto-eea-website-policy/commit/37bc97d0a3db77fa8f31e750be179cb287814217)]
|
|
19
|
+
|
|
20
|
+
#### :hammer_and_wrench: Others
|
|
21
|
+
|
|
22
|
+
- Increased package version [Alexandru Ghica - [`174b77e`](https://github.com/eea/volto-eea-website-policy/commit/174b77eccf7ba80286edee8ea30c1a3f2523b200)]
|
|
23
|
+
- prettier fix [Miu Razvan - [`eef9199`](https://github.com/eea/volto-eea-website-policy/commit/eef91996a480b371da69506700285c12adb69167)]
|
|
24
|
+
- prettier fix [Miu Razvan - [`0a3bf2d`](https://github.com/eea/volto-eea-website-policy/commit/0a3bf2de5103fd898e68491207751d39c8510d08)]
|
|
25
|
+
- other: disable tableau and map embed blocks [Miu Razvan - [`a032766`](https://github.com/eea/volto-eea-website-policy/commit/a0327664c25c55beb544dd22ca2e9d5cc6380acd)]
|
|
7
26
|
### [1.5.0](https://github.com/eea/volto-eea-website-policy/compare/1.4.0...1.5.0) - 24 March 2023
|
|
8
27
|
|
|
9
28
|
#### :bug: Bug Fixes
|
|
@@ -18,6 +37,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
18
37
|
|
|
19
38
|
- Release 1.5.0 [Alin Voinea - [`a3dea8e`](https://github.com/eea/volto-eea-website-policy/commit/a3dea8ea15cb8d2a876dc10da926ece3a5707ea9)]
|
|
20
39
|
- test(Jenkinsfile): Use latest stable volto for testing [Alin Voinea - [`a8f7123`](https://github.com/eea/volto-eea-website-policy/commit/a8f712364187f9638886667c249fa102cb49b5c0)]
|
|
40
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`124a8f8`](https://github.com/eea/volto-eea-website-policy/commit/124a8f8ad4ced507aeec27012d725f2e2b977e08)]
|
|
21
41
|
### [1.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023
|
|
22
42
|
|
|
23
43
|
#### :rocket: New Features
|
|
@@ -97,6 +117,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
97
117
|
#### :hammer_and_wrench: Others
|
|
98
118
|
|
|
99
119
|
- Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)]
|
|
120
|
+
- yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)]
|
|
100
121
|
### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022
|
|
101
122
|
|
|
102
123
|
#### :nail_care: Enhancements
|
|
@@ -142,6 +163,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
142
163
|
|
|
143
164
|
#### :hammer_and_wrench: Others
|
|
144
165
|
|
|
166
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
|
|
145
167
|
### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022
|
|
146
168
|
|
|
147
169
|
#### :hammer_and_wrench: Others
|
|
@@ -217,6 +239,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
217
239
|
- format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
|
|
218
240
|
- Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
|
|
219
241
|
- Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
|
|
242
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
|
|
220
243
|
### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022
|
|
221
244
|
|
|
222
245
|
#### :hammer_and_wrench: Others
|
|
@@ -229,4 +252,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
229
252
|
|
|
230
253
|
#### :hammer_and_wrench: Others
|
|
231
254
|
|
|
255
|
+
- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
|
|
232
256
|
- Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { runtimeConfig } from '@plone/volto/runtime_config';
|
|
2
2
|
import installContextNavigationBlock from '@eeacms/volto-eea-website-policy/components/Blocks/ContextNavigation';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
const restrictedBlocks = [
|
|
5
|
+
'imagecards',
|
|
6
|
+
'embed_eea_tableau_block',
|
|
7
|
+
'embed_eea_map_block',
|
|
8
|
+
// TODO: use what is needed from volto-datablocks after clean-up
|
|
9
|
+
'conditionalDataBlock',
|
|
10
|
+
'countryFlag',
|
|
11
|
+
'custom_connected_block',
|
|
12
|
+
'data_connected_embed',
|
|
13
|
+
'dataqueryfilter',
|
|
14
|
+
'dottedTableChart',
|
|
15
|
+
'simpleDataConnectedTable',
|
|
16
|
+
];
|
|
5
17
|
|
|
6
18
|
const applyConfig = (config) => {
|
|
7
19
|
// #158717#note-25 any path that isn't static, en or controlpanel is treated as external
|
|
@@ -59,53 +71,6 @@ const applyConfig = (config) => {
|
|
|
59
71
|
config.settings.eea.logoTargetUrl = '/en';
|
|
60
72
|
}
|
|
61
73
|
|
|
62
|
-
// Block chooser
|
|
63
|
-
config.blocks.blocksConfig.image.mostUsed = false;
|
|
64
|
-
config.blocks.blocksConfig.video.mostUsed = false;
|
|
65
|
-
|
|
66
|
-
// Grid/Teaser block (kitconcept)
|
|
67
|
-
if (config.blocks.blocksConfig.__grid) {
|
|
68
|
-
config.blocks.blocksConfig.__grid.restricted = true;
|
|
69
|
-
}
|
|
70
|
-
if (config.blocks.blocksConfig.imagesGrid) {
|
|
71
|
-
config.blocks.blocksConfig.imagesGrid.restricted = true;
|
|
72
|
-
}
|
|
73
|
-
if (config.blocks.blocksConfig.teaser) {
|
|
74
|
-
config.blocks.blocksConfig.teaser.restricted = true;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Divider
|
|
78
|
-
if (config.blocks.blocksConfig.dividerBlock) {
|
|
79
|
-
config.blocks.blocksConfig.dividerBlock.mostUsed = true;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Call to Action
|
|
83
|
-
if (config.blocks.blocksConfig.callToActionBlock) {
|
|
84
|
-
config.blocks.blocksConfig.callToActionBlock.mostUsed = true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Group
|
|
88
|
-
if (config.blocks.blocksConfig.group) {
|
|
89
|
-
config.blocks.blocksConfig.group.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Columns
|
|
93
|
-
if (config.blocks.blocksConfig.columnsBlock) {
|
|
94
|
-
config.blocks.blocksConfig.columnsBlock.mostUsed = true;
|
|
95
|
-
config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Accordion
|
|
99
|
-
if (config.blocks.blocksConfig.accordion) {
|
|
100
|
-
config.blocks.blocksConfig.accordion.mostUsed = true;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Listing
|
|
104
|
-
if (config.blocks.blocksConfig.listing) {
|
|
105
|
-
config.blocks.blocksConfig.listing.title = 'Listing (Content)';
|
|
106
|
-
config.blocks.blocksConfig.listing.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
74
|
// Custom blocks
|
|
110
75
|
// context navigation
|
|
111
76
|
config = [installContextNavigationBlock].reduce(
|
|
@@ -113,16 +78,12 @@ const applyConfig = (config) => {
|
|
|
113
78
|
config,
|
|
114
79
|
);
|
|
115
80
|
|
|
116
|
-
// layout settings
|
|
117
|
-
config = [installLayoutSettingsBlock].reduce(
|
|
118
|
-
(acc, apply) => apply(acc),
|
|
119
|
-
config,
|
|
120
|
-
);
|
|
121
|
-
|
|
122
81
|
// Disable some blocks
|
|
123
|
-
|
|
124
|
-
config.blocks.blocksConfig
|
|
125
|
-
|
|
82
|
+
restrictedBlocks.forEach((block) => {
|
|
83
|
+
if (config.blocks.blocksConfig[block]) {
|
|
84
|
+
config.blocks.blocksConfig[block].restricted = true;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
126
87
|
|
|
127
88
|
config.settings.apiExpanders = [
|
|
128
89
|
...config.settings.apiExpanders,
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EditSchema } from '@eeacms/volto-eea-website-policy/components/Blocks/LayoutSettings/schema';
|
|
3
|
-
import { BlockDataForm, SidebarPortal } from '@plone/volto/components';
|
|
4
|
-
import LayoutSettingsView from '@eeacms/volto-eea-website-policy/components/Blocks/LayoutSettings/LayoutSettingsView';
|
|
5
|
-
import '@eeacms/volto-eea-website-policy/components/Blocks/LayoutSettings/edit.less';
|
|
6
|
-
|
|
7
|
-
const LayoutSettingsEdit = (props) => {
|
|
8
|
-
const schema = EditSchema();
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<h3>Page layout settings</h3>
|
|
12
|
-
<LayoutSettingsView {...props} />
|
|
13
|
-
<SidebarPortal selected={props.selected}>
|
|
14
|
-
{props.selected && (
|
|
15
|
-
<BlockDataForm
|
|
16
|
-
title={schema.title}
|
|
17
|
-
schema={schema}
|
|
18
|
-
formData={props.data}
|
|
19
|
-
onChangeField={(id, value) => {
|
|
20
|
-
props.onChangeBlock(props.block, {
|
|
21
|
-
...props.data,
|
|
22
|
-
[id]: value,
|
|
23
|
-
});
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
)}
|
|
27
|
-
</SidebarPortal>
|
|
28
|
-
</>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default LayoutSettingsEdit;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BodyClass } from '@plone/volto/helpers';
|
|
3
|
-
import { getVoltoStyles } from '@eeacms/volto-eea-website-policy/components/Blocks/schema-utils';
|
|
4
|
-
import cx from 'classnames';
|
|
5
|
-
|
|
6
|
-
const LayoutSettingsView = (props) => {
|
|
7
|
-
const classNames = getVoltoStyles(props.data);
|
|
8
|
-
return <BodyClass className={cx(classNames)} />;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
function propsAreEqual(prevProps, nextProps) {
|
|
12
|
-
return prevProps.data === nextProps.data;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default React.memo(LayoutSettingsView, propsAreEqual);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import codeSVG from '@plone/volto/icons/code.svg';
|
|
2
|
-
import LayoutSettingsView from './LayoutSettingsView';
|
|
3
|
-
import LayoutSettingsEdit from './LayoutSettingsEdit';
|
|
4
|
-
import BlockSettingsSchema from '@plone/volto/components/manage/Blocks/Block/Schema';
|
|
5
|
-
|
|
6
|
-
export default (config) => {
|
|
7
|
-
config.blocks.blocksConfig.layoutSettings = {
|
|
8
|
-
id: 'layoutSettings',
|
|
9
|
-
title: 'Layout settings',
|
|
10
|
-
icon: codeSVG,
|
|
11
|
-
group: 'common',
|
|
12
|
-
view: LayoutSettingsView,
|
|
13
|
-
edit: LayoutSettingsEdit,
|
|
14
|
-
schema: BlockSettingsSchema,
|
|
15
|
-
restricted: ({ properties }) => {
|
|
16
|
-
return !!properties['@type'];
|
|
17
|
-
},
|
|
18
|
-
mostUsed: true,
|
|
19
|
-
blockHasOwnFocusManagement: true,
|
|
20
|
-
sidebarTab: 1,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return config;
|
|
24
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import imageNarrowSVG from '@eeacms/volto-eea-website-policy/components/Blocks/icons/image-narrow.svg';
|
|
2
|
-
import imageFitSVG from '@plone/volto/icons/image-fit.svg';
|
|
3
|
-
import imageWideSVG from '@plone/volto/icons/image-wide.svg';
|
|
4
|
-
|
|
5
|
-
export const ALIGN_INFO_MAP = {
|
|
6
|
-
narrow_view: [imageNarrowSVG, 'Narrow width'],
|
|
7
|
-
container_view: [imageFitSVG, 'Container width'],
|
|
8
|
-
wide_view: [imageWideSVG, 'Wide width'],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const EditSchema = () => {
|
|
12
|
-
return {
|
|
13
|
-
title: 'Page layout settings',
|
|
14
|
-
fieldsets: [
|
|
15
|
-
{
|
|
16
|
-
id: 'default',
|
|
17
|
-
title: 'Default',
|
|
18
|
-
fields: ['layout_size'],
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
required: [],
|
|
22
|
-
properties: {
|
|
23
|
-
layout_size: {
|
|
24
|
-
widget: 'style_align',
|
|
25
|
-
title: 'Layout size',
|
|
26
|
-
actions: Object.keys(ALIGN_INFO_MAP),
|
|
27
|
-
actionsInfoMap: ALIGN_INFO_MAP,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M10 13L11.9333 11V25L10 23H26L24.0667 25V11L26 13H10ZM26 11V18V21.5V23.5V25H10V11H26Z" fill="black"/>
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 31H29V29H7V31Z"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 7H29V5H7V7Z"/>
|
|
5
|
-
</svg>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const getVoltoStyles = (props) => {
|
|
2
|
-
// return an object with same key and value for cx class setting
|
|
3
|
-
const styles = props ? props : {};
|
|
4
|
-
const output = {};
|
|
5
|
-
for (const [key, value] of Object.entries(styles)) {
|
|
6
|
-
if (key === '@type') {
|
|
7
|
-
continue;
|
|
8
|
-
}
|
|
9
|
-
if (styles[key] === true) {
|
|
10
|
-
output[key] = key;
|
|
11
|
-
} else {
|
|
12
|
-
output[value] = value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return output;
|
|
16
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { cloneDeep } from 'lodash';
|
|
2
|
-
import imageNarrowSVG from '@eeacms/volto-eea-website-policy/components/Blocks/icons/image-narrow.svg';
|
|
3
|
-
import imageFitSVG from '@plone/volto/icons/image-fit.svg';
|
|
4
|
-
import imageWideSVG from '@plone/volto/icons/image-wide.svg';
|
|
5
|
-
import imageFullSVG from '@plone/volto/icons/image-full.svg';
|
|
6
|
-
|
|
7
|
-
export const ALIGN_INFO_MAP = {
|
|
8
|
-
narrow_width: [imageNarrowSVG, 'Narrow width'],
|
|
9
|
-
container_width: [imageFitSVG, 'Container width'],
|
|
10
|
-
wide_width: [imageWideSVG, 'Wide width'],
|
|
11
|
-
full: [imageFullSVG, 'Full width'],
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const addStylingFieldsetSchemaEnhancer = ({ schema }) => {
|
|
15
|
-
const applied = schema?.properties?.styles;
|
|
16
|
-
|
|
17
|
-
if (!applied) {
|
|
18
|
-
const resSchema = cloneDeep(schema);
|
|
19
|
-
|
|
20
|
-
resSchema.fieldsets.push({
|
|
21
|
-
id: 'styling',
|
|
22
|
-
fields: ['styles'],
|
|
23
|
-
title: 'Styling',
|
|
24
|
-
});
|
|
25
|
-
resSchema.properties.styles = {
|
|
26
|
-
widget: 'object',
|
|
27
|
-
title: 'Styling',
|
|
28
|
-
schema: {
|
|
29
|
-
fieldsets: [
|
|
30
|
-
{
|
|
31
|
-
id: 'default',
|
|
32
|
-
title: 'Default',
|
|
33
|
-
fields: ['size'],
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
properties: {
|
|
37
|
-
size: {
|
|
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
|
-
}
|
|
49
|
-
|
|
50
|
-
return schema;
|
|
51
|
-
};
|