Merge duplicate ReferencePreviews Beta feature flag

Change-Id: Ia7f1c9128460bc5a139e37eb16fff649e80cd20f
This commit is contained in:
Thiemo Kreuz 2021-04-16 11:33:03 +02:00
parent 700f8ed306
commit e19b557227
7 changed files with 7 additions and 9 deletions

View file

@ -182,7 +182,6 @@ class PopupsHooks {
$vars['wgPopupsRestGatewayEndpoint'] = $config->get( 'PopupsRestGatewayEndpoint' ); $vars['wgPopupsRestGatewayEndpoint'] = $config->get( 'PopupsRestGatewayEndpoint' );
$vars['wgPopupsStatsvSamplingRate'] = $config->get( 'PopupsStatsvSamplingRate' ); $vars['wgPopupsStatsvSamplingRate'] = $config->get( 'PopupsStatsvSamplingRate' );
$vars['wgPopupsTextExtractsIntroOnly'] = $config->get( 'PopupsTextExtractsIntroOnly' ); $vars['wgPopupsTextExtractsIntroOnly'] = $config->get( 'PopupsTextExtractsIntroOnly' );
$vars['wgPopupsReferencePreviewsBetaFeature'] = $config->get( 'PopupsReferencePreviewsBetaFeature' );
} }
/** /**
@ -196,7 +195,6 @@ class PopupsHooks {
* setting. * setting.
* * `wgPopupsConflictsWithNavPopupGadget' - The server's notion of whether or not the * * `wgPopupsConflictsWithNavPopupGadget' - The server's notion of whether or not the
* user has enabled conflicting Navigational Popups Gadget. * user has enabled conflicting Navigational Popups Gadget.
*
* * `wgPopupsConflictsWithRefTooltipsGadget' - The server's notion of whether or not the * * `wgPopupsConflictsWithRefTooltipsGadget' - The server's notion of whether or not the
* user has enabled conflicting Reference Tooltips Gadget. * user has enabled conflicting Reference Tooltips Gadget.
* *

Binary file not shown.

Binary file not shown.

View file

@ -32,7 +32,7 @@ export default function setUserConfigFlags( config ) {
!!( popupsFlags & REFERENCE_PREVIEWS_ENABLED ) !!( popupsFlags & REFERENCE_PREVIEWS_ENABLED )
); );
config.set( config.set(
'wgPopupsReferencePreviewsBeta', 'wgPopupsReferencePreviewsBetaFeature',
!!( popupsFlags & REFERENCE_PREVIEWS_BETA ) !!( popupsFlags & REFERENCE_PREVIEWS_BETA )
); );
/* eslint-enable no-bitwise */ /* eslint-enable no-bitwise */

View file

@ -34,7 +34,7 @@ export default function createSettingsDialogRenderer( config ) {
*/ */
return ( boundActions ) => { return ( boundActions ) => {
if ( !$dialog ) { if ( !$dialog ) {
$dialog = createSettingsDialog( config.get( 'wgPopupsReferencePreviewsBeta' ) ); $dialog = createSettingsDialog( config.get( 'wgPopupsReferencePreviewsBetaFeature' ) );
$overlay = $( '<div>' ).addClass( 'mwe-popups-overlay' ); $overlay = $( '<div>' ).addClass( 'mwe-popups-overlay' );
// Setup event bindings // Setup event bindings

View file

@ -13,7 +13,7 @@ QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
config.get( 'wgPopupsConflictsWithNavPopupGadget' ), config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ), config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
config.get( 'wgPopupsReferencePreviews' ), config.get( 'wgPopupsReferencePreviews' ),
config.get( 'wgPopupsReferencePreviewsBeta' ) config.get( 'wgPopupsReferencePreviewsBetaFeature' )
], ],
[ true, true, true, true ] [ true, true, true, true ]
); );
@ -26,7 +26,7 @@ QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
config.get( 'wgPopupsConflictsWithNavPopupGadget' ), config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ), config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
config.get( 'wgPopupsReferencePreviews' ), config.get( 'wgPopupsReferencePreviews' ),
config.get( 'wgPopupsReferencePreviewsBeta' ) config.get( 'wgPopupsReferencePreviewsBetaFeature' )
], ],
[ false, true, false, true ] [ false, true, false, true ]
); );
@ -39,7 +39,7 @@ QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
config.get( 'wgPopupsConflictsWithNavPopupGadget' ), config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ), config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
config.get( 'wgPopupsReferencePreviews' ), config.get( 'wgPopupsReferencePreviews' ),
config.get( 'wgPopupsReferencePreviewsBeta' ) config.get( 'wgPopupsReferencePreviewsBetaFeature' )
], ],
[ true, false, true, false ] [ true, false, true, false ]
); );
@ -52,7 +52,7 @@ QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
config.get( 'wgPopupsConflictsWithNavPopupGadget' ), config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ), config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
config.get( 'wgPopupsReferencePreviews' ), config.get( 'wgPopupsReferencePreviews' ),
config.get( 'wgPopupsReferencePreviewsBeta' ) config.get( 'wgPopupsReferencePreviewsBetaFeature' )
], ],
[ false, false, false, false ] [ false, false, false, false ]
); );

View file

@ -158,7 +158,7 @@ class PopupsHooksTest extends MediaWikiTestCase {
]; ];
$this->setMwGlobals( $config ); $this->setMwGlobals( $config );
PopupsHooks::onResourceLoaderGetConfigVars( $vars, '' ); PopupsHooks::onResourceLoaderGetConfigVars( $vars, '' );
$this->assertCount( 8, $vars, 'A configuration is retrieved.' ); $this->assertCount( 7, $vars, 'A configuration is retrieved.' );
foreach ( $config as $key => $value ) { foreach ( $config as $key => $value ) {
$this->assertSame( $this->assertSame(