Harej has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/336174 )
Change subject: Adding messages for errors in Collaboration List editing tools. ...................................................................... Adding messages for errors in Collaboration List editing tools. Bug: T155651 Change-Id: Iba8c53fb92f0ccdc9e48401efc3f5e6b4959d9f8 --- M i18n/en.json M i18n/qqq.json M modules/ext.CollaborationKit.list.edit.js M modules/ext.CollaborationKit.list.ui.js 4 files changed, 14 insertions(+), 6 deletions(-) Approvals: jenkins-bot: Verified Isarra: Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index c977116..adff1ec 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -44,6 +44,10 @@ "collaborationkit-list-add-summary": "/* $1 */ Adding to list.", "collaborationkit-list-add-self-summary": "/* $1 */ Joining project.", "collaborationkit-list-alreadyadded": "You are already a member of this project.", + "collaborationkit-list-error-editconflict": "There was an edit conflict, and your change was not saved. Please refresh the page and try again.", + "collaborationkit-list-error-couldnotgetpage": "The page failed to load. Please refresh the page and try again.", + "collaborationkit-list-error-generic": "There was an error. Please refresh the page and try again.", + "collaborationkit-list-error-saving": "Your edits to the list did not save. Please refresh the page and try again.", "collaborationkit-list-move": "Re-order this item", "collaborationkit-list-move-summary": "/* $1 */ Reordering item [[$1]]", "collaborationkit-list-move-popup": "Successfully saved: $1 was re-ordered.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 4a77816..adcc79e 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -47,6 +47,10 @@ "collaborationkit-list-add-summary": "Edit summary when adding a new item to CollaborationKit list page", "collaborationkit-list-add-self-summary": "Edit summary if the user clicked the one-click add self to membership list button (collaborationkit-list-add-self).", "collaborationkit-list-alreadyadded": "Error if the user pressed the button labelled by collaborationkit-list-add-self but is already on the list", + "collaborationkit-list-error-editconflict": "Error that appears if there is an edit conflict", + "collaborationkit-list-error-couldnotgetpage": "Error that appears if the requested page fails to load.", + "collaborationkit-list-error-generic": "A generic error on CollaborationListContent and its associated editing tools", + "collaborationkit-list-error-saving": "Error that appears when the page fails to save following edits", "collaborationkit-list-move": "Tooltip for move icon on list editor", "collaborationkit-list-move-summary": "Edit summary for moving an item on a CollaborationKit list. $1 = Item that is being moved.", "collaborationkit-list-move-popup": "Popup notification for telling users an item was moved on a CollaborationKit list. $1 = Item being moved.", diff --git a/modules/ext.CollaborationKit.list.edit.js b/modules/ext.CollaborationKit.list.edit.js index f8e305f..ed3eb46 100644 --- a/modules/ext.CollaborationKit.list.edit.js +++ b/modules/ext.CollaborationKit.list.edit.js @@ -177,7 +177,7 @@ // Must be missing. // FIXME sane error handling. - alert( 'Edit conflict detected' ); + alert( mw.msg( 'collaborationkit-list-error-editconflict' ) ); location.reload(); throw new Error( 'Item ' + title + ' is missing' ); }; @@ -227,7 +227,7 @@ ) { mw.log( 'Could not get page ' + pageId ); // FIXME better error handling - alert( 'Unhandled error fetching page with ajax' ); + alert( mw.msg( 'collaborationkit-list-error-couldnotgetpage' ) ); throw new Error( 'Could not get page' ); } rev = data.query.pages[ pageId ].revisions[ 0 ]; @@ -240,7 +240,7 @@ res.content = JSON.parse( rev[ '*' ] ); callback( res ); } ).fail( - function () { alert( 'Unhandled ajax error' ); } + function () { alert( mw.msg( 'collaborationkit-list-error-generic' ) ); } ); }; @@ -260,7 +260,7 @@ basetimestamp: params.timestamp } ).done( callback ).fail( function () { // FIXME proper error handling. - alert( 'Unhandled error saving page' ); + alert( 'collaborationkit-list-error-saving' ); } ); }; diff --git a/modules/ext.CollaborationKit.list.ui.js b/modules/ext.CollaborationKit.list.ui.js index b53b746..50e304d 100644 --- a/modules/ext.CollaborationKit.list.ui.js +++ b/modules/ext.CollaborationKit.list.ui.js @@ -45,7 +45,7 @@ } ); if ( !done ) { // FIXME error handling - alert( 'Edit conflict!' ); + alert( mw.msg( 'collaborationkit-list-error-edit' ) ); location.reload(); } } ); @@ -184,7 +184,7 @@ if ( res.content.columns[ dialog.itemColId ].items <= dialog.itemIndex || res.content.columns[ dialog.itemColId ].items[ dialog.itemIndex ].title !== dialog.itemTitle ) { - alert( 'Edit conflict' ); + alert( mw.msg( 'collaborationkit-list-error-editconflict' ) ); location.reload(); // fixme proper handling. throw new Error( 'edit conflict' ); -- To view, visit https://gerrit.wikimedia.org/r/336174 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba8c53fb92f0ccdc9e48401efc3f5e6b4959d9f8 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Harej <jamesmh...@gmail.com> Gerrit-Reviewer: Harej <jamesmh...@gmail.com> Gerrit-Reviewer: Isarra <zhoris...@gmail.com> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits