@eeacms/volto-clms-theme 1.1.147 → 1.1.149

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.1.149](https://github.com/eea/volto-clms-theme/compare/1.1.148...1.1.149) - 14 May 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - update snapshot [Ion Lizarazu - [`48fbba7`](https://github.com/eea/volto-clms-theme/commit/48fbba77051a86789c2751f77bd679be075ad73f)]
12
+ - eslint [Ion Lizarazu - [`e94e0c8`](https://github.com/eea/volto-clms-theme/commit/e94e0c85357e4c8ad9f71a995d186c740c64b3cc)]
13
+ - modify a link [Ion Lizarazu - [`17b495f`](https://github.com/eea/volto-clms-theme/commit/17b495f6a8beaa66683ca851a4e457b51b474e7e)]
14
+ - Modify login functionality on Unauthorized view, due to fix the non showing modal error [Ion Lizarazu - [`d324f75`](https://github.com/eea/volto-clms-theme/commit/d324f75339fc5ca9899cdb70b2d3d3c41d3b71d6)]
15
+ ### [1.1.148](https://github.com/eea/volto-clms-theme/compare/1.1.147...1.1.148) - 13 May 2024
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - CLMS-3270 CLMS-3271 (Bugs): Cart calendar future dates + no year dropdown solved [Urkorue - [`4e08019`](https://github.com/eea/volto-clms-theme/commit/4e080197ab224a072f8d0e5e494faa698bfedd1f)]
7
20
  ### [1.1.147](https://github.com/eea/volto-clms-theme/compare/1.1.146...1.1.147) - 10 May 2024
8
21
 
9
22
  #### :hammer_and_wrench: Others
@@ -434,6 +447,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
434
447
 
435
448
  - to render nothing, return null [Mikel Larreategi - [`2fb3580`](https://github.com/eea/volto-clms-theme/commit/2fb35802b23e3aba5fd166aeefd103c929ffb5d1)]
436
449
  - simplify condtioin [Mikel Larreategi - [`f9b43da`](https://github.com/eea/volto-clms-theme/commit/f9b43da91d360e0028402f9a7ba762f16b0d9b22)]
450
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`7c6e9ca`](https://github.com/eea/volto-clms-theme/commit/7c6e9cac9da0c06d0f24711303404f5055fba7d1)]
437
451
  ### [1.1.80](https://github.com/eea/volto-clms-theme/compare/1.1.79...1.1.80) - 17 November 2023
438
452
 
439
453
  #### :bug: Bug Fixes
@@ -444,6 +458,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
444
458
 
445
459
  #### :hammer_and_wrench: Others
446
460
 
461
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`37c3299`](https://github.com/eea/volto-clms-theme/commit/37c3299dd19c95057e70d48152bfef2365f2416c)]
447
462
  - CLMS-2509 (Bug): Lint [Urkorue - [`1bbc011`](https://github.com/eea/volto-clms-theme/commit/1bbc011481c0ee1feb68d0cf57c4a5a9f4c224ca)]
448
463
  - CLMS-2509 (Bug): Timeseries icon centered [Urkorue - [`fc38685`](https://github.com/eea/volto-clms-theme/commit/fc3868598ab592f01bb3ee23f985ada5c11227d4)]
449
464
  ### [1.1.78](https://github.com/eea/volto-clms-theme/compare/1.1.77...1.1.78) - 16 November 2023
@@ -496,14 +511,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
496
511
 
497
512
  #### :hammer_and_wrench: Others
498
513
 
514
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`c55db1c`](https://github.com/eea/volto-clms-theme/commit/c55db1c20cfef1eb34c587343a4822fa4bde3c54)]
499
515
  ### [1.1.73](https://github.com/eea/volto-clms-theme/compare/1.1.72...1.1.73) - 6 November 2023
500
516
 
501
517
  #### :hammer_and_wrench: Others
502
518
 
519
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`3a543b9`](https://github.com/eea/volto-clms-theme/commit/3a543b9000c1168d54edfb8003eb08dfa7c85031)]
503
520
  - comment Integration tests [Ion Lizarazu - [`74713f8`](https://github.com/eea/volto-clms-theme/commit/74713f8f78d77ba193d8c27462cc8787d698ab81)]
504
521
  - uncomment cypress tests [Ion Lizarazu - [`3526a5c`](https://github.com/eea/volto-clms-theme/commit/3526a5c46481667b0518c6cce0927e67726c6f6c)]
505
522
  - use chrome instead of chromium to run cypress tests [Ion Lizarazu - [`6ae3a06`](https://github.com/eea/volto-clms-theme/commit/6ae3a06dbec1914c06a55c0dcb826c49b75f9739)]
506
523
  - ccltabs activeTab condition having first child [Ion Lizarazu - [`3cf9376`](https://github.com/eea/volto-clms-theme/commit/3cf9376d55f5f41b7e42c25e5925cd871ec71d81)]
524
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`f41ecfe`](https://github.com/eea/volto-clms-theme/commit/f41ecfea8b5a1e409303ffcc7befe7f51316d652)]
507
525
  ### [1.1.72](https://github.com/eea/volto-clms-theme/compare/1.1.71...1.1.72) - 2 November 2023
508
526
 
509
527
  ### [1.1.71](https://github.com/eea/volto-clms-theme/compare/1.1.70...1.1.71) - 31 October 2023
@@ -514,6 +532,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
514
532
 
515
533
  #### :house: Internal changes
516
534
 
535
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`67ca3bb`](https://github.com/eea/volto-clms-theme/commit/67ca3bb111f34842569c12b9c87a2a91bd14b09e)]
517
536
 
518
537
  #### :hammer_and_wrench: Others
519
538
 
@@ -610,6 +629,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
610
629
 
611
630
  - readme [Mikel Larreategi - [`3c0ab05`](https://github.com/eea/volto-clms-theme/commit/3c0ab051981a4efad7712bc46182eed9d79fd10f)]
612
631
  - remove from addons [Mikel Larreategi - [`89c2e7d`](https://github.com/eea/volto-clms-theme/commit/89c2e7d793193e6bb64642f0b06a01cd3c81108a)]
632
+ - yarn.lock added after running yarn [Unai - [`ad307be`](https://github.com/eea/volto-clms-theme/commit/ad307be72bbfe753f7571ea4d784a09978e0f7f2)]
613
633
  - prettier issue fix [Unai - [`8bc0650`](https://github.com/eea/volto-clms-theme/commit/8bc0650918f9fa1065d19d2c15ce153a5fc5abbb)]
614
634
  - set a limit of 5 items in the download queue [Mikel Larreategi - [`b81cc83`](https://github.com/eea/volto-clms-theme/commit/b81cc8383165bafbbff52fbeeb365d413051802e)]
615
635
  - adjust logo size [Mikel Larreategi - [`b90a72c`](https://github.com/eea/volto-clms-theme/commit/b90a72c07102025a7e90607b25d34611ddd4f4f6)]
@@ -751,6 +771,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
751
771
 
752
772
  - fix cart items concat function [Ion Lizarazu - [`4b72249`](https://github.com/eea/volto-clms-theme/commit/4b72249ef17a0cda22661809fce5be7c2d1f6649)]
753
773
  - revert Jenkinsfile [Ion Lizarazu - [`64f6cd0`](https://github.com/eea/volto-clms-theme/commit/64f6cd08100357843b507c00d3286d7debe0ef04)]
774
+ - yarn.lock file [Ion Lizarazu - [`8444ad1`](https://github.com/eea/volto-clms-theme/commit/8444ad1606b3939e4609bdd186e5ace2252588a8)]
754
775
  - packages.json versions order [Ion Lizarazu - [`4fd7a86`](https://github.com/eea/volto-clms-theme/commit/4fd7a86ab43238841b421e1ed10ebd52ab420a15)]
755
776
  - downloadablefilestablewidget param modification [Ion Lizarazu - [`5dd794a`](https://github.com/eea/volto-clms-theme/commit/5dd794a33a8eddd042a753b7ab47e7d2a323b011)]
756
777
  - add technical_documents_accordion_text field to the dataset view [Ion Lizarazu - [`96ed1e5`](https://github.com/eea/volto-clms-theme/commit/96ed1e5e2c2b501bd303bc76b333a70ad1614c16)]
@@ -875,6 +896,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
875
896
 
876
897
  - remove NUTS text for area naming in the cart [ionlizarazu - [`062e0a3`](https://github.com/eea/volto-clms-theme/commit/062e0a375f5352bc13c18ff7ec33fad4bcc59f2f)]
877
898
  - dependencies [ionlizarazu - [`405ef96`](https://github.com/eea/volto-clms-theme/commit/405ef96090fe7bd4af73a49d3285a92fad712e3b)]
899
+ - yarn.lock [ionlizarazu - [`7132119`](https://github.com/eea/volto-clms-theme/commit/71321195c4dd4fceed67f2f0872f3e24bba61c17)]
878
900
  - volto-blocks-grid module mapping [ionlizarazu - [`4fec3ca`](https://github.com/eea/volto-clms-theme/commit/4fec3cabc437322ad92ed90d682250bd123ccaaf)]
879
901
  - volto-blocks-grid v7.0.2 [ionlizarazu - [`2557e60`](https://github.com/eea/volto-clms-theme/commit/2557e6039d3cea33ca0bd11a0a3ef4764c611f78)]
880
902
  - remove styling from teaser block [ionlizarazu - [`879e684`](https://github.com/eea/volto-clms-theme/commit/879e684057c88f52f60f0fa54cbaa155c7d14688)]
@@ -962,6 +984,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
962
984
 
963
985
  #### :house: Internal changes
964
986
 
987
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`b4cbf65`](https://github.com/eea/volto-clms-theme/commit/b4cbf6557fbc67f7fc4cea5aa2cb19804f3d7e3c)]
965
988
 
966
989
  #### :hammer_and_wrench: Others
967
990
 
@@ -2160,6 +2183,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2160
2183
  #### :hammer_and_wrench: Others
2161
2184
 
2162
2185
  - related products and datasets added to news and meeting views and login-plone route created [Unai - [`5704a1a`](https://github.com/eea/volto-clms-theme/commit/5704a1a766148746162b60efaf232ea90dc20cf4)]
2186
+ - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
2163
2187
  - sort items according to the lowercased label and put those with special meaning at the end [Mikel Larreategi - [`6410abe`](https://github.com/eea/volto-clms-theme/commit/6410abe096f60dcad54dced2026c9df9b7946d68)]
2164
2188
  - lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
2165
2189
  - footer newsletter subscription change, global search maxLength change from 8000 to 200 and /login design change [Unai - [`a09d24a`](https://github.com/eea/volto-clms-theme/commit/a09d24adbb6fa053fb2a2cc0071506b906593b42)]
@@ -2310,6 +2334,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2310
2334
  - search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
2311
2335
  - language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
2312
2336
  - toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
2337
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
2313
2338
  ### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
2314
2339
 
2315
2340
  #### :hammer_and_wrench: Others
@@ -3214,11 +3239,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
3214
3239
  #### :hammer_and_wrench: Others
3215
3240
 
3216
3241
  - replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
3242
+ - yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
3217
3243
  - add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
3218
3244
  - upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
3219
3245
  - HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
3220
3246
  - babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
3221
3247
  - prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
3248
+ - add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
3222
3249
  - Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
3223
3250
  - cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
3224
3251
  - some fixes [ionlizarazu - [`046279b`](https://github.com/eea/volto-clms-theme/commit/046279b9d05bea8a64eca03eed493e02621534c9)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.147",
3
+ "version": "1.1.149",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -28,6 +28,11 @@ export const GeonetworkImporterButtons = (props) => {
28
28
  dispatch(postImportGeonetwork(location.pathname, id, type));
29
29
  };
30
30
 
31
+ const TYPE_NAMING = {
32
+ VITO: 'Global Land collection catalog - VITO NV',
33
+ EEA: 'EEA',
34
+ };
35
+
31
36
  return (
32
37
  <Segment basic>
33
38
  <h2>Geonetwork importation options:</h2>
@@ -106,8 +111,11 @@ export const GeonetworkImporterButtons = (props) => {
106
111
  />
107
112
  </h1>
108
113
  This action will import the data from{' '}
109
- <strong>{item.title}</strong> (from {item.type})
110
- into this dataset.
114
+ <strong>{item.title}</strong> (from{' '}
115
+ {TYPE_NAMING[item.type]
116
+ ? TYPE_NAMING[item.type]
117
+ : item.type}
118
+ ) into this dataset.
111
119
  <br />
112
120
  <br />
113
121
  <a
@@ -117,7 +125,7 @@ export const GeonetworkImporterButtons = (props) => {
117
125
  item.type === 'EEA'
118
126
  ? 'https://sdi.eea.europa.eu/catalogue/srv/eng/catalog.search#/metadata/' +
119
127
  item.id
120
- : 'https://land.copernicus.vgt.vito.be/geonetwork/srv/eng/catalog.search#/metadata/' +
128
+ : 'https://globalland.vito.be/geonetwork/srv/spa/catalog.search#/home' +
121
129
  item.id
122
130
  }
123
131
  >
@@ -433,10 +433,11 @@ const CLMSCartContent = (props) => {
433
433
  <TimeseriesPicker
434
434
  start={
435
435
  datasetTimeseries.datasets[item?.dataset_uid]
436
- ?.start
436
+ ?.start || new Date(0)
437
437
  }
438
438
  end={
439
- datasetTimeseries.datasets[item?.dataset_uid]?.end
439
+ datasetTimeseries.datasets[item?.dataset_uid]
440
+ ?.end || new Date()
440
441
  }
441
442
  period={
442
443
  datasetTimeseries.datasets[item?.dataset_uid]
@@ -2,8 +2,10 @@ import React, { useEffect } from 'react';
2
2
  import { useSelector } from 'react-redux';
3
3
  import config from '@plone/volto/registry';
4
4
  import { UniversalLink } from '@plone/volto/components';
5
- import { toPublicURL } from '@plone/volto/helpers/Url/Url';
6
5
  import { toBase64 } from '../CclUtils';
6
+ import { getRegistry } from '@eeacms/volto-clms-theme/actions';
7
+ import { useDispatch } from 'react-redux';
8
+ import { Segment } from 'semantic-ui-react';
7
9
 
8
10
  /**
9
11
  * Login Modal component doc.
@@ -12,10 +14,16 @@ import { toBase64 } from '../CclUtils';
12
14
  *
13
15
  */
14
16
  function CLMSLoginView(props) {
17
+ const dispatch = useDispatch();
15
18
  const registryRecords = useSelector((state) => state.registry.records);
16
19
  const [loginUrl, setLoginUrl] = React.useState('');
17
20
  const registry_key = config.settings?.registry?.login_url || null;
18
21
 
22
+ useEffect(() => {
23
+ dispatch(getRegistry(registry_key));
24
+ // eslint-disable-next-line react-hooks/exhaustive-deps
25
+ }, []);
26
+
19
27
  useEffect(() => {
20
28
  if (registryRecords && registry_key in registryRecords) {
21
29
  setLoginUrl(
@@ -29,51 +37,61 @@ function CLMSLoginView(props) {
29
37
  return (
30
38
  <>
31
39
  <div className="ccl-container login">
32
- <h1 className="page-title">Registration / Login</h1>
33
- <div className="modal-login-text">
34
- <p>
35
- EU Login, the European Commission Authentication Service, enables
36
- you to access various web applications centrally using the same
37
- e-mail and password. You can read more{' '}
38
- <UniversalLink
39
- openLinkInNewTab
40
- href="https://ecas.ec.europa.eu/cas/about.html"
41
- >
42
- here
43
- </UniversalLink>
44
- .
45
- </p>
46
- <p>
47
- If you have EU Login account, please click 'Login using EU Login'.
48
- </p>
49
- <p>
50
- If you don't have EU Login account, please follow this{' '}
51
- <UniversalLink
52
- openLinkInNewTab
53
- href="https://ecas.ec.europa.eu/cas/eim/external/register.cgi"
54
- >
55
- link
56
- </UniversalLink>{' '}
57
- to create it.
58
- </p>
59
- <p>
60
- If you have othe questions, please contact our
61
- <UniversalLink openLinkInNewTab href="/en/service-desk">
62
- {' '}
63
- Service desk
64
- </UniversalLink>
65
- .
66
- </p>
67
- </div>
68
- </div>
69
- <div className="login-button">
70
- <div className="modal-buttons">
71
- <UniversalLink
72
- href={toPublicURL(loginUrl) || '#'}
73
- className="ccl-button ccl-button-green"
74
- >
75
- Login using EU Login
76
- </UniversalLink>
40
+ <h1 className="page-title">Register / Login</h1>
41
+ <div className="login-page-container">
42
+ <Segment padded="very" className="login-page-container-content">
43
+ <div className="content">
44
+ <h2 className="modal-login-title">
45
+ This website uses EU Login for user authentication.
46
+ </h2>
47
+ <div className="modal-login-text">
48
+ <p>
49
+ EU Login, the European Commission Authentication Service,
50
+ enables you to access various web applications centrally using
51
+ the same e-mail and password. You can read more{' '}
52
+ <UniversalLink
53
+ openLinkInNewTab
54
+ href="https://ecas.ec.europa.eu/cas/about.html"
55
+ >
56
+ here
57
+ </UniversalLink>
58
+ .
59
+ </p>
60
+ <p>
61
+ If you have EU Login account, please click 'Login using EU
62
+ Login'.
63
+ </p>
64
+ <p>
65
+ If you don't have EU Login account, please follow this{' '}
66
+ <UniversalLink
67
+ openLinkInNewTab
68
+ href="https://ecas.ec.europa.eu/cas/eim/external/register.cgi"
69
+ >
70
+ link
71
+ </UniversalLink>{' '}
72
+ to create it.
73
+ </p>
74
+ <p>
75
+ If you have othe questions, please contact our
76
+ <UniversalLink openLinkInNewTab href="/en/service-desk">
77
+ {' '}
78
+ Service desk
79
+ </UniversalLink>
80
+ .
81
+ </p>
82
+ </div>
83
+ </div>
84
+ <div className="actions">
85
+ <div className="modal-buttons">
86
+ <a
87
+ href={loginUrl || '#'}
88
+ className="ccl-button ccl-button-green"
89
+ >
90
+ Login using EU Login
91
+ </a>
92
+ </div>
93
+ </div>
94
+ </Segment>
77
95
  </div>
78
96
  </div>
79
97
  </>
@@ -21,6 +21,7 @@ import CclLoginModal from '@eeacms/volto-clms-theme/components/CclLoginModal/Ccl
21
21
  import CclTopMainMenu from '@eeacms/volto-clms-theme/components/CclTopMainMenu/CclTopMainMenu';
22
22
  import { getCartItems } from '@eeacms/volto-clms-utils/actions';
23
23
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
24
+ import { UniversalLink } from '@plone/volto/components';
24
25
 
25
26
  import jwtDecode from 'jwt-decode';
26
27
  import PropTypes from 'prop-types';
@@ -239,7 +240,13 @@ class Header extends Component {
239
240
  </>
240
241
  )) || (
241
242
  <li>
242
- <CclLoginModal />
243
+ {this.props.apiStatusCode === 401 ? (
244
+ <UniversalLink href="/en/login">
245
+ Register/Login
246
+ </UniversalLink>
247
+ ) : (
248
+ <CclLoginModal />
249
+ )}
243
250
  </li>
244
251
  )}
245
252
  <li className="header-vertical-line">
@@ -297,7 +304,13 @@ class Header extends Component {
297
304
  </>
298
305
  )) || (
299
306
  <li>
300
- <CclLoginModal />
307
+ {this.props.apiStatusCode === 401 ? (
308
+ <UniversalLink href="/en/login">
309
+ Register/Login
310
+ </UniversalLink>
311
+ ) : (
312
+ <CclLoginModal />
313
+ )}
301
314
  </li>
302
315
  )}
303
316
  <li className="header-vertical-line">
@@ -326,6 +339,7 @@ export default compose(
326
339
  ? jwtDecode(state.userSession.token).sub
327
340
  : '',
328
341
  rawtoken: state.userSession.token,
342
+ apiStatusCode: state.apierror?.statusCode?.statusCode,
329
343
  }),
330
344
  { getUser, getCartItems, loginRenew },
331
345
  ),
@@ -1,117 +1,16 @@
1
1
  /**
2
2
  * @module components/theme/Unauthorized/Unauthorized
3
3
  */
4
- import React, { useEffect } from 'react';
4
+ import React from 'react';
5
5
  import { FormattedMessage } from 'react-intl';
6
- import { useDispatch, useSelector } from 'react-redux';
6
+ import { useSelector } from 'react-redux';
7
7
  import { Link } from 'react-router-dom';
8
8
  import { Container } from 'semantic-ui-react';
9
+ import { UniversalLink } from '@plone/volto/components';
9
10
 
10
11
  import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils';
11
12
  // import CclLoginModal from '@eeacms/volto-clms-theme/components/CclLoginModal/CclLoginModal';
12
13
 
13
- import { UniversalLink } from '@plone/volto/components';
14
- import config from '@plone/volto/registry';
15
- import { getRegistry } from '@eeacms/volto-clms-theme/actions';
16
- import CclModal from '@eeacms/volto-clms-theme/components/CclModal/CclModal';
17
- import { toBase64 } from '../../../../../components/CclUtils';
18
-
19
- const CclLoginModal = (props) => {
20
- let {
21
- classname = 'header-login-link',
22
- triggerComponent = () => (
23
- <span className={classname}>
24
- <FormattedMessage id="loginRegister" defaultMessage="Register/Login" />
25
- </span>
26
- ),
27
- otherPath = undefined,
28
- } = props;
29
- const dispatch = useDispatch();
30
- const registryRecords = useSelector((state) => state?.registry?.records);
31
- const [loginUrl, setLoginUrl] = React.useState('');
32
- const registry_key = config.settings?.registry?.login_url || null;
33
-
34
- useEffect(() => {
35
- if (registryRecords && registry_key in registryRecords) {
36
- if (otherPath) {
37
- setLoginUrl(
38
- `${registryRecords[registry_key]}?came_from=${toBase64(otherPath)}`,
39
- );
40
- } else {
41
- setLoginUrl(
42
- `${registryRecords[registry_key]}?came_from=${toBase64(
43
- window.location.href,
44
- )}`,
45
- );
46
- }
47
- }
48
- }, [otherPath, registryRecords, registry_key]);
49
-
50
- function modalStatus(status) {
51
- if (status === true) {
52
- dispatch(getRegistry(registry_key));
53
- }
54
- }
55
-
56
- return (
57
- <CclModal
58
- trigger={triggerComponent()}
59
- size="tiny"
60
- modalStatus={modalStatus}
61
- >
62
- <div className="content">
63
- <div className="modal-login-title">
64
- This website uses EU Login for user authentication.
65
- </div>
66
- <div className="modal-login-text">
67
- <p>
68
- {' '}
69
- EU Login, the European Commission Authentication Service, enables
70
- you to access various web applications centrally using the same
71
- e-mail and password. You can read more{' '}
72
- <UniversalLink
73
- openLinkInNewTab
74
- href="https://ecas.ec.europa.eu/cas/about.html"
75
- >
76
- here
77
- </UniversalLink>
78
- .
79
- </p>
80
- <p>
81
- {' '}
82
- If you have EU Login account, please click 'Login using EU Login'.
83
- </p>
84
- <p>
85
- If you don't have EU Login account, please follow this{' '}
86
- <UniversalLink
87
- openLinkInNewTab
88
- href="https://ecas.ec.europa.eu/cas/eim/external/register.cgi"
89
- >
90
- link
91
- </UniversalLink>{' '}
92
- to create it.
93
- </p>
94
- <p>
95
- If you have other questions, please contact our
96
- <UniversalLink openLinkInNewTab href="/en/contact-service-helpdesk">
97
- {' '}
98
- Service desk
99
- </UniversalLink>
100
- .
101
- </p>
102
- </div>
103
- </div>
104
- <div className="actions">
105
- <div className="modal-buttons">
106
- <a href={loginUrl || '#'} className="ccl-button ccl-button-green">
107
- Login using EU Login
108
- </a>
109
- </div>
110
- </div>
111
- </CclModal>
112
- );
113
- };
114
-
115
14
  /**
116
15
  * unauthorized function.
117
16
  * @function Unauthorized
@@ -132,16 +31,7 @@ const Unauthorized = () => {
132
31
  defaultMessage="You are trying to access a protected resource, please {login} first."
133
32
  values={{
134
33
  login: (
135
- <CclLoginModal
136
- triggerComponent={() => (
137
- <span className="unauthorized-login-link">
138
- <FormattedMessage
139
- id="register-login"
140
- defaultMessage="Register / Login"
141
- />
142
- </span>
143
- )}
144
- />
34
+ <UniversalLink href="/en/login">Register/Login</UniversalLink>
145
35
  ),
146
36
  }}
147
37
  />
@@ -14,16 +14,15 @@ exports[`Unauthorized renders a not found component 1`] = `
14
14
  className="description"
15
15
  >
16
16
  You are trying to access a protected resource, please
17
- <span
18
- className="unauthorized-login-link"
19
- onBlur={[Function]}
17
+ <a
18
+ className={null}
19
+ href="/en/login"
20
20
  onClick={[Function]}
21
- onFocus={[Function]}
22
- onMouseEnter={[Function]}
23
- onMouseLeave={[Function]}
21
+ target={null}
22
+ title={null}
24
23
  >
25
- Register / Login
26
- </span>
24
+ Register/Login
25
+ </a>
27
26
  first.
28
27
  </p>
29
28
  <p>
@@ -327,6 +327,26 @@
327
327
  color: @clmsGreen;
328
328
  }
329
329
 
330
+ div.ui.segment.login-page-container-content {
331
+ max-width: 540px;
332
+ margin-bottom: 2rem;
333
+
334
+ .content{
335
+ font-size: 1em;
336
+ line-height: 1.4;
337
+ padding: 1.5rem;
338
+ }
339
+ .actions{
340
+ border-top: 0.07142857rem solid #EDF1F2;
341
+ padding: 1rem 1rem;
342
+ }
343
+ }
344
+
345
+ div.login-page-container{
346
+ display: flex;
347
+ justify-content: center;
348
+ }
349
+
330
350
  .handle {
331
351
  border: none !important;
332
352
  margin: 1rem !important;