refactor: Extract settings_config.

This moves some code from settings_display.js
into the new module settings_config.js.

Extracting this module breaks some dependencies
on settings_display.js (which has some annoying
transitive dependencies, including jQuery).

In particular this isolates stream_data from
from settings_display.js.

Two of the three structures that we moved here
weren't even directly used by settings_display.js,
since we do a lot of rendering in the modules
admin.js and setting.js.

We make get_all_display_settings() a function
to avoid a require-time dependency on page_params.

Breaking the dependencies simplifies a few
node tests.

Most of the node test complexity came from the
following commit in March 2019:

5a130097bf

The commit itself seems harmless enough, but
dependencies can have a somewhat "viral" nature,
where making stream_data depend on settings_display
caused us to modify four different node tests.
This commit is contained in:
Steve Howell
2020-02-21 13:26:11 +00:00
committed by Tim Abbott
parent 8aae02de68
commit 5e8279c2fb
10 changed files with 75 additions and 58 deletions

View File

@@ -111,6 +111,7 @@ EXEMPT_FILES = {
'static/js/server_events.js',
'static/js/settings_account.js',
'static/js/settings_bots.js',
'static/js/settings_config.js',
'static/js/settings_display.js',
'static/js/settings_emoji.js',
'static/js/settings_exports.js',