Page MenuHomePhabricator

zObject creation: errors / blockers to saving are not surfaced well or at all
Closed, ResolvedPublic

Description

Every zObject requires a label for the save button to be enabled (it is disabled by default). For ZImplementations and ZTesters, the save button further requires the selection of a zFunction.

There is no feedback to the user as to why the save button is grayed out and what they need to do for it to be un-grayed out. We need to surface form validation errors in a comprehensible way. Additionally, we need to ensure when saving does fail, it is clear to the user what to do to correct it.

Related Objects

Event Timeline

Needs discussion with Amin on what kinds of front-end validation we should do, and what should be the format of the errors surfaced.

For the moment I believe this patch can be addressed and limited to the following:

  • remove isCurrentZObjectValid from the :disabled parameter of the save button
  • modify isCurrentZObjectValid so that it's a method that instead of just returning true/false it also returns something identifying the type of error that we are getting.
  • call isCurrentZObjectValid when clicking the error and showing the identifying message if it returns false.

We should make these changes as expansible as possible so that:

  • validation method can be cleanly expanded once we decide all different use cases that will be detected in the front-end as invalid
  • we currently show the output error in the simplest way possible, but in the future we can decide to:
    • show the message in a toast or a dialog, or
    • show the message next to the related input field, or
    • both

Change 837752 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/extensions/WikiLambda@master] errors

https://gerrit.wikimedia.org/r/837752

Change 837752 abandoned by Jkieserman:

[mediawiki/extensions/WikiLambda@master] allow ZObject saving at all times, and surface errors for ZFunction, ZImplementation and ZTester

Reason:

in favor of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/842834

https://gerrit.wikimedia.org/r/837752

Change 857005 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/extensions/WikiLambda@master] Add checks for missing inputs for ZImplementation and ZTester

https://gerrit.wikimedia.org/r/857005

Change 857005 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add checks for missing inputs for ZImplementation and ZTester

https://gerrit.wikimedia.org/r/857005