Update 'save_failure_type' map for EditAttemptStep schema

Remove unused error codes, update the ones that changed, and sort in
the order in which the types are listed on the schema page.

Bug: T272162
Change-Id: Ib16f7e11ff81d43443b08cf704ce5196420671e4
This commit is contained in:
Bartosz Dziewoński 2021-01-15 19:53:51 +01:00
parent 90f2bbfe87
commit 1fa9a020ad

View file

@ -705,22 +705,19 @@ ReplyWidget.prototype.onReplyClick = function () {
// TODO: When editing a transcluded page, VE API returning the page HTML is a waste, since we won't use it // TODO: When editing a transcluded page, VE API returning the page HTML is a waste, since we won't use it
logger( { action: 'saveAttempt' } ); logger( { action: 'saveAttempt' } );
widget.commentController.save( comment, pageName ).fail( function ( code, data ) { widget.commentController.save( comment, pageName ).fail( function ( code, data ) {
// Compare to ve.init.mw.ArticleTargetEvents.js in VisualEditor.
var typeMap = { var typeMap = {
// Compare to ve.init.mw.ArticleTargetEvents.js in VisualEditor.
editconflict: 'editConflict',
wasdeleted: 'editPageDeleted',
abusefilter: 'extensionAbuseFilter',
'abusefilter-disallowed': 'extensionAbuseFilter',
captcha: 'extensionCaptcha',
spamprotectiontext: 'extensionSpamBlacklist',
titleblacklist: 'extensionTitleBlacklist',
'titleblacklist-forbidden-edit': 'extensionTitleBlacklist',
badtoken: 'userBadToken', badtoken: 'userBadToken',
newuser: 'userNewUser', assertanonfailed: 'userNewUser',
assertuserfailed: 'userNewUser',
assertnameduserfailed: 'userNewUser',
'abusefilter-disallowed': 'extensionAbuseFilter',
'abusefilter-warning': 'extensionAbuseFilter',
captcha: 'extensionCaptcha',
spamblacklist: 'extensionSpamBlacklist', spamblacklist: 'extensionSpamBlacklist',
empty: 'responseEmpty', 'titleblacklist-forbidden': 'extensionTitleBlacklist',
unknown: 'responseUnknown', pagedeleted: 'editPageDeleted',
pagedeleted: 'editPageDeleted' editconflict: 'editConflict'
}; };
if ( widget.captchaMessage ) { if ( widget.captchaMessage ) {