jenkins-bot has submitted this change and it was merged.
Change subject: Let user make hidenondamaging default
......................................................................
Let user make hidenondamaging default
In recent changes and watchlist
Bug: T130560
Change-Id: Iac1b4b00998ecb3d31e43f1fb3b3142934c11d85
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/Hooks.php
4 files changed, 32 insertions(+), 2 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index bd0bdc9..ec0b34d 100644
--- a/extension.json
+++ b/extension.json
@@ -94,7 +94,9 @@
}
},
"DefaultUserOptions": {
- "oresDamagingPref": "hard"
+ "oresDamagingPref": "hard",
+ "oresRCHideNonDamaging": false,
+ "oresWatchlistHideNonDamaging": false
},
"manifest_version": 1
}
diff --git a/i18n/en.json b/i18n/en.json
index df0a8ba..5701080 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,5 +13,7 @@
"ores-damaging-legend": "This edit may be damaging and should be
reviewed",
"ores-help-damaging-pref": "This threshold determines how sensitive
ORES is when flagging edits needing review",
"ores-pref-damaging": "ORES sensitivity",
+ "ores-pref-rc-hidenondamaging": "Hide good edits from recent changes",
+ "ores-pref-watchlist-hidenondamaging": "Hide good edits from the
watchlist",
"prefs-ores" : "ORES"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b4ffda7..7d98f84 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -16,5 +16,7 @@
"ores-damaging-legend": "Legend for damaging risk icon.",
"ores-help-damaging-pref": "Help text for \"ORES sensitivity\" in
preferences",
"ores-pref-damaging": "Part asking for damaging threshold",
+ "ores-pref-rc-hidenondamaging": "Display message for user preferences
to make hidenondamaging default in recent changes",
+ "ores-pref-watchlist-hidenondamaging": "Display message for user
preferences to make hidenondamaging default in the watchlist",
"prefs-ores": "{{optional}} \nName of ORES section in preferences"
}
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 9cea658..60a2ba7 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -72,9 +72,20 @@
return true;
}
+ switch ( $clsp->getName() ) {
+ case 'Watchlist':
+ $default = $clsp->getUser()->getOption(
'oresWatchlistHideNonDamaging' );
+ break;
+ case 'Recentchanges':
+ $default = $clsp->getUser()->getOption(
'oresRCHideNonDamaging' );
+ break;
+ default:
+ $default = false;
+ }
+
$filters['hidenondamaging'] = [
'msg' => 'ores-damaging-filter',
- 'default' => false,
+ 'default' => $default,
];
return true;
@@ -253,6 +264,7 @@
/**
* GetPreferences hook, adding ORES section, letting people choose a
threshold
+ * Also let people make hidenondamaging default
*/
public static function onGetPreferences( $user, &$preferences ) {
global $wgOresDamagingThresholds;
@@ -272,6 +284,18 @@
'options' => $options,
'help-message' => 'ores-help-damaging-pref',
];
+
+ // Make hidenondamaging default
+ $preferences['oresWatchlistHideNonDamaging'] = [
+ 'type' => 'toggle',
+ 'section' => 'watchlist/ores',
+ 'label-message' =>
'ores-pref-watchlist-hidenondamaging',
+ ];
+ $preferences['oresRCHideNonDamaging'] = [
+ 'type' => 'toggle',
+ 'section' => 'rc/advancedrc',
+ 'label-message' => 'ores-pref-rc-hidenondamaging',
+ ];
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/278839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac1b4b00998ecb3d31e43f1fb3b3142934c11d85
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits