From ba86bd1d644e0685588202570f6a5702f41f45e6 Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Tue, 29 Aug 2017 08:05:17 -0400 Subject: [PATCH] WLFilters: Use displaysOnUnstructuredUi instead of isVisible Follow up I3e48a9f2d9b70f0b9f6d7c6329db9c8e8001ee49 Bug: T171134 Change-Id: Ife0b10265c34d2dfd9a4d234f4a5409382530cc9 --- includes/changes/ChangesListBooleanFilter.php | 22 ------------------- includes/specials/SpecialWatchlist.php | 4 ++-- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/includes/changes/ChangesListBooleanFilter.php b/includes/changes/ChangesListBooleanFilter.php index 961cb48ac0..913bd3832f 100644 --- a/includes/changes/ChangesListBooleanFilter.php +++ b/includes/changes/ChangesListBooleanFilter.php @@ -73,13 +73,6 @@ class ChangesListBooleanFilter extends ChangesListFilter { */ 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. * @@ -106,8 +99,6 @@ class ChangesListBooleanFilter extends ChangesListFilter { * * $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 @@ -150,12 +141,6 @@ class ChangesListBooleanFilter extends ChangesListFilter { } else { $this->activeValue = true; } - - if ( isset( $filterDefinition['isVisible'] ) ) { - $this->isVisible = $filterDefinition['isVisible']; - } else { - $this->isVisible = true; - } } /** @@ -268,11 +253,4 @@ class ChangesListBooleanFilter extends ChangesListFilter { 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 94b36b94fb..0dd66b023d 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -151,7 +151,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { [ 'name' => 'extended', 'isReplacedInStructuredUi' => true, - 'isVisible' => false, 'activeValue' => false, 'default' => $this->getUser()->getBoolOption( 'extendwatchlist' ), 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, @@ -334,8 +333,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { // 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; } } -- 2.20.1