mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
settings: Add live update code for realm-level defaults settings.
This commit adds code for live-updating the realm-level default settings page which contains only display settings as of now. This commit also adds realm_user_settings_defaults object to zpage_params so that we can write the tests.
This commit is contained in:
@@ -102,6 +102,8 @@ try {
|
||||
require("../../static/js/page_params");
|
||||
namespace.mock_esm("../../static/js/user_settings", zpage_params);
|
||||
require("../../static/js/user_settings");
|
||||
namespace.mock_esm("../../static/js/realm_user_settings_defaults", zpage_params);
|
||||
require("../../static/js/realm_user_settings_defaults");
|
||||
|
||||
run_one_module(file);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.page_params = {};
|
||||
exports.realm_user_settings_defaults = {};
|
||||
exports.user_settings = {};
|
||||
|
||||
exports.reset = () => {
|
||||
@@ -14,4 +15,9 @@ exports.reset = () => {
|
||||
delete exports.user_settings[field];
|
||||
}
|
||||
}
|
||||
for (const field in exports.realm_user_settings_defaults) {
|
||||
if (Object.prototype.hasOwnProperty.call(exports.realm_user_settings_defaults, field)) {
|
||||
delete exports.realm_user_settings_defaults[field];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user