Follow-up 3481e3b2: Drop disablability of ExpiryInputWidget before 1.32 is cut
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 4 Oct 2018 00:45:29 +0000 (17:45 -0700)
committerJforrester <jforrester@wikimedia.org>
Tue, 16 Oct 2018 19:21:40 +0000 (19:21 +0000)
No longer used anywhere(?); we'd rather not have to explain the temporary
variable in the MediaWiki 1.32.0 release notes if we can instead just not ship
it.

Bug: T192620
Change-Id: Icfb82f228512ed45f1a27ce3e565fbc5fc09f39c

includes/DefaultSettings.php
includes/widget/ExpiryInputWidget.php
resources/src/mediawiki.widgets/mw.widgets.ExpiryInputWidget.js

index 6a1ed92..12d4aaa 100644 (file)
@@ -9001,15 +9001,6 @@ $wgMultiContentRevisionSchemaMigrationStage = SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_
  */
 $wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_OLD;
 
-/**
- * Temporary option to disable the date picker from the Expiry Widget.
- *
- * @since 1.32
- * @deprecated 1.32
- * @var bool
- */
-$wgExpiryWidgetNoDatePicker = false;
-
 /**
  * change_tag table schema migration stage.
  *
index f9985eb..289cc85 100644 (file)
@@ -20,11 +20,6 @@ class ExpiryInputWidget extends Widget {
         */
        protected $relativeInput;
 
-       /**
-        * @var bool
-        */
-       protected $noDatePicker;
-
        /**
         * @var bool
         */
@@ -37,11 +32,8 @@ class ExpiryInputWidget extends Widget {
        public function __construct( Widget $relativeInput, array $options = [] ) {
                $config = \RequestContext::getMain()->getConfig();
 
-               $options['noDatePicker'] = $config->get( 'ExpiryWidgetNoDatePicker' );
-
                parent::__construct( $options );
 
-               $this->noDatePicker = $options['noDatePicker'];
                $this->required = $options['required'] ?? false;
 
                // Properties
@@ -49,14 +41,11 @@ class ExpiryInputWidget extends Widget {
                $this->relativeInput->addClasses( [ 'mw-widget-ExpiryWidget-relative' ] );
 
                // Initialization
-               $classes = [
-                       'mw-widget-ExpiryWidget',
-               ];
-               if ( $options['noDatePicker'] === false ) {
-                       $classes[] = 'mw-widget-ExpiryWidget-hasDatePicker';
-               }
                $this
-                       ->addClasses( $classes )
+                       ->addClasses( [
+                               'mw-widget-ExpiryWidget',
+                               'mw-widget-ExpiryWidget-hasDatePicker'
+                       ] )
                        ->appendContent( $this->relativeInput );
        }
 
@@ -68,7 +57,6 @@ class ExpiryInputWidget extends Widget {
         * {@inheritdoc}
         */
        public function getConfig( &$config ) {
-               $config['noDatePicker'] = $this->noDatePicker;
                $config['required'] = $this->required;
                $config['relativeInput'] = [];
                $this->relativeInput->getConfig( $config['relativeInput'] );
index 26f347a..333b8f9 100644 (file)
                // Parent constructor
                mw.widgets.ExpiryWidget.parent.call( this, config );
 
-               // If the wiki does not want the date picker, then initialize the relative
-               // field and exit.
-               if ( config.noDatePicker ) {
-                       this.relativeField.on( 'change', function ( event ) {
-                               // Emit a change event for this widget.
-                               this.emit( 'change', event );
-                       }.bind( this ) );
-
-                       // Initialization
-                       this.$element
-                               .addClass( 'mw-widget-ExpiryWidget' )
-                               .append(
-                                       this.relativeField.$element
-                               );
-
-                       return;
-               }
-
                // Properties
                this.inputSwitch = new OO.ui.ButtonSelectWidget( {
                        tabIndex: -1,