From d7541b66728a4b2a2fff5edf3fb86a2c79b2323f Mon Sep 17 00:00:00 2001 From: LucasC Date: Thu, 7 Nov 2024 10:57:06 +0100 Subject: [PATCH] XWIKI-22121: Improve the registration experience (#3627) * Improved maintanibility reported by SonarCloud * Fixed a typo in Registration.xml --- .../src/main/resources/XWiki/Registration.xml | 2 +- .../widgets/validation/livevalidation_prototype.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/main/resources/XWiki/Registration.xml b/xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/main/resources/XWiki/Registration.xml index f677d13a6dce..9b19a7cf7929 100644 --- a/xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/main/resources/XWiki/Registration.xml +++ b/xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui/src/main/resources/XWiki/Registration.xml @@ -284,7 +284,7 @@ ## Also, not filled back in if there is an error ('noReturn'). #set($field = {'name' : 'captcha_placeholder', - 'label' : $services.localization.render('core.captcha.label') + 'label' : $services.localization.render('core.captcha.label'), 'skipLabelFor' : true, 'type' : 'html', 'html' : "<span class='xHint'>$escapetool.xml($services.localization.render('core.captcha.instruction')) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/validation/livevalidation_prototype.js b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/validation/livevalidation_prototype.js index 2739d54c2d5a..b3f96bdce998 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/validation/livevalidation_prototype.js +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/validation/livevalidation_prototype.js @@ -457,8 +457,8 @@ LiveValidation.prototype = { * Empties out the message elements if they exist */ removeMessage: function(){ - for (let i = 0; i < this.validations.length; i++) { - let messageHolder = this.validations[i].messageHolder; + for (let validation of validations) { + let messageHolder = validation.messageHolder; this.removeMessageClass(messageHolder); messageHolder.lastChild.textContent = ''; }