jenkins-bot has submitted this change and it was merged.
Change subject: Wikidata descriptions should only be displayed in beta
......................................................................
Wikidata descriptions should only be displayed in beta
The existing config variable makes descriptions available and is enabled
on the cluster as true. This decouples them and fixes the browser tests
for when the flag is true in future.
Bug: T116756
Change-Id: I15d5631ec43e5832c1ac7d44d12768cf2c944a3b
(cherry picked from commit 872b8a3a3162ceafabc01aa2067ab8ab7c3e6fbc)
---
M includes/MobileFrontend.hooks.php
M includes/config/Wikidata.php
M tests/browser/features/step_definitions/search_steps.rb
M tests/browser/features/support/pages/article_page.rb
4 files changed, 21 insertions(+), 2 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index b778f55..68fd56d 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -346,9 +346,19 @@
) );
}
+ // We need to check that first descriptions are enabled (the
server admin has installed
+ // Wikidata) and then secondly that it is okay to display them
prominently in the UI
+ // For instance a server admin may want to make them available
in the page via JS for gadgets
+ // but not build them into their experience.
+ $displayDescriptions = $config->get(
'MFDisplayWikibaseDescription' );
+ $useDescriptions = $config->get( 'MFUseWikibaseDescription' );
+
+ if ( $context->isBetaGroupMember() ) {
+ $displayDescriptions = true;
+ }
// When set turn on Wikidata descriptions
// https://phabricator.wikimedia.org/T101719
- if ( $config->get( 'MFUseWikibaseDescription' ) ) {
+ if ( $useDescriptions && $displayDescriptions ) {
if ( !in_array( 'pageterms', $pageProps ) ) {
$pageProps[] = 'pageterms';
}
diff --git a/includes/config/Wikidata.php b/includes/config/Wikidata.php
index 2542415..7e75009 100644
--- a/includes/config/Wikidata.php
+++ b/includes/config/Wikidata.php
@@ -12,6 +12,12 @@
$wgMFUseWikibaseDescription = false;
/**
+ * If set to true wikidata descriptions will be displayed in UI elements such
as search,
+ * nearby and watchlist.
+ */
+$wgMFDisplayWikibaseDescription = false;
+
+/**
* Define the property that holds a string representing a category on
$wgMFPhotoUploadEndpoint
*/
$wgMFWikibaseImageCategory = '';
diff --git a/tests/browser/features/step_definitions/search_steps.rb
b/tests/browser/features/step_definitions/search_steps.rb
index 5f7592a..818899c 100644
--- a/tests/browser/features/step_definitions/search_steps.rb
+++ b/tests/browser/features/step_definitions/search_steps.rb
@@ -67,7 +67,7 @@
end
Then(/^search results should contain "(.+)"$/) do |text|
- expect(on(ArticlePage).search_result_element.when_present.text).to eq text
+ expect(on(ArticlePage).search_result_heading_element.when_present.text).to
eq text
end
Then(/^I should not see '#\/search' in URL$/) do
diff --git a/tests/browser/features/support/pages/article_page.rb
b/tests/browser/features/support/pages/article_page.rb
index edec96d..7b8e0bd 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -69,6 +69,9 @@
a(:search_result) do |page|
page.search_overlay_page_list_element.element.a
end
+ h3(:search_result_heading) do |page|
+ page.search_overlay_page_list_element.element.h3
+ end
a(:notifications_button, id: 'secondary-button', class: 'user-button')
div(:notifications_overlay, class: 'notifications-overlay')
--
To view, visit https://gerrit.wikimedia.org/r/249585
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I15d5631ec43e5832c1ac7d44d12768cf2c944a3b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.27.0-wmf.4
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits