@eeacms/volto-eea-website-policy 2.6.0 → 2.8.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 +17 -1
- package/package.json +1 -1
- package/src/components/ErrorView/ErrorView.jsx +191 -0
- package/src/index.js +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ 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
|
+
### [2.8.0](https://github.com/eea/volto-eea-website-policy/compare/2.7.0...2.8.0) - 4 December 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Custom ErrorView - refs #291209 [Nilesh - [`842a21b`](https://github.com/eea/volto-eea-website-policy/commit/842a21b2ae439c61ef30c12a6636feb09a8ddd2e)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Release 2.8.0 [Alin Voinea - [`1b2d223`](https://github.com/eea/volto-eea-website-policy/commit/1b2d22315096d7f6cf908e1ca5f0fd34c82ff9ed)]
|
|
16
|
+
### [2.7.0](https://github.com/eea/volto-eea-website-policy/compare/2.6.0...2.7.0) - 3 December 2025
|
|
17
|
+
|
|
18
|
+
#### :rocket: New Features
|
|
19
|
+
|
|
20
|
+
- feat: Add option to exclude counting chars in specific blocks in group-block - refs #293783 [Teodor Voicu - [`cecfb56`](https://github.com/eea/volto-eea-website-policy/commit/cecfb5636f75b131b2b150ead90827e5338bc9fc)]
|
|
21
|
+
|
|
22
|
+
#### :hammer_and_wrench: Others
|
|
23
|
+
|
|
7
24
|
### [2.6.0](https://github.com/eea/volto-eea-website-policy/compare/2.5.1...2.6.0) - 6 August 2025
|
|
8
25
|
|
|
9
26
|
#### :nail_care: Enhancements
|
|
@@ -12,7 +29,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
12
29
|
|
|
13
30
|
#### :hammer_and_wrench: Others
|
|
14
31
|
|
|
15
|
-
- Release 2.6.0 [alin - [`c1ad9aa`](https://github.com/eea/volto-eea-website-policy/commit/c1ad9aab4fcaf3b58618b379603fbd4fb4793144)]
|
|
16
32
|
### [2.5.1](https://github.com/eea/volto-eea-website-policy/compare/2.5.0...2.5.1) - 7 July 2025
|
|
17
33
|
|
|
18
34
|
#### :nail_care: Enhancements
|
package/package.json
CHANGED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { FormattedMessage } from 'react-intl';
|
|
2
|
+
import { Container } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @function ErrorView
|
|
6
|
+
* @returns {string} Static Markup of the Error page.
|
|
7
|
+
*/
|
|
8
|
+
const ErrorView = ({ name, error }) => {
|
|
9
|
+
return (
|
|
10
|
+
<Container
|
|
11
|
+
className="view-wrapper"
|
|
12
|
+
style={{
|
|
13
|
+
fontFamily: 'Helvetica, sans-serif',
|
|
14
|
+
fontSize: '20px',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
backgroundColor: '#006699',
|
|
20
|
+
minHeight: '100vh',
|
|
21
|
+
width: '100vw',
|
|
22
|
+
margin: 0,
|
|
23
|
+
padding: 0,
|
|
24
|
+
position: 'fixed',
|
|
25
|
+
top: 0,
|
|
26
|
+
left: 0,
|
|
27
|
+
right: 0,
|
|
28
|
+
bottom: 0,
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
{__DEVELOPMENT__ && (
|
|
32
|
+
<>
|
|
33
|
+
{error && (
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
backgroundColor: '#f8f8f8',
|
|
37
|
+
border: '1px solid #ddd',
|
|
38
|
+
borderRadius: '4px',
|
|
39
|
+
padding: '20px',
|
|
40
|
+
margin: '20px 0',
|
|
41
|
+
maxWidth: '90%',
|
|
42
|
+
overflow: 'auto',
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<h3 style={{ marginTop: 0, color: '#d32f2f' }}>
|
|
47
|
+
Error Details (Development Mode)
|
|
48
|
+
</h3>
|
|
49
|
+
{error.name && (
|
|
50
|
+
<p>
|
|
51
|
+
<strong>Error Name:</strong> {error.name}
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
54
|
+
{error.message && (
|
|
55
|
+
<p>
|
|
56
|
+
<strong>Error Message:</strong> {error.message}
|
|
57
|
+
</p>
|
|
58
|
+
)}
|
|
59
|
+
{error.status && (
|
|
60
|
+
<p>
|
|
61
|
+
<strong>Status:</strong> {error.status}
|
|
62
|
+
</p>
|
|
63
|
+
)}
|
|
64
|
+
{error.stack && (
|
|
65
|
+
<>
|
|
66
|
+
<p>
|
|
67
|
+
<strong>Stack Trace:</strong>
|
|
68
|
+
</p>
|
|
69
|
+
<pre
|
|
70
|
+
style={{
|
|
71
|
+
backgroundColor: '#f0f0f0',
|
|
72
|
+
padding: '10px',
|
|
73
|
+
borderRadius: '4px',
|
|
74
|
+
fontSize: '12px',
|
|
75
|
+
lineHeight: '1.4',
|
|
76
|
+
overflow: 'auto',
|
|
77
|
+
whiteSpace: 'pre-wrap',
|
|
78
|
+
wordBreak: 'break-word',
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{error.stack}
|
|
82
|
+
</pre>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
{name && (
|
|
86
|
+
<p>
|
|
87
|
+
<strong>Component Name:</strong> {name}
|
|
88
|
+
</p>
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
</>
|
|
93
|
+
)}
|
|
94
|
+
{!__DEVELOPMENT__ && (
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
display: 'flex',
|
|
98
|
+
flexDirection: 'column',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
textAlign: 'center',
|
|
102
|
+
width: '100%',
|
|
103
|
+
color: 'white',
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<div>
|
|
107
|
+
<h1
|
|
108
|
+
style={{
|
|
109
|
+
fontSize: '18px',
|
|
110
|
+
fontWeight: 'normal',
|
|
111
|
+
margin: '0 0 10px 0',
|
|
112
|
+
color: 'white',
|
|
113
|
+
}}
|
|
114
|
+
>
|
|
115
|
+
European Environment Agency (EEA)
|
|
116
|
+
</h1>
|
|
117
|
+
<a
|
|
118
|
+
href="https://www.eea.europa.eu"
|
|
119
|
+
style={{
|
|
120
|
+
color: 'white',
|
|
121
|
+
textDecoration: 'underline',
|
|
122
|
+
fontSize: '16px',
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
www.eea.europa.eu
|
|
126
|
+
</a>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div
|
|
130
|
+
style={{
|
|
131
|
+
borderTop: '1px solid rgba(255, 255, 255, 0.3)',
|
|
132
|
+
borderBottom: '1px solid rgba(255, 255, 255, 0.3)',
|
|
133
|
+
padding: '30px 0',
|
|
134
|
+
margin: '20px 0',
|
|
135
|
+
width: '600px',
|
|
136
|
+
maxWidth: '90%',
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
<h2
|
|
140
|
+
style={{
|
|
141
|
+
fontSize: '24px',
|
|
142
|
+
fontWeight: 'bold',
|
|
143
|
+
margin: '0',
|
|
144
|
+
color: 'white',
|
|
145
|
+
lineHeight: '1.4',
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<FormattedMessage
|
|
149
|
+
id="Our apologies, our website is not available at the moment."
|
|
150
|
+
defaultMessage="Our apologies, our website is not available at the moment."
|
|
151
|
+
/>
|
|
152
|
+
</h2>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div>
|
|
156
|
+
<p
|
|
157
|
+
style={{
|
|
158
|
+
fontSize: '16px',
|
|
159
|
+
fontStyle: 'italic',
|
|
160
|
+
margin: '0 0 20px 0',
|
|
161
|
+
color: 'white',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<FormattedMessage
|
|
165
|
+
id="If this problem persists Contact EEA Web Team (web.helpdesk at eea.europa.eu)"
|
|
166
|
+
defaultMessage="If this problem persists Contact EEA Web Team (web.helpdesk at eea.europa.eu)"
|
|
167
|
+
/>
|
|
168
|
+
</p>
|
|
169
|
+
<p
|
|
170
|
+
style={{
|
|
171
|
+
fontSize: '14px',
|
|
172
|
+
margin: '0',
|
|
173
|
+
color: 'white',
|
|
174
|
+
lineHeight: '1.4',
|
|
175
|
+
}}
|
|
176
|
+
>
|
|
177
|
+
<span style={{ textDecoration: 'underline' }}>
|
|
178
|
+
European Environment Agency
|
|
179
|
+
</span>
|
|
180
|
+
, Kongens Nytorv 6, 1050
|
|
181
|
+
<br />
|
|
182
|
+
Copenhagen K, Denmark - Phone: +45 3336 7100
|
|
183
|
+
</p>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
187
|
+
</Container>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export default ErrorView;
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { runtimeConfig } from '@plone/volto/runtime_config';
|
|
2
2
|
import { appendGroup, getAsyncData } from './helpers';
|
|
3
3
|
import { FrequencyOfDissemination } from '@eeacms/volto-eea-website-policy/components/Widgets/FrequencyOfDissemination';
|
|
4
|
+
import ErrorView from '@eeacms/volto-eea-website-policy/components/ErrorView/ErrorView';
|
|
4
5
|
|
|
5
6
|
const restrictedBlocks = [
|
|
6
7
|
'imagecards',
|
|
@@ -63,6 +64,12 @@ const applyConfig = (config) => {
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
//This only works if the component is wrapped in ErrorBoundary from volto
|
|
68
|
+
config.registerComponent({
|
|
69
|
+
name: 'ErrorBoundary',
|
|
70
|
+
component: ErrorView,
|
|
71
|
+
});
|
|
72
|
+
|
|
66
73
|
// #137187 Keycloak integration
|
|
67
74
|
if (runtimeConfig['RAZZLE_KEYCLOAK'] === 'Yes') {
|
|
68
75
|
config.settings.externalRoutes = [
|
|
@@ -173,6 +180,13 @@ const applyConfig = (config) => {
|
|
|
173
180
|
// Custom widgets
|
|
174
181
|
config.widgets.views.id.frequency_of_dissemination = FrequencyOfDissemination;
|
|
175
182
|
|
|
183
|
+
// Group block: Skip figure-metadata groups when counting characters
|
|
184
|
+
if (config.blocks.blocksConfig.group) {
|
|
185
|
+
config.blocks.blocksConfig.group.skipBlocksInGroups = [
|
|
186
|
+
{ className: 'figure-metadata' },
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
|
|
176
190
|
// Subsite
|
|
177
191
|
config.settings.apiExpanders = [
|
|
178
192
|
...config.settings.apiExpanders,
|