Page MenuHomePhabricator

VisualEditor: Move default value and autoValue code from MWParameterPage (UI) to MWParameterModel (DM)
Closed, ResolvedPublic

Description

Half of dm.MWParameterModel is dedicated to looking things up in the parent template's spec. Despite that, ui.MWParameterPage manually looks up the default value and autoValue because there are no getters in dm.MWParameterModel for those things, for no good reason whatsoever. Those getters should be added.

What's even worse is the "if there is no real value, set the value to the autoValue" logic (added in https://gerrit.wikimedia.org/r/168204 ). Currently this logic (which is fundamentally DM logic) is in ui.ParameterPage as well. Instead, MWParameterPage.getValue() should be smart enough to return either the real value or the autoValue if there is no real value.


Version: unspecified
Severity: enhancement

Details

Reference
bz72404

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:59 AM
bzimport set Reference to bz72404.
Catrope created this task.Oct 22 2014, 11:07 PM

(In reply to Roan Kattouw from comment #0)

Instead, MWParameterPage.getValue() should be
smart enough to return either the real value or the autoValue if there is no
real value.

MWParameterModel.getValue()?

gerritadmin wrote:

Change 168926 had a related patch set uploaded by Alex Monk:
Move autoValue logic from ui.MWParameterPage to dm.MWParameterModel

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

gerritadmin wrote:

Change 168926 merged by jenkins-bot:
Move autoValue logic from ui.MWParameterPage to dm.MWParameterModel

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