Page MenuHomePhabricator

More tightly couple object model and interface model in UploadWizard
Closed, ResolvedPublic

Description

While we have an UploadWizardUploadInterface class, its utility is somewhat questionable, given that we still have myriad selectors for known elements strewn around the code.

Ideally it would be commonplace to save an interface DOM element (or more appropriately jQuery object) to an object when you create it, for example, this.interface.details.$titleField is a lot simpler than $j( '#title_' + id ), and way more readable. And it makes it easier to extend the project - once T51989 is fixed, we'll have sound documentation on all the available interface objects as well.

Details

Reference
bz49990

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:50 AM
bzimport set Reference to bz49990.
bzimport added a subscriber: Unknown Object (MLST).

We should also pick a model and follow it. I mean, is our code (supposed to be) MVP or is it MVC or should it be something totally different ? What is common in jQuery world ?
These are unanswered questions in our JS code conventions I believe, but they are starting to become more important.

I think UW itself is pretty much MVP, but MediaWiki is sort of up in the air. The WMF/Wikia meeting that happened last week had some chatter about making MediaWiki more MVCy, but whether that will actually move forward remains to be seen. But this isn't the place to decide that.

matthiasmullie claimed this task.
matthiasmullie added a subscriber: matthiasmullie.

This is now pretty much done (as part of T96906: Refactor UploadWizard to be maintainable & subtasks, and earlier refactors)