Awight has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/247038

Change subject: Show revert risk pill on ungrouped recentchanges lines
......................................................................

Show revert risk pill on ungrouped recentchanges lines

Bug: T112856
Change-Id: If3ad0a9a8c0b022655637d521a8a8e7ce185fe78
---
M extension.json
M includes/Hooks.php
2 files changed, 24 insertions(+), 0 deletions(-)


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

diff --git a/extension.json b/extension.json
index 17b1b53..e895e1a 100644
--- a/extension.json
+++ b/extension.json
@@ -26,6 +26,9 @@
                "ChangesListSpecialPageQuery": [
                        "ORES\\Hooks::onChangesListSpecialPageQuery"
                ],
+               "EnhancedChangesListModifyBlockLineData": [
+                       "ORES\\Hooks::onEnhancedChangesListModifyBlockLineData"
+               ],
                "EnhancedChangesListModifyLineData": [
                        "ORES\\Hooks::onEnhancedChangesListModifyLineData"
                ],
diff --git a/includes/Hooks.php b/includes/Hooks.php
index c6737af..40b9ec2 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -83,6 +83,26 @@
                }
        }
 
+       /**
+        * @param EnhancedChangesList $ecl
+        * @param array $data
+        * @param RCCacheEntry $rcObj
+        */
+       public static function onEnhancedChangesListModifyBlockLineData( 
EnhancedChangesList $ecl,
+               array &$data, RCCacheEntry $rcObj
+       ) {
+               $score = $rcObj->getAttribute( 'ores_probability' );
+               if ( $score !== null ) {
+                       $type = self::getRevertThreshold( $score );
+
+                       if ( $type ) {
+                               $data[] = self::getScoreHtml( $type, $score );
+
+                               $ecl->getOutput()->addModuleStyles( 
'ext.ores.styles' );
+                       }
+               }
+       }
+
        // FIXME: Repeated code.
        public static function onOldChangesListRecentChangesLine( 
OldChangesList &$ocl, &$html,
                RecentChange $rc, array &$classes
@@ -94,6 +114,7 @@
                        if ( $type ) {
                                $html = $html . ' ' . self::getScoreHtml( 
$type, $score );
 
+                               // TODO: once per page
                                $ocl->getOutput()->addModuleStyles( 
'ext.ores.styles' );
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3ad0a9a8c0b022655637d521a8a8e7ce185fe78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>

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

Reply via email to