Merge "Add feature flag to disable reference previews by default"

This commit is contained in:
jenkins-bot 2019-01-22 15:42:19 +00:00 committed by Gerrit Code Review
commit 4800c27d34
4 changed files with 9 additions and 1 deletions

View file

@ -80,6 +80,7 @@ See the .storybook/README.md for details.
## Terminology
* Footnote - What the Cite extension shows at the bottom of the page.
* Hovercard - Deprecated term for popup.
* Link preview - A similar user feature in the Android native app.
* Navpop / nav pop - A popup-like UI from the NavigationPopups gadget.
@ -87,3 +88,6 @@ See the .storybook/README.md for details.
being hovered over by a cursor.
* Page preview - A specific type of popup that shows a page summary.
* Preview - A synonym for popup.
* Reference - A specific type of popup that previews the Cite extension's
footnotes. Since footnotes are typically used for references, and the tag's
name is `<ref>`, the terms are used synonymously.

View file

@ -72,6 +72,8 @@
"PopupsGateway": "mwApiPlain",
"@PopupsRestGatewayEndpoint": "Specify a REST endpoint where summaries should be sourced from. Endpoint must meet the spec at https://www.mediawiki.org/wiki/Specs/Summary/1.2.0",
"PopupsRestGatewayEndpoint": "/api/rest_v1/page/summary/",
"@PopupsReferencePreviews": "Temporary feature flag to disable reference previews during developement.",
"PopupsReferencePreviews": false,
"@PopupsEventLogging": "Whether we should log events. Note if this is enabled without using that variable events will be logged for all users without any sampling! Be careful!",
"PopupsEventLogging": false,
"@PopupsStatsvSamplingRate": "Sampling rate for logging performance data to statsv.",

View file

@ -112,6 +112,7 @@ class PopupsHooks {
$vars['wgPopupsGateway'] = $conf->get( 'PopupsGateway' );
$vars['wgPopupsEventLogging'] = $conf->get( 'PopupsEventLogging' );
$vars['wgPopupsRestGatewayEndpoint'] = $conf->get( 'PopupsRestGatewayEndpoint' );
$vars['wgPopupsReferencePreviews'] = $conf->get( 'PopupsReferencePreviews' );
$vars['wgPopupsStatsvSamplingRate'] = $conf->get( 'PopupsStatsvSamplingRate' );
}

View file

@ -171,11 +171,12 @@ class PopupsHooksTest extends MediaWikiTestCase {
'wgPopupsRestGatewayEndpoint' => '/api',
'wgPopupsVirtualPageViews' => true,
'wgPopupsGateway' => 'mwApiPlain',
'wgPopupsReferencePreviews' => false,
'wgPopupsStatsvSamplingRate' => 0
];
$this->setMwGlobals( $config );
PopupsHooks::onResourceLoaderGetConfigVars( $vars );
$this->assertCount( 6, $vars, 'A configuration is retrieved.' );
$this->assertCount( 7, $vars, 'A configuration is retrieved.' );
foreach ( $config as $key => $value ) {
$this->assertEquals(