jenkins-bot has submitted this change and it was merged. Change subject: Fix deed validation ......................................................................
Fix deed validation We were letting users go to the describe step without filling out required fields - causing frustration and loss of data. Now fixed. Change-Id: I3c529320eaf9258f7fd5ce053ec560fd01419f12 --- M resources/controller/uw.controller.Deed.js M resources/mw.UploadWizardDeed.js 2 files changed, 6 insertions(+), 7 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/controller/uw.controller.Deed.js b/resources/controller/uw.controller.Deed.js index 4dd6536..bb9a00f 100644 --- a/resources/controller/uw.controller.Deed.js +++ b/resources/controller/uw.controller.Deed.js @@ -28,10 +28,7 @@ uw.controller.Step.call( this, - new uw.ui.Deed() - .connect( this, { - 'next-step': 'validate' - } ), + new uw.ui.Deed(), config ); @@ -42,11 +39,12 @@ DP = Deed.prototype; - DP.validate = function () { + DP.moveFrom = function () { + var valid = this.deedChooser.valid(); // validate has the side effect of notifying the user of problems, or removing existing notifications. // if returns false, you can assume there are notifications in the interface. - if ( this.deedChooser.valid() ) { - this.emit( 'next-step' ); + if ( valid ) { + uw.controller.Step.prototype.moveFrom.call( this ); } }; diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js index 1e42ba9..c616a66 100644 --- a/resources/mw.UploadWizardDeed.js +++ b/resources/mw.UploadWizardDeed.js @@ -430,6 +430,7 @@ // do not short-circuit. var formValid = this.$form.valid(), licenseInputValid = this.licenseInput.valid(); + return formValid && licenseInputValid; } } ); -- To view, visit https://gerrit.wikimedia.org/r/213497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c529320eaf9258f7fd5ce053ec560fd01419f12 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: MarkTraceur <mtrac...@member.fsf.org> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits