jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374534 )

Change subject: WLFilters: Use displaysOnUnstructuredUi instead of isVisible
......................................................................


WLFilters: Use displaysOnUnstructuredUi instead of isVisible

Follow up I3e48a9f2d9b70f0b9f6d7c6329db9c8e8001ee49

Bug: T171134
Change-Id: Ife0b10265c34d2dfd9a4d234f4a5409382530cc9
---
M includes/changes/ChangesListBooleanFilter.php
M includes/specials/SpecialWatchlist.php
2 files changed, 2 insertions(+), 24 deletions(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/changes/ChangesListBooleanFilter.php 
b/includes/changes/ChangesListBooleanFilter.php
index 961cb48..913bd38 100644
--- a/includes/changes/ChangesListBooleanFilter.php
+++ b/includes/changes/ChangesListBooleanFilter.php
@@ -74,13 +74,6 @@
        protected $activeValue;
 
        /**
-        * Whether this filter is visible somewhere (legacy form or structured 
UI).
-        *
-        * @var bool $isVisible
-        */
-       protected $isVisible;
-
-       /**
         * Create a new filter with the specified configuration.
         *
         * It infers which UI (it can be either or both) to display the filter 
on based on
@@ -106,8 +99,6 @@
         * * $filterDefinition['default'] bool Default
         * * $filterDefinition['activeValue'] bool This filter is considered 
active when
         *     its value is equal to its activeValue. Default is true.
-        * * $filterDefinition['isVisible'] bool This filter is visible in the 
legacy form or
-        *     structured UI. Default is true.
         * * $filterDefinition['priority'] int Priority integer.  Higher value 
means higher
         *     up in the group's filter list.
         * * $filterDefinition['queryCallable'] callable Callable accepting 
parameters, used
@@ -149,12 +140,6 @@
                        $this->activeValue = $filterDefinition['activeValue'];
                } else {
                        $this->activeValue = true;
-               }
-
-               if ( isset( $filterDefinition['isVisible'] ) ) {
-                       $this->isVisible = $filterDefinition['isVisible'];
-               } else {
-                       $this->isVisible = true;
                }
        }
 
@@ -267,12 +252,5 @@
                }
 
                return $opts[ $this->getName() ] === $this->activeValue;
-       }
-
-       /**
-        * @return bool Whether this filter is visible anywhere
-        */
-       public function isVisible() {
-               return $this->isVisible;
        }
 }
diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 94b36b9..0dd66b0 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -151,7 +151,6 @@
                                [
                                        'name' => 'extended',
                                        'isReplacedInStructuredUi' => true,
-                                       'isVisible' => false,
                                        'activeValue' => false,
                                        'default' => 
$this->getUser()->getBoolOption( 'extendwatchlist' ),
                                        'queryCallable' => function ( 
$specialClassName, $ctx, $dbr, &$tables,
@@ -334,8 +333,9 @@
                        // unchecked boxes.
                        foreach ( $this->filterGroups as $filterGroup ) {
                                if ( $filterGroup instanceof 
ChangesListBooleanFilterGroup ) {
+                                       /** @var ChangesListBooleanFilter 
$filter */
                                        foreach ( $filterGroup->getFilters() as 
$filter ) {
-                                               if ( $filter->isVisible() ) {
+                                               if ( 
$filter->displaysOnUnstructuredUi() ) {
                                                        
$allBooleansFalse[$filter->getName()] = false;
                                                }
                                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/374534
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife0b10265c34d2dfd9a4d234f4a5409382530cc9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to