mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-15 11:46:55 +00:00
010a4d91a6
gateway/*/rest were copies of gateway/restProvider just passing a different provider. Docs were the same, they were untested, and looking at them they seemed like unnecessary abstraction. This patch removes the plain vs html structure, and separates gateways like before, by endpoint. There is a light utility in gateway/restFormatters.js that adapts the call from the rest gateway to use formatters.js functions. It needs testing, that I'll add in the next patch. The flow for creating a gateway ends up as follows: 1. index.js calls gateway/index#createGateway( mw.config ) 2. createGateway chooses based on wgPopupsGateway and invokes * mediawiki.js#createMediaWikiApiGateway or * rest.js#createRESTBaseGateway w/ restFormatters.js#parsePlainTextResponse or * rest.js#createRESTBaseGateway w/ restFormatters.js#parseHTMLResponse Changes: * Removed src/gateway/{plain,html}/rest.js * Extracted formatter functions to src/gateway/restFormatters.js * src/gateway/plain/mediawiki.js -> src/gateway/mediawiki.js * tests/node-qunit/gateway/plain/mediawiki.test.js -> tests/node-qunit/gateway/mediawiki.test.js * gateway/restProvider{,.test}.js -> gateway/rest{,.test}.js * Change gateway/index.js#createGateway to properly call the rest gateways with the rest formatters Bug: T165018 Change-Id: Ia75695dfc192aad5bc581a68882514bad6c29646 |
||
---|---|---|
.. | ||
index.test.js | ||
mediawiki.test.js | ||
rest.test.js |