@eeacms/volto-bise-policy 1.2.18 → 1.2.20
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/package.json +1 -1
- package/src/components/manage/Blocks/CustomCSS/CustomCSSEdit.jsx +16 -0
- package/src/components/manage/Blocks/CustomCSS/CustomCSSView.jsx +17 -0
- package/src/components/manage/Blocks/CustomCSS/index.js +26 -0
- package/src/components/manage/Blocks/CustomJS/CustomJSEdit.jsx +14 -0
- package/src/components/manage/Blocks/CustomJS/CustomJSView.jsx +18 -0
- package/src/components/manage/Blocks/CustomJS/index.js +26 -0
- package/src/components/manage/Blocks/index.js +4 -0
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/Edit.jsx +10 -9
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/index.js +2 -2
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/templates/smart/View.jsx +12 -14
- package/src/customizations/volto/components/theme/Header/Header.jsx +7 -1
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.2.20](https://github.com/eea/volto-bise-policy/compare/1.2.19...1.2.20) - 30 June 2025
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- show proper menu on habitat types [Claudia Ifrim - [`4d2f905`](https://github.com/eea/volto-bise-policy/commit/4d2f905ea020746bdf5668d7428e361c8fd5d250)]
|
|
12
|
+
### [1.2.19](https://github.com/eea/volto-bise-policy/compare/1.2.18...1.2.19) - 30 June 2025
|
|
13
|
+
|
|
14
|
+
#### :bug: Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix: extend column schema to populate choices [nileshgulia1 - [`6897739`](https://github.com/eea/volto-bise-policy/commit/6897739b206ba4d7618dc222b5c2d2b88a99d6af)]
|
|
17
|
+
|
|
18
|
+
#### :house: Internal changes
|
|
19
|
+
|
|
20
|
+
- style: Automated code fix [eea-jenkins - [`9b23b7c`](https://github.com/eea/volto-bise-policy/commit/9b23b7c7f1646feb814b03d4ee88ca79d093b536)]
|
|
21
|
+
- style: Automated code fix [eea-jenkins - [`0767bb6`](https://github.com/eea/volto-bise-policy/commit/0767bb68e90dae2570edead9201b36d5a99319e6)]
|
|
22
|
+
|
|
23
|
+
#### :hammer_and_wrench: Others
|
|
24
|
+
|
|
25
|
+
- add custom css basic block [Claudia Ifrim - [`3a43d19`](https://github.com/eea/volto-bise-policy/commit/3a43d1909e185be80e17a82434917c1c42ee6c77)]
|
|
26
|
+
- custom js block [Claudia Ifrim - [`8e40d21`](https://github.com/eea/volto-bise-policy/commit/8e40d219592b816d274c3b3143c39f0737de82da)]
|
|
27
|
+
- rename simple data table customization [Claudia Ifrim - [`9e1bc9e`](https://github.com/eea/volto-bise-policy/commit/9e1bc9e0af3d3c2be9eaf129b2bb03d72a0805eb)]
|
|
7
28
|
### [1.2.18](https://github.com/eea/volto-bise-policy/compare/1.2.17...1.2.18) - 23 June 2025
|
|
8
29
|
|
|
9
30
|
#### :house: Internal changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TextareaWidget } from '@plone/volto/components';
|
|
2
|
+
|
|
3
|
+
const CustomCSSBlockEdit = ({ data, onChangeBlock, block }) => {
|
|
4
|
+
return (
|
|
5
|
+
<TextareaWidget
|
|
6
|
+
id="cssCode"
|
|
7
|
+
title="Inline CSS"
|
|
8
|
+
value={data.cssCode}
|
|
9
|
+
onChange={(id, value) =>
|
|
10
|
+
onChangeBlock(block, { ...data, cssCode: value })
|
|
11
|
+
}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default CustomCSSBlockEdit;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const CustomCSSBlockView = ({ data }) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const style = document.createElement('style');
|
|
6
|
+
style.innerHTML = data?.cssCode || '';
|
|
7
|
+
document.head.appendChild(style);
|
|
8
|
+
|
|
9
|
+
return () => {
|
|
10
|
+
document.head.removeChild(style);
|
|
11
|
+
};
|
|
12
|
+
}, [data]);
|
|
13
|
+
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default CustomCSSBlockView;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import codeSVG from '@plone/volto/icons/code.svg';
|
|
2
|
+
import CustomCSSView from './CustomCSSView';
|
|
3
|
+
import CustomCSSEdit from './CustomCSSEdit';
|
|
4
|
+
|
|
5
|
+
const config = (config) => {
|
|
6
|
+
config.blocks.blocksConfig.biseCustomCSS = {
|
|
7
|
+
id: 'biseCustomCSS',
|
|
8
|
+
title: 'Custom CSS',
|
|
9
|
+
icon: codeSVG,
|
|
10
|
+
group: 'custom_addons',
|
|
11
|
+
view: CustomCSSView,
|
|
12
|
+
edit: CustomCSSEdit,
|
|
13
|
+
restricted: false,
|
|
14
|
+
mostUsed: false,
|
|
15
|
+
blockHasOwnFocusManagement: false,
|
|
16
|
+
sidebarTab: 1,
|
|
17
|
+
security: {
|
|
18
|
+
addPermission: [],
|
|
19
|
+
view: [],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return config;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default config;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextareaWidget } from '@plone/volto/components';
|
|
2
|
+
|
|
3
|
+
const CustomJSBlockEdit = ({ data, onChangeBlock, block }) => {
|
|
4
|
+
return (
|
|
5
|
+
<TextareaWidget
|
|
6
|
+
id="jsCode"
|
|
7
|
+
title="Inline JavaScript"
|
|
8
|
+
value={data.jsCode}
|
|
9
|
+
onChange={(id, value) => onChangeBlock(block, { ...data, jsCode: value })}
|
|
10
|
+
/>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default CustomJSBlockEdit;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const CustomJSBlockView = ({ data }) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const script = document.createElement('script');
|
|
6
|
+
script.type = 'text/javascript';
|
|
7
|
+
script.innerHTML = data?.jsCode || '';
|
|
8
|
+
document.body.appendChild(script);
|
|
9
|
+
|
|
10
|
+
return () => {
|
|
11
|
+
document.body.removeChild(script);
|
|
12
|
+
};
|
|
13
|
+
}, [data]);
|
|
14
|
+
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default CustomJSBlockView;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import codeSVG from '@plone/volto/icons/code.svg';
|
|
2
|
+
import CustomJSView from './CustomJSView';
|
|
3
|
+
import CustomJSEdit from './CustomJSEdit';
|
|
4
|
+
|
|
5
|
+
const config = (config) => {
|
|
6
|
+
config.blocks.blocksConfig.biseCustomJS = {
|
|
7
|
+
id: 'biseCustomJS',
|
|
8
|
+
title: 'Custom JS',
|
|
9
|
+
icon: codeSVG,
|
|
10
|
+
group: 'custom_addons',
|
|
11
|
+
view: CustomJSView,
|
|
12
|
+
edit: CustomJSEdit,
|
|
13
|
+
restricted: false,
|
|
14
|
+
mostUsed: false,
|
|
15
|
+
blockHasOwnFocusManagement: false,
|
|
16
|
+
sidebarTab: 1,
|
|
17
|
+
security: {
|
|
18
|
+
addPermission: [],
|
|
19
|
+
view: [],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return config;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default config;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import installBodyClass from './BodyClass';
|
|
2
|
+
import installCustomJS from './CustomJS';
|
|
3
|
+
import installCustomCSS from './CustomCSS';
|
|
2
4
|
import installRedirect from './Redirect';
|
|
3
5
|
import installFactsheetsListing from './FactsheetsListing';
|
|
4
6
|
import installKeyFacts from './KeyFacts';
|
|
@@ -8,6 +10,8 @@ import installNavigation from './Navigation';
|
|
|
8
10
|
const config = (config) => {
|
|
9
11
|
return [
|
|
10
12
|
installBodyClass,
|
|
13
|
+
installCustomJS,
|
|
14
|
+
installCustomCSS,
|
|
11
15
|
installRedirect,
|
|
12
16
|
installFactsheetsListing,
|
|
13
17
|
installKeyFacts,
|
|
@@ -69,13 +69,14 @@ class Edit extends Component {
|
|
|
69
69
|
|
|
70
70
|
if (!provider_data) return schema;
|
|
71
71
|
|
|
72
|
-
const choices = Array.from(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
const choices = Array.from(
|
|
73
|
+
Object.keys(provider_data).sort((a, b) => a - b),
|
|
74
|
+
).map((n) => [n, n]);
|
|
75
|
+
schema.properties.columns.schemaExtender = (schema) => {
|
|
76
|
+
schema.properties.column.choices = choices;
|
|
77
|
+
schema.properties.column_link.choices = choices;
|
|
78
|
+
return schema;
|
|
79
|
+
};
|
|
79
80
|
|
|
80
81
|
return schema;
|
|
81
82
|
};
|
|
@@ -109,7 +110,7 @@ const EditWrapper = compose(
|
|
|
109
110
|
}),
|
|
110
111
|
)(injectIntl(Edit));
|
|
111
112
|
|
|
112
|
-
const
|
|
113
|
+
const SimpleDataTableEdit = (props) => {
|
|
113
114
|
return (
|
|
114
115
|
<VisibilitySensor offset={{ top: -150, bottom: -150 }}>
|
|
115
116
|
<EditWrapper {...props} />
|
|
@@ -117,4 +118,4 @@ const $Edit = (props) => {
|
|
|
117
118
|
);
|
|
118
119
|
};
|
|
119
120
|
|
|
120
|
-
export default
|
|
121
|
+
export default SimpleDataTableEdit;
|
|
@@ -11,12 +11,12 @@ import { ColoredTableView, coloredTableSchema } from './templates/colored';
|
|
|
11
11
|
const applyConfig = (config) => {
|
|
12
12
|
config.blocks.blocksConfig.simpleDataConnectedTable = {
|
|
13
13
|
id: 'simpleDataConnectedTable',
|
|
14
|
-
title: 'Data Table',
|
|
14
|
+
title: 'Simple Data Table',
|
|
15
15
|
icon: tableSVG,
|
|
16
16
|
group: 'data_blocks',
|
|
17
17
|
view: SimpleDataTableView,
|
|
18
18
|
edit: SimpleDataTableEdit,
|
|
19
|
-
restricted:
|
|
19
|
+
restricted: false,
|
|
20
20
|
mostUsed: false,
|
|
21
21
|
sidebarTab: 1,
|
|
22
22
|
security: {
|
|
@@ -61,14 +61,16 @@ const View = (props) => {
|
|
|
61
61
|
clearTimeout(timeoutRef.current);
|
|
62
62
|
props.dispatch({ type: 'TABLE_START_SEARCH', query: data.value });
|
|
63
63
|
timeoutRef.current = setTimeout(() => {
|
|
64
|
-
props.history
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
if (props.history) {
|
|
65
|
+
props.history.push({
|
|
66
|
+
search:
|
|
67
|
+
'?' +
|
|
68
|
+
qs.stringify({
|
|
69
|
+
...props.query,
|
|
70
|
+
searchTerm: data.value,
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
72
74
|
if (data.value.length === 0) {
|
|
73
75
|
props.dispatch({ type: 'TABLE_CLEAN_QUERY' });
|
|
74
76
|
return;
|
|
@@ -233,9 +235,7 @@ const View = (props) => {
|
|
|
233
235
|
{placeholder}
|
|
234
236
|
</Table.Cell>
|
|
235
237
|
</Table.Row>
|
|
236
|
-
) :
|
|
237
|
-
''
|
|
238
|
-
)}
|
|
238
|
+
) : null}
|
|
239
239
|
</Table.Body>
|
|
240
240
|
{Math.ceil(items.length / row_size) > 1 ? (
|
|
241
241
|
<Table.Footer>
|
|
@@ -258,9 +258,7 @@ const View = (props) => {
|
|
|
258
258
|
</Table.HeaderCell>
|
|
259
259
|
</Table.Row>
|
|
260
260
|
</Table.Footer>
|
|
261
|
-
) :
|
|
262
|
-
''
|
|
263
|
-
)}
|
|
261
|
+
) : null}
|
|
264
262
|
</Table>
|
|
265
263
|
</div>
|
|
266
264
|
);
|
|
@@ -99,7 +99,13 @@ const EEAHeader = ({ token, history, subsite, content, screen, ...props }) => {
|
|
|
99
99
|
|
|
100
100
|
const isN2KHabitat = useMemo(() => {
|
|
101
101
|
return !!matchPath(pathname, {
|
|
102
|
-
path:
|
|
102
|
+
path: [
|
|
103
|
+
'/natura2000/habitats/habitat',
|
|
104
|
+
'/natura2000/habitats/habitats_eunis2012',
|
|
105
|
+
'/natura2000/habitats/habitats_eunis_revised',
|
|
106
|
+
'/natura2000/habitats/habitats_rl',
|
|
107
|
+
'/natura2000/habitats/habitats_res4',
|
|
108
|
+
],
|
|
103
109
|
exact: false,
|
|
104
110
|
});
|
|
105
111
|
}, [pathname]);
|