From f2032ff7a4436871fdb9302662e495356afb3ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:48:02 +0300 Subject: [PATCH] Account Module - prettier settings added and js files reformatted --- modules/account/.prettierrc | 4 + .../Pages/Account/LoggedOut.js | 10 ++- .../Pages/Account/Manage.js | 73 +++++++++---------- 3 files changed, 45 insertions(+), 42 deletions(-) create mode 100644 modules/account/.prettierrc diff --git a/modules/account/.prettierrc b/modules/account/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/account/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js index 950bf65719..6b5d0bb0af 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js @@ -1,5 +1,7 @@ -document.addEventListener("DOMContentLoaded", function (event) { - setTimeout(function () { - window.location = document.getElementById("redirectButton").getAttribute("href"); - }, 3000) +document.addEventListener('DOMContentLoaded', function (event) { + setTimeout(function () { + window.location = document + .getElementById('redirectButton') + .getAttribute('href'); + }, 3000); }); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js index 844151c71b..015d481df4 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js @@ -1,50 +1,47 @@ (function ($) { + var l = abp.localization.getResource('AbpAccount'); - var l = abp.localization.getResource('AbpAccount'); + var _profileService = volo.abp.identity.profile; - var _profileService = volo.abp.identity.profile; + $('#ChangePasswordForm').submit(function (e) { + e.preventDefault(); - $("#ChangePasswordForm").submit(function (e) { - e.preventDefault(); + if (!$('#ChangePasswordForm').valid()) { + return false; + } - if (!$("#ChangePasswordForm").valid()) { - return false; - } + var input = $('#ChangePasswordForm').serializeFormToObject() + .changePasswordInfoModel; - var input = $("#ChangePasswordForm").serializeFormToObject().changePasswordInfoModel; + if ( + input.newPassword != input.newPasswordConfirm || + input.currentPassword == '' + ) { + abp.message.error(l('NewPasswordConfirmFailed')); + return; + } - if (input.newPassword != input.newPasswordConfirm || input.currentPassword == '') { - abp.message.error(l("NewPasswordConfirmFailed")); - return; - } + if (input.currentPassword == '') { + return; + } - if (input.currentPassword == '') { - return; - } + _profileService.changePassword(input).then(function (result) { + abp.message.success(l('PasswordChanged')); + }); + }); - _profileService.changePassword( - input - ).then(function (result) { - abp.message.success(l("PasswordChanged")); - }); + $('#PersonalSettingsForm').submit(function (e) { + e.preventDefault(); - }); + if (!$('#PersonalSettingsForm').valid()) { + return false; + } - $("#PersonalSettingsForm").submit(function (e) { - e.preventDefault(); + var input = $('#PersonalSettingsForm').serializeFormToObject() + .personalSettingsInfoModel; - if (!$("#PersonalSettingsForm").valid()) { - return false; - } - - var input = $("#PersonalSettingsForm").serializeFormToObject().personalSettingsInfoModel; - - _profileService.update( - input - ).then(function (result) { - abp.notify.success(l("PersonalSettingsSaved")); - }); - - }); - -})(jQuery); \ No newline at end of file + _profileService.update(input).then(function (result) { + abp.notify.success(l('PersonalSettingsSaved')); + }); + }); +})(jQuery);