jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/388677 )
Change subject: Use Promise.then() instead of non-standard done()
......................................................................
Use Promise.then() instead of non-standard done()
jquery already supports standard .then() / .catch(),
so lets use those instead of .done().
This change allows implementers to use proper ES6+ things
like async functions, which return standard promise.
Change-Id: If692d7f13d406bbcc75b22735f78749c6460def4
---
M embed.html
M wikibase/queryService/ui/App.js
2 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
Jonas Kress (WMDE): Looks good to me, approved
Lucas Werkmeister (WMDE): Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/embed.html b/embed.html
index 5b98e78..2d48ca0 100644
--- a/embed.html
+++ b/embed.html
@@ -275,7 +275,7 @@
$( 'body' ).i18n();
$( 'html' ).attr( { lang: lang, dir:
$.uls.data.getDir( lang ) } );
- resultView.draw( query ).done( function() {
+ resultView.draw( query ).then( function() {
$( '.logo' ).hide();
} );
renderEdit( query, function( q ){
diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index d6ee0b7..ce6ba8d 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -672,9 +672,13 @@
this._updateQueryUrl();
$( '#execute-button' ).prop( 'disabled', true );
- this._resultView.draw( this._editor.getValue() ).fail( function
( error ) {
- self._editor.highlightError( error );
- } ).always( function () {
+ this._resultView.draw( this._editor.getValue() ).catch(
function ( error ) {
+ try {
+ self._editor.highlightError( error );
+ } catch ( err ) {
+ // ignore
+ }
+ } ).then( function () {
$( '#execute-button' ).prop( 'disabled', false );
} );
--
To view, visit https://gerrit.wikimedia.org/r/388677
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If692d7f13d406bbcc75b22735f78749c6460def4
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits