Create dedicated input methods for transclusion parameters (using "Param#type" from TemplateData)
OpenPublic

Description

"unbalanced-wikitext" and "unknown" – continue as a raw wikitext input field

All others need the ability to bypass for raw values (e.g. {{#if:…}} instead of "4" for number):

  • "string" – A plain text input widget
  • "number" – A number input widget (T124850)
  • "boolean" – A checkbox input widget
  • "date" – A date input widget
  • "url" – A link input widget
  • "wiki-page-name" – An mw.widgets.TitleInputWidget with validity checking (T124734)
  • "wiki-user-name" – An mw.widgets.UserInputWidget (T124736)
  • "wiki-file-name" – An image search and selection widget of some kind
  • "wiki-template-name" – An mw.widgets.TitleInputWidget for NS10 with validity checking
  • "content" – A full VE surface (T52355)
  • "line" – A VE surface with locked height and no toolbar
bzimport set Reference to bz53613.
Jdforrester-WMF created this task.Via LegacyAug 30 2013, 11:32 PM
gerritbot added a comment.Via ConduitOct 29 2014, 10:04 PM

Change 169936 had a related patch set uploaded by Alex Monk:
Use MWTitleInputWidget for wiki-page-name parameters, add MWUserInputWidget for wiki-user-name

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

Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 1:25 AM
Jdforrester-WMF changed the title from "VisualEditor: Create dedicated input methods for transclusion parameters (using "Param#type" from TemplateData)" to "Create dedicated input methods for transclusion parameters (using "Param#type" from TemplateData)".Via WebNov 24 2014, 1:44 AM
Jdforrester-WMF assigned this task to Krenair.
Jdforrester-WMF moved this task to TR9: ???? on the VisualEditor workboard.
Jdforrester-WMF edited the task description. (Show Details)
Jdforrester-WMF moved this task to TR5: Rich media tools on the VisualEditor workboard.
Jdforrester-WMF set Security to None.
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebJan 15 2015, 12:10 AM
Krenair added a project: WMF-Design.Via WebApr 2 2015, 3:35 AM

Needs design input to work out how we should handle existing invalid input, and how we should continue to allow invalid input.

Jdforrester-WMF edited the task description. (Show Details)Via WebJun 29 2015, 10:32 PM
Jdforrester-WMF added a project: Design.
Jdforrester-WMF removed a project: WMF-Design.
Krenair added a comment.EditedVia WebJul 18 2015, 9:41 PM

James and I discussed how this should work, and decided that we'll try to provide the correct input widget for the given parameter type where possible (falling back to wikitext where the current value obviously isn't), as well as providing the user with a button to always fall back to wikitext (because sometimes the TemplateData for the parameter might just be wrong). We're not actually given the Parsoid HTML of individual parameters by Parsoid/RESTBase, and need to figure that out with upstream. Blocker bug to follow.
Edit: T106242: Create API to get both Parsoid HTML and wikitext for individual template parameters in a given transclusion block

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptVia HeraldJul 18 2015, 9:41 PM
Krenair added a project: Blocked-on-Parsoid.Via WebAug 9 2015, 2:21 AM
Krenair removed a project: Blocked-on-Parsoid.
gerritbot added a subscriber: gerritbot.Via ConduitThu, Jan 21, 12:11 AM

Change 169936 had a related patch set uploaded (by Alex Monk):
[WIP] Use widgets for wiki-page-name and wiki-user-name parameters

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

Jdforrester-WMF moved this task to TR0: Interrupt on the VisualEditor workboard.Via WebFri, Jan 22, 7:14 PM
AndreasJonsson added a subscriber: AndreasJonsson.Via WebSat, Jan 23, 3:02 PM

May I request that this is implemented in a way that enables extensions to register custom input widgets? Technically this is not hard to achieve:

  1. Specify the interface the input widget must implement (currently, it must be an EventEmitter, implement the methods setValue, getValue and simulateLabeClick and have an $element).
  2. Add 'widgetType' and 'widgetConfig' to TemplateData, where 'widgetConfig' is a JSON string.
  3. Instantiate input widgets from a factory with fallback to 'text'.

Regarding invalid input I suggest the following: Allow the setValue method to throw an exception. (There could also be a button next to the input widget to replace it with a text input in case you want to be able to input values the widget can't handle).

I have a patch for this, which I guess I could commit to gerrit.

gerritbot added a comment.Via ConduitTue, Jan 26, 12:48 AM

Change 266446 had a related patch set uploaded (by Alex Monk):
TitleInputWidget: Allow config to disable validation

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

Jdforrester-WMF edited the task description. (Show Details)Via WebTue, Jan 26, 1:36 AM
Krenair moved this task to Doing on the MediaWiki-extensions-TemplateData workboard.Via WebTue, Jan 26, 2:31 AM
gerritbot added a comment.Via ConduitTue, Jan 26, 10:40 AM

Change 266446 merged by jenkins-bot:
TitleInputWidget: Allow config to disable validation

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

Krenair edited the task description. (Show Details)Via WebFri, Feb 5, 11:06 PM
Krenair edited the task description. (Show Details)Via WebSat, Feb 6, 1:03 AM
gerritbot added a comment.Via ConduitSat, Feb 6, 1:40 AM

Change 268854 had a related patch set uploaded (by Alex Monk):
Use widgets for wiki-template-namep, boolean and URL template fields

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

gerritbot added a project: Patch-For-Review.Via ConduitSat, Feb 6, 1:40 AM

Add Comment