From 7b5e210ed8a4d2463714026b9c5cf298fb72e037 Mon Sep 17 00:00:00 2001 From: Piotr Miazga Date: Wed, 31 Jul 2019 16:57:27 +0200 Subject: [PATCH] Show warning when user tries to use enhanced RecentChanges view Bug: T228516 Change-Id: I16e3d69b410f20a3f70f4bb213a279664613f725 --- i18n/en.json | 4 +++- i18n/qqq.json | 3 ++- includes/MinervaHooks.php | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 884c89e..63f710c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -66,5 +66,7 @@ "skin-minerva-mobile-option-MinervaEnableBackToTop": "Jump to top", "skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Jump to top of the current page using a floating button", "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment": "Improved page issues treatment", - "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment-description": "Page issues (Template:ambox) will be inlined in the article." + "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment-description": "Page issues (Template:ambox) will be inlined in the article.", + "skin-minerva-recentchanges-warning-enhanced-not-supported": "Unfortunately, grouping results by page is not available on mobile. If you would like to use the group by page feature please visit the desktop site." + } diff --git a/i18n/qqq.json b/i18n/qqq.json index 012ced5..622bbc3 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -75,5 +75,6 @@ "skin-minerva-mobile-option-MinervaEnableBackToTop": "Label for jump to top mobile web beta feature", "skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Description label for jump to top mobile web beta feature", "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment": "Title for page issues feature flag displayed in Special:MobileOptions", - "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment-description": "Description shown on Special:MobileOptions for page issues beta feature." + "skin-minerva-mobile-option-MinervaPageIssuesNewTreatment-description": "Description shown on Special:MobileOptions for page issues beta feature.", + "skin-minerva-recentchanges-warning-enhanced-not-supported": "Warning message when informing about lack of '''group results by page''' feature availability on on mobile site. Message should recommend visiting desktop site to access grouping results by page." } diff --git a/includes/MinervaHooks.php b/includes/MinervaHooks.php index 0d238b2..4fff1fd 100644 --- a/includes/MinervaHooks.php +++ b/includes/MinervaHooks.php @@ -193,6 +193,15 @@ class MinervaHooks { 'skins.minerva.mainMenu.styles', ] ); break; + case 'Recentchanges': + $isEnhancedDefaultForUser = $special->getUser()->getOption( 'usenewrc' ); + $enhanced = $request->getBool( 'enhanced', $isEnhancedDefaultForUser ); + if ( $enhanced ) { + $out->addHTML( Html::warningBox( + $special->msg( 'skin-minerva-recentchanges-warning-enhanced-not-supported' ) + ) ); + } + break; case 'Userlogin': case 'CreateAccount': // Add default warning message to Special:UserLogin and Special:UserCreate