TheDJ has uploaded a new change for review.
https://gerrit.wikimedia.org/r/65318
Change subject: UploadWizard: Re-enable the option to upload previously deleted
files
......................................................................
UploadWizard: Re-enable the option to upload previously deleted files
This was disabled after some flow issues arose when making changes to
the upload list. These problems should no longer occur.
Bug: 40921
Change-Id: I55e3ef9b3224f7a31c8d738e75a241010ed55226
---
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
2 files changed, 33 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/18/65318/1
diff --git a/resources/mw.UploadWizardUpload.js
b/resources/mw.UploadWizardUpload.js
index c37d105..3b72d04 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -162,10 +162,14 @@
/**
* Resume the upload, assume that whatever error(s) we got were benign.
+ * @param result An upload handler result object
+ * @param code The warning/error that we want to remove from
the upload result
*/
- removeErrors: function ( code ) {
+ removeWarning: function ( result, code ) {
this.ignoreWarning[code] = true;
+ this.state = 'transporting';
this.start();
+ this.setTransported( result );
},
/**
@@ -232,12 +236,12 @@
.attr( 'href',
'javascript:' )
.text( mw.msg(
'mwe-upwiz-override' ) )
.click( ( function (
theCode ) {
-
this.removeErrors( theCode );
+
this.removeWarning( result, theCode );
} ).bind( this,
warnCode ) );
$(
'.mwe-upwiz-file-status-line-item', this.ui.visibleFilenameDiv )
.first()
- .append( ' ' );
- //.append( $override );
See bug 39852
+ .append( ' ' )
+ .append( $override );
// See bug 39852
break;
default:
// we have an unknown warning,
so let's say what we know
@@ -329,7 +333,7 @@
_this.ui.showStashed();
$.publishReady( 'thumbnails.' + _this.index, 'api' );
// check all uploads, if they're complete, show the
next button
- //_this.wizard.showNext( 'file', 'stashed' ); See bug
39852
+ _this.wizard.showNext( 'file', 'stashed' ); //See bug
39852
} else {
_this.setError( 'noimageinfo' );
}
diff --git a/resources/mw.UploadWizardUploadInterface.js
b/resources/mw.UploadWizardUploadInterface.js
index 7c13c14..36ae711 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -268,6 +268,30 @@
},
+ /**
+ * Show that transport has failed
+ * @param String code: error code from API
+ * @param {String|Object} info: extra info
+ */
+ showWarning: function( code, info ) {
+ this.showIndicator( 'warning' );
+ // is this an error that we expect to have a message for?
+ var msgKey, args;
+
+ if ( $j.inArray( code, mw.Api.errors ) !== -1 ) {
+ msgKey = 'api-error-' + code;
+ args = $j.makeArray( info );
+ } else if ( code === 'unknown-warning' ) {
+ msgKey = 'api-error-unknown-warning';
+ args = $j.makeArray( info );
+ } else {
+ msgKey = 'api-error-unknown-code';
+ args = [code].concat( $j.makeArray( info ) );
+ }
+ this.setStatus( msgKey, args );
+ },
+
+
initFileInputCtrl: function() {
var _this = this;
_this.$fileInputCtrl.change( function() {
--
To view, visit https://gerrit.wikimedia.org/r/65318
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I55e3ef9b3224f7a31c8d738e75a241010ed55226
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits