Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build the registration from using the userschema provided by backend #6435

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
05139cb
build the registration from using the userschema provided by backend
erral Oct 24, 2024
7882859
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 24, 2024
fbb5e5b
prettier
erral Oct 24, 2024
d86b649
Update packages/volto/news/6434.feature
erral Oct 25, 2024
22cdbb1
Update packages/volto/src/components/theme/Register/Register.stories.jsx
erral Oct 25, 2024
dc1e596
Update packages/volto/src/components/theme/Register/Register.stories.jsx
erral Oct 25, 2024
fac9aa7
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 25, 2024
906a485
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 25, 2024
f544fe0
s/fullname/full name
erral Oct 25, 2024
53cb2c3
remove unneeded strings
erral Oct 25, 2024
3b80078
update po files
erral Oct 25, 2024
d3a8e77
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 25, 2024
c1b8552
Update packages/volto/src/components/theme/Register/__snapshots__/Reg…
erral Oct 27, 2024
3d80440
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 27, 2024
2c288ee
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 27, 2024
84b98fa
update Register test snapshot
ionlizarazu Oct 28, 2024
8c9b3c5
fix: Register.jsx file test and snapshot
ionlizarazu Oct 28, 2024
8a5ef06
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 29, 2024
67b7f5f
add cypress test
erral Oct 30, 2024
7372fa1
send all the data in the form to the backend
erral Oct 30, 2024
76eda12
Merge branch 'main' into erral-registration-form-with-userschema
erral Oct 30, 2024
53d588f
Merge branch 'main' into erral-registration-form-with-userschema
ionlizarazu Nov 4, 2024
911ccfe
Merge branch 'main' into erral-registration-form-with-userschema
ionlizarazu Nov 5, 2024
8207472
Merge branch 'main' into erral-registration-form-with-userschema
ionlizarazu Nov 5, 2024
903aa91
Merge branch 'main' into erral-registration-form-with-userschema
ionlizarazu Nov 6, 2024
c3dd62d
Merge branch 'main' into erral-registration-form-with-userschema
ionlizarazu Nov 8, 2024
166fa73
remove unused translations
ionlizarazu Nov 8, 2024
3f6c741
Merge branch 'main' into erral-registration-form-with-userschema
erral Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/volto/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});
});
24 changes: 24 additions & 0 deletions packages/volto/cypress/tests/core/basic/register.js
Original file line number Diff line number Diff line change
@@ -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,
);
});
});
});
});
21 changes: 0 additions & 21 deletions packages/volto/locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ msgstr ""
#: components/theme/ContactForm/ContactForm
#: components/theme/PasswordReset/PasswordReset
#: components/theme/PasswordReset/RequestPasswordReset
#: components/theme/Register/Register
msgid "Default"
msgstr ""

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/fi/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions packages/volto/locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Loading
Loading