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 = 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.
@@ -84,13 +67,6 @@
                } else {
                        return parent::getSecondaryActions( $tpl );
                }
-       }
-
-       public function getSkinConfigVariables() {
-               $vars = parent::getSkinConfigVariables();
-               $vars['wgMFDescription'] = $this->getOutput()->getProperty( 
'wgMFDescription' );
-
-               return $vars;
        }
 
        /**
diff --git a/tests/browser/features/step_definitions/wikidata_descriptions.rb 
b/tests/browser/features/step_definitions/wikidata_descriptions.rb
index 7cd4257..8b70621 100644
--- a/tests/browser/features/step_definitions/wikidata_descriptions.rb
+++ b/tests/browser/features/step_definitions/wikidata_descriptions.rb
@@ -5,7 +5,3 @@
 Then(/^I should not see a wikidata description$/) do
   expect(on(ArticlePage).wikidata_description_element).not_to be_visible
 end
-
-Given(/^I have Wikidata descriptions enabled$/) do
-  step 'I am in beta mode'
-end
diff --git a/tests/browser/features/wikidata_descriptions.feature 
b/tests/browser/features/wikidata_descriptions.feature
index 458ee8a..c64520b 100644
--- a/tests/browser/features/wikidata_descriptions.feature
+++ b/tests/browser/features/wikidata_descriptions.feature
@@ -3,7 +3,6 @@
 
   Background:
     Given I am using the mobile site
-      And I have Wikidata descriptions enabled
       And I am on the "Main Page" page
 
   Scenario: Description does not appear on Main Page

-- 
To view, visit https://gerrit.wikimedia.org/r/293882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fbadbc0d3d01ad4c84a8f921360de941837c797
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jhobs <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jhobs <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to