Page MenuHomePhabricator

Wire template parameters into the checkbox list view
Closed, ResolvedPublic5 Estimated Story Points

Description

  • Show all possible parameters as checkboxes.
  • Parameters are checked when present in content.
  • Don't worry about handling undocumented parameters yet. See T274550: Handle undocumented template parameters
  • Listen to content model events: add and remove parameters
  • Order param list in sidebar and main input area based on:
    • If existing, use TemplateData order (ParamOrder or order of parameters as listed in TemplateData)
    • If TemplateData is missing, auto-order based on the order of parameters in the template definition/source code
  • Parameters should be encapsulated in per-template containers.

Patch-For-Review:

Related Objects

StatusSubtypeAssignedTask
ResolvedWMDE-Fisch
ResolvedLena_WMDE
ResolvedLena_WMDE
ResolvedWMDE-Fisch
ResolvedWMDE-Fisch
ResolvedECohen_WMDE
ResolvedNone
InvalidNone
Resolvedthiemowmde
ResolvedAndrew-WMDE
ResolvedNone
ResolvedNone
Resolvedthiemowmde
ResolvedAndrew-WMDE
ResolvedWMDE-Fisch
ResolvedLena_WMDE
ResolvedNone
Resolvedawight
ResolvedAndrew-WMDE
InvalidNone
Resolvedthiemowmde
Resolvedawight
ResolvedECohen_WMDE
InvalidNone

Event Timeline

There's an interesting implementation question here, about which module takes responsibility for interpreting the TemplateModel and ParameterModels and converting to inputs for creating checkboxes.

awight moved this task from Ready for pickup to In sprint on the WMDE-Templates-FocusArea board.

Pulling this in because it's a good way to explore the event-driven data flow.

Change 700190 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] [WIP] Wire model changes into new template sidebar

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

Change 700346 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] [WIP] New function to get all potential template parameters, in order

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

Change 700350 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] [WIP] Fall back from explicit parameter order to TemplateData sort

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

Change 700362 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Tests for MWTemplateModel parameter ordering

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

Change 700362 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Tests for MWTemplateModel parameter ordering

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

Change 700346 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Function to get all potential template parameters, in order

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

Change 700392 had a related patch set uploaded (by Andrew-WMDE; author: Andrew-WMDE):

[mediawiki/extensions/VisualEditor@master] [WIP] Configure adding and removing parameters

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

Change 700398 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Tests for getAllParametersOrdered

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

Change 700408 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] [WIP] Handle aliases when building parameter order

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

Change 700485 had a related patch set uploaded (by Andrew-WMDE; author: Andrew-WMDE):

[mediawiki/extensions/VisualEditor@master] Remove extraneous ve.ui.MWTemplateOutlineCheckboxListWidget.js

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

Change 700517 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Label for each template in sidebar

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

Change 700619 had a related patch set uploaded (by Andrew-WMDE; author: Andrew-WMDE):

[mediawiki/extensions/VisualEditor@master] "Add more information" should be a button instead of a checkbox

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

It made sense to do this work next, so pulling into the sprint.

Change 700398 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Tests for getAllParametersOrdered

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

Change 700350 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Fall back from explicit parameter order to TemplateData sort

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

Please note that this patch was reverted, https://gerrit.wikimedia.org/r/700350 "Fall back from explicit parameter order to TemplateData sort".

We need to reimplement but without affecting serialization order, it seems that the users don't want this behavior. According to T138200: TemplateData: Normalisation should not assume paramOrder, they expect paramOrder to cause parameter shuffling when saving, but do not expect the implicit order of parameters to do the same thing.

Change 701115 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Revert "Revert "Fall back from explicit parameter order to TemplateData sort""

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

Change 701115 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Revert "Revert "Fall back from explicit parameter order to TemplateData sort""

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

Change 700190 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Wire model changes into new template sidebar

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

Change 700485 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Remove extraneous ve.ui.MWTemplateOutlineCheckboxListWidget.js

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

Change 700619 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] "Add more information" should be a button instead of a checkbox

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

Change 700392 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Wiring for adding and removing parameters

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

Change 700517 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Label for each template in sidebar

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

Change 701885 had a related patch set uploaded (by WMDE-Fisch; author: Andrew-WMDE):

[mediawiki/extensions/VisualEditor@master] Fix parameter ordering when using aliases

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

Change 701885 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Fix parameter ordering when using aliases

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

WMDE-Fisch claimed this task.

Change 700408 abandoned by Bartosz Dziewoński:

[mediawiki/extensions/VisualEditor@master] Handle aliases when building parameter order

Reason:

Associated task is already resolved, so presumably this patch is no longer needed.

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