refactor: Rename settings/muted-topics code to be specific.

This is a prep change for implementing mute
users feature, which will add another settings
page with similar naming conventions.
This commit is contained in:
Abhijeet Prasad Bodas 2021-03-27 16:09:36 +05:30 committed by Tim Abbott
parent 3a9dfc02e6
commit 586f8fe9e0
4 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,7 @@ const $ = require("../zjsunit/zjquery");
mock_cjs("jquery", $); mock_cjs("jquery", $);
const muting_ui = mock_esm("../../static/js/muting_ui"); const muting_ui = mock_esm("../../static/js/muting_ui");
const settings_muting = zrequire("settings_muting"); const settings_muted_topics = zrequire("settings_muted_topics");
const stream_data = zrequire("stream_data"); const stream_data = zrequire("stream_data");
const muting = zrequire("muting"); const muting = zrequire("muting");
@ -38,11 +38,11 @@ run_test("settings", () => {
set_up_topic_ui_called = true; set_up_topic_ui_called = true;
}; };
settings_muting.reset(); settings_muted_topics.reset();
assert.equal(settings_muting.loaded, false); assert.equal(settings_muted_topics.loaded, false);
settings_muting.set_up(); settings_muted_topics.set_up();
assert.equal(settings_muting.loaded, true); assert.equal(settings_muted_topics.loaded, true);
const topic_click_handler = $("body").get_on_handler("click", ".settings-unmute-topic"); const topic_click_handler = $("body").get_on_handler("click", ".settings-unmute-topic");
assert.equal(typeof topic_click_handler, "function"); assert.equal(typeof topic_click_handler, "function");

View File

@ -11,7 +11,7 @@ import * as message_lists from "./message_lists";
import * as muting from "./muting"; import * as muting from "./muting";
import * as overlays from "./overlays"; import * as overlays from "./overlays";
import * as recent_topics from "./recent_topics"; import * as recent_topics from "./recent_topics";
import * as settings_muting from "./settings_muting"; import * as settings_muted_topics from "./settings_muted_topics";
import * as stream_data from "./stream_data"; import * as stream_data from "./stream_data";
import * as stream_list from "./stream_list"; import * as stream_list from "./stream_list";
import * as stream_popover from "./stream_popover"; import * as stream_popover from "./stream_popover";
@ -36,7 +36,7 @@ export function rerender_on_topic_update() {
if (message_lists.current !== message_lists.home) { if (message_lists.current !== message_lists.home) {
message_lists.home.update_topic_muting_and_rerender(); message_lists.home.update_topic_muting_and_rerender();
} }
if (overlays.settings_open() && settings_muting.loaded) { if (overlays.settings_open() && settings_muted_topics.loaded) {
set_up_muted_topics_ui(); set_up_muted_topics_ui();
} }
} }

View File

@ -8,7 +8,7 @@ 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_muting from "./settings_muting"; import * as settings_muted_topics from "./settings_muted_topics";
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";
import * as settings_profile_fields from "./settings_profile_fields"; import * as settings_profile_fields from "./settings_profile_fields";
@ -49,7 +49,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("muted-topics", settings_muting.set_up); load_func_dict.set("muted-topics", settings_muted_topics.set_up);
// org // org
load_func_dict.set("org_misc", settings_org.set_up); load_func_dict.set("org_misc", settings_org.set_up);
@ -95,6 +95,6 @@ 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_muting.reset(); settings_muted_topics.reset();
// settings_users doesn't need a reset() // settings_users doesn't need a reset()
} }