From: Roan Kattouw Date: Tue, 2 May 2017 23:41:05 +0000 (-0700) Subject: Follow-up bac92e67ca0: make order of filter groups less misleading X-Git-Tag: 1.31.0-rc.0~3343^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=dda3aa29ae3385cf0ed5c5c6257104dbe4edb076;ds=sidebyside Follow-up bac92e67ca0: make order of filter groups less misleading The significance group comes before the lastRevision group in the UI (because it has priority -6 vs -7), but we listed lastRevision first. Swap them so the order in the definition matches the order in the UI. Change-Id: I5d498bd8c7505f5cab3c89564650e0e8aaa4e117 --- diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 3f6d86516f..bb3be11e2e 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -255,79 +255,79 @@ abstract class ChangesListSpecialPage extends SpecialPage { // reviewStatus (conditional) [ - 'name' => 'lastRevision', - 'title' => 'rcfilters-filtergroup-lastRevision', + 'name' => 'significance', + 'title' => 'rcfilters-filtergroup-significance', 'class' => ChangesListBooleanFilterGroup::class, - 'priority' => -7, + 'priority' => -6, 'filters' => [ [ - 'name' => 'hidelastrevision', - 'label' => 'rcfilters-filter-lastrevision-label', - 'description' => 'rcfilters-filter-lastrevision-description', + 'name' => 'hideminor', + 'label' => 'rcfilters-filter-minor-label', + 'description' => 'rcfilters-filter-minor-description', + // rcshowhideminor-show, rcshowhideminor-hide, + // wlshowhideminor + 'showHideSuffix' => 'showhideminor', 'default' => false, 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds, &$query_options, &$join_conds ) { - $conds[] = 'rc_this_oldid <> page_latest'; + + $conds[] = 'rc_minor = 0'; }, - 'cssClassSuffix' => 'last', + 'cssClassSuffix' => 'minor', 'isRowApplicableCallable' => function ( $ctx, $rc ) { - return $rc->getAttribute( 'rc_this_oldid' ) === $rc->getAttribute( 'page_latest' ); + return $rc->getAttribute( 'rc_minor' ); } ], [ - 'name' => 'hidepreviousrevisions', - 'label' => 'rcfilters-filter-previousrevision-label', - 'description' => 'rcfilters-filter-previousrevision-description', + 'name' => 'hidemajor', + 'label' => 'rcfilters-filter-major-label', + 'description' => 'rcfilters-filter-major-description', 'default' => false, 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds, &$query_options, &$join_conds ) { - $conds[] = 'rc_this_oldid = page_latest'; + + $conds[] = 'rc_minor = 1'; }, - 'cssClassSuffix' => 'previous', + 'cssClassSuffix' => 'major', 'isRowApplicableCallable' => function ( $ctx, $rc ) { - return $rc->getAttribute( 'rc_this_oldid' ) !== $rc->getAttribute( 'page_latest' ); + return !$rc->getAttribute( 'rc_minor' ); } ] ] ], [ - 'name' => 'significance', - 'title' => 'rcfilters-filtergroup-significance', + 'name' => 'lastRevision', + 'title' => 'rcfilters-filtergroup-lastRevision', 'class' => ChangesListBooleanFilterGroup::class, - 'priority' => -6, + 'priority' => -7, 'filters' => [ [ - 'name' => 'hideminor', - 'label' => 'rcfilters-filter-minor-label', - 'description' => 'rcfilters-filter-minor-description', - // rcshowhideminor-show, rcshowhideminor-hide, - // wlshowhideminor - 'showHideSuffix' => 'showhideminor', + 'name' => 'hidelastrevision', + 'label' => 'rcfilters-filter-lastrevision-label', + 'description' => 'rcfilters-filter-lastrevision-description', 'default' => false, 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds, &$query_options, &$join_conds ) { - - $conds[] = 'rc_minor = 0'; + $conds[] = 'rc_this_oldid <> page_latest'; }, - 'cssClassSuffix' => 'minor', + 'cssClassSuffix' => 'last', 'isRowApplicableCallable' => function ( $ctx, $rc ) { - return $rc->getAttribute( 'rc_minor' ); + return $rc->getAttribute( 'rc_this_oldid' ) === $rc->getAttribute( 'page_latest' ); } ], [ - 'name' => 'hidemajor', - 'label' => 'rcfilters-filter-major-label', - 'description' => 'rcfilters-filter-major-description', + 'name' => 'hidepreviousrevisions', + 'label' => 'rcfilters-filter-previousrevision-label', + 'description' => 'rcfilters-filter-previousrevision-description', 'default' => false, 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds, &$query_options, &$join_conds ) { - - $conds[] = 'rc_minor = 1'; + $conds[] = 'rc_this_oldid = page_latest'; }, - 'cssClassSuffix' => 'major', + 'cssClassSuffix' => 'previous', 'isRowApplicableCallable' => function ( $ctx, $rc ) { - return !$rc->getAttribute( 'rc_minor' ); + return $rc->getAttribute( 'rc_this_oldid' ) !== $rc->getAttribute( 'page_latest' ); } ] ]