Images Compressed Login page modifications

Цей коміт міститься в:
Abhiram
2023-04-24 18:25:18 +05:30
джерело bace314f10
коміт edd3113258
160 змінених файлів з 430 додано та 172 видалено
сторонній
+172 -16
Переглянути файл
@@ -60,6 +60,7 @@ function initLogin() {
});
$("#Login_btn").click(function () {
$('.error_msg').hide();
// loginForm.find(".loader-btn").show();
let userEmail = loginForm.find("#User_Email").val();
let userPassword = loginForm.find("#User_password").val();
@@ -103,8 +104,20 @@ function initLogin() {
};
let response = await axios(config);
if (response.data.result == null) {
toasterOpts();
Command: toastr["error"]("Please enter Valid email / password");
$('.error_msg').show();
$('.error_msg .error_msg_res').html(`User doesn't exists with the email, <a href="#" class="alert-link register_sectionbtn" id="register_sectionbtn">Sign Up </a>`);
$(".register_sectionbtn").click(function(){
$(".login_section").css("display","none");
$(".register_section").css("display","block");
$(".login_section").find("#User_Email").removeClass("is-invalid");
$(".login_section").find(".form-floating").removeClass("is-invalid");
$(".login_section").find("#User_password").removeClass("is-invalid");
$(".login_section").find(".form-floating").removeClass("is-invalid");
$('.error_msg').hide();
});
// toasterOpts();
// Command: toastr["error"]("Please enter Valid email / password");
} else {
let userEmail = $("#User_Email").val();
let userPassword = $("#User_password").val();
@@ -148,8 +161,16 @@ function initLogin() {
window.location.href = `./index.html`;
} else {
toasterOpts();
Command: toastr["error"](res.data.message)
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message + ' <a class="validate_mail text-danger"><b>Validate Email</b></a>');
// toasterOpts();
// Command: toastr["error"]()
/*Email validation*/
$('.validate_mail').click(function(){
$(".login_section").hide();
$(".email-validate-div").show();
$('.error_msg').hide();
})
}
}
}
@@ -194,8 +215,10 @@ function initLogin() {
$(".loader-btn").hide();
$('#register_btn').show()
if (res.data.code == "404" ) {
toasterOpts();
Command: toastr["error"](res.data.message)
// toasterOpts();
// Command: toastr["error"](res.data.message)
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message);
return;
}
else {
@@ -254,12 +277,16 @@ function initLogin() {
window.localStorage.setItem("isaccountCreated", true);
window.location.href = `./index.html`;
} else {
toasterOpts();
Command: toastr["error"](res.data.message)
// toasterOpts();
// Command: toastr["error"](res.data.message)
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message);
}
} else {
toasterOpts();
Command: toastr["error"]("Please enter Valid OTP");
// toasterOpts();
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
});
}
@@ -327,7 +354,7 @@ function initLogin() {
// function to validate user entered password
function validatepassword(userPassword) {
var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
// return $.trim(userPassword).test(pattern) ? true : false;
return pattern.test(userPassword) ? true : false;
}
@@ -338,6 +365,7 @@ function initLogin() {
// this will be triggered on clicking continue in signup form
$("#register_btn").click(function () {
$('.error_msg').hide();
registerForm.find(".loader-btn").show();
$(this).hide();
let userEmail = registerForm.find("#User_Email").val();
@@ -373,9 +401,9 @@ function initLogin() {
registerForm.find(".loader-btn").hide();
$(this).show();
}else if(Pwd_valid === false){
emailInput.find("#User_password").addClass("is-invalid");
emailInput.find(".form-floating").addClass("is-invalid");
emailInput.find(".invalid-feedback").text("Please check the password!");
passwordInput.find("#User_password").addClass("is-invalid");
passwordInput.find(".form-floating").addClass("is-invalid");
passwordInput.find(".invalid-feedback").text("Please check the password!");
registerForm.find(".loader-btn").hide();
$(this).show();
}
@@ -531,8 +559,10 @@ return
$(".login-forgot-password-details-div").show();
$(".otp-validation .otp-input-group").hide();
} else {
toasterOpts()
Command: toastr["error"]("Please enter Valid OTP");
// toasterOpts()
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
});
$("#forgot_password_details_submit").click(async function () {
@@ -612,5 +642,131 @@ return
}
}
}
$("#email_validate_submit").click(async function () {
let vaidate_otp;
let validate_email = $("#email_validation_input").val();
if(validate_email == ''){
$('#email_validation_input').addClass('is-invalid')
$('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
return
}
else{
debugger;
let port = "https://beta.bizgaze.app";
// let port = "http://localhost:3088";
let url = `${port}/account/getuserbyphoneormail/${validate_email}/${validate_email}`;
const config = {
url,
method: "get",
};
$(".loader-btn").show();
$('#email_validate_submit').hide()
let response = await axios(config);
debugger;
console.log(response);
$(".loader-btn").hide();
$('#email_validate_submit').show()
if (response.data.result != null) {
debugger;
console.log(response.data);
const forgotpassPayload = {
firstname: "",
lastname: "",
contactnumber: "",
email: "",
tenantname: "",
contactoremail: response.data.result.email,
IsSignup: false,
IsRegisterUser: false,
IsForgotPswd: true,
UnibaseId: response.data.result.userName,
OtpId: 0,
UserOtp: "",
};
$('#email_validate_submit').hide()
$(".loader-btn").show();
const validate_email_res = await postAPIService(
`account/sendotp`,
forgotpassPayload
);
$(".loader-btn").hide();
vaidate_otp = validate_email_res.data;
console.log(validate_email_res);
$(".email-validation").hide();
$('.user_email').html(validate_email)
$(".otp-validation .otp-input-group").show();
$(".otp-validation .otp-input-group").on("paste", function (p) {
let data = p.originalEvent.clipboardData.getData("text");
let dataLength = data.length;
for (let i = 0; i < dataLength; i++) {
let input = $(
'.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
);
input.val(data.charAt(i));
if (input.val().length >= input.attr("maxlength")) {
let nextInput = $(
'.otp-validation .otp-input-group input[tabindex="' +
(i + 2) +
'"]'
);
if (nextInput) {
nextInput.focus();
}
}
}
p.preventDefault();
});
}
else{
$('#email_validation_input').addClass('is-invalid');
$('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
}
}
$("#email_validate_proceed").click(async function () {
debugger;
let userotp='';
let validate_email = $("#email_validation_input").val();
$(".email-validate-div .otp-validation .otp-input-group input").each(function () {
let presVal = $(this).val();
userotp += presVal;
});
if(userotp.length == 6){
const validateForgotpass = {
email: validate_email,
otpid: vaidate_otp,
userotp: userotp,
};
$('#email_validate_proceed').hide()
$(".loader-btn").show();
const validate_email_resopt = await postAPIService(
`hyperfusion/validateotp`,
validateForgotpass
);
$(".loader-btn").hide();
$('#email_validate_proceed').show()
const Resotp = validate_email_resopt.data.result;
if (Resotp == "Otp verified successfully") {
$(".login_section").show();
$(".otp-validation .otp-input-group").hide();
$("#email_validate_back").hide();
$('.error_msg').hide();
} else {
// toasterOpts()
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
}
else{
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter OTP");
}
});
});
initLogin();