Mattflaschen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349537 )

Change subject: Make the preference for the "r" flag on the RC page also 
control highlighting
......................................................................

Make the preference for the "r" flag on the RC page also control highlighting

And disable it when the RCFilters beta feature is enabled.

Bug: T163025
Change-Id: I988f6641773dcec27ff9bb01861c1491348d332f
(cherry picked from commit b9f6a0fe8e52f982d1b93c05141fce4f05c3f687)
---
M i18n/en.json
M includes/Hooks.php
M tests/phpunit/includes/HooksTest.php
3 files changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/37/349537/1

diff --git a/i18n/en.json b/i18n/en.json
index f8904b3..b0089c4 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,7 +15,7 @@
        "ores-help-damaging-pref": "Sets the level of probability at which the 
system flags edits with an \"{{int:ores-damaging-letter}}\" to indicate they 
\"need review\" on Recent Changes, Watchlist and Contributions. Also sets the 
threshold for \"Show only likely problem edits\".",
        "ores-hide-nondamaging-filter": "Hide probably good edits",
        "ores-pref-damaging": "ORES sensitivity",
-       "ores-pref-damaging-flag": "Mark likely problem edits with an 
\"{{int:ores-damaging-letter}}\" for \"needs review\" (to set the level at 
which edits are marked, use the \"{{int:ores-pref-damaging}}\" setting in the 
Watchlist preferences)",
+       "ores-pref-damaging-flag": "Highlight likely problem edits with colors 
and an \"{{int:ores-damaging-letter}}\" for \"needs review\" (to set the level 
at which edits are marked, use the \"{{int:ores-pref-damaging}}\" setting in 
the Watchlist preferences)",
        "ores-rcfilters-whats-this-link-text": "Learn more",
        "ores-rcfilters-ores-conflicts-logactions-global": "The \"Logged 
actions\" filter conflicts with one or more Contribution Quality or User Intent 
filters. Quality and Intent predictions are not available for logged actions. 
The conflicting filters are marked in the Active Filters area, above.",
        "ores-rcfilters-logactions-conflicts-ores": "This filter conflicts with 
one or more Contribution Quality or User Intent filters. Quality and Intent 
predictions are not available for logged actions.",
diff --git a/includes/Hooks.php b/includes/Hooks.php
index a136e51..90e1fec 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -642,9 +642,10 @@
                        'section' => 'rc/advancedrc',
                        'label-message' => 'ores-pref-rc-hidenondamaging',
                ];
-               // Hide RC pref if enhanced filters are enabled
+               // Hide RC prefs if enhanced filters are enabled
                if ( $user->getBoolOption( 'rcenhancedfilters' ) ) {
                        $wgHiddenPrefs[] = 'oresRCHideNonDamaging';
+                       $wgHiddenPrefs[] = 'ores-damaging-flag-rc';
                }
        }
 
@@ -737,11 +738,9 @@
         * @return boolean Whether highlights should be shown
         */
        private static function isHighlightEnabled( IContextSource $context ) {
-               global $wgOresExtensionStatus;
-               return $wgOresExtensionStatus === 'beta' || (
-                       !self::isRCPage( $context ) &&
-                       $context->getUser()->getBoolOption( 'oresHighlight' )
-               );
+               // Was previously controlled by different preferences than the 
"r", but they're currently
+               // the same.
+               return self::isDamagingFlagEnabled( $context );
        }
 
        /**
diff --git a/tests/phpunit/includes/HooksTest.php 
b/tests/phpunit/includes/HooksTest.php
index a4d84c4..e076e4f 100644
--- a/tests/phpunit/includes/HooksTest.php
+++ b/tests/phpunit/includes/HooksTest.php
@@ -309,7 +309,7 @@
                        ' <abbr class="ores-damaging" title="This edit needs 
review">r</abbr>',
                        $s
                );
-               $this->assertSame( [ 'damaging' ], $classes );
+               $this->assertSame( [ 'ores-highlight', 'damaging' ], $classes );
        }
 
        public function testOnOldChangesListModifyLineDataNonDamaging() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I988f6641773dcec27ff9bb01861c1491348d332f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: wmf/1.29.0-wmf.20
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to