mediawiki-extensions-Popups/tests/node-qunit
Thiemo Kreuz c281bb9302 Clean up code enabling individual popup types
We still have 2 different mechanisms in place, maybe even 3:
* We simplify the CSS selector when we know a popup type is
  disabled, and it's impossible an anonymous user can enable it
  at run-time.
* We create that "initiallyEnabled" map that allows anonymous
  users to toggle the individual popup types at run-time.
* This map is also used to check if the footer link should be
  shown.
* There is also a wgPopupsReferencePreviews global that acts as
  a "kill switch". However, this is not a pure feature flag,
  but incorporates the user setting for registered users. This
  is currently partly redundant (checking
  `mw.user.options.get( 'popupsreferencepreviews' )` does the
  same) and can be removed later when the feature flag is not
  needed any more.

The footer link currently acts odd because anonymous users are
unable to enable ReferencePreviews, but get the footer link.

This patch introduces a 3-state model:
* `true` acts as before.
* `false` means a popup type is disabled, but anonymous users
  can enable it (i.e. this is the opt-out behavior for anonymous
  users).
* `null` means a popup type is not available at run-time, for
  nobody. Anonymous users can't do anything about this.
  Registered users must leave the page and change a setting.

Bug: T277640
Change-Id: Id8d1396c09cf0f706034a66f9cd3c880a8b33df8
2021-04-21 19:38:25 +02:00
..
changeListeners Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
gateway Much more relaxed reference type detection 2021-02-22 11:55:03 +01:00
instrumentation Minor code cleanups, e.g. utilizing arrow functions 2020-10-30 11:31:12 +01:00
integrations Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
preview eslint: Update to 0.15.3 2020-04-25 22:32:53 +01:00
reducers Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
ui Changed radio button to checkbox in anonymous user settings window 2021-04-21 14:13:47 +02:00
.eslintrc.json build: Update eslint-config-wikimedia to 0.16.2 2020-06-26 17:05:56 +01:00
actions.test.js Allow to disable/enable popup types individually 2021-04-15 11:30:36 +02:00
bracketedPixelRatio.test.js build: Update linters 2018-09-11 10:26:35 -07:00
changeListener.test.js build: Update linters 2018-09-11 10:26:35 -07:00
container.test.js build: Update linters 2018-09-11 10:26:35 -07:00
counts.test.js eslint: Enforce template-curly-spacing 2019-08-15 10:24:43 +02:00
experiments.test.js build: Update eslint-config-wikimedia to 0.10.0 2019-01-31 11:05:33 +01:00
formatter.test.js Remove obsolete mediaWiki and jQuery aliases 2019-10-22 09:30:46 +02:00
getPageviewTracker.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 Clean up code enabling individual popup types 2021-04-21 19:38:25 +02:00
isReferencePreviewsEnabled.test.js Clean up code enabling individual popup types 2021-04-21 19:38:25 +02:00
previewBehavior.test.js Remove obsolete mediaWiki and jQuery aliases 2019-10-22 09:30:46 +02:00
run.js Use 6.1.0 of @wikimedia/mw-node-qunit 2019-10-22 10:42:49 -07:00
setUserConfigFlags.test.js Merge duplicate ReferencePreviews Beta feature flag 2021-04-21 10:46:05 +02:00
stubs.js Remove not needed userSettings.hasIsEnabled() 2021-04-08 11:57:52 +02:00
title.test.js Remove obsolete mediaWiki and jQuery aliases 2019-10-22 09:30:46 +02:00
userSettings.test.js Expand userSettings module for reference previews 2021-04-13 12:19:49 +02:00
wait.test.js Fix action reducer forgetting *all* duplicate dwell actions 2019-08-23 10:08:19 +02:00