@eeacms/volto-bise-policy 1.2.20 → 1.2.22

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,19 @@ 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.22](https://github.com/eea/volto-bise-policy/compare/1.2.21...1.2.22) - 22 August 2025
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Update Login.jsx [dobri1408 - [`e7c2546`](https://github.com/eea/volto-bise-policy/commit/e7c2546fe6709e5a43098f80787cabd6615e37c0)]
12
+ - entra id login [Dobricean Ioan Dorian - [`b8edbe8`](https://github.com/eea/volto-bise-policy/commit/b8edbe8a4a0be037308df154283075bf0111f4a0)]
13
+ ### [1.2.21](https://github.com/eea/volto-bise-policy/compare/1.2.20...1.2.21) - 7 August 2025
14
+
15
+ #### :bug: Bug Fixes
16
+
17
+ - fix: toc padding [nileshgulia1 - [`ccef744`](https://github.com/eea/volto-bise-policy/commit/ccef744db5a8d4b66ce5178ae92e4e8e47b43c23)]
18
+ - fix: toc styles for sidenav [nileshgulia1 - [`fcf0627`](https://github.com/eea/volto-bise-policy/commit/fcf0627ae095ebe071d8d4a089c20691c41ae014)]
19
+
7
20
  ### [1.2.20](https://github.com/eea/volto-bise-policy/compare/1.2.19...1.2.20) - 30 June 2025
8
21
 
9
22
  #### :hammer_and_wrench: Others
@@ -119,7 +132,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
119
132
  - chore: customize root theme to use volto-spotlight - refs #259794 [ana-oprea - [`347f96e`](https://github.com/eea/volto-bise-policy/commit/347f96e335139f9656abd34c308c531b05de85e7)]
120
133
  - chore: change the theme and alias to volto-spotlight and add volto-spotlight to package.json - refs #259794 [ana-oprea - [`52732a1`](https://github.com/eea/volto-bise-policy/commit/52732a17b3247a04ffae0a3f5118e173afa98157)]
121
134
  - chore: change theme to eea-volto-theme, change config.alias - refs #259794 [ana-oprea - [`c2d08ea`](https://github.com/eea/volto-bise-policy/commit/c2d08ea08a7f0e5f6f7d32149e60ea3f3e901923)]
122
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`a3c9488`](https://github.com/eea/volto-bise-policy/commit/a3c9488c5d09ba97fe5976675524d436080a2460)]
123
135
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`fddc30f`](https://github.com/eea/volto-bise-policy/commit/fddc30f11a1d8ec290edaca2d924282f5e113bc6)]
124
136
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`005ce74`](https://github.com/eea/volto-bise-policy/commit/005ce742dbd014fde27e417059251233365766dd)]
125
137
 
@@ -132,17 +144,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
132
144
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c1277ba`](https://github.com/eea/volto-bise-policy/commit/c1277bacf840ee9feccbfd6a2c85f0b25a9a9125)]
133
145
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c944153`](https://github.com/eea/volto-bise-policy/commit/c944153710fd53c5d48863cf363464273e25f52e)]
134
146
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`d648d52`](https://github.com/eea/volto-bise-policy/commit/d648d525a2fc5076577fe0f75ff9782bf0d1d4e9)]
135
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`2a7affe`](https://github.com/eea/volto-bise-policy/commit/2a7affe33d737704bdba117c4a5c8c6748ef7a47)]
136
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`5929642`](https://github.com/eea/volto-bise-policy/commit/59296420105d0e8c1f1547aa0cd17a019e478c2b)]
137
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`b1142f1`](https://github.com/eea/volto-bise-policy/commit/b1142f1da3667a9f56720f65bebce897a5dd8005)]
138
147
  - test: cypress should not wait for navigation, actions, types - refs #259794 [ana-oprea - [`188637c`](https://github.com/eea/volto-bise-policy/commit/188637c78a0cae71b5ee48022507d559dfaceb3e)]
139
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`fa4e473`](https://github.com/eea/volto-bise-policy/commit/fa4e473018386ec3f09d7300d655c8cccdc19a0e)]
140
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1d9135b`](https://github.com/eea/volto-bise-policy/commit/1d9135bb878b3c7a1b828085b99b9d27d78ce60e)]
141
148
  - remove cypress tests as it doesn t work on bise [Dobricean Ioan Dorian - [`ba7e2de`](https://github.com/eea/volto-bise-policy/commit/ba7e2defea2dcfd01537c3abb41fa9515ff0a3e3)]
142
149
  - add mega menu layout settings as #259794 said [dobri1408 - [`b9a3683`](https://github.com/eea/volto-bise-policy/commit/b9a3683e7d85f8c88ad8feac975c47c434f62c4a)]
143
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9181908`](https://github.com/eea/volto-bise-policy/commit/9181908c7f4b51bdf83a34f8c7f25827de9b1cc6)]
144
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`099d796`](https://github.com/eea/volto-bise-policy/commit/099d79669471e6924bf1e0bc51a79d54379c3a1a)]
145
- - test: [JENKINS] Improve cypress time [valentinab25 - [`6d5d8e2`](https://github.com/eea/volto-bise-policy/commit/6d5d8e29b04ddb92628245570055067ca3dcbb6c)]
146
150
  - test: fix comment [valentinab25 - [`4f27d5a`](https://github.com/eea/volto-bise-policy/commit/4f27d5af2e8895c7af4f1157521ca42682b96e23)]
147
151
  - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c2fcb0`](https://github.com/eea/volto-bise-policy/commit/4c2fcb01065e1ef962317ba7be788fd1df079618)]
148
152
  - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`89afaa1`](https://github.com/eea/volto-bise-policy/commit/89afaa15892930452027ef8c8593fc6d193cda70)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "@eeacms/volto-bise-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -18,7 +18,8 @@
18
18
  "@eeacms/volto-eea-design-system",
19
19
  "@eeacms/volto-eea-website-theme",
20
20
  "@eeacms/volto-resize-helper",
21
- "@eeacms/volto-spotlight"
21
+ "@eeacms/volto-spotlight",
22
+ "@plone-collective/volto-authomatic"
22
23
  ],
23
24
  "repository": {
24
25
  "type": "git",
@@ -31,6 +32,7 @@
31
32
  "@eeacms/volto-eea-website-theme": "*",
32
33
  "@eeacms/volto-resize-helper": "*",
33
34
  "@eeacms/volto-spotlight": "*",
35
+ "@plone-collective/volto-authomatic": "2.0.1",
34
36
  "esri-loader": "3.7.0",
35
37
  "plotly.js": "^2.28.0",
36
38
  "react-plotly.js": "2.6.0"
@@ -0,0 +1,389 @@
1
+ /**
2
+ * Combined Login container - supports both external providers and Plone login.
3
+ * @module components/Login/Login
4
+ */
5
+ import React, { useEffect, useState } from 'react';
6
+ import { useDispatch, useSelector, shallowEqual } from 'react-redux';
7
+ import { Link, useHistory, useLocation } from 'react-router-dom';
8
+ import {
9
+ Container,
10
+ Button,
11
+ Form,
12
+ Input,
13
+ Segment,
14
+ Grid,
15
+ } from 'semantic-ui-react';
16
+ import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
17
+ import qs from 'query-string';
18
+ import { useCookies } from 'react-cookie';
19
+
20
+ import { Helmet } from '@plone/volto/helpers';
21
+ import config from '@plone/volto/registry';
22
+ import { Icon } from '@plone/volto/components';
23
+ import { login, resetLoginRequest } from '@plone/volto/actions';
24
+ import { toast } from 'react-toastify';
25
+ import { Toast } from '@plone/volto/components';
26
+ import aheadSVG from '@plone/volto/icons/ahead.svg';
27
+ import clearSVG from '@plone/volto/icons/clear.svg';
28
+ import './Login.less';
29
+
30
+ // Import authomatic components and actions
31
+ import {
32
+ authomaticRedirect,
33
+ listAuthOptions,
34
+ oidcRedirect,
35
+ } from '@plone-collective/volto-authomatic/actions';
36
+ import AuthProviders from '@plone-collective/volto-authomatic/components/AuthProviders/AuthProviders';
37
+
38
+ const messages = defineMessages({
39
+ login: {
40
+ id: 'Log in',
41
+ defaultMessage: 'Log in',
42
+ },
43
+ loginName: {
44
+ id: 'Login Name',
45
+ defaultMessage: 'Login Name',
46
+ },
47
+ Login: {
48
+ id: 'Login',
49
+ defaultMessage: 'Login',
50
+ },
51
+ password: {
52
+ id: 'Password',
53
+ defaultMessage: 'Password',
54
+ },
55
+ cancel: {
56
+ id: 'Cancel',
57
+ defaultMessage: 'Cancel',
58
+ },
59
+ error: {
60
+ id: 'Error',
61
+ defaultMessage: 'Error',
62
+ },
63
+ loginFailed: {
64
+ id: 'Login Failed',
65
+ defaultMessage: 'Login Failed',
66
+ },
67
+ loginFailedContent: {
68
+ id: 'Both email address and password are case sensitive, check that caps lock is not enabled.',
69
+ defaultMessage:
70
+ 'Both email address and password are case sensitive, check that caps lock is not enabled.',
71
+ },
72
+ register: {
73
+ id: 'Register',
74
+ defaultMessage: 'Register',
75
+ },
76
+ forgotPassword: {
77
+ id: 'box_forgot_password_option',
78
+ defaultMessage: 'Forgot your password?',
79
+ },
80
+ signInWith: {
81
+ id: 'Sign in with EEA Microsoft Entra ID',
82
+ defaultMessage: 'Sign in with EEA Microsoft Entra ID',
83
+ },
84
+ orSignIn: {
85
+ id: 'Or sign in with EEA Entra ID:',
86
+ defaultMessage: 'Or sign in with EEA Entra ID:',
87
+ },
88
+ loading: {
89
+ id: 'Loading',
90
+ defaultMessage: 'Loading',
91
+ },
92
+ });
93
+
94
+ /**
95
+ * Get return url function.
96
+ * @function getReturnUrl
97
+ * @param {Object} location Location object.
98
+ * @returns {string} Return url.
99
+ */
100
+ function getReturnUrl(location) {
101
+ return `${
102
+ qs.parse(location.search).return_url ||
103
+ (location.pathname === '/login'
104
+ ? '/'
105
+ : location.pathname.replace('/login', ''))
106
+ }`;
107
+ }
108
+
109
+ /**
110
+ * Combined Login function.
111
+ * @function Login
112
+ * @returns {JSX.Element} Markup of the Login page.
113
+ */
114
+ function Login({ intl }) {
115
+ const dispatch = useDispatch();
116
+ const history = useHistory();
117
+ const location = useLocation();
118
+
119
+ // Authomatic state
120
+ const [startedOAuth, setStartedOAuth] = useState(false);
121
+ const [startedOIDC, setStartedOIDC] = useState(false);
122
+ const loading = useSelector((state) => state.authOptions.loading);
123
+ const options = useSelector((state) => state.authOptions.options);
124
+ const loginOAuthValues = useSelector((state) => state.authomaticRedirect);
125
+ const loginOIDCValues = useSelector((state) => state.oidcRedirect);
126
+ const [, setCookie] = useCookies();
127
+
128
+ // Plone login state
129
+ const token = useSelector((state) => state.userSession.token, shallowEqual);
130
+ const error = useSelector((state) => state.userSession.login.error);
131
+ const ploneLoading = useSelector((state) => state.userSession.login.loading);
132
+
133
+ const returnUrl =
134
+ qs.parse(location.search).return_url ||
135
+ location.pathname.replace(/\/login\/?$/, '').replace(/\/logout\/?$/, '') ||
136
+ '/';
137
+
138
+ useEffect(() => {
139
+ dispatch(listAuthOptions());
140
+ }, [dispatch]);
141
+
142
+ // Handle successful Plone login
143
+ useEffect(() => {
144
+ if (token) {
145
+ history.push(returnUrl || '/');
146
+ if (toast.isActive('loggedOut')) {
147
+ toast.dismiss('loggedOut');
148
+ }
149
+ if (toast.isActive('loginFailed')) {
150
+ toast.dismiss('loginFailed');
151
+ }
152
+ }
153
+ if (error) {
154
+ if (toast.isActive('loggedOut')) {
155
+ toast.dismiss('loggedOut');
156
+ }
157
+ if (!toast.isActive('loginFailed')) {
158
+ toast.error(
159
+ <Toast
160
+ error
161
+ title={intl.formatMessage(messages.loginFailed)}
162
+ content={intl.formatMessage(messages.loginFailedContent)}
163
+ />,
164
+ { autoClose: false, toastId: 'loginFailed' },
165
+ );
166
+ }
167
+ }
168
+ return () => {
169
+ if (toast.isActive('loginFailed')) {
170
+ toast.dismiss('loginFailed');
171
+ dispatch(resetLoginRequest());
172
+ }
173
+ };
174
+ }, [dispatch, token, error, intl, history, returnUrl]);
175
+
176
+ // Handle OAuth redirects
177
+ useEffect(() => {
178
+ const next_url = loginOAuthValues.next_url;
179
+ const session = loginOAuthValues.session;
180
+ if (next_url && session && startedOAuth) {
181
+ setStartedOAuth(false);
182
+ // Give time to save state to localstorage
183
+ setTimeout(function () {
184
+ window.location.href = next_url;
185
+ }, 500);
186
+ }
187
+ }, [startedOAuth, loginOAuthValues]);
188
+
189
+ useEffect(() => {
190
+ const next_url = loginOIDCValues.next_url;
191
+ if (next_url && startedOIDC) {
192
+ setStartedOIDC(false);
193
+ // Give time to save state to localstorage
194
+ setTimeout(function () {
195
+ window.location.href = next_url;
196
+ }, 500);
197
+ }
198
+ }, [startedOIDC, loginOIDCValues]);
199
+
200
+ useEffect(() => {
201
+ if (
202
+ options !== undefined &&
203
+ options.length === 1 &&
204
+ options[0].id === 'oidc'
205
+ ) {
206
+ setStartedOIDC(true);
207
+ dispatch(oidcRedirect('oidc'));
208
+ }
209
+ }, [options, dispatch]);
210
+
211
+ // Handle provider selection
212
+ const onSelectProvider = (provider) => {
213
+ setStartedOAuth(true);
214
+ setCookie('return_url', getReturnUrl(location), { path: '/' });
215
+ dispatch(authomaticRedirect(provider.id));
216
+ };
217
+
218
+ // Handle Plone login form submission
219
+ const onLogin = (event) => {
220
+ dispatch(
221
+ login(
222
+ document.getElementsByName('login')[0].value,
223
+ document.getElementsByName('password')[0].value,
224
+ ),
225
+ );
226
+ event.preventDefault();
227
+ };
228
+
229
+ // Prepare providers for external login
230
+ const validProviders = options
231
+ ? options.filter((provider) => provider.id !== 'oidc')
232
+ : [];
233
+
234
+ return (
235
+ <div id="page-login">
236
+ <Helmet title={intl.formatMessage(messages.Login)} />
237
+ <Container text>
238
+ <Segment.Group raised>
239
+ <Segment className="primary">
240
+ <FormattedMessage id="Log In" defaultMessage="Login" />
241
+ </Segment>
242
+ <Segment secondary>
243
+ <FormattedMessage
244
+ id="Sign in to start session"
245
+ defaultMessage="Sign in to start session"
246
+ />
247
+ </Segment>
248
+
249
+ {/* Plone Login Form */}
250
+ <Segment className="form">
251
+ <Form method="post" onSubmit={onLogin}>
252
+ <Form.Field inline className="help">
253
+ <Grid>
254
+ <Grid.Row stretched>
255
+ <Grid.Column width="4">
256
+ <div className="wrapper">
257
+ <label htmlFor="login">
258
+ <FormattedMessage
259
+ id="Login Name"
260
+ defaultMessage="Login Name"
261
+ />
262
+ </label>
263
+ </div>
264
+ </Grid.Column>
265
+ <Grid.Column width="8">
266
+ <Input
267
+ id="login"
268
+ name="login"
269
+ placeholder={intl.formatMessage(messages.loginName)}
270
+ />
271
+ </Grid.Column>
272
+ </Grid.Row>
273
+ </Grid>
274
+ </Form.Field>
275
+ <Form.Field inline className="help">
276
+ <Grid>
277
+ <Grid.Row stretched>
278
+ <Grid.Column stretched width="4">
279
+ <div className="wrapper">
280
+ <label htmlFor="password">
281
+ <FormattedMessage
282
+ id="Password"
283
+ defaultMessage="Password"
284
+ />
285
+ </label>
286
+ </div>
287
+ </Grid.Column>
288
+ <Grid.Column stretched width="8">
289
+ <Input
290
+ type="password"
291
+ id="password"
292
+ autoComplete="current-password"
293
+ name="password"
294
+ placeholder={intl.formatMessage(messages.password)}
295
+ tabIndex={0}
296
+ />
297
+ </Grid.Column>
298
+ </Grid.Row>
299
+ </Grid>
300
+ </Form.Field>
301
+ <Form.Field inline className="help">
302
+ <Grid>
303
+ <Grid.Row stretched>
304
+ {config.settings.showSelfRegistration && (
305
+ <Grid.Column stretched width="12">
306
+ <p className="help">
307
+ <Link to="/register">
308
+ {intl.formatMessage(messages.register)}
309
+ </Link>
310
+ </p>
311
+ </Grid.Column>
312
+ )}
313
+ <Grid.Column stretched width="12">
314
+ <p className="help">
315
+ <Link to="/passwordreset">
316
+ {intl.formatMessage(messages.forgotPassword)}
317
+ </Link>
318
+ </p>
319
+ </Grid.Column>
320
+ </Grid.Row>
321
+ </Grid>
322
+ </Form.Field>
323
+ </Form>
324
+ </Segment>
325
+
326
+ <Segment className="actions" clearing>
327
+ <Button
328
+ basic
329
+ primary
330
+ icon
331
+ floated="right"
332
+ type="submit"
333
+ form="login-form"
334
+ id="login-form-submit"
335
+ aria-label={intl.formatMessage(messages.login)}
336
+ title={intl.formatMessage(messages.login)}
337
+ loading={ploneLoading}
338
+ onClick={onLogin}
339
+ >
340
+ <Icon className="circled" name={aheadSVG} size="30px" />
341
+ </Button>
342
+
343
+ <Button
344
+ basic
345
+ secondary
346
+ icon
347
+ floated="right"
348
+ id="login-form-cancel"
349
+ as={Link}
350
+ to="/"
351
+ aria-label={intl.formatMessage(messages.cancel)}
352
+ title={intl.formatMessage(messages.cancel)}
353
+ >
354
+ <Icon className="circled" name={clearSVG} size="30px" />
355
+ </Button>
356
+ </Segment>
357
+ </Segment.Group>
358
+
359
+ {/* External Login Providers - Outside the main form */}
360
+ {validProviders && validProviders.length > 0 && (
361
+ <div style={{ marginTop: '2rem', width: '100%' }}>
362
+ <div style={{ textAlign: 'center', marginBottom: '1rem' }}>
363
+ <FormattedMessage
364
+ id="Or sign in with external provider:"
365
+ defaultMessage="Or sign in with external provider:"
366
+ />
367
+ </div>
368
+ <div style={{ width: '100%' }}>
369
+ {!loading && validProviders && (
370
+ <AuthProviders
371
+ providers={validProviders}
372
+ action="login"
373
+ onSelectProvider={onSelectProvider}
374
+ />
375
+ )}
376
+ {(loading || validProviders.length === 0) && (
377
+ <div style={{ textAlign: 'center', padding: '1rem' }}>
378
+ {intl.formatMessage(messages.loading)}
379
+ </div>
380
+ )}
381
+ </div>
382
+ </div>
383
+ )}
384
+ </Container>
385
+ </div>
386
+ );
387
+ }
388
+
389
+ export default injectIntl(Login);
@@ -124,10 +124,17 @@
124
124
  // Table of contents - accordion menu
125
125
  .table-of-contents.accordionMenu {
126
126
  .ui.accordion {
127
+ .accordion {
128
+ margin: 1em 0em 0em !important;
129
+ padding: 0em;
130
+ }
131
+ .title {
132
+ padding: 0.75em 2em;
133
+ }
127
134
  .content {
135
+ --bg-color: initial !important;
128
136
  ul {
129
- padding-top: 0.5rem;
130
- padding-bottom: 1.3rem;
137
+ padding: 0.5rem 10px 1.3rem 50px;
131
138
  }
132
139
  .accordion-list-bulleted li::marker {
133
140
  content: '\25CB';