Merge "Standardize the order of options in dropdown filters for search"

This commit is contained in:
jenkins-bot 2020-09-17 11:26:55 +00:00 committed by Gerrit Code Review
commit 6bf5e2ce6f
3 changed files with 14 additions and 6 deletions

View file

@ -85,6 +85,7 @@
"abusefilter-log-details-ip": "Originating IP address",
"abusefilter-log-details-checkuser": "Check user",
"abusefilter-log-noactions": "none",
"abusefilter-log-noactions-filter": "None",
"abusefilter-log-details-diff": "Changes made in edit",
"abusefilter-log-linkoncontribs": "abuse log",
"abusefilter-log-linkoncontribs-text": "Abuse log for {{GENDER:$1|this user}}",

View file

@ -123,6 +123,7 @@
"abusefilter-log-details-ip": "Row label in private log details.",
"abusefilter-log-details-checkuser": "Text to use as link to [[Special:Checkuser]] for the given IP.\n{{Identical|Check user}}",
"abusefilter-log-noactions": "Text displayed in Special:AbuseLog when a rule was triggered, but no action was taken.\n{{Identical|None}}",
"abusefilter-log-noactions-filter": "Text displayed in the dropdown menu on Special:AbuseLog when a user tries fo filter the logs for those where a rule was triggered, but no action was taken.\n{{Identical|None}}",
"abusefilter-log-details-diff": "Header for differences between two edits in log details.",
"abusefilter-log-linkoncontribs": "Link text added on [[Special:Contributions]] and other relevant special pages.\n{{Identical|Abuse log}}",
"abusefilter-log-linkoncontribs-text": "Title for link added on [[Special:Contributions]] and other relevant special pages. Parameters:\n* $1 is the target user name used for GENDER.",

View file

@ -243,23 +243,29 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
];
$filterableActions = $this->getAllFilterableActions();
$actions = array_combine( $filterableActions, $filterableActions );
$actions[ $this->msg( 'abusefilter-log-search-action-other' )->text() ] = 'other';
$actions[ $this->msg( 'abusefilter-log-search-action-any' )->text() ] = 'any';
ksort( $actions );
$actions = array_merge(
[ $this->msg( 'abusefilter-log-search-action-any' )->text() => 'any' ],
$actions,
[ $this->msg( 'abusefilter-log-search-action-other' )->text() => 'other' ]
);
$formDescriptor['SearchAction'] = [
'label-message' => 'abusefilter-log-search-action-label',
'type' => 'select',
'options' => $actions,
'default' => 'any',
];
$options = [
$this->msg( 'abusefilter-log-noactions' )->text() => 'noactions',
$this->msg( 'abusefilter-log-search-action-taken-any' )->text() => '',
];
$options = [];
foreach ( $this->getAllActions() as $action ) {
$key = AbuseFilter::getActionDisplay( $action );
$options[$key] = $action;
}
ksort( $options );
$options = array_merge(
[ $this->msg( 'abusefilter-log-search-action-taken-any' )->text() => '' ],
$options,
[ $this->msg( 'abusefilter-log-noactions-filter' )->text() => 'noactions' ]
);
$formDescriptor['SearchActionTaken'] = [
'label-message' => 'abusefilter-log-search-action-taken-label',
'type' => 'select',