Page MenuHomePhabricator

Form for infobox wizard
Closed, ResolvedPublic8 Estimated Story Points

Description

Follow-up from T186654: Create a basic proof-of-concept user script for fetching template data .

This ticket includes:

  1. Choosing a template shows template data in the popup (fields and descriptions)
    • Similar to how VE does it - but show all fields.
  2. Autovalues should be pre-filled (see API example).
  3. There should be some indication that required fields are required.
  4. Show the required fields on top and suggested fields below it and rest of the optional ones below it.
  5. Submitting the form does nothing (we'll handle that in T186672)

Tentative mocks:

Screen Shot 2018-02-07 at 1.28.43 PM.png (972×1 px, 234 KB)

Event Timeline

Niharika set the point value for this task to 8.
  1. Default param values should be pre-filled.

Default values should not pre-filled. Auto values should be. Defaults are handled by the template.

  1. Default param values should be pre-filled.

Default values should not pre-filled. Auto values should be. Defaults are handled by the template.

Changed the ticket. FYI @Niharika

Is a template parameter's type allowed to have multiple values? I'm assuming not, but for example enwp's Template:Infobox hospital has "type": "string/wiki-page-name".

Is a template parameter's type allowed to have multiple values? I'm assuming not, but for example enwp's Template:Infobox hospital has "type": "string/wiki-page-name".

Oh? For which field? I'm looking at the API result.

For name, but I guess it gets fixed by TemplateData. The source for that template has the extra value: https://en.wikipedia.org/w/index.php?title=Template:Infobox_hospital/doc&action=edit&section=16 but it seems that we can leave it up to TD to return us the correct thing. (I only went looking at it because name there is required; I suspect it's an error.)

Ah, I see. Interesting. TemplateData itself doesn't offer multiple options because it's a dropdown so I imagine someone edited the wikitext as an afterthought.
Yeah, we should rely on what TemplateData tells us. That's what VE does.

The code for this is in the repo, and is linked to T186672; for this one you can look at https://en.wikipedia.org/wiki/User:Samwilson/TemplateWizard.js

mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Samwilson/TemplateWizard.js&action=raw&ctype=text/javascript' );

Sorry for conflating these two tasks. I could split them apart, but there's going to be lots more changes to come; seems better to just get on with getting the basics up and running?

The code for this is in the repo, and is linked to T186672; for this one you can look at https://en.wikipedia.org/wiki/User:Samwilson/TemplateWizard.js

mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Samwilson/TemplateWizard.js&action=raw&ctype=text/javascript' );

Sorry for conflating these two tasks. I could split them apart, but there's going to be lots more changes to come; seems better to just get on with getting the basics up and running?

Perfectly fine. I'll try and review the code tomorrow. :)

On https://en.wikipedia.org/wiki/Template:Infobox_film on Mac/Chrome this happened:

Screen Shot 2018-03-09 at 8.50.11 AM.png (508×562 px, 77 KB)

Screen Shot 2018-03-09 at 8.50.33 AM.png (477×528 px, 97 KB)

Looks like there's a problem when one of the template parameters is an image type.

On https://en.wikipedia.org/wiki/Template:Infobox_film on Mac/Chrome this happened:

Screen Shot 2018-03-09 at 8.50.11 AM.png (508×562 px, 77 KB)

Screen Shot 2018-03-09 at 8.50.33 AM.png (477×528 px, 97 KB)

Looks like there's a problem when one of the template parameters is an image type.

See https://phabricator.wikimedia.org/T186672#4037391 and conversation below. :)

The file-selection has been fixed by replacing it with a title select widget with thumbnails.

Is there anything else remaining for this task?

Niharika moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.

I think we're all done here.