"feedback-external-bug-report-button": "File a technical task",
"feedback-dialog-title": "Submit feedback",
"feedback-dialog-intro": "You can use the easy form below to submit your feedback. Your comment will be added to the page \"$1\", along with your username.",
- "feedback-error-title": "Error",
"feedback-error1": "Error: Unrecognized result from API",
"feedback-error2": "Error: Edit failed",
"feedback-error3": "Error: No response from API",
"feedback-external-bug-report-button": "A button for submitting an external technical bug report.",
"feedback-dialog-title": "Title of the feedback dialog",
"feedback-dialog-intro": "An introduction at the top of the feedback dialog. $1 - Feedback page link",
- "feedback-error-title": "{{Identical|Error}}",
"feedback-error1": "Error message, appears when an unknown error occurs submitting feedback",
"feedback-error2": "Error message, appears when we could not add feedback",
"feedback-error3": "Error message, appears when we lose our connection to the wiki",
'feedback-cancel',
'feedback-close',
'feedback-dialog-title',
- 'feedback-error-title',
'feedback-error1',
'feedback-error2',
'feedback-error3',
]
};
break;
- case 'error1':
- case 'error2':
- case 'error3':
- case 'error4':
- dialogConfig = {
- title: mw.msg( 'feedback-error-title' ),
- message: mw.msg( 'feedback-' + status ),
- actions: [
- {
- action: 'accept',
- label: mw.msg( 'feedback-close' ),
- flags: 'primary'
- }
- ]
- };
- break;
}
// Show the message dialog
}, function () {
fb.status = 'error4';
mw.log.warn( 'Feedback report failed because MessagePoster could not be fetched' );
- } ).always( function () {
+ } ).then( function () {
fb.close();
+ }, function () {
+ return fb.getErrorMessage();
} );
}, this );
}
return mw.Feedback.Dialog.parent.prototype.getActionProcess.call( this, action );
};
+ /**
+ * Returns an error message for the current status.
+ *
+ * @private
+ *
+ * @return {OO.ui.Error}
+ */
+ mw.Feedback.Dialog.prototype.getErrorMessage = function () {
+ switch ( this.status ) {
+ case 'error1':
+ case 'error2':
+ case 'error3':
+ case 'error4':
+ // Messages: feedback-error1, feedback-error2, feedback-error3, feedback-error4
+ return new OO.ui.Error( mw.msg( 'feedback-' + this.status ) );
+ }
+ };
+
/**
* Posts the message
*