design-comuni-plone-theme 11.23.1 → 11.23.2

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.
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
 
2
2
 
3
+ ## [11.23.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.23.1...v11.23.2) (2024-09-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * added condition for spid user link redirect ([#776](https://github.com/RedTurtle/design-comuni-plone-theme/issues/776)) ([8ab726b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/8ab726b52fb22df66d76f1b00089cb4aa0f07968))
9
+
10
+
11
+ ### Documentation
12
+
13
+ * updated publiccode and release log ([19a712d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/19a712d35570da2a97bf811c72f4d87343c4e2dc))
14
+
3
15
  ## [11.23.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.23.0...v11.23.1) (2024-09-19)
4
16
 
5
17
 
package/RELEASE.md CHANGED
@@ -41,6 +41,12 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 11.23.2 (24/09/2024)
45
+
46
+ ### Migliorie
47
+
48
+ - Gli utenti SPID vengono ora direttamente rediretti al link finale quando viene utilizzato un CT di tipo Collegamento
49
+
44
50
  ## Versione 11.23.1 (19/09/2024)
45
51
 
46
52
  ### Migliorie
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "design-comuni-plone-theme",
3
3
  "description": "Volto Theme for Italia design guidelines",
4
4
  "license": "GPL-v3",
5
- "version": "11.23.1",
5
+ "version": "11.23.2",
6
6
  "main": "src/index.js",
7
7
  "repository": {
8
8
  "type": "git",
package/publiccode.yml CHANGED
@@ -227,9 +227,9 @@ maintenance:
227
227
  name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
228
228
  platforms:
229
229
  - web
230
- releaseDate: '2024-09-19'
230
+ releaseDate: '2024-09-24'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.23.1
232
+ softwareVersion: 11.23.2
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -0,0 +1,75 @@
1
+ // CUSTOMIZATION:
2
+ // - Added condition to check if user is SPID user (16-18 and 21)
3
+
4
+ import { useEffect } from 'react';
5
+ import { useSelector } from 'react-redux';
6
+ import PropTypes from 'prop-types';
7
+ import { useHistory } from 'react-router-dom';
8
+ import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
9
+ import { Container as SemanticContainer } from 'semantic-ui-react';
10
+ import { UniversalLink } from '@plone/volto/components';
11
+ import { FormattedMessage } from 'react-intl';
12
+ import config from '@plone/volto/registry';
13
+
14
+ const LinkView = ({ token, content }) => {
15
+ const history = useHistory();
16
+ const userIsSpidUser = useSelector(
17
+ (state) => state.users.user.roles.length === 0,
18
+ );
19
+
20
+ useEffect(() => {
21
+ if (!token || userIsSpidUser) {
22
+ const { remoteUrl } = content;
23
+ if (isInternalURL(remoteUrl)) {
24
+ history.replace(flattenToAppURL(remoteUrl));
25
+ } else if (!__SERVER__) {
26
+ window.location.href = flattenToAppURL(remoteUrl);
27
+ }
28
+ }
29
+ }, [content, history, token, userIsSpidUser]);
30
+ const { title, description, remoteUrl } = content;
31
+ const { openExternalLinkInNewTab } = config.settings;
32
+ const Container =
33
+ config.getComponent({ name: 'Container' }).component || SemanticContainer;
34
+
35
+ return (
36
+ <Container id="page-document">
37
+ <h1 className="documentFirstHeading">{title}</h1>
38
+ {content.description && (
39
+ <p className="documentDescription">{description}</p>
40
+ )}
41
+ {remoteUrl && (
42
+ <p>
43
+ <FormattedMessage
44
+ id="The link address is:"
45
+ defaultMessage="The link address is:"
46
+ />{' '}
47
+ <UniversalLink
48
+ href={remoteUrl}
49
+ openLinkInNewTab={
50
+ openExternalLinkInNewTab && !isInternalURL(remoteUrl)
51
+ }
52
+ >
53
+ {flattenToAppURL(remoteUrl)}
54
+ </UniversalLink>
55
+ </p>
56
+ )}
57
+ </Container>
58
+ );
59
+ };
60
+
61
+ LinkView.propTypes = {
62
+ content: PropTypes.shape({
63
+ title: PropTypes.string,
64
+ description: PropTypes.string,
65
+ remoteUrl: PropTypes.string,
66
+ }),
67
+ token: PropTypes.string,
68
+ };
69
+
70
+ LinkView.defaultProps = {
71
+ content: null,
72
+ token: null,
73
+ };
74
+
75
+ export default LinkView;