From a04c0cafdf3d605fd28bfbab56b2c6f53f988261 Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 14:25:25 +0200 Subject: [PATCH] Fix install alert msg not showed, pw confirm id + js errors lang js #retype-password to #password-confirm --- application/views/pages/installation.php | 2 +- assets/js/pages/installation.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/views/pages/installation.php b/application/views/pages/installation.php index a1529d69..0a7f9e49 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -39,7 +39,7 @@

-
+
diff --git a/assets/js/pages/installation.js b/assets/js/pages/installation.js index 34708551..28ba50af 100644 --- a/assets/js/pages/installation.js +++ b/assets/js/pages/installation.js @@ -25,7 +25,7 @@ App.Pages.Installation = (function () { const $phoneNumber = $('#phone-number'); const $username = $('#username'); const $password = $('#password'); - const $retypePassword = $('#retype-password'); + const $passwordConfirm = $('#password-confirm'); const $companyName = $('#company-name'); const $companyEmail = $('#company-email'); const $companyLink = $('#company-link'); @@ -97,31 +97,31 @@ App.Pages.Installation = (function () { }); if (missingRequired) { - throw new Error('All the page fields are required.'); + throw new Error(lang('fields_are_required')); } // Validate Passwords - if ($password.val() !== $retypePassword.val()) { + if ($password.val() !== $passwordConfirm.val()) { $password.addClass('is-invalid'); - $retypePassword.addClass('is-invalid'); - throw new Error('Passwords do not match!'); + $passwordConfirm.addClass('is-invalid'); + throw new Error(lang('passwords_mismatch')); } if ($password.val().length < MIN_PASSWORD_LENGTH) { $password.addClass('is-invalid'); - $retypePassword.addClass('is-invalid'); - throw new Error(`The password must be at least ${MIN_PASSWORD_LENGTH} characters long.`); + $passwordConfirm.addClass('is-invalid'); + throw new Error(lang('password_length_notice').replace('$number', MIN_PASSWORD_LENGTH)); } // Validate Email if (!App.Utils.Validation.email($email.val())) { $email.addClass('is-invalid'); - throw new Error('The email address is invalid!'); + throw new Error(lang('invalid_email')); } if (!App.Utils.Validation.email($companyEmail.val())) { $companyEmail.addClass('is-invalid'); - throw new Error('The email address is invalid!'); + throw new Error(lang('invalid_email')); } return true;