user_topics: Rename 'settings_muted_topics.js'.

This commit renames 'settings_muted_topics.js'
to 'settings_user_topics.js' because the file now
supports the settings for topics with any visibility_policy,
not just MUTED.

It also renames the corresponding test file.
This commit is contained in:
Prakhar Pratyush 2023-04-16 10:03:06 +05:30 committed by Tim Abbott
parent d5846ab534
commit a079bb811b
4 changed files with 9 additions and 9 deletions

View File

@ -160,7 +160,6 @@ EXEMPT_FILES = make_set(
"web/src/settings_exports.js", "web/src/settings_exports.js",
"web/src/settings_invites.js", "web/src/settings_invites.js",
"web/src/settings_linkifiers.js", "web/src/settings_linkifiers.js",
"web/src/settings_muted_topics.js",
"web/src/settings_muted_users.js", "web/src/settings_muted_users.js",
"web/src/settings_notifications.js", "web/src/settings_notifications.js",
"web/src/settings_org.js", "web/src/settings_org.js",
@ -174,6 +173,7 @@ EXEMPT_FILES = make_set(
"web/src/settings_toggle.js", "web/src/settings_toggle.js",
"web/src/settings_ui.js", "web/src/settings_ui.js",
"web/src/settings_user_groups_legacy.js", "web/src/settings_user_groups_legacy.js",
"web/src/settings_user_topics.js",
"web/src/settings_users.js", "web/src/settings_users.js",
"web/src/setup.js", "web/src/setup.js",
"web/src/spectators.js", "web/src/spectators.js",

View File

@ -8,7 +8,6 @@ import * as settings_emoji from "./settings_emoji";
import * as settings_exports from "./settings_exports"; import * as settings_exports from "./settings_exports";
import * as settings_invites from "./settings_invites"; import * as settings_invites from "./settings_invites";
import * as settings_linkifiers from "./settings_linkifiers"; import * as settings_linkifiers from "./settings_linkifiers";
import * as settings_muted_topics from "./settings_muted_topics";
import * as settings_muted_users from "./settings_muted_users"; import * as settings_muted_users from "./settings_muted_users";
import * as settings_notifications from "./settings_notifications"; import * as settings_notifications from "./settings_notifications";
import * as settings_org from "./settings_org"; import * as settings_org from "./settings_org";
@ -17,6 +16,7 @@ import * as settings_profile_fields from "./settings_profile_fields";
import * as settings_realm_user_settings_defaults from "./settings_realm_user_settings_defaults"; import * as settings_realm_user_settings_defaults from "./settings_realm_user_settings_defaults";
import * as settings_streams from "./settings_streams"; import * as settings_streams from "./settings_streams";
import * as settings_user_groups from "./settings_user_groups_legacy"; import * as settings_user_groups from "./settings_user_groups_legacy";
import * as settings_user_topics from "./settings_user_topics";
import * as settings_users from "./settings_users"; import * as settings_users from "./settings_users";
const load_func_dict = new Map(); // group -> function const load_func_dict = new Map(); // group -> function
@ -60,7 +60,7 @@ export function initialize() {
load_func_dict.set("your-bots", settings_bots.set_up); load_func_dict.set("your-bots", settings_bots.set_up);
load_func_dict.set("alert-words", alert_words_ui.set_up_alert_words); load_func_dict.set("alert-words", alert_words_ui.set_up_alert_words);
load_func_dict.set("uploaded-files", attachments_ui.set_up_attachments); load_func_dict.set("uploaded-files", attachments_ui.set_up_attachments);
load_func_dict.set("topics", settings_muted_topics.set_up); load_func_dict.set("topics", settings_user_topics.set_up);
load_func_dict.set("muted-users", settings_muted_users.set_up); load_func_dict.set("muted-users", settings_muted_users.set_up);
// org // org
@ -113,7 +113,7 @@ export function reset_sections() {
settings_profile_fields.reset(); settings_profile_fields.reset();
settings_streams.reset(); settings_streams.reset();
settings_user_groups.reset(); settings_user_groups.reset();
settings_muted_topics.reset(); settings_user_topics.reset();
settings_muted_users.reset(); settings_muted_users.reset();
alert_words_ui.reset(); alert_words_ui.reset();
// settings_users doesn't need a reset() // settings_users doesn't need a reset()

View File

@ -8,7 +8,7 @@ const $ = require("./lib/zjquery");
const list_widget = mock_esm("../src/list_widget"); const list_widget = mock_esm("../src/list_widget");
const settings_muted_topics = zrequire("settings_muted_topics"); const settings_user_topics = zrequire("settings_user_topics");
const stream_data = zrequire("stream_data"); const stream_data = zrequire("stream_data");
const user_topics = zrequire("user_topics"); const user_topics = zrequire("user_topics");
@ -42,11 +42,11 @@ run_test("settings", ({override}) => {
populate_list_called = true; populate_list_called = true;
}); });
settings_muted_topics.reset(); settings_user_topics.reset();
assert.equal(settings_muted_topics.loaded, false); assert.equal(settings_user_topics.loaded, false);
settings_muted_topics.set_up(); settings_user_topics.set_up();
assert.equal(settings_muted_topics.loaded, true); assert.equal(settings_user_topics.loaded, true);
assert.ok(populate_list_called); assert.ok(populate_list_called);
const topic_change_handler = $("body").get_on_handler( const topic_change_handler = $("body").get_on_handler(