Back-end of new RecentChanges page, refactoring
authorMatthew Flaschen <mflaschen@wikimedia.org>
Tue, 14 Feb 2017 07:55:37 +0000 (02:55 -0500)
committerCatrope <roan@wikimedia.org>
Sat, 11 Mar 2017 01:42:01 +0000 (01:42 +0000)
commitaa063f4c5a19e2a267e694e3614af1c3ce4498da
tree7310115f92f9b479a6b0fc7319788ec348c93534
parente20a4a8c18c108158f7b29342408dec2d6659d70
Back-end of new RecentChanges page, refactoring

Generate old RC, Related changes (it was already displayed and working
on 'Related changes' before this change), and Watchlist/etc. and data
for new UI from back-end.

This moves everything used for defining the old (unstructured) and new
(structured) filters into unified objects, ChangesListFilter and
ChangesListFilterGroup (and sub-classes).

This includes the query logic (see below) and logic for adding
CSS attribution classes.

This is a breaking change (for subclasses of ChangesListSpecialpage)
due to the signature (and name) change of buildMainQueryConds and
doMainQuery.  An alternative that I don't think is a breaking change
would be to put the filter->DB logic in runMainQueryHook, but then it's
doing more than just running a hook.

This is because it used to only build $conds here, but it's clear from
filterOnUserExperienceLevel filters need more than this.  I added all
the DB parameters from the hook, but this could be debated.

I have an checked and fixed the WMF-deployed extensions affected by
this.

Other than that, there should be full back-compat (including legacy
filters not using the new system).

* add hidepatrolled/hideunpatrolled to new UI.

* Move userExpLevel from RC to ChangesListSpecialPage.  Although for
now the structured UI only displays on RC anyway, when it displays on
watchlist, it seems we'll want userExpLevel there.

  Change this to make 'all' exclude unregistered users.

* Don't have front-end convert none-selected to 'all' on string_options.

* Needs the hideanons/hideliu special redirect to be done before this
is merged (T151873)

Bug: T152754
Bug: T152797
Change-Id: Iec2d82f6a830403d1c948a280efa58992e0cdee7
29 files changed:
RELEASE-NOTES-1.29
autoload.php
docs/hooks.txt
includes/changes/ChangesList.php
includes/changes/ChangesListBooleanFilter.php [new file with mode: 0644]
includes/changes/ChangesListBooleanFilterGroup.php [new file with mode: 0644]
includes/changes/ChangesListFilter.php [new file with mode: 0644]
includes/changes/ChangesListFilterGroup.php [new file with mode: 0644]
includes/changes/ChangesListStringOptionsFilter.php [new file with mode: 0644]
includes/changes/ChangesListStringOptionsFilterGroup.php [new file with mode: 0644]
includes/changes/EnhancedChangesList.php
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialWatchlist.php
languages/i18n/en.json
languages/i18n/qqq.json
resources/Resources.php
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
tests/common/TestsAutoLoader.php
tests/phpunit/includes/changes/ChangesListBooleanFilterGroupTest.php [new file with mode: 0644]
tests/phpunit/includes/changes/ChangesListBooleanFilterTest.php [new file with mode: 0644]
tests/phpunit/includes/changes/ChangesListStringOptionsFilterGroupTest.php [new file with mode: 0644]
tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php [new file with mode: 0644]
tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php [new file with mode: 0644]
tests/phpunit/includes/specials/SpecialRecentchangesTest.php
tests/qunit/suites/resources/mediawiki.rcfilters/dm.FiltersViewModel.test.js