Follow-up bac92e67ca0: make order of filter groups less misleading
authorRoan Kattouw <roan.kattouw@gmail.com>
Tue, 2 May 2017 23:41:05 +0000 (16:41 -0700)
committerCatrope <roan@wikimedia.org>
Wed, 3 May 2017 22:11:02 +0000 (22:11 +0000)
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

includes/specialpage/ChangesListSpecialPage.php

index 3f6d865..bb3be11 100644 (file)
@@ -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' );
                                                }
                                        ]
                                ]