Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-26230

Modernize the client-side validation of the registration and password forms

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • None
    • 18.10.0
    • None
    • Unknown

    Description

      The client-side validation of the registration form and of the forms built on the same macros relies on a copy of LiveValidation 1.4 (Prototype.js version, last released in 2010), maintained inside xwiki-platform with XWiki-specific changes, and on JavaScript generated inline by Velocity.

      Need

      • The validation behaviour is hard to follow and to change safely. The fields are coupled through events dispatched by hand, and timing details decide what the user sees. XWIKI-26229 is an example: a stale "The two passwords do not match." message moved the Create button under the pointer and the click was lost.
      • The code depends on Prototype.js, while the rest of the platform is moving away from it.
      • The forked library has no upstream anymore, so XWiki carries its maintenance alone.
      • The behaviour has no automated test of its own. Regressions surface as flickering functional tests (XWIKI-25059, XWIKI-25859).

      Scope

      • The registration page (register.vm, registerinline.vm) and the user creation modal of the administration (AdminUsersSheet).
      • The other forms using register_macros.vm: password change (passwd.vm) and password reset (resetpasswordinline.vm).
      • The validation configuration exposed to administrators in XWiki.Registration (mandatory fields, regular expressions, field matching, programmatic validation, custom messages).
      • The other LiveValidation users in the platform (locationPicker), at least to decide whether they move together.

      Expected outcome

      • The same validation rules and messages as today, from the user's point of view, with no layout shift while validating.
      • Accessible error reporting, at least as good as today.
      • Automated tests covering the validation behaviour itself.

      Risks

      • Extensions and customized registration pages may call the LiveValidation global or rely on its CSS classes (LV_valid, LV_invalid). Changing it may break them, so backward compatibility, or a deprecation path, has to be considered.
      • The functional test page objects check LiveValidation classes and messages and would need to follow.
      • Administrators' existing registration configurations must keep working after an upgrade.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mleduc Manuel Leduc
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: