@pagopa/selfcare-common-frontend 2.4.0 → 2.5.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 +7 -0
- package/lib/components/Footer/Footer.js +3 -3
- package/lib/config/env.d.ts +1 -1
- package/lib/config/env.js +3 -22
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,15 @@ 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
|
+
#### [v2.5.0](https://github.com/pagopa/selfcare-common-frontend/compare/v2.4.0...v2.5.0)
|
|
8
|
+
|
|
9
|
+
- update link [`#363`](https://github.com/pagopa/selfcare-common-frontend/pull/363)
|
|
10
|
+
- chore: release v2.4.0 [`#361`](https://github.com/pagopa/selfcare-common-frontend/pull/361)
|
|
11
|
+
|
|
7
12
|
#### [v2.4.0](https://github.com/pagopa/selfcare-common-frontend/compare/v2.2.1...v2.4.0)
|
|
8
13
|
|
|
14
|
+
> 10 September 2026
|
|
15
|
+
|
|
9
16
|
- [SELC-9222] feat: update privacy policy handling and add tests for environment configurations [`#360`](https://github.com/pagopa/selfcare-common-frontend/pull/360)
|
|
10
17
|
- chore: release v2.2.1 [`#359`](https://github.com/pagopa/selfcare-common-frontend/pull/359)
|
|
11
18
|
- [SELC-9222] feat: update privacy policy handling and add tests for environment configurations (#360) [`#9222`](https://pagopa.atlassian.net/browse/9222)
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Footer as MuiItaliaFooter, } from '@pagopa/mui-italia';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { Trans, useTranslation } from 'react-i18next';
|
|
5
|
-
import { CONFIG } from '../../config/env';
|
|
5
|
+
import { CONFIG, showStaticPrivacyPolicy } from '../../config/env';
|
|
6
6
|
import i18n from '../../locale/locale-utils';
|
|
7
7
|
import { LANGUAGES, pagoPALink } from './FooterConfig';
|
|
8
8
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
@@ -56,7 +56,7 @@ export default function Footer({ loggedUser, productsJsonUrl, onExit = (exitActi
|
|
|
56
56
|
href: CONFIG.FOOTER.LINK.PRIVACYPOLICY,
|
|
57
57
|
ariaLabel: `${t('common.footer.preLoginLinks.resources.links.privacyPolicy')}: vai al link`,
|
|
58
58
|
linkType: 'external',
|
|
59
|
-
onClick:
|
|
59
|
+
onClick: showStaticPrivacyPolicy()
|
|
60
60
|
? () => window.open(CONFIG.FOOTER.LINK.PRIVACYPOLICY, '_blank', 'noopener,noreferrer')
|
|
61
61
|
: undefined,
|
|
62
62
|
},
|
|
@@ -155,7 +155,7 @@ export default function Footer({ loggedUser, productsJsonUrl, onExit = (exitActi
|
|
|
155
155
|
href: CONFIG.FOOTER.LINK.PRIVACYPOLICY,
|
|
156
156
|
ariaLabel: `${t('common.footer.postLoginLinks.privacyPolicy')}: vai al link`,
|
|
157
157
|
linkType: 'internal',
|
|
158
|
-
onClick:
|
|
158
|
+
onClick: showStaticPrivacyPolicy()
|
|
159
159
|
? () => window.open(CONFIG.FOOTER.LINK.PRIVACYPOLICY, '_blank', 'noopener,noreferrer')
|
|
160
160
|
: undefined,
|
|
161
161
|
},
|
package/lib/config/env.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const showStaticPrivacyPolicy: () => boolean;
|
|
1
2
|
export declare const CONFIG: {
|
|
2
3
|
URL_FE: {
|
|
3
4
|
LOGIN_GOOGLE: string;
|
|
@@ -38,7 +39,6 @@ export declare const CONFIG: {
|
|
|
38
39
|
LINK: {
|
|
39
40
|
PAGOPALINK: string;
|
|
40
41
|
PRIVACYPOLICY: string;
|
|
41
|
-
PRIVACYPOLICY_OPEN_IN_NEW_TAB: boolean;
|
|
42
42
|
TERMSANDCONDITIONS: string;
|
|
43
43
|
PROTECTIONOFPERSONALDATA: string;
|
|
44
44
|
ABOUTUS: string;
|
package/lib/config/env.js
CHANGED
|
@@ -10,26 +10,7 @@ const appendBackstageParam = (url) => {
|
|
|
10
10
|
};
|
|
11
11
|
const currentEnv = import.meta.env.VITE_ENV || '';
|
|
12
12
|
const isProd = currentEnv === 'PROD';
|
|
13
|
-
|
|
14
|
-
* Computes the Privacy Policy link shown in the footer.
|
|
15
|
-
* - Backstage context or PROD environment: legacy SPA route (OneTrust), with `origin=backstage` param when applicable.
|
|
16
|
-
* - Non-backstage, non-PROD (DEV/UAT/local/test): new static CDN page, bypassing the SPA route entirely.
|
|
17
|
-
* Falls back to the legacy SPA route (without backstage param) if the static URL env var is not configured.
|
|
18
|
-
*/
|
|
19
|
-
const privacyPolicyUrl = () => {
|
|
20
|
-
const legacyUrl = import.meta.env.VITE_URL_PRIVACY_DISCLAIMER || '';
|
|
21
|
-
if (isFromBackstage || isProd) {
|
|
22
|
-
return appendBackstageParam(legacyUrl);
|
|
23
|
-
}
|
|
24
|
-
const staticUrl = import.meta.env.VITE_URL_PRIVACY_POLICY_STATIC || '';
|
|
25
|
-
return staticUrl || legacyUrl;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* `true` when the Privacy Policy link currently points to the static CDN page (i.e. non-backstage,
|
|
29
|
-
* non-PROD, with the static URL configured), so consumers can open it in a new tab instead of
|
|
30
|
-
* navigating away from the SPA. `false` for the legacy SPA route, to preserve the current behavior.
|
|
31
|
-
*/
|
|
32
|
-
const isStaticPrivacyPolicy = () => !isFromBackstage && !isProd && !!import.meta.env.VITE_URL_PRIVACY_POLICY_STATIC;
|
|
13
|
+
export const showStaticPrivacyPolicy = () => !isFromBackstage && !isProd;
|
|
33
14
|
export const CONFIG = {
|
|
34
15
|
URL_FE: {
|
|
35
16
|
LOGIN_GOOGLE: '/auth/google',
|
|
@@ -69,8 +50,8 @@ export const CONFIG = {
|
|
|
69
50
|
FOOTER: {
|
|
70
51
|
LINK: {
|
|
71
52
|
PAGOPALINK: 'https://www.pagopa.it/',
|
|
72
|
-
PRIVACYPOLICY:
|
|
73
|
-
|
|
53
|
+
PRIVACYPOLICY: showStaticPrivacyPolicy() ? import.meta.env.VITE_URL_PRIVACY_POLICY_STATIC || ''
|
|
54
|
+
: appendBackstageParam(import.meta.env.VITE_URL_PRIVACY_DISCLAIMER || ''),
|
|
74
55
|
TERMSANDCONDITIONS: appendBackstageParam(import.meta.env.VITE_URL_TERMS_AND_CONDITIONS || ''),
|
|
75
56
|
PROTECTIONOFPERSONALDATA: 'https://privacyportal-de.onetrust.com/webform/77f17844-04c3-4969-a11d-462ee77acbe1/9ab6533d-be4a-482e-929a-0d8d2ab29df8',
|
|
76
57
|
ABOUTUS: 'https://www.pagopa.it/it/societa/chi-siamo/',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagopa/selfcare-common-frontend",
|
|
3
3
|
"description": "Shared React components for the pagopa selfcare project",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|