jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343205 )

Change subject: Add ORES conflicts and What's This?
......................................................................


Add ORES conflicts and What's This?

Bug: T158459
Bug: T156427
Change-Id: Id6a778eb7cdfe8a8c75f2e37631d5226480fa301
---
M i18n/en.json
M i18n/qqq.json
M includes/Hooks.php
3 files changed, 52 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 2c798ed..69b2d44 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,7 +15,13 @@
        "ores-help-damaging-pref": "This threshold determines how sensitive 
ORES is when flagging edits needing review",
        "ores-hide-nondamaging-filter": "Hide probably good edits",
        "ores-pref-damaging": "ORES sensitivity",
+       "ores-rcfilters-whats-this-link-text": "Learn more",
+       "ores-rcfilters-ores-conflicts-logactions-global": "The \"Logged 
actions\" filter is conflicting 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 as inactive above.",
+       "ores-rcfilters-logactions-conflicts-ores": "This filter is conflicting 
with one or more Contribution Quality or User Intent filters. Quality and 
Intent predictions are not available for logged actions.",
        "ores-rcfilters-damaging-title": "Contribution quality predictions",
+       "ores-rcfilters-damaging-whats-this-header": "About contribution 
quality predictions",
+       "ores-rcfilters-damaging-whats-this-body": "Filter edits based on how 
likely they are to contain problems using predictions made by ORES, a 
machine-learning service trained on a large set of edits previously scored by 
human editors.\n\nFilters with different levels of accuracy are provided. 
Stricter, more accurate filters find fewer false positives but miss more of 
their targets. Less accurate filters find more of their targets, but they also 
find more false positives.",
+       "ores-rcfilters-damaging-conflicts-logactions": "Contribution Quality 
predictions are not available for certain types of change. This filter is 
inactive because it is in conflict with the following Type of Change 
{{PLURAL:$2|filter|filters}}: $1",
        "ores-rcfilters-damaging-likelygood-label": "Very likely good",
        "ores-rcfilters-damaging-likelygood-desc": "Highly accurate at finding 
almost all problem-free edits.",
        "ores-rcfilters-damaging-maybebad-label": "May have problems",
@@ -25,6 +31,9 @@
        "ores-rcfilters-damaging-verylikelybad-label": "Very likely have 
problems",
        "ores-rcfilters-damaging-verylikelybad-desc": "Highly accurate at 
finding the most obvious 10% of flawed or damaging edits.",
        "ores-rcfilters-goodfaith-title": "User intent predictions",
+       "ores-rcfilters-goodfaith-whats-this-header": "About user intent 
predictions",
+       "ores-rcfilters-goodfaith-whats-this-body": "Filter edits based on 
whether they were, or weren't, made in good faith using predictions generated 
by ORES, a machine-learning service trained on a large set of edits previously 
scored by human editors.\n\nFilters with different levels of accuracy are 
provided. Stricter, more accurate filters find fewer false positives but miss 
more of their targets. Less accurate filters find more of their targets, but 
they also find more false positives.",
+       "ores-rcfilters-goodfaith-conflicts-logactions": "User Intent 
predictions are not available for certain types of change. This filter is 
inactive because it is in conflict with the following Type of Change 
{{PLURAL:$2|filter|filters}}: $1",
        "ores-rcfilters-goodfaith-good-label": "Very likely good faith",
        "ores-rcfilters-goodfaith-good-desc": "Highly accurate at finding 
almost all good-faith edits.",
        "ores-rcfilters-goodfaith-maybebad-label": "May be bad faith",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a478506..d7eae12 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -19,7 +19,13 @@
        "ores-help-damaging-pref": "Help text for \"ORES sensitivity\" in 
preferences",
        "ores-hide-nondamaging-filter": "Label for Contributions filter, 'only 
show'",
        "ores-pref-damaging": "Part asking for damaging threshold",
+       "ores-rcfilters-whats-this-link-text": "Text of a link to more 
information about either Contribution Quality Predictions or User Intent 
Predictions",
+       "ores-rcfilters-ores-conflicts-logactions-global": "Message shown in 
the result area when both an ORES filter and the 'Logged actions' filter are 
selected.  This indicates that no results will be shown because log actions are 
never scored by ORES.\n\n\"Logged actions\" is 
{{msg-mw|rcfilters-filter-logactions-label}}.",
+       "ores-rcfilters-logactions-conflicts-ores": "Tooltip shown when 
hovering over a Logged actions filter tag, when a ORES filter is also 
selected.\n\n\"Logged actions\" is 
{{msg-mw|rcfilters-filter-logactions-label}}.",
        "ores-rcfilters-damaging-title": "Title for the filter group for ORES 
damaging score.",
+       "ores-rcfilters-damaging-whats-this-header": "Header of \"What's This\" 
popup for Contribution Quality group",
+       "ores-rcfilters-damaging-whats-this-body": "Body of \"What's This\" 
popup for Contribution Quality group",
+       "ores-rcfilters-damaging-conflicts-logactions": "Tooltip shown when 
hovering over a 'Contribution quality predictions' filter tag, when the 'Logged 
actions' filter is selected and there is a conflict.  'Logged actions' are not 
scored by ORES.  Parameters:\n* $1 - Comma-separated string of selected Type of 
Change filters, e.g. \"Logged actions\"\n* $2 - Count of selected Type of 
Change filters, for PLURAL",
        "ores-rcfilters-damaging-likelygood-label": "Label for the filter for 
showing edits that are very likely to be non-damaging.",
        "ores-rcfilters-damaging-likelygood-desc": "Description for the filter 
for showing edits that are very likely to be non-damaging.",
        "ores-rcfilters-damaging-maybebad-label": "Label for the filter for 
showing edits that are somewhat likely to be damaging.",
@@ -29,6 +35,9 @@
        "ores-rcfilters-damaging-verylikelybad-label": "Label for the filter 
for showing edits that are somewhat likely to be damaging.",
        "ores-rcfilters-damaging-verylikelybad-desc": "Description for the 
filter for showing edits that are somewhat likely to be damaging.",
        "ores-rcfilters-goodfaith-title": "Title for the filter group for ORES 
good faith score.",
+       "ores-rcfilters-goodfaith-whats-this-header": "Header of \"What's 
This\" popup for User Intent group",
+       "ores-rcfilters-goodfaith-whats-this-body": "Body of \"What's This\" 
popup for User Intent group",
+       "ores-rcfilters-goodfaith-conflicts-logactions": "Tooltip shown when 
hovering over a 'User intent predictions' filter tag, when the 'Logged actions' 
filter is selected and there is a conflict.  'Logged actions' are not scored by 
ORES.  Parameters:\n* $1 - Comma-separated string of selected Type of Change 
filters, e.g. \"Logged actions\"\n* $2 - Count of selected Type of Change 
filters, for PLURAL",
        "ores-rcfilters-goodfaith-good-label": "Label for the filter for 
showing edits that are very likely to be good faith.",
        "ores-rcfilters-goodfaith-good-desc": "Description for the filter for 
showing edits that are very likely to be good faith.",
        "ores-rcfilters-goodfaith-maybebad-label": "Label for the filter for 
showing edits that are somewhat likely to be bad faith.",
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 55178f9..530fc51 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -91,11 +91,20 @@
                }
 
                $stats = Stats::newFromGlobalState();
+
+               $changeTypeGroup = $clsp->getFilterGroup( 'changeType' );
+               $logFilter = $changeTypeGroup->getFilter( 'hidelog' );
+
                if ( self::isModelEnabled( 'damaging' ) ) {
                        $damagingLevels = $stats->getThresholds( 'damaging' );
                        $newDamagingGroup = new 
ChangesListStringOptionsFilterGroup( [
                                'name' => 'damaging',
                                'title' => 'ores-rcfilters-damaging-title',
+                               'whatsThisHeader' => 
'ores-rcfilters-damaging-whats-this-header',
+                               'whatsThisBody' => 
'ores-rcfilters-damaging-whats-this-body',
+                               'whatsThisUrl' => 
'https://www.mediawiki.org/wiki/' .
+                                       
'Special:MyLanguage/Help:New_filters_for_edit_review/Quality_and_Intent_Filters',
+                               'whatsThisLinkText' => 
'ores-rcfilters-whats-this-link-text',
                                'priority' => 2,
                                'filters' => [
                                        [
@@ -153,6 +162,14 @@
                                        }
                                },
                        ] );
+
+                       $newDamagingGroup->conflictsWith(
+                               $logFilter,
+                               
'ores-rcfilters-ores-conflicts-logactions-global',
+                               'ores-rcfilters-damaging-conflicts-logactions',
+                               'ores-rcfilters-logactions-conflicts-ores'
+                       );
+
                        $newDamagingGroup->getFilter( 'maybebad' 
)->setAsSupersetOf(
                                $newDamagingGroup->getFilter( 'likelybad' )
                        );
@@ -173,6 +190,9 @@
                                $damagingDefault = false;
                        }
 
+                       // I don't think we need to register a conflict here, 
since
+                       // if we're showing non-damaging, that won't conflict 
with
+                       // anything.
                        $legacyDamagingGroup = new 
ChangesListBooleanFilterGroup( [
                                'name' => 'ores',
                                'filters' => [
@@ -194,6 +214,7 @@
                                ],
 
                        ] );
+
                        $clsp->registerFilterGroup( $legacyDamagingGroup );
                }
                if ( self::isModelEnabled( 'goodfaith' ) ) {
@@ -201,6 +222,11 @@
                        $goodfaithGroup = new 
ChangesListStringOptionsFilterGroup( [
                                'name' => 'goodfaith',
                                'title' => 'ores-rcfilters-goodfaith-title',
+                               'whatsThisHeader' => 
'ores-rcfilters-goodfaith-whats-this-header',
+                               'whatsThisBody' => 
'ores-rcfilters-goodfaith-whats-this-body',
+                               'whatsThisUrl' => 
'https://www.mediawiki.org/wiki/' .
+                                       
'Special:MyLanguage/Help:New_filters_for_edit_review/Quality_and_Intent_Filters',
+                               'whatsThisLinkText' => 
'ores-rcfilters-whats-this-link-text',
                                'priority' => 1,
                                'filters' => [
                                        [
@@ -256,6 +282,14 @@
                        $goodfaithGroup->getFilter( 'maybebadfaith' 
)->setAsSupersetOf(
                                $goodfaithGroup->getFilter( 'bad' )
                        );
+
+                       $goodfaithGroup->conflictsWith(
+                               $logFilter,
+                               
'ores-rcfilters-ores-conflicts-logactions-global',
+                               'ores-rcfilters-goodfaith-conflicts-logactions',
+                               'ores-rcfilters-logactions-conflicts-ores'
+                       );
+
                        $clsp->registerFilterGroup( $goodfaithGroup );
                }
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id6a778eb7cdfe8a8c75f2e37631d5226480fa301
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to