Page MenuHomePhabricator

TemplateData should include enumeration type
Closed, ResolvedPublic

Description

Author: kwwilliams

Description:
A lot of templates have arguments that are effectively enumeration types. Using the singlechart template from English Wikipedia as an example, the first argument has a limited range of actual values: things like UKrock, UKdance, UKdownload, Billboardhot100, etc. The template is structured as a switch statement that only does anything useful if it recognises the chart name. Otherwise, it just spits out a big red error message.

It would be good if I could encode that in the template data, something like

"1": 
 {
  "label": "Chart identifier",
  "description": "Chart name: recognized values are listed at",
  "type": "enum",
  "values":
    {
     "UKrock", "UKdance", "UKdownload", "Billboardhot100"
    }
  "required": true
 }

The template edit should then not allow freeform text entry while entering the template. Instead, it should provide a menu selection that only allows the editor to enter one of the recognized values.


Version: unspecified
Severity: normal

Details

Reference
bz51074

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:06 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz51074.
bzimport added a subscriber: Unknown Object (MLST).

This is pretty-much entirely covered by bug 50760 - will merge and move your comment there.

  • This bug has been marked as a duplicate of bug 50760 ***