diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index f7ecb18ba..ba6c380a2 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -2358,6 +2358,21 @@ msgstr "" msgid "login_agid_other_description" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2379,6 +2394,11 @@ msgstr "" msgid "login_spid_help" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index d2d3516de..45ce60aaf 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -2343,6 +2343,21 @@ msgstr "" msgid "login_agid_other_description" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2364,6 +2379,11 @@ msgstr "" msgid "login_spid_help" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 012db0a93..5b76f5b95 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -2352,6 +2352,21 @@ msgstr "" msgid "login_agid_other_description" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2373,6 +2388,11 @@ msgstr "" msgid "login_spid_help" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index 3fcf30571..d3241018e 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -2360,6 +2360,21 @@ msgstr "" msgid "login_agid_other_description" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2381,6 +2396,11 @@ msgstr "" msgid "login_spid_help" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index 978e1beff..aa6e468c7 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -2343,6 +2343,21 @@ msgstr "Altre utenze" msgid "login_agid_other_description" msgstr "In alternativa puoi utilizzare le seguenti modalità." +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "Entra con CIE" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "Maggiori informazioni sulla CIE" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2364,6 +2379,11 @@ msgstr "Accedi con SPID, il sistema Pubblico di Identità Digitale." msgid "login_spid_help" msgstr "Come attivare SPID" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "Entra con CIE" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/locales/volto.pot b/locales/volto.pot index b0f053335..8bfba3058 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-12-18T16:06:10.430Z\n" +"POT-Creation-Date: 2023-12-20T09:24:02.911Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -2345,6 +2345,21 @@ msgstr "" msgid "login_agid_other_description" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: CIE +msgid "login_cie" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Log in with CIE. +msgid "login_cie_description" +msgstr "" + +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: How to activate CIE +msgid "login_cie_help" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgid #: components/ItaliaTheme/Unauthorized/Unauthorized # defaultMessage: Log in as employee @@ -2366,6 +2381,11 @@ msgstr "" msgid "login_spid_help" msgstr "" +#: components/ItaliaTheme/LoginAgid/LoginAgidButtons +# defaultMessage: Login with CIE +msgid "login_with_cie" +msgstr "" + #: components/ItaliaTheme/LoginAgid/LoginAgidButtons # defaultMessage: Login with SPID msgid "login_with_spid" diff --git a/src/components/ItaliaTheme/LoginAgid/LoginAgidButtons.jsx b/src/components/ItaliaTheme/LoginAgid/LoginAgidButtons.jsx index eff346d92..898a1f5c3 100644 --- a/src/components/ItaliaTheme/LoginAgid/LoginAgidButtons.jsx +++ b/src/components/ItaliaTheme/LoginAgid/LoginAgidButtons.jsx @@ -14,8 +14,10 @@ import { Icon, LoginButton, } from 'design-comuni-plone-theme/components/ItaliaTheme'; +import { Icon as BaseIcon } from '@plone/volto/components'; import { useLocation } from 'react-router-dom'; import config from '@plone/volto/registry'; +import cieSVG from 'design-comuni-plone-theme/icons/entra_con_cie.svg'; const messages = defineMessages({ loginSpid: { @@ -34,6 +36,22 @@ const messages = defineMessages({ id: 'login_spid_help', defaultMessage: 'How to activate SPID', }, + loginCie: { + id: 'login_cie', + defaultMessage: 'CIE', + }, + loginCieDescription: { + id: 'login_cie_description', + defaultMessage: 'Log in with CIE.', + }, + loginCieButton: { + id: 'login_with_cie', + defaultMessage: 'Login with CIE', + }, + loginCieHelp: { + id: 'login_cie_help', + defaultMessage: 'How to activate CIE', + }, }); // https://v5.reactrouter.com/web/example/query-parameters @@ -42,61 +60,111 @@ function useQueryV5() { return React.useMemo(() => new URLSearchParams(search), [search]); } +const SpidButton = ({ spidLoginUrl, qs, intl }) => ( +
+

{intl.formatMessage(messages.loginSpid)}

+

+ {intl.formatMessage(messages.loginSpidDescription)} +

+
+ +
+ + {intl.formatMessage(messages.loginSpidHelp)} + +
+
+
+); + +const CieButton = ({ cieLoginUrl, qs, intl }) => ( +
+

{intl.formatMessage(messages.loginCie)}

+

+ {intl.formatMessage(messages.loginCieDescription)} +

+
+ +
+ + {intl.formatMessage(messages.loginCieHelp)} + +
+
+
+); + +const ArButton = ({ arLoginUrl, intl }) => ( +
+

{intl.formatMessage(messages.loginSpid)}

+

+ {intl.formatMessage(messages.loginSpidDescription)} +

+
+ + + + + + {intl.formatMessage(messages.loginSpidButton)} + + +
+
+); + const LoginAgidButtons = ({ origin }) => { const intl = useIntl(); const query = useQueryV5(); const came_from = query.get('came_from') || origin; const qs = came_from ? `?came_from=${came_from}` : ''; + // "ar" => "Area Riservata" const arLoginUrl = config.settings.siteProperties?.arLoginUrl; const spidLoginUrl = __CLIENT__ ? window.env.RAZZLE_SPID_LOGIN_URL : process.env.RAZZLE_SPID_LOGIN_URL; + const cieLoginUrl = __CLIENT__ + ? window.env.RAZZLE_CIE_LOGIN_URL + : process.env.RAZZLE_CIE_LOGIN_URL; - return spidLoginUrl ? ( -
-

{intl.formatMessage(messages.loginSpid)}

-

- {intl.formatMessage(messages.loginSpidDescription)} -

-
- -
- - {intl.formatMessage(messages.loginSpidHelp)} - -
-
-
- ) : arLoginUrl ? ( -
-

{intl.formatMessage(messages.loginSpid)}

-

- {intl.formatMessage(messages.loginSpidDescription)} -

-
- - - - - - {intl.formatMessage(messages.loginSpidButton)} - - -
-
- ) : null; + return ( + <> + {spidLoginUrl && ( + + )} + {cieLoginUrl && ( + + )} + {!cieLoginUrl && !spidLoginUrl && arLoginUrl && ( + + )} + + ); }; export default LoginAgidButtons; diff --git a/src/icons/entra_con_cie.svg b/src/icons/entra_con_cie.svg new file mode 100644 index 000000000..0dd60a2d4 --- /dev/null +++ b/src/icons/entra_con_cie.svg @@ -0,0 +1,52 @@ + + + Entra con CIE + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file