Checkout: show red border around email when invalid (#1013)

This commit is contained in:
Andrew Camilleri 2019-09-12 11:28:11 +02:00 committed by Nicolas Dorier
parent 41d714e2ce
commit 18b8bec8d0
3 changed files with 10 additions and 12 deletions

View file

@ -66,12 +66,15 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("emailAddressFormInput")).SendKeys("xxx");
s.Driver.FindElement(By.Id("emailAddressForm")).FindElement(By.CssSelector("button.action-button"))
.Click();
var formInput = s.Driver.FindElement(By.Id("emailAddressFormInput"));
Assert.True(formInput.Displayed);
Assert.Contains("form-input-invalid", formInput.GetAttribute("class"));
formInput = s.Driver.FindElement(By.Id("emailAddressFormInput"));
formInput.SendKeys("@g.com");
Assert.True(s.Driver.FindElement(By.Id("emailAddressFormInput")).Displayed);
s.Driver.FindElement(By.Id("emailAddressFormInput")).SendKeys("@g.com");
s.Driver.FindElement(By.Id("emailAddressForm")).FindElement(By.CssSelector("button.action-button"))
.Click();
await Task.Delay(1000);
s.Driver.AssertElementNotFound(By.Id("emailAddressFormInput"));

View file

@ -160,14 +160,14 @@
<span>{{$t("Contact and Refund Email")}}</span>
</div>
<div class="manual__step-one__instructions">
<span class="initial-label">
<span class="initial-label" v-show="!emailAddressInputInvalid">
<span>{{$t("Contact_Body")}}</span>
</span>
<span class="submission-error-label">{{$t("Please enter a valid email address")}}</span>
<span class="submission-error-label" v-show="emailAddressInputInvalid">{{$t("Please enter a valid email address")}}</span>
</div>
<div class="input-wrapper">
<input class="bp-input email-input "
v-bind:class="{ 'ng-pristine ng-submitted ng-touched': !emailAddressInputDirty, 'ng-invalid': emailAddressInputInvalid }" id="emailAddressFormInput"
v-bind:class="{ 'ng-pristine ng-submitted ng-touched': !emailAddressInputDirty, 'ng-invalid form-input-invalid': emailAddressInputInvalid }" id="emailAddressFormInput"
v-bind:placeholder="$t('Your email')" type="email" v-model="emailAddressInput"
v-on:change="onEmailChange">
<bp-loading-button>

View file

@ -9895,12 +9895,7 @@ strong {
letter-spacing: .7px;
}
.submission-error-label {
display: none;
}
.refund-address-form.ng-invalid.ng-submitted input,
.email-receipt-form.ng-invalid.ng-submitted input {
.form-input-invalid {
border: 1px solid #E15061;
}