Shouldn't be too difficult, also put the UI stuff from removeUpload into the UWUI class.
|Open||None||T96906 Refactor UploadWizard to be maintainable|
|Resolved||matthiasmullie||T291 Make removeUpload and removeMatchingUploads etc. into UploadWizardUpload and UploadWizardUploadList, respectively|
removeMatchingUploads/removeErrorUploads has already been moved, to uw.controller.Step.js (in https://gerrit.wikimedia.org/r/#/c/318020/)
removeUpload was moved from uw.controller.Upload.js to uw.controller.Step.js (in https://gerrit.wikimedia.org/r/#/c/322277/)
UploadWizardUploadList has been abandoned and everything to do with this.uploads (add, remove, ...) has now been moved to uw.controller.Step.js.
It didn't seem to make much sense to move removeUpload to mw.UploadWizardUpload.js anymore, since all of the real action now happens in the controllers:
- if an upload is removed, it needs to be removed from this.uploads, which is in the controllers
- it needs to be removed from upload queue, which are in the controllers
- copy metadata feature may need to be repositioned (in the controller)
- if all of them are gone, controller needs to move on to the next step
Removing an upload only really affects the upload object itself in that it needs to detach some interface element.
The controller's removeUpload will reach out to the upload object to make sure that happens, but UploadWizardUpload shouldn't be the one orchestrating this.
Once https://gerrit.wikimedia.org/r/#/c/322277/ is merged, I believe we can close this. The troubling parts have been refactored, even though the approach ended up being different.