Talk page 'issues' are not subject to A/B test

Bug: T199005
Change-Id: Ib5f60fc5c2157d0b10e39209f5ce4ff56d745eee
This commit is contained in:
jdlrobson 2018-07-09 14:24:29 -07:00
parent 2c98ed3def
commit 34e1a80318
1 changed files with 9 additions and 6 deletions

View File

@ -64,9 +64,11 @@
* @param {jQuery.Object} $container to render the page issues banner inside. * @param {jQuery.Object} $container to render the page issues banner inside.
* @param {string} labelText what the label of the page issues banner should say * @param {string} labelText what the label of the page issues banner should say
* @param {string} headingText the heading of the overlay that is created when the page issues banner is clicked * @param {string} headingText the heading of the overlay that is created when the page issues banner is clicked
* @param {boolean} inline - if true the first ambox in the section will become the entry point for the issues overlay
* and if false, a link will be rendered under the heading.
* @ignore * @ignore
*/ */
function createBanner( $container, labelText, headingText ) { function createBanner( $container, labelText, headingText, inline ) {
var $learnMore, var $learnMore,
selector = 'table.ambox, table.tmbox, table.cmbox, table.fmbox', selector = 'table.ambox, table.tmbox, table.cmbox, table.fmbox',
$metadata = $container.find( selector ), $metadata = $container.find( selector ),
@ -85,7 +87,7 @@
} }
} ); } );
if ( isInGroupB ) { if ( inline ) {
new Icon( { new Icon( {
glyphPrefix: 'minerva', glyphPrefix: 'minerva',
name: 'warning', name: 'warning',
@ -129,6 +131,7 @@
*/ */
function initPageIssues() { function initPageIssues() {
var ns = mw.config.get( 'wgNamespaceNumber' ), var ns = mw.config.get( 'wgNamespaceNumber' ),
inline = isInGroupB && ns === 0,
// Categories have no lead section // Categories have no lead section
$container = ns === 14 || isInGroupB ? $( '#bodyContent' ) : $container = ns === 14 || isInGroupB ? $( '#bodyContent' ) :
page.getLeadSectionElement(); page.getLeadSectionElement();
@ -143,17 +146,17 @@
if ( action === 'edit' ) { if ( action === 'edit' ) {
createBanner( $container, mw.msg( 'edithelp' ), createBanner( $container, mw.msg( 'edithelp' ),
mw.msg( 'edithelp' ) ); mw.msg( 'edithelp' ), inline );
} else if ( ns === 0 ) { } else if ( ns === 0 ) {
createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues' ), createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues' ),
mw.msg( 'mobile-frontend-meta-data-issues-header' ) ); mw.msg( 'mobile-frontend-meta-data-issues-header' ), inline );
// Create a banner for talk pages (namespace 1) in beta mode to make them more readable. // Create a banner for talk pages (namespace 1) in beta mode to make them more readable.
} else if ( ns === 1 ) { } else if ( ns === 1 ) {
createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues-talk' ), createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues-talk' ),
mw.msg( 'mobile-frontend-meta-data-issues-header-talk' ) ); mw.msg( 'mobile-frontend-meta-data-issues-header-talk' ), inline );
} else if ( ns === 14 ) { } else if ( ns === 14 ) {
createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues-categories' ), createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues-categories' ),
mw.msg( 'mobile-frontend-meta-data-issues-header-talk' ) ); mw.msg( 'mobile-frontend-meta-data-issues-header-talk' ), inline );
} }
} }