Page MenuHomePhabricator

Control for JSON-schema enums
Closed, ResolvedPublic3 Estimated Story Points

Description

The Special:EditGrowthConfig contains a control for choosing Where should questions from the help panel be directed? which offers two options: Mentor talk pages and Help desk. The selection is then stored as a boolean, values are true and false respectively.
We need a new control implemented in Vue as a replacement that would display the same but store the data as an string rather than a boolean.

Config property: GEHelpPanelAskMentor

Data schema

"GEHelpPanelAskMentor": {
  "type": "string",
   "enum": ["mentor-talk-page", "help-desk-page"]
  },

Existing implementation:

Screenshot 2024-04-16 at 17.45.27.png (214×1 px, 33 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Sgs triaged this task as High priority.Apr 16 2024, 3:46 PM
KStoller-WMF set the point value for this task to 3.Apr 16 2024, 4:10 PM

Change #1025301 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Add support for enums

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

Change #1025451 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] Add support for ask-mentor and post-on-top community config enums

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

Change #1025301 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Add support for enums

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

Change #1025451 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add support for ask-mentor and post-on-top community config enums

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

Things hat still need to be done here, I think:

  • actually make the two radio fields in GrowthExperiments HelpPanel config do something
  • make a config having a value that is not in the enum into a validation warning instead of a fatal error on reading

Change #1025769 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/CommunityConfiguration@master] Treat enum mismatches as a Validation warning on reading

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

Change #1025769 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Treat enum mismatches as a Validation warning on reading

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

Urbanecm_WMF subscribed.

Things hat still need to be done here, I think:

  • actually make the two radio fields in GrowthExperiments HelpPanel config do something

This is not done, but also doesn't really fit into this task – the goal here was to create an enum control, which works and saves the expected change in the JSON config. That config is not processed properly in GrowthExperiments as of now, but that's not really directly related to the enum control itself – that one is working as expected :). Filled T364053: Help panel does not process `GEHelpPanelPostOnTop` correctly when CommunityConfiguration extension is used for fixing the Help panel.

  • make a config having a value that is not in the enum into a validation warning instead of a fatal error on reading

This is done.

Since both of those items appear to be done, and there is no patch to review, moving to QA.

This should now be simple to try out in the CommunityConfiguratinExample extension.

Transfered between QA columns for a couple of sprints => resolving.