jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/392735 )
Change subject: Add client-side setDebugInfo() method ...................................................................... Add client-side setDebugInfo() method Also fixes a small bug in cn.internal.state.registerTest() Bug: T180478 Change-Id: Iecece883eca7e507edfc613c2c481c8ce8d8e25a --- M resources/subscribing/ext.centralNotice.display.js M resources/subscribing/ext.centralNotice.display.state.js 2 files changed, 27 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/resources/subscribing/ext.centralNotice.display.js b/resources/subscribing/ext.centralNotice.display.js index 9ced44b..8ea9a9a 100644 --- a/resources/subscribing/ext.centralNotice.display.js +++ b/resources/subscribing/ext.centralNotice.display.js @@ -712,6 +712,17 @@ }, /** + * Set a string with information for debugging. (All strings set here will be + * sent to the server via the debugInfo parameter on the record impression call). + * + * @param {string} str A string with the debugging information; should not + * contain pipe characters ('|'). + */ + setDebugInfo: function ( str ) { + cn.internal.state.setDebugInfo( str ); + }, + + /** * Request that, if possible, the record impression call be delayed until a * promise is resolved. If the promise does not resolve before * MAX_RECORD_IMPRESSION_DELAY milliseconds after the banner is injected, diff --git a/resources/subscribing/ext.centralNotice.display.state.js b/resources/subscribing/ext.centralNotice.display.state.js index 407e048..0f10d79 100644 --- a/resources/subscribing/ext.centralNotice.display.state.js +++ b/resources/subscribing/ext.centralNotice.display.state.js @@ -405,11 +405,26 @@ if ( tests.length === 1 ) { state.data.testIdentifiers = identifier; } else { - state.data.testIdentifiers.concat( ',' + identifier ); + state.data.testIdentifiers += ',' + identifier; } } }, + /** + * Set a string with information for debugging. (All strings set here will be + * added to state data). + * + * @param {string} str A string with the debugging information; should not + * contain pipe characters ('|'). + */ + setDebugInfo: function ( str ) { + if ( !state.data.debugInfo ) { + state.data.debugInfo = str; + } else { + state.data.debugInfo += '|' + str; + } + }, + lookupReasonCode: function ( reasonName ) { if ( reasonName in REASONS ) { return REASONS[ reasonName ]; -- To view, visit https://gerrit.wikimedia.org/r/392735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecece883eca7e507edfc613c2c481c8ce8d8e25a Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: AndyRussG <andrew.green...@gmail.com> Gerrit-Reviewer: Ejegg <ej...@ejegg.com> Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits