[MediaWiki-commits] [Gerrit] Prepare Wikidata descriptions for rollout to stable - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Prepare Wikidata descriptions for rollout to stable .. Prepare Wikidata descriptions for rollout to stable * Move header html from SkinMinervaBeta to SkinMinerva * Move skin config vars from SkinMinervaBeta to SkinMinerva * Remove references to isBeta in parser output and README * Remove references to beta in tests Bug: T127250 Change-Id: I5fbadbc0d3d01ad4c84a8f921360de941837c797 --- M README.md M includes/MobileFrontend.hooks.php M includes/skins/SkinMinerva.php M includes/skins/SkinMinervaBeta.php M tests/browser/features/step_definitions/wikidata_descriptions.rb M tests/browser/features/wikidata_descriptions.feature 6 files changed, 19 insertions(+), 37 deletions(-) Approvals: Bmansurov: Looks good to me, but someone else must approve Phuedx: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 0b59fbb..d1910f9 100644 --- a/README.md +++ b/README.md @@ -519,8 +519,7 @@ Default: 0; # $wgMFUseWikibaseDescription -If set to true and running beta, will add Wikidata description to page JS as -wgMFDescription variable +If set to true, will add Wikidata description to page JS as wgMFDescription variable Type: Boolean Default: false; diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index fed9819..9c1b09c 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -1260,14 +1260,13 @@ */ public static function onOutputPageParserOutput( $outputPage, ParserOutput $po ) { $context = MobileContext::singleton(); - $isBeta = $context->isBetaGroupMember(); $mfUseWikibaseDescription = $context->getMFConfig()->get( 'MFUseWikibaseDescription' ); if ( $context->shouldDisplayMobileView() ) { $outputPage->enableTOC( false ); $outputPage->setProperty( 'MFTOC', $po->getTOCHTML() !== '' ); - if ( $mfUseWikibaseDescription && $isBeta ) { + if ( $mfUseWikibaseDescription ) { $item = $po->getProperty( 'wikibase_item' ); if ( $item ) { $desc = ExtMobileFrontend::getWikibaseDescription( $item ); diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 2a52319..1e2e044 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -625,9 +625,21 @@ ); } } else { - $title = $this->getOutput()->getPageTitle(); - if ( $title ) { - $html = Html::rawElement( 'h1', [ 'id' => 'section_0' ], $title ); + $title = $this->getTitle(); + $pageTitle = $this->getOutput()->getPageTitle(); + if ( $title && $pageTitle ) { + $html = Html::rawElement( 'h1', [ + 'id' => 'section_0', + ], $pageTitle ); + if ( !$title->isMainPage() && $title->inNamespace( NS_MAIN ) ) { + $vars = $this->getSkinConfigVariables(); + $description = $vars['wgMFDescription']; + if ( $description ) { + $html .= Html::element( 'div', [ + 'class' => 'tagline', + ], $description ); + } + } } } return $html; @@ -945,7 +957,8 @@ $vars = [ 'wgMinervaMenuData' => $this->getMenuData(), // Expose for skins.minerva.tablet.scripts - 'wgMinervaTocEnabled' => $this->getOutput()->getProperty( 'MFTOC' ) + 'wgMinervaTocEnabled' => $this->getOutput()->getProperty( 'MFTOC' ), + 'wgMFDescription' => $this->getOutput()->getProperty( 'wgMFDescription' ), ]; if ( $this->isAuthenticatedUser() ) { diff --git a/includes/skins/SkinMinervaBeta.php b/includes/skins/SkinMinervaBeta.php index e47b0d9..5ede10c 100644 --- a/includes/skins/SkinMinervaBeta.php +++ b/includes/skins/SkinMinervaBeta.php @@ -14,23 +14,6 @@ /** @inheritdoc */ protected $shouldSecondaryActionsIncludeLanguageBtn = false; - /** @inheritdoc **/ - protected function getHeadingHtml() { - $html =
[MediaWiki-commits] [Gerrit] Prepare Wikidata descriptions for rollout to stable - change (mediawiki...MobileFrontend)
Jhobs has uploaded a new change for review. https://gerrit.wikimedia.org/r/293882 Change subject: Prepare Wikidata descriptions for rollout to stable .. Prepare Wikidata descriptions for rollout to stable * Move header html from SkinMinervaBeta to SkinMinerva * Remove references to isBeta in parser output and README Bug: T127250 Change-Id: I5fbadbc0d3d01ad4c84a8f921360de941837c797 --- M README.md M includes/MobileFrontend.hooks.php M includes/skins/SkinMinerva.php M includes/skins/SkinMinervaBeta.php 4 files changed, 17 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/82/293882/1 diff --git a/README.md b/README.md index 0b59fbb..d1910f9 100644 --- a/README.md +++ b/README.md @@ -519,8 +519,7 @@ Default: 0; # $wgMFUseWikibaseDescription -If set to true and running beta, will add Wikidata description to page JS as -wgMFDescription variable +If set to true, will add Wikidata description to page JS as wgMFDescription variable Type: Boolean Default: false; diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 797bf57..b395d75 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -1267,7 +1267,7 @@ $outputPage->enableTOC( false ); $outputPage->setProperty( 'MFTOC', $po->getTOCHTML() !== '' ); - if ( $mfUseWikibaseDescription && $isBeta ) { + if ( $mfUseWikibaseDescription ) { $item = $po->getProperty( 'wikibase_item' ); if ( $item ) { $desc = ExtMobileFrontend::getWikibaseDescription( $item ); diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 2a52319..ca478d2 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -625,9 +625,22 @@ ); } } else { - $title = $this->getOutput()->getPageTitle(); + $title = $this->getTitle(); if ( $title ) { - $html = Html::rawElement( 'h1', [ 'id' => 'section_0' ], $title ); + $html = Html::rawElement( 'h1', + [ + 'id' => 'section_0', + ], $title ); + if ( !$title->isMainPage() && $title->inNamespace( NS_MAIN ) ) { + $vars = $this->getSkinConfigVariables(); + $description = $vars['wgMFDescription']; + if ( $description ) { + $html .= Html::element( 'div', + [ + 'class' => 'tagline', + ], $description ); + } + } } } return $html; diff --git a/includes/skins/SkinMinervaBeta.php b/includes/skins/SkinMinervaBeta.php index e47b0d9..e305ddd 100644 --- a/includes/skins/SkinMinervaBeta.php +++ b/includes/skins/SkinMinervaBeta.php @@ -14,23 +14,6 @@ /** @inheritdoc */ protected $shouldSecondaryActionsIncludeLanguageBtn = false; - /** @inheritdoc **/ - protected function getHeadingHtml() { - $html = parent::getHeadingHtml(); - $title = $this->getTitle(); - if ( !$title->isMainPage() && $title->inNamespace( NS_MAIN ) ) { - $vars = $this->getSkinConfigVariables(); - $description = $vars['wgMFDescription']; - if ( $description ) { - $html .= Html::element( 'div', - [ - 'class' => 'tagline', - ], $description ); - } - } - return $html; - } - /** * Do not set page actions on the user page that hasn't been created yet. * Also add the language switcher action. -- To view, visit https://gerrit.wikimedia.org/r/293882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fbadbc0d3d01ad4c84a8f921360de941837c797 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jhobs