RCFilters: Minimize url string
authorMoriel Schottlender <moriel@gmail.com>
Mon, 15 May 2017 21:43:33 +0000 (14:43 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Sun, 28 May 2017 09:05:59 +0000 (12:05 +0300)
commit2dea830ecce09c2de5f5186fd667e607ad9da7b5
tree4512e785b14b6731caa5656f0950f26c34c850a3
parent930f8f7a4ac2f5f7559f50484f8a06e81b854df8
RCFilters: Minimize url string

In order to minimize the URL query, we use a base representation of the
parameters as if they were all '0' or '' and internally expand on it.

- Only display parameters with a value that is not empty or '0' in the
  URI. Any parameter that is missing from the URI is presumed to have
  an empty value.
- Stop pushing defaultParameters everywhere. Default parameters should
  only be considered either on load (when/if needed) or when the user
  actively requests for them.
- Minimize parameters to the URL, and expand when reading into the model.

Similar to using base filters, we can use a representation of base
parameters to make the URL small but the representation all-encompassing.

Bug: T165445
Change-Id: I1d21c38137fde51fcd561e2de24592722bf532c6
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
tests/qunit/suites/resources/mediawiki.rcfilters/dm.FiltersViewModel.test.js