From a079bb811b9577be0602b09a12bbc186f9786473 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Sun, 16 Apr 2023 10:03:06 +0530 Subject: [PATCH] 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. --- tools/test-js-with-node | 2 +- web/src/settings_sections.js | 6 +++--- ...ettings_muted_topics.js => settings_user_topics.js} | 0 ...ted_topics.test.js => settings_user_topics.test.js} | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) rename web/src/{settings_muted_topics.js => settings_user_topics.js} (100%) rename web/tests/{settings_muted_topics.test.js => settings_user_topics.test.js} (91%) diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 1506904b24..7efc6d8899 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -160,7 +160,6 @@ EXEMPT_FILES = make_set( "web/src/settings_exports.js", "web/src/settings_invites.js", "web/src/settings_linkifiers.js", - "web/src/settings_muted_topics.js", "web/src/settings_muted_users.js", "web/src/settings_notifications.js", "web/src/settings_org.js", @@ -174,6 +173,7 @@ EXEMPT_FILES = make_set( "web/src/settings_toggle.js", "web/src/settings_ui.js", "web/src/settings_user_groups_legacy.js", + "web/src/settings_user_topics.js", "web/src/settings_users.js", "web/src/setup.js", "web/src/spectators.js", diff --git a/web/src/settings_sections.js b/web/src/settings_sections.js index 55b60af9b0..d21cf3dea1 100644 --- a/web/src/settings_sections.js +++ b/web/src/settings_sections.js @@ -8,7 +8,6 @@ import * as settings_emoji from "./settings_emoji"; import * as settings_exports from "./settings_exports"; import * as settings_invites from "./settings_invites"; 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_notifications from "./settings_notifications"; 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_streams from "./settings_streams"; 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"; 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("alert-words", alert_words_ui.set_up_alert_words); 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); // org @@ -113,7 +113,7 @@ export function reset_sections() { settings_profile_fields.reset(); settings_streams.reset(); settings_user_groups.reset(); - settings_muted_topics.reset(); + settings_user_topics.reset(); settings_muted_users.reset(); alert_words_ui.reset(); // settings_users doesn't need a reset() diff --git a/web/src/settings_muted_topics.js b/web/src/settings_user_topics.js similarity index 100% rename from web/src/settings_muted_topics.js rename to web/src/settings_user_topics.js diff --git a/web/tests/settings_muted_topics.test.js b/web/tests/settings_user_topics.test.js similarity index 91% rename from web/tests/settings_muted_topics.test.js rename to web/tests/settings_user_topics.test.js index 63afb9cade..d9300b26c1 100644 --- a/web/tests/settings_muted_topics.test.js +++ b/web/tests/settings_user_topics.test.js @@ -8,7 +8,7 @@ const $ = require("./lib/zjquery"); 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 user_topics = zrequire("user_topics"); @@ -42,11 +42,11 @@ run_test("settings", ({override}) => { populate_list_called = true; }); - settings_muted_topics.reset(); - assert.equal(settings_muted_topics.loaded, false); + settings_user_topics.reset(); + assert.equal(settings_user_topics.loaded, false); - settings_muted_topics.set_up(); - assert.equal(settings_muted_topics.loaded, true); + settings_user_topics.set_up(); + assert.equal(settings_user_topics.loaded, true); assert.ok(populate_list_called); const topic_change_handler = $("body").get_on_handler(