Page MenuHomePhabricator

VE Dialog on the Test Instance: Implement soft validation
Closed, ResolvedPublic3 Estimated Story Points

Description

Background:
Adding "soft" validation to the following fields should help users filling in templates to catch errors earlier on.

Parameter warnings by type of parameter:

Param typeExpected valueTextType of message
[x]Numberany combination of 0-9This parameter expects only numerical values, 0-9.Warning
[x]DateISO 8601 (YYYY-MM-DD, YYYY, YYYY-MM, --MM-DD)This parameter expects dates formatted in ISO 8601.Warning
[x]ComboboxSuggested values as defined in TemplateData[already implemented] This is not one of the suggested values and may not work with the template.Notice
FileFilename without file: prefixThis template likely expects a filename without prefix. If you experience issues, try removing it.Notice

Situation based warnings:

SituationTextType of Message
Nested templates: When {{ }} is detectedNested templates are not supported in the VisualEditor and must be edited in wikitext.Notice
[x]Adding undefined parameters T117890: Alert the user when adding template parameter not defined by TemplateDataThis user-added parameter may not be supported by the template.Notice
[ ]Required parameters[Switch current pop-up warning to inline warning]Warning

Requirements:

  • Validation should appear in real time, but not before the user has stopped typing and clicked out of the field.
  • Validation should provide enough flexibility to the user to continue with the value filled in if desired (i.e. validation should not block the user from saving).
  • Investigate: if there are any other "pop-up" warnings currently in place that should be changed to inline warnings.

Mocks:
Use OOUI FieldLayout with notice and FieldLayout with warning

Validation messages.png (352×631 px, 31 KB)

Event Timeline

Lena_WMDE updated the task description. (Show Details)
Lena_WMDE set the point value for this task to 8.Sep 21 2020, 9:41 AM
Lena_WMDE renamed this task from DRAFT: VE Dialog on the Test Instance: Implement soft validation to VE Dialog on the Test Instance: Implement soft validation.Sep 23 2020, 7:49 AM
Lena_WMDE moved this task from Backlog to Ready for pickup on the WMDE-Templates-FocusArea board.

If we have time to implement just one of these, it should be for the Date type.

I think we should also validate non-Latin numerals for the Number type. The question seems to be whether we should only allow the content language's locale numbers, the content language plus so-called Western Latin numerals, or numerals from any language?

Date and number validation (just 0-9) are deployed to the test instance.

I accidentally gave everything the "notice" style. Working on a fix...

Lena_WMDE changed the point value for this task from 8 to 3.

Just checked and the current wording for Number and Date parameter warnings is incorrect. Please update it to match the wording in this ticket. Also if possible, switch it to the warning style. This is more important than adding the missing messages included in this task. Thanks!

I updated the wording. Have a look at the following screencast to check the behaviour (click on it to start).

Peek_soft-validation_2020-10-23.gif (621×725 px, 105 KB)

Looking good to me. As discussed, ideally it would not appear until done typing but this is working well enough for testing. We can save that bit for later if this feature is chosen for implementation.

Checked on the test instance as well, and it's behaving the same for me.

Added the display of the validation only when the user clicked out of an input field (click to start video).

Peek_soft-validation_2020-10-27.gif (827×1 px, 464 KB)

Not sure, if it might be a bit confusing that the message also only disappears after clicking out of the input field. :/

@lilients_WMDE Ya I can see how this is not ideal, as people are looking for the message to disappear as they edit to see if their changes are the changes needed. I think it's good to mark this as an issue if we implement this, but would leave it for the prototype. Will be interesting to see if this assumption is true, I'll document if it's an issue or not.

Looks good to deploy.

Just a minor thing, some of these were supposed to be notices but are still at warning level:

  • Adding undefined parameters
  • Combo box

Just a minor thing, some of these were supposed to be notices but are still at warning level

I've pushed a patch to the soft_validation branch, the code was all there but just needed some wiring.

@lilients_WMDE I've "approved" the merge request, to signal that I think it's ready to merge. If you agree, please merge and deploy at your convenience!

@awight Thanks! I tested your commit on my local installation and it looks good! Merged!

soft-validation.png (628×721 px, 70 KB)

Note: scope was reduced in order to meet deadline for usability testing. This ticket did not complete the investigation into pop-us.

Also the required parameter change is checked but was not implemented:

Screen Shot 2020-11-03 at 13.53.25.png (650×772 px, 117 KB)

This ticket is still resolved, but just a note for the future.