Merge pull request #246 from CydarLtd/bootstrap_loading_spinner
Make first factor login page UI indicate loading statepull/251/merge
commit
97e0ee8ff6
|
@ -1,3 +1,4 @@
|
|||
|
||||
export const USERNAME_FIELD_ID = "#username";
|
||||
export const PASSWORD_FIELD_ID = "#password";
|
||||
export const PASSWORD_FIELD_ID = "#password";
|
||||
export const SIGN_IN_BUTTON_ID = "#signin";
|
||||
|
|
|
@ -15,7 +15,10 @@ export default function (window: Window, $: JQueryStatic,
|
|||
function onFormSubmitted() {
|
||||
const username: string = $(UISelectors.USERNAME_FIELD_ID).val() as string;
|
||||
const password: string = $(UISelectors.PASSWORD_FIELD_ID).val() as string;
|
||||
$(UISelectors.PASSWORD_FIELD_ID).val("");
|
||||
|
||||
$("form").css("opacity", 0.5);
|
||||
$("input,button").attr("disabled", "true");
|
||||
$(UISelectors.SIGN_IN_BUTTON_ID).text("Please wait...");
|
||||
|
||||
const redirectUrl = QueryParametersRetriever.get(Constants.REDIRECT_QUERY_PARAM);
|
||||
firstFactorValidator.validate(username, password, redirectUrl, $)
|
||||
|
@ -28,7 +31,11 @@ export default function (window: Window, $: JQueryStatic,
|
|||
}
|
||||
|
||||
function onFirstFactorFailure(err: Error) {
|
||||
$("input,button").removeAttr("disabled");
|
||||
$("form").css("opacity", 1);
|
||||
notifier.error(UserMessages.AUTHENTICATION_FAILED);
|
||||
$(UISelectors.PASSWORD_FIELD_ID).select();
|
||||
$(UISelectors.SIGN_IN_BUTTON_ID).text("Sign in");
|
||||
}
|
||||
|
||||
$(window.document).ready(function () {
|
||||
|
|
|
@ -14,7 +14,7 @@ block content
|
|||
div(class="form-inputs")
|
||||
input(type="text" class="form-control" id="username" placeholder="Username" required autofocus)
|
||||
input(type="password" class="form-control" id="password" placeholder="Password" required)
|
||||
button(class="btn btn-lg btn-primary btn-block" type="submit") Sign in
|
||||
button(id="signin" class="btn btn-lg btn-primary btn-block" type="submit") Sign in
|
||||
div(class="bottom-right-links pull-right")
|
||||
a(href=reset_password_request_endpoint, class="link forgot-password") Forgot password?
|
||||
span(class="clearfix")
|
||||
|
|
|
@ -78,6 +78,10 @@ function CustomWorld() {
|
|||
return that.driver.findElement(seleniumWebdriver.By.id("username"))
|
||||
.sendKeys(username);
|
||||
})
|
||||
.then(function () {
|
||||
return that.driver.findElement(seleniumWebdriver.By.id("password"))
|
||||
.clear();
|
||||
})
|
||||
.then(function () {
|
||||
return that.driver.findElement(seleniumWebdriver.By.id("password"))
|
||||
.sendKeys(password);
|
||||
|
|
Loading…
Reference in New Issue