Merge "Use field name for the hide-if statement"

This commit is contained in:
jenkins-bot 2022-01-17 20:10:04 +00:00 committed by Gerrit Code Review
commit 863cdc34bf
3 changed files with 4 additions and 4 deletions

View file

@ -428,8 +428,8 @@ class Hooks {
// Only show this section when the Vector skin is checked. The JavaScript client also uses
// this state to determine whether to show or hide the whole section.
// If migration mode is enabled, the section is always hidden.
'hide-if' => self::isMigrationMode() ? [ '!==', 'wpskin', '0' ] :
[ '!==', 'wpskin', Constants::SKIN_NAME_LEGACY ],
'hide-if' => self::isMigrationMode() ? [ '!==', 'skin', '0' ] :
[ '!==', 'skin', Constants::SKIN_NAME_LEGACY ],
],
Constants::PREF_KEY_SIDEBAR_VISIBLE => [
'type' => 'api',

View file

@ -72,7 +72,7 @@ class HTMLLegacySkinVersionFieldTest extends \MediaWikiIntegrationTestCase {
'label-message' => 'prefs-vector-enable-vector-1-label',
'help-message' => 'prefs-vector-enable-vector-1-help',
'default' => true,
'hide-if' => [ '!==', 'wpskin', Constants::SKIN_NAME_LEGACY ],
'hide-if' => [ '!==', 'skin', Constants::SKIN_NAME_LEGACY ],
];
$skinVersionField = new HTMLLegacySkinVersionField( $params );
$checkField = new \HTMLCheckField( $params );

View file

@ -17,7 +17,7 @@ use Vector\HTMLForm\Fields\HTMLLegacySkinVersionField;
* @coversDefaultClass \Vector\Hooks
*/
class VectorHooksTest extends MediaWikiIntegrationTestCase {
private const HIDE_IF = [ '!==', 'wpskin', Constants::SKIN_NAME_LEGACY ];
private const HIDE_IF = [ '!==', 'skin', Constants::SKIN_NAME_LEGACY ];
private const SKIN_PREFS_SECTION = 'rendering/skin/skin-prefs';