Page MenuHomePhabricator

Add multiline input fields for 'content' and 'unbalanced-wikitext' parameter types
Closed, ResolvedPublic1 Estimated Story Points

Description

This ticket splits out the less-complicated part of T200664.

We're currently not doing anything special for the follow types of template parameter:

  • "content" Page content in wikitext, such as text style, links, images, etc.
  • "unbalanced-wikitext" Raw wikitext that should not be treated as standalone content because it is unbalanced - for example, templates concatenating incomplete wikitext as a bigger whole, such as {{echo|before=<u>|after=</u>}}

They should be handled as MultilineTextInputWidgets, with autosize turned on (so the input grows when there's more content) and maxRows set to 10.

The fields look something like this:

Screenshot_2018-07-31 Editing Template Only required - Dev Wiki wiki1.png (243×435 px, 11 KB)
Screenshot_2018-08-08 Editing Template Multiline - Dev Wiki wiki1.png (382×472 px, 13 KB)

Steps for testing:

  1. Add a template with the following TemplateData:
<templatedata>
{
	"format": "\n{{_\n|________________ = _\n}}\n",
	"description": "This is a testing template to see various special fields and how they are dealt with in TemplateWizard.",
	"params": {
		"multilineThing": {
			"label": "A multiline field",
			"type": "content",
			"description": "A multiline field for testing."
		},
		"name": {
			"label": "A simple string field for comparison",
			"type": "string",
			"description": "Some sort of name."
		}
	}
}
</templatedata>
  1. Go to a random page (or a new page) and edit it
  2. Click on the "TemplateWizard" button
  3. Add the field "a multiline field"

Expected result: Multiline field should allow for several lines. It should also expand automatically as you add lines, up to 10 rows.
This behavior can be compared to the field "A simple string field for comparison" which should only allow for 1 line of text.

Event Timeline

Change 449128 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Add 'content' and 'unbalanced-wikitext' types for parameters

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

Samwilson set the point value for this task to 1.
Mooeypoo subscribed.

@Samwilson I've merged and moved this to QA/Product -- I just realized, though, do you know of any template structure we could add to local wiki (or comm tech wiki if this is tested there) that can feature this field type, so it can be tested?

Change 449128 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Add 'content' and 'unbalanced-wikitext' types for parameters

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

@Mooeypoo: It can be tested by using "type": "content" in a template parameter's templatedata. The parameter value will be added as normal, but with the possibility of including newlines.

Change 451223 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Set multiline fields to autosize up to 10 rows

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

There's now a 2nd patch to review; moving out of QA for now.

Change 451223 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Set multiline fields to autosize up to 10 rows

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

Niharika moved this task from QA to Q1 2018-19 on the Community-Tech-Sprint board.

Works well. I added some fields to the Test template on Commtech wiki for testing if anyone else wants to see this in action.