jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/402127 )
Change subject: List all the features in beta (UI)
......................................................................
List all the features in beta (UI)
This takes care of the UI portion of listing all features
in beta.
Bug: T182362
Change-Id: If0855122e388e2f6742b19bffaf078e90b18809e
---
M README.md
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialMobileOptions.php
M resources/mobile.special.mobileoptions.styles/mobileoptions.less
6 files changed, 108 insertions(+), 22 deletions(-)
Approvals:
Pmiazga: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README.md b/README.md
index 6c3625c..49ff6fd 100644
--- a/README.md
+++ b/README.md
@@ -494,6 +494,13 @@
* Type: `Boolean`
* Default: `false`
+#### MFBetaFeedbackLink
+
+Link to feedback page for beta features. If false no feedback link will be
shown.
+
+* Type: `String|false`
+* Default: `false`
+
#### $wgMFDefaultSkinClass
The default skin for MobileFrontend.
diff --git a/extension.json b/extension.json
index f4935db..49f112d 100644
--- a/extension.json
+++ b/extension.json
@@ -1301,6 +1301,7 @@
"MFStopRedirectCookieHost": null,
"MobileFrontendLogo": false,
"MFEnableBeta": false,
+ "MFBetaFeedbackLink": false,
"MFDefaultSkinClass": "SkinMinerva",
"MFNamespacesWithoutCollapsibleSections": [
6,
diff --git a/i18n/en.json b/i18n/en.json
index d946136..9217300 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -178,7 +178,7 @@
"mobile-frontend-nearby-requirements-guidance": "Try a different
browser or enable JavaScript if you've disabled it.",
"mobile-frontend-nearby-title": "Nearby",
"mobile-frontend-news-items": "In the news",
- "mobile-frontend-opt-in-explain": "Join {{SITENAME}} Beta to get access
to the latest experimental features!",
+ "mobile-frontend-opt-in-explain": "{{SITENAME}} βeta is a way for you
to try these experimental features and provide us with valuable feedback",
"mobile-frontend-overlay-close": "Close",
"mobile-frontend-overlay-continue": "Continue",
"mobile-frontend-page-edit-summary": "<span><strong>Edit
summary</strong> $1</span>",
@@ -199,7 +199,7 @@
"mobile-frontend-search-content-no-results":
"'''{{int:mobile-frontend-search-content}}''' to see if this phrase appears
anywhere.",
"mobile-frontend-search-no-results": "No page with this title.",
"mobile-frontend-settings-tagline": "Reading preferences",
- "mobile-frontend-settings-beta": "Beta",
+ "mobile-frontend-settings-beta": "{{SITENAME}} βeta",
"mobile-frontend-settings-site-description": "{{SITENAME}} is available
in $1 {{PLURAL:$1|language|languages}}. All available versions are listed
below",
"mobile-frontend-settings-site-header": "{{SITENAME}} Languages",
"mobile-frontend-settings-save": "Settings were saved successfully.",
@@ -297,5 +297,10 @@
"mobile-frontend-panel-betaoptin-msg": "Do you want to try some new
features? By joining the beta, you will get access to experimental features, at
the risk of encountering bugs and issues.",
"mobile-frontend-search-feedback-link-text": "Give us your feedback.",
"mobile-frontend-search-feedback-prompt": "Couldn't find what you were
looking for?",
- "mobile-frontend-notifications-filter-title": "Filter notifications"
-}
\ No newline at end of file
+ "mobile-frontend-notifications-filter-title": "Filter notifications",
+ "mobile-frontend-mobile-option-MFLazyLoadReferences": "Lazy load
references",
+ "mobile-frontend-mobile-option-MFEnableWikidataDescriptions": "Title
descriptions",
+
"mobile-frontend-mobile-option-MFEnableWikidataDescriptions-description":
"Learn about the subject of the article with a short description below the
title",
+ "mobile-frontend-mobile-option-MFLazyLoadReferences-description": "Load
article references only when needed",
+ "mobile-frontend-send-feedback": "Send feedback"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ab92dfc..91f2348 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -298,5 +298,10 @@
"mobile-frontend-panel-betaoptin-msg": "Message in panel asking if user
wants to opt in to beta.",
"mobile-frontend-search-feedback-link-text": "Text of anchor linking to
a form for the user to give feedback on search results.",
"mobile-frontend-search-feedback-prompt": "Text shown in front of an
anchor linking to a form for the user to give feedback on search results.",
- "mobile-frontend-notifications-filter-title": "Title shown in the
notifications filter page on click of the Filter button"
+ "mobile-frontend-notifications-filter-title": "Title shown in the
notifications filter page on click of the Filter button",
+ "mobile-frontend-mobile-option-MFLazyLoadReferences": "An identifier
for the lazy load references subproject/feature",
+ "mobile-frontend-mobile-option-MFEnableWikidataDescriptions": "An
identifier for the wikidata descriptions subproject/feature",
+
"mobile-frontend-mobile-option-MFEnableWikidataDescriptions-description": "A
description of the wikidata description subproject/feature",
+ "mobile-frontend-mobile-option-MFLazyLoadReferences-description": "A
description of the lazy load references subproject/feature",
+ "mobile-frontend-send-feedback": "Link label for sending feedback to
the mobile web beta"
}
diff --git a/includes/specials/SpecialMobileOptions.php
b/includes/specials/SpecialMobileOptions.php
index ebb9364..a00e0b4 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -94,31 +94,67 @@
$form->addClasses( [ 'mw-mf-settings' ] );
// beta settings
+ $isInBeta = $context->isBetaGroupMember();
if ( $this->getMFConfig()->get( 'MFEnableBeta' ) ) {
$input = new OOUI\CheckboxInputWidget( [
'name' => 'enableBeta',
'infusable' => true,
- 'selected' => $context->isBetaGroupMember(),
+ 'selected' => $isInBeta,
'id' => 'enable-beta-toggle',
'value' => '1',
] );
$fields[] = new OOUI\FieldLayout(
$input,
[
- 'label' => new OOUI\LabelWidget( [
- 'input' => $input,
- 'label' => new OOUI\HtmlSnippet(
- Html::openElement( 'div' ) .
- Html::element( 'strong', [],
- $this->msg(
'mobile-frontend-settings-beta' )->parse() ) .
- Html::element( 'div', [ 'class'
=> 'option-description' ],
- $this->msg(
'mobile-frontend-opt-in-explain' )->parse()
- ) .
- Html::closeElement( 'div' )
- )
- ] ),
- 'id' => 'beta-field',
- ] );
+ 'label' => new OOUI\LabelWidget( [
+ 'input' => $input,
+ 'label' => new OOUI\HtmlSnippet(
+ Html::openElement(
'div' ) .
+ Html::element(
'strong', [],
+ $this->msg(
'mobile-frontend-settings-beta' )->parse() ) .
+ Html::element( 'div', [
'class' => 'option-description' ],
+ $this->msg(
'mobile-frontend-opt-in-explain' )->parse()
+ ) .
+ Html::closeElement(
'div' )
+ )
+ ] ),
+ 'id' => 'beta-field',
+ ]
+ );
+
+ $features = \MediaWiki\MediaWikiServices::getInstance()
+ ->getService( 'MobileFrontend.FeaturesManager' )
+ ->getAvailable( MobileContext::MODE_BETA );
+
+ $classNames = [ 'mobile-options-beta-feature' ];
+ if ( $isInBeta ) {
+ $classNames[] = 'is-enabled';
+ $icon = 'check';
+ } else {
+ $icon = 'lock';
+ }
+ /** @var \MobileFrontend\Features\IFeature $feature */
+ foreach ( $features as $feature ) {
+ $fields[] = new OOUI\FieldLayout(
+ new OOUI\IconWidget( [
+ 'icon' => $icon,
+ 'title' => 'Available in beta
only',
+ ] ),
+ [
+ 'classes' => $classNames,
+ 'label' => new
OOUI\LabelWidget( [
+ 'label' => new
OOUI\HtmlSnippet(
+
Html::rawElement( 'div', [],
+
Html::element( 'strong', [],
+
wfMessage( $feature->getNameKey() ) ) .
+
Html::element( 'div', [ 'class' => 'option-description' ],
+
wfMessage( $feature->getDescriptionKey() ) )
+ )
+ ),
+ ] )
+ ]
+ );
+ }
}
$fields[] = new OOUI\ButtonInputWidget( [
@@ -135,7 +171,20 @@
'value' => $user->getEditToken() ] );
}
- // @codingStandardsIgnoreEnd
+ $feedbackLink = $this->getConfig()->get( 'MFBetaFeedbackLink' );
+ if ( $feedbackLink && $isInBeta ) {
+ $fields[] = new OOUI\ButtonWidget( [
+ 'framed' => false,
+ 'href' => $feedbackLink,
+ 'icon' => 'feedback',
+ 'flags' => [
+ 'progressive',
+ ],
+ 'classes' => [ 'mobile-options-feedback' ],
+ 'label' => $this->msg(
'mobile-frontend-send-feedback' )->escaped(),
+ ] );
+ }
+
$form->appendContent(
$fields
);
diff --git a/resources/mobile.special.mobileoptions.styles/mobileoptions.less
b/resources/mobile.special.mobileoptions.styles/mobileoptions.less
index cf0d582..4f63514 100644
--- a/resources/mobile.special.mobileoptions.styles/mobileoptions.less
+++ b/resources/mobile.special.mobileoptions.styles/mobileoptions.less
@@ -35,8 +35,18 @@
}
.oo-ui-fieldLayout {
- border-top: solid 1px @colorGray14;
+ border-bottom: solid 1px @colorGray14;
padding-top: 12.5px;
+ padding-bottom: 12.5px;
+ margin-top: 0;
+
+ &:first-child {
+ border-top: solid 1px @colorGray14;
+ }
+ }
+
+ .mobile-options-feedback {
+ margin-top: 10px !important;
}
#beta-field {
@@ -62,6 +72,15 @@
}
}
+ .mobile-options-beta-feature {
+ font-size: 0.9em;
+ opacity: 0.5;
+
+ &.is-enabled {
+ opacity: 1;
+ }
+ }
+
.oo-ui-fieldLayout-body {
margin-bottom: 40px;
}
--
To view, visit https://gerrit.wikimedia.org/r/402127
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If0855122e388e2f6742b19bffaf078e90b18809e
Gerrit-PatchSet: 17
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: specialpages
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits