Skip to content
Snippets Groups Projects
Commit 9b2caafe authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

feat: added validation for SIREN/T input

parent ab62c690
No related branches found
No related tags found
No related merge requests found
......@@ -68,3 +68,7 @@ footer a {
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24),
0 17px 50px 0 rgba(0, 0, 0, 0.19);
}
#id-content {
overflow: scroll;
}
// Imports
import * as messages from "/services/messages/messages.js";
export async function mount(where) {
const authComponent = new Auth();
await authComponent.mount(where);
......@@ -18,7 +20,7 @@ class Auth {
<input
type="text"
id="auth-sirent"
value="000000001"
value=""
class="common-input"
pattern="[0-9]{9}|[0-9]{14}"
title="Le numéro doit être un SIREN ou SIRET"
......@@ -39,8 +41,18 @@ class Auth {
une connexion France Connect avec le compte "sans_nom_dusage".
</p>
`;
// TODO : Check SIREN/T is in input and looks like a SIREN/T
const sirentField = document.getElementById("auth-sirent");
document.getElementById(`auth-do`).addEventListener("click", () => {
if (sirentField.validity.patternMismatch) {
messages.Show(
"#d32f2f",
"Le numéro entré n'est pas un SIREN ou un SIRET."
);
return;
}
// Add the SIREN/T to the request
let searchParams = new URLSearchParams(window.location.search);
searchParams.set("sirent", document.getElementById(`auth-sirent`).value);
......
......@@ -20,12 +20,7 @@ class Matcher {
Voulez vous qu'une demande de mandatement soit envoyée au dirigeant ?
</p>
<div class="input-group">
<input
type="email"
id="matcher-email"
value="nicolas@alpha.grandlyon.com"
class="common-input"
/>
<input type="email" id="matcher-email" value="" class="common-input" />
<button id="matcher-do" class="common-btn action-btn">OK</button>
<button id="matcher-cancel" class="common-btn action-btn">
Annuler
......
......@@ -106,7 +106,7 @@ p {
width: calc(var(--inputs-height) * 284 / 82);
}
.fc-button:hover {
.fc-btn:hover {
background-image: url(assets/fc_button_hover.svg);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment