MarkTraceur has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/97/213497/1

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: newchange
Gerrit-Change-Id: I3c529320eaf9258f7fd5ce053ec560fd01419f12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <mtrac...@member.fsf.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to