diff --git a/packages/volto/cypress/support/commands.js b/packages/volto/cypress/support/commands.js index f8ba71f310..690557b6f6 100644 --- a/packages/volto/cypress/support/commands.js +++ b/packages/volto/cypress/support/commands.js @@ -967,3 +967,24 @@ Cypress.Commands.add('queryCounter', (path, steps, number = 1) => { cy.get('@counterName').its('callCount').should('equal', number); }); + +Cypress.Commands.add('enableSelfRegister', () => { + let api_url; + if (Cypress.env('API') === 'guillotina') { + api_url = GUILLOTINA_API_URL; + } else { + api_url = PLONE_API_URL; + } + + cy.request({ + method: 'PATCH', + url: `${api_url}/@controlpanels/security`, + headers: { Accept: 'application/json' }, + auth: ploneAuthObj, + body: { + enable_self_reg: true, + use_email_as_login: true, + use_uuid_as_userid: true, + }, + }); +}); diff --git a/packages/volto/cypress/tests/core/basic/register.js b/packages/volto/cypress/tests/core/basic/register.js new file mode 100644 index 0000000000..2819de4bbe --- /dev/null +++ b/packages/volto/cypress/tests/core/basic/register.js @@ -0,0 +1,24 @@ +describe('Register Tests', () => { + beforeEach(() => { + cy.enableSelfRegister(); + cy.intercept('GET', '@userschema').as('userschema'); + }); + it('Registration form is built according to the schema of the backend', function () { + let userschema = {}; + + cy.visit('/register'); + cy.wait('@userschema').then((res) => { + userschema = res.response.body; + Object.keys(userschema.properties).forEach((item) => { + cy.get(`#fieldset-undefined-field-label-${item}`).should( + 'have.text', + userschema.properties[item].title, + ); + cy.get(`.field-wrapper-${item} .help`).should( + 'have.text', + userschema.properties[item].description, + ); + }); + }); + }); +}); diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index e9e7fe90a2..42d24e6fac 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -995,7 +995,6 @@ msgstr "Data (el més nou primer)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Per defecte" @@ -1203,11 +1202,6 @@ msgstr "Deixeu fitxers aquí..." msgid "Dry run selected, transaction aborted." msgstr "" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "correu electrònic" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1327,16 +1321,6 @@ msgstr "Introduïu l'URL o seleccioneu un element" msgid "Enter a username above to search or click 'Show All'" msgstr "Introduïu un nom d'usuari a dalt per cercar o feu clic a 'Mostra-ho tot'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Introduïu una adreça de correu electrònic. Aquest serà el vostre nom d'inici de sessió. Respectem la vostra privadesa i no donarem l'adreça a tercers ni l'exposarem enlloc." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Introduïu el nom complet, per exemple John Smith." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1617,11 +1601,6 @@ msgstr "Des de" msgid "Full" msgstr "Complet" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nom complet" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index 07723ded35..868c85b380 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -994,7 +994,6 @@ msgstr "Datum (neustes zuerst)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Standard" @@ -1202,11 +1201,6 @@ msgstr "Datei hier ablegen um die bestehende Datei zu ersetzen" msgid "Dry run selected, transaction aborted." msgstr "Probelauf gewählt, Transaktion abgebrochen." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-Mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1326,16 +1320,6 @@ msgstr "URL eingeben oder Objekt auswählen" msgid "Enter a username above to search or click 'Show All'" msgstr "Benutzername oben eingeben oder auf 'Alle anzeigen' klicken" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Tragen Sie Ihre E-Mail-Adresse ein, mit der Sie sich künftig anmelden müssen. Wir respektieren den Datenschutz und werden die E-Mail-Adresse nicht an Dritte weitergeben und auch nirgends anzeigen." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Tragen Sie bitte Ihren vollen Namen ein." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1616,11 +1600,6 @@ msgstr "E-Mail" msgid "Full" msgstr "Volle Breite" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Vor- und Nachname" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index 2ad5450f89..9bd30d6714 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -989,7 +989,6 @@ msgstr "" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "" @@ -1197,11 +1196,6 @@ msgstr "" msgid "Dry run selected, transaction aborted." msgstr "" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1321,16 +1315,6 @@ msgstr "" msgid "Enter a username above to search or click 'Show All'" msgstr "" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "" - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "" - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1611,11 +1595,6 @@ msgstr "" msgid "Full" msgstr "" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 669fa842da..b413b42a8e 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -996,7 +996,6 @@ msgstr "Fecha (primero los más recientes)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Por defecto" @@ -1204,11 +1203,6 @@ msgstr "Arrastrar archivos aquí..." msgid "Dry run selected, transaction aborted." msgstr "Se ha seleccionado el modo de prueba, transacción abortada" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "Correo electrónico" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1328,16 +1322,6 @@ msgstr "Introduzca una URL o seleccione un elemento" msgid "Enter a username above to search or click 'Show All'" msgstr "Introduzca un nombre de usuario o haga clic en 'Mostrar todos'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Introduzca una dirección de correo electrónico. Este será el nombre de usuario. Nosotros respetamos su privacidad: y no daremos la dirección de correo electrónico a terceros, o la expondremos de alguna forma en el portal." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Introduzca el nombre completo, por ejemplo Leonardo Caballero." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1618,11 +1602,6 @@ msgstr "De" msgid "Full" msgstr "Completo" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nombre completo" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 504f03b20d..6e348b6557 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -996,7 +996,6 @@ msgstr "Data (berriena lehenengo)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Defektuzkoa" @@ -1204,11 +1203,6 @@ msgstr "Arrastatu fitxategiak hona..." msgid "Dry run selected, transaction aborted." msgstr "Modu lehorra aukeratu duzunez, transakzioa bertan behera utzi da." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "Eposta" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1328,16 +1322,6 @@ msgstr "Sartu URL bat edo aukeratu elementu bat" msgid "Enter a username above to search or click 'Show All'" msgstr "Idatzi erabiltzaile-izen bat bilaketa egiteko edo sakatu 'Ikusi guztiak'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Idatzi eposta helbidea. Hau zure erabiltzaile-izena izango da. Zure pribatutasuna errespetatzen dugu eta ez dugu helbidea argitaratu edo inori emango." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Idatzi izen osoa, adb. Jon Garmendia." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1618,11 +1602,6 @@ msgstr "Nok" msgid "Full" msgstr "Osoa" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Izen-abizenak" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 99ad9cfb65..ecad4f01ad 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -994,7 +994,6 @@ msgstr "Päivä (uusin ensin)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Oletus" @@ -1202,11 +1201,6 @@ msgstr "Pudota tiedosto tänne... " msgid "Dry run selected, transaction aborted." msgstr "Koeajo valittu, toiminto keskeytetty." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "Sähköposti" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1326,16 +1320,6 @@ msgstr "Syötä URL-osoite tai valitse kohde" msgid "Enter a username above to search or click 'Show All'" msgstr "Syötä yläpuolelle etsittävä käyttäjähimi tai valitse 'Näytä kaikki'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Syötä sähköpostiosoite, jota haluat käyttää kirjautumistunnuksena. Me kunnioitamme yksityisyyttäsi, emmekä jaa sähköpostiosoitettasi kenellekään muulle tai julkaise sitä missään." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Syötä koko nimi, esimerkiksi Lumi Vuorinen." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1616,11 +1600,6 @@ msgstr "Sähköposti" msgid "Full" msgstr "Kokoleveästi" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Koko nimi" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index fb52823be1..4861166d52 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -996,7 +996,6 @@ msgstr "Date (le plus récent en premier)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Défaut" @@ -1204,11 +1203,6 @@ msgstr "Déposez les fichiers ici ..." msgid "Dry run selected, transaction aborted." msgstr "Essai sélectionné, transaction abandonnée." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1328,16 +1322,6 @@ msgstr "Saisissez l'URL ou sélectionnez un élément" msgid "Enter a username above to search or click 'Show All'" msgstr "Saisissez un nom d'utilisateur ci-dessus à rechercher ou cliquez sur 'Afficher tous'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Saisissez votre adresse e-mail. Elle sera votre nom d'utilisateur. Nous respectons votre vie privée, nous ne donnerons pas votre adresse à un tiers et elle ne sera pas exposée." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Saisissez votre nom complet (par exemple : John Smith)" - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1618,11 +1602,6 @@ msgstr "De" msgid "Full" msgstr "Complet" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nom complet" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/hi/LC_MESSAGES/volto.po b/packages/volto/locales/hi/LC_MESSAGES/volto.po index 0028b6e413..ffb3f2ed07 100644 --- a/packages/volto/locales/hi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hi/LC_MESSAGES/volto.po @@ -989,7 +989,6 @@ msgstr "तारीख (नवीनतम पहले)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "डिफ़ॉल्ट" @@ -1197,11 +1196,6 @@ msgstr "यहाँ फ़ाइलें ड्रॉप करें ..." msgid "Dry run selected, transaction aborted." msgstr "सूखा परीक्षण चुना गया, लेन-देन रद्द किया गया।" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "ईमेल" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1321,16 +1315,6 @@ msgstr "URL दर्ज करें या आइटम का चयन क msgid "Enter a username above to search or click 'Show All'" msgstr "खोज करने के लिए ऊपर एक उपयोगकर्ता नाम दर्ज करें या 'सभी दिखाएं' पर क्लिक करें" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "एक ईमेल पता दर्ज करें। यह आपका लॉगिन नाम होगा। हम आपकी गोपनीयता का सम्मान करते हैं, और हम इस पते को किसी तीसरे पक्ष को नहीं देंगे या इसे कहीं भी प्रकट नहीं करेंगे।" - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "पूरा नाम दर्ज करें, उदाहरण के लिए, John Smith।" - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1611,11 +1595,6 @@ msgstr "से" msgid "Full" msgstr "पूरा" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "पूरा नाम" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index d8f9c6b6ec..c2ac5e7128 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -989,7 +989,6 @@ msgstr "Data (prima i più recenti)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Default" @@ -1197,11 +1196,6 @@ msgstr "Rilascia file qui..." msgid "Dry run selected, transaction aborted." msgstr "Prova a vuoto selezionata, transazione annullata" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1321,16 +1315,6 @@ msgstr "Inserisci un URL o seleziona un elemento" msgid "Enter a username above to search or click 'Show All'" msgstr "Inserisci uno username da ricercare, oppure clicca su 'Vedi tutto'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Inserisci un indirizzo e-mail. Esso sarà il tuo nome utente. Rispettiamo la tua privacy: non daremo l'indirizzo a terzi, né verrà esposto nel portale." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Inserisci il tuo nome completo, ad esempio Mario Rossi." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1611,11 +1595,6 @@ msgstr "Da" msgid "Full" msgstr "A tutta larghezza" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nome completo" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index c6ba730668..76f2aaeecc 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -994,7 +994,6 @@ msgstr "日付 (新しい順)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "基本" @@ -1202,11 +1201,6 @@ msgstr "ファイルをここにドロップ" msgid "Dry run selected, transaction aborted." msgstr "" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "メール" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1326,16 +1320,6 @@ msgstr "URLを入力または項目を選択" msgid "Enter a username above to search or click 'Show All'" msgstr "検索するユーザ名を上に入力するか、[すべて表示]をクリックしてください。" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "メールアドレスを入力してください。このメールアドレスがログイン名になります。当サイトはプライバシーを尊重しています。メールアドレスを第三者に提供したり、公開することはありません。" - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "氏名(フルネーム)を入力。例: Hanako Suzuki や 山田太郎 " - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1616,11 +1600,6 @@ msgstr "メールアドレス" msgid "Full" msgstr "フルサイズ" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "氏名" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index 9b1adebbf3..ae37a7164a 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -993,7 +993,6 @@ msgstr "Datum (nieuwste eerst)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Standaard" @@ -1201,11 +1200,6 @@ msgstr "Zet bestanden hier neer..." msgid "Dry run selected, transaction aborted." msgstr "Geselecteerde proefdraaien, transactie afbreken." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mailadres" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1325,16 +1319,6 @@ msgstr "Vul de URL in of selecteer een item" msgid "Enter a username above to search or click 'Show All'" msgstr "Vul hierboven een gebruikersnaam in om te zoeken of klik 'Toon alles'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Vul een e-mailadres in. Dit zal jouw inlognaam worden. Wij respecteren jouw privacy en zullen het niet delen met eender welke derde partij of het ergens blootstellen." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Vul de volledige naam in, bijvoorbeeld Jan Smit." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1615,11 +1599,6 @@ msgstr "Van" msgid "Full" msgstr "Volledig" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Volledige naam" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index 075a03f3d3..859563154e 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -994,7 +994,6 @@ msgstr "" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Predefinido" @@ -1202,11 +1201,6 @@ msgstr "" msgid "Dry run selected, transaction aborted." msgstr "" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1326,16 +1320,6 @@ msgstr "" msgid "Enter a username above to search or click 'Show All'" msgstr "" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Escreva um endereço de email. Este será o seu nome de sessão. Respeitamos a sua privacidade e nunca iremos ceder o seu endereço a terceiros ou expô-lo onde quer que seja." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Escreva o nome completo. Por exemplo, José Silva." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1616,11 +1600,6 @@ msgstr "De" msgid "Full" msgstr "Cheio" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nome Completo" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 8ec0da515b..f391cba34c 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -995,7 +995,6 @@ msgstr "Data (mais novo primeiro)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Padrão" @@ -1203,11 +1202,6 @@ msgstr "Soltar aquivos aqui…" msgid "Dry run selected, transaction aborted." msgstr "Simulação selecionada, transação abortada." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1327,16 +1321,6 @@ msgstr "Digite URL ou selecione um item" msgid "Enter a username above to search or click 'Show All'" msgstr "Digite um nome de usuário acima para pesquisar ou clique em 'Mostrar todos'" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Digite um endereço de e-mail. Este será o seu nome de usuário. Respeitamos a sua privacidade e nunca iremos ceder o seu endereço a terceiros ou expô-lo onde quer que seja." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Digite o nome completo. Por exemplo, José da Silva." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1617,11 +1601,6 @@ msgstr "E-mail" msgid "Full" msgstr "Cheia" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Nome completo" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 1cbec413e0..2f62374617 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -995,7 +995,6 @@ msgstr "Data (cea mai recentă mai întâi)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "Implicit" @@ -1203,11 +1202,6 @@ msgstr "Trageți fișierele aici..." msgid "Dry run selected, transaction aborted." msgstr "Testare selectată, tranzacție anulată." -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1327,16 +1321,6 @@ msgstr "Introduceți adresa URL sau selectați un obiect" msgid "Enter a username above to search or click 'Show All'" msgstr "Introduceți un nume de utilizator mai sus pentru a căuta sau faceți clic pe „Afișați tot”" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "Introduceți o adresă de e-mail. Acesta va fi numele dvs. de autentificare. Respectăm confidențialitatea dvs. și nu vom oferi adresa niciunui terț și nu o vom expune nicăieri." - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "Introduceți numele complet, de exemplu, Valentin Popescu." - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1617,11 +1601,6 @@ msgstr "Din" msgid "Full" msgstr "Complet" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "Numele complet" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index 3d048e5ef7..0b7add77ef 100644 --- a/packages/volto/locales/volto.pot +++ b/packages/volto/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-10-24T16:41:21.354Z\n" +"POT-Creation-Date: 2024-10-25T16:54:59.838Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -991,7 +991,6 @@ msgstr "" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "" @@ -1199,11 +1198,6 @@ msgstr "" msgid "Dry run selected, transaction aborted." msgstr "" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1323,16 +1317,6 @@ msgstr "" msgid "Enter a username above to search or click 'Show All'" msgstr "" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "" - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "" - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1613,11 +1597,6 @@ msgstr "" msgid "Full" msgstr "" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index e1948dea26..5bb62dcbf4 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -995,7 +995,6 @@ msgstr "日期(最新在前)" #: components/theme/ContactForm/ContactForm #: components/theme/PasswordReset/PasswordReset #: components/theme/PasswordReset/RequestPasswordReset -#: components/theme/Register/Register msgid "Default" msgstr "默认" @@ -1203,11 +1202,6 @@ msgstr "在此处放置文件 ..." msgid "Dry run selected, transaction aborted." msgstr ",事务已被终止。" -#. Default: "E-mail" -#: components/theme/Register/Register -msgid "E-mail" -msgstr "E-mail" - #. Default: "E-mail addresses do not match." #: components/theme/PasswordReset/PasswordReset msgid "E-mail addresses do not match." @@ -1327,16 +1321,6 @@ msgstr "输入 URL 或选择一个项目" msgid "Enter a username above to search or click 'Show All'" msgstr "输入用户名进行搜索或点击显示全部" -#. Default: "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -#: components/theme/Register/Register -msgid "Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere." -msgstr "输入一个 Email 地址。这会成为您的登录名。我们尊重您的隐私,不会向第三方透漏您的个人信息。" - -#. Default: "Enter full name, e.g. John Smith." -#: components/theme/Register/Register -msgid "Enter full name, e.g. John Smith." -msgstr "输入您的姓名,如:张三" - #. Default: "Enter map Embed Code" #: components/manage/Blocks/Maps/Edit msgid "Enter map Embed Code" @@ -1617,11 +1601,6 @@ msgstr "" msgid "Full" msgstr "" -#. Default: "Full Name" -#: components/theme/Register/Register -msgid "Full Name" -msgstr "姓名" - #. Default: "Fullname" #: helpers/MessageLabels/MessageLabels msgid "Fullname" diff --git a/packages/volto/news/6434.feature b/packages/volto/news/6434.feature new file mode 100644 index 0000000000..0f704423b9 --- /dev/null +++ b/packages/volto/news/6434.feature @@ -0,0 +1 @@ +Build the registration form with information from the backend, provided by the `@userschema` endpoint. @erral diff --git a/packages/volto/src/components/theme/Register/Register.jsx b/packages/volto/src/components/theme/Register/Register.jsx index 52c1430a9e..7c15bb729c 100644 --- a/packages/volto/src/components/theme/Register/Register.jsx +++ b/packages/volto/src/components/theme/Register/Register.jsx @@ -7,35 +7,15 @@ import { toast } from 'react-toastify'; import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import Toast from '@plone/volto/components/manage/Toast/Toast'; -import { Form } from '@plone/volto/components/manage/Form'; +import Form from '@plone/volto/components/manage/Form/Form'; import { createUser } from '@plone/volto/actions/users/users'; +import { getUserSchema } from '@plone/volto/actions/userschema/userschema'; const messages = defineMessages({ title: { id: 'Registration form', defaultMessage: 'Registration form', }, - default: { - id: 'Default', - defaultMessage: 'Default', - }, - fullnameTitle: { - id: 'Full Name', - defaultMessage: 'Full Name', - }, - fullnameDescription: { - id: 'Enter full name, e.g. John Smith.', - defaultMessage: 'Enter full name, e.g. John Smith.', - }, - emailTitle: { - id: 'E-mail', - defaultMessage: 'E-mail', - }, - emailDescription: { - id: 'Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere.', - defaultMessage: - 'Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere.', - }, successRegisterCompletedTitle: { id: 'Account Registration Completed', defaultMessage: 'Account Registration Completed', @@ -65,6 +45,13 @@ const Register = () => { const { loaded, loading, error } = useUsers(); const prevloading = usePrevious(loading); + const userschema = useSelector((state) => state.userschema); + + useEffect(() => { + if (!userschema.loading && !userschema.loaded) { + dispatch(getUserSchema()); + } + }, [userschema, dispatch]); useEffect(() => { if (prevloading && loaded) { @@ -80,17 +67,16 @@ const Register = () => { }, [intl, history, loaded, prevloading]); const onSubmit = (data) => { - const { fullname, email } = data; - dispatch( - createUser({ - fullname: fullname, - email: email, - sendPasswordReset: true, - }), - ); + dispatch(createUser(data)); setError(null); }; + const emptySchema = { + fieldsets: [], + properties: {}, + required: [], + }; + return (
@@ -100,28 +86,7 @@ const Register = () => { error={errors || error} loading={loading} submitLabel={intl.formatMessage(messages.register)} - schema={{ - fieldsets: [ - { - id: 'default', - title: intl.formatMessage(messages.default), - fields: ['fullname', 'email'], - }, - ], - properties: { - fullname: { - type: 'string', - title: intl.formatMessage(messages.fullnameTitle), - description: intl.formatMessage(messages.fullnameDescription), - }, - email: { - type: 'string', - title: intl.formatMessage(messages.emailTitle), - description: intl.formatMessage(messages.emailDescription), - }, - }, - required: ['fullname', 'email'], - }} + schema={userschema.loaded ? userschema.userschema : emptySchema} />
); diff --git a/packages/volto/src/components/theme/Register/Register.stories.jsx b/packages/volto/src/components/theme/Register/Register.stories.jsx index a3861a7072..09268ce922 100644 --- a/packages/volto/src/components/theme/Register/Register.stories.jsx +++ b/packages/volto/src/components/theme/Register/Register.stories.jsx @@ -20,6 +20,32 @@ function StoryComponent(args) { locale: 'en', messages: {}, }, + userschema: { + loaded: true, + loading: false, + userschema: { + fieldsets: [ + { + id: 'default', + title: 'default', + fields: ['fullname', 'email'], + }, + ], + properties: { + fullname: { + type: 'string', + title: 'Full name', + description: 'Enter your full name', + }, + email: { + type: 'string', + title: 'email', + description: 'Enter your email address', + }, + }, + required: ['fullname', 'email'], + }, + }, }} >
diff --git a/packages/volto/src/components/theme/Register/Register.test.jsx b/packages/volto/src/components/theme/Register/Register.test.jsx index cac8ca499c..d1d4425d19 100644 --- a/packages/volto/src/components/theme/Register/Register.test.jsx +++ b/packages/volto/src/components/theme/Register/Register.test.jsx @@ -31,6 +31,32 @@ describe('Register', () => { loaded: true, }, }, + userschema: { + loaded: true, + loading: false, + userschema: { + fieldsets: [ + { + id: 'default', + title: 'default', + fields: ['fullname', 'email'], + }, + ], + properties: { + fullname: { + type: 'string', + title: 'Full name', + description: 'Enter your full name', + }, + email: { + type: 'string', + title: 'email', + description: 'Enter your email address', + }, + }, + required: ['fullname', 'email'], + }, + }, }); const component = renderer.create( diff --git a/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap b/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap index c75ba527ee..16bd2645ea 100644 --- a/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap +++ b/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap @@ -9,7 +9,7 @@ exports[`Register renders a register component 1`] = ` \\"fieldsets\\": [ { \\"id\\": \\"default\\", - \\"title\\": \\"Default\\", + \\"title\\": \\"default\\", \\"fields\\": [ \\"fullname\\", \\"email\\" @@ -19,13 +19,13 @@ exports[`Register renders a register component 1`] = ` \\"properties\\": { \\"fullname\\": { \\"type\\": \\"string\\", - \\"title\\": \\"Full Name\\", - \\"description\\": \\"Enter full name, e.g. John Smith.\\" + \\"title\\": \\"Full name\\", + \\"description\\": \\"Enter your full name\\" }, \\"email\\": { \\"type\\": \\"string\\", - \\"title\\": \\"E-mail\\", - \\"description\\": \\"Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere.\\" + \\"title\\": \\"email\\", + \\"description\\": \\"Enter your email address\\" } }, \\"required\\": [