Merge "Get namespace ids from wgNamespaceIds"

This commit is contained in:
jenkins-bot 2024-04-16 05:02:49 +00:00 committed by Gerrit Code Review
commit 83c0b7d907
2 changed files with 7 additions and 5 deletions

View file

@ -2,8 +2,9 @@
const PageHTMLParser = require( 'mobile.startup' ).PageHTMLParser; const PageHTMLParser = require( 'mobile.startup' ).PageHTMLParser;
const KEYWORD_ALL_SECTIONS = 'all'; const KEYWORD_ALL_SECTIONS = 'all';
const NS_MAIN = 0; const namespaceIds = mw.config.get( 'wgNamespaceIds' );
const NS_CATEGORY = 14; const NS_MAIN = namespaceIds[ '' ];
const NS_CATEGORY = namespaceIds.category;
const CURRENT_NS = mw.config.get( 'wgNamespaceNumber' ); const CURRENT_NS = mw.config.get( 'wgNamespaceNumber' );
const features = mw.config.get( 'wgMinervaFeatures', {} ); const features = mw.config.get( 'wgMinervaFeatures', {} );
const pageIssuesParser = require( './parser.js' ); const pageIssuesParser = require( './parser.js' );
@ -121,7 +122,7 @@ function initPageIssues( overlayManager, pageHTMLParser ) {
const allIssues = {}; const allIssues = {};
const $lead = pageHTMLParser.getLeadSectionElement(); const $lead = pageHTMLParser.getLeadSectionElement();
const issueOverlayShowAll = CURRENT_NS === NS_CATEGORY || !$lead; const issueOverlayShowAll = CURRENT_NS === NS_CATEGORY || !$lead;
const inline = newTreatmentEnabled && CURRENT_NS === 0; const inline = newTreatmentEnabled && CURRENT_NS === NS_MAIN;
// set A-B test class. // set A-B test class.
// When wgMinervaPageIssuesNewTreatment is the default this can be removed. // When wgMinervaPageIssuesNewTreatment is the default this can be removed.

View file

@ -1,8 +1,9 @@
const Overlay = require( 'mobile.startup' ).Overlay; const Overlay = require( 'mobile.startup' ).Overlay;
const IssueList = require( './IssueList.js' ); const IssueList = require( './IssueList.js' );
const KEYWORD_ALL_SECTIONS = 'all'; const KEYWORD_ALL_SECTIONS = 'all';
const NS_MAIN = 0; const namespaceIds = mw.config.get( 'wgNamespaceIds' );
const NS_CATEGORY = 14; const NS_MAIN = namespaceIds[ '' ];
const NS_CATEGORY = namespaceIds.category;
/** /**
* Overlay for displaying page issues * Overlay for displaying page issues