Show CLA error (#25496)

This commit is contained in:
Joakim Sørensen 2023-01-02 10:40:18 +01:00 committed by GitHub
parent aee819b682
commit d4e43a995d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,12 +29,20 @@ description: "The Home Assistant contributor license agreement (CLA) signature p
#complete {
display: none;
}
#error {
background: red;
color: white;
padding: 4px;
display: none;
}
</style>
<div id="loading">
<div id="spinner"></div>
<p>Please wait while we complete authentication and load data from GitHub...</p>
</div>
<div id="error"></div>
<form action="#" id="signature_form">
<div class="wrapper">
@ -454,6 +462,7 @@ description: "The Home Assistant contributor license agreement (CLA) signature p
}
});
$('#submit').click(function(e){
const errorEl = document.querySelector("#error")
if ($('form')[0].checkValidity()) {
e.preventDefault();
var payload = {
@ -489,6 +498,10 @@ description: "The Home Assistant contributor license agreement (CLA) signature p
}
localStorage.removeItem("pr");
localStorage.removeItem("gh_token");
errorEl.style.display = "none"
}).fail(function(data){
errorEl.textContent = data.responseJSON.message;
errorEl.style.display = "block"
});
}
});