mediawiki-extensions-Popups/tests/node-qunit
Jon Robson 6924a89b07 Generalize settings code
A new REGISTER_SETTING action replaces the BOOT action for
registering settings. This allows custom preview types to be
associated with a setting. They do this by adding the enabled
property to the module they provide to mw.popups.register

Every time the new action is called, we refresh the settings
dialog UI with the new settings.

Previously the settings dialog was hardcoded, but now it is generated
from the registered preview types by deriving associated messages
and checking they exist, so by default custom types will not show
up in the settings.

Benefits:
* This change empowers us to add a setting for Math previews to allow
them to be enabled or disabled.
* Allows us to separate references as its own module

Additional notes:
* The syncUserSettings.js changeListener is no longer needed as the logic
for this is handled inside the "userSettings" change listener in response to
the "settings" reducer which is responding to
SETTINGS_CHANGE and REGISTER_SETTING actions.

Upon merging:
* https://www.mediawiki.org/wiki/Extension:Popups#Extensibility will be
updated to detail how a setting can be registered.

Bug: T334261
Bug: T326692
Change-Id: Ie11057052fb9035944f2b79a17fb486f97102994
2023-10-17 15:08:15 +00:00
..
changeListeners Generalize settings code 2023-10-17 15:08:15 +00:00
gateway Prefer native JavaScript to jQuery 2023-05-21 16:53:50 +00:00
instrumentation Remove Popups instrumentation 2021-07-29 17:01:01 +00:00
integrations Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
preview TypeError: n.closest is not a function 2023-07-10 11:48:40 -07:00
reducers Generalize settings code 2023-10-17 15:08:15 +00:00
ui Generalize settings code 2023-10-17 15:08:15 +00:00
.eslintrc.json Discourage jQuery usage in Popups extension 2023-06-13 15:39:57 -07:00
actions.test.js Generalize settings code 2023-10-17 15:08:15 +00:00
bracketedPixelRatio.test.js build: Update linters 2018-09-11 10:26:35 -07:00
changeListener.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
container.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
counts.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
experiments.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
formatter.test.js Remove obsolete mediaWiki and jQuery aliases 2019-10-22 09:30:46 +02:00
integration.test.js Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
isPagePreviewsEnabled.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
isReferencePreviewsEnabled.test.js IP masked users use localStorage for settings 2023-06-14 08:16:50 -07:00
previewBehavior.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
run.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
setUserConfigFlags.test.js Merge duplicate ReferencePreviews Beta feature flag 2021-04-21 10:46:05 +02:00
stubs.js IP masked users use localStorage for settings 2023-06-14 08:16:50 -07:00
title.test.js build: Upgrade eslint-config-wikimedia from 0.17.0 to 0.20.0 2021-05-03 12:31:52 -07:00
userSettings.test.js build: Update eslint-config-wikimedia to 0.22.1 2022-02-28 13:18:24 +00:00
wait.test.js Fixes flakey test: it should resolve after waiting 2023-05-09 10:43:56 -07:00