GSoC Biweekly Report-01
ABOUT ME:
Hi, my name is Yash Varshney, and I’m a First-Year Undergraduate at the Indian Institute of Technology, Ropar. Though I belong to Electrical Engineering, my interests fully belong to Programming. In addition, I’m also a Data Science Enthusiast.
ABOUT MY PROJECT:
GSoC Proposal Link: https://phabricator.wikimedia.org/T278714
Project Page: https://www.mediawiki.org/wiki/Extension:Page_Forms
Mentors: Yaron Koren, Sahaj Khandelwal
My Project is for adding the autocompletion to the spreadsheet-style display in PageForms.
Page Forms support spreadsheets at two places:
a. In regular forms under the form-definition “|multiple|display=spreadsheet” for handling multiple instances of a template.
b. At Special: MultiPageEdit, a special page that is used for editing/creating multiple pages of a template. This feature is beneficial in case large edits have to be made.
Currently, jExcel is used in the spreadsheet module of PageForms, which supports various input types like checkbox, radio-button, dropdowns, text-area, etc. Also, if one sets “|values from category=…” in the “field” part of the form definition, then the values from that category are displayed as the options of the dropdown. What we need is to enable the autocompletion based on the values from a category, or a cargo field, or from some external data source(with the help of External Data Extension), or from “values dependent on.” Most importantly, all these autocompletion should support the $wgPageFormsAutocompleteOnAllChars settings(visit this to know more about this). Some description of these forms of autocompletion:
a. “|values from category …”: These are the name of pages that match a specific category.
b. “|cargo table= …|cargo field= …”: These are the values of the field that are from a cargo field, which is a part of a certain cargo table.
c. “|values from external data=…”: These are the values from an external data source; visit this to know more about External Data autocompletion.
d. “values dependent on=…”: These are the values that are set for autocompletion based on the values that are entered in some field previously; visit this to know more.
We have decided to use OOUI’s TextInputWidget; the other option was to go with Select2(the same way tokens enable autocompletion), but OOUI has some interface advantage over the Select2; still, it’s difficult to insert the TextInputWidget inside the spreadsheet cells, but the motive itself to enable the autocompletion with OOUI is great, as it’ll maintain consistency across the MediaWiki.
Till now, I’ve been able to enable autocompletion for the category and cargo field. The most tricky part was to modify the jExcel library to create an OOUI-based editor for the spreadsheet cells. Now, this task has been achieved partially as the autocompletion works in the cells, but there are some limitations to that, but these are not that big and can be handled later also.
A tutorial for enabling the autocompletion:
{{{for template|Books|multiple|display=spreadsheet}}}
{| class=”formtable”
! Title:
| {{{field|Title|values from category=Books11}}}
|-
! Genre:
| {{{field|Genre}}}
|-
! Name:
| {{{field|Name}}}
|-
! Class:
| {{{field|Class}}}
|}
{{{end template}}}


I’m very thankful to my mentor, Yaron Koren, for extending the internship opportunity in WikiWorks to me. This helped me extensively use MediaWiki’s own library, OOUI, and we worked on some amazing projects to modify the PageForms and Cargo display to OOUI.
In the next report, I’ll discuss autocompletion for “values from external data” and “values dependent on”. We are also aiming to introduce a new form of autocompletion for the spreadsheets only, based on all the values entered in the current spreadsheet. Visit this to view some of the initial patches for the project.