Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
streams-settings: Update ID of overlay container element.
Lauryn Menard141e1d4c9077
diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.htmlindex 095399d18a5..d50a8e967f4 100644--- a/templates/zerver/app/index.html+++ b/templates/zerver/app/index.html@@ -141,7 +141,7 @@</div><div id="tooltip-templates-container"></div>-<div id="streams_overlay_container"></div>+<div id="channels_overlay_container"></div><div id="groups_overlay_container"></div><div id="drafts_table"></div><div id="scheduled_messages_overlay_container"></div>diff --git a/web/src/stream_edit.js b/web/src/stream_edit.jsindex b63fc756fcc..042e8fc8da3 100644--- a/web/src/stream_edit.js+++ b/web/src/stream_edit.js@@ -275,7 +275,7 @@ export function show_settings_for(node) {stream_ui_updates.enable_or_disable_permission_settings_in_edit_panel(sub);setup_dropdown(sub, slim_sub);- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".stream-creation-confirmation-banner .main-view-banner-close-button",(e) => {@@ -438,7 +438,7 @@ export function initialize() {stream_settings_components.sub_or_unsub(sub);});- $("#streams_overlay_container").on("click", "#open_stream_info_modal", (e) => {+ $("#channels_overlay_container").on("click", "#open_stream_info_modal", (e) => {e.preventDefault();e.stopPropagation();const stream_id = get_stream_id(e.target);@@ -468,7 +468,7 @@ export function initialize() {});});- $("#streams_overlay_container").on("keypress", "#change_stream_description", (e) => {+ $("#channels_overlay_container").on("keypress", "#change_stream_description", (e) => {// Stream descriptions cannot be multiline, so disable enter key// to prevent new lineif (keydown_util.is_enter_event(e)) {@@ -477,7 +477,7 @@ export function initialize() {return true;});- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".stream-permissions-warning-banner .main-view-banner-close-button",(event) => {@@ -486,7 +486,7 @@ export function initialize() {},);- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".stream-permissions-warning-banner .main-view-banner-action-button",(event) => {@@ -497,7 +497,7 @@ export function initialize() {const stream_id = Number.parseInt($target.attr("data-stream-id"), 10);// Makes sure we take the correct stream_row.const $stream_row = $(- `#streams_overlay_container div.stream-row[data-stream-id='${CSS.escape(+ `#channels_overlay_container div.stream-row[data-stream-id='${CSS.escape(stream_id,)}']`,);@@ -525,7 +525,7 @@ export function initialize() {dialog_widget.submit_api_request(channel.patch, url, data);}- $("#streams_overlay_container").on("click", ".copy_email_button", (e) => {+ $("#channels_overlay_container").on("click", ".copy_email_button", (e) => {e.preventDefault();e.stopPropagation();@@ -547,13 +547,13 @@ export function initialize() {});});- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".subsection-parent .reset-stream-notifications-button",stream_notification_reset,);- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("change",".sub_setting_checkbox .sub_setting_control",stream_setting_changed,@@ -561,7 +561,7 @@ export function initialize() {// This handler isn't part of the normal edit interface; it's the convenient// checkmark in the subscriber list.- $("#streams_overlay_container").on("click", ".sub_unsub_button", (e) => {+ $("#channels_overlay_container").on("click", ".sub_unsub_button", (e) => {if ($(e.currentTarget).hasClass("disabled")) {// We do not allow users to subscribe themselves to private streams.return;@@ -570,7 +570,7 @@ export function initialize() {const sub = get_sub_for_target(e.target);// Makes sure we take the correct stream_row.const $stream_row = $(- `#streams_overlay_container div.stream-row[data-stream-id='${CSS.escape(+ `#channels_overlay_container div.stream-row[data-stream-id='${CSS.escape(sub.stream_id,)}']`,);@@ -585,7 +585,7 @@ export function initialize() {e.stopPropagation();});- $("#streams_overlay_container").on("click", ".deactivate", (e) => {+ $("#channels_overlay_container").on("click", ".deactivate", (e) => {e.preventDefault();e.stopPropagation();@@ -648,13 +648,13 @@ export function initialize() {$(".dialog_submit_button").attr("data-stream-id", stream_id);});- $("#streams_overlay_container").on("click", ".stream-row", function (e) {+ $("#channels_overlay_container").on("click", ".stream-row", function (e) {if ($(e.target).closest(".check, .subscription_settings").length === 0) {open_edit_panel_for_row(this);}});- $("#streams_overlay_container").on("change", ".stream_message_retention_setting", (e) => {+ $("#channels_overlay_container").on("change", ".stream_message_retention_setting", (e) => {const message_retention_setting_dropdown_value = e.target.value;settings_components.change_element_block_display_property("stream_message_retention_custom_input",@@ -662,7 +662,7 @@ export function initialize() {);});- $("#streams_overlay_container").on("change input", "input, select, textarea", (e) => {+ $("#channels_overlay_container").on("change input", "input, select, textarea", (e) => {e.preventDefault();e.stopPropagation();@@ -683,7 +683,7 @@ export function initialize() {return true;});- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".subsection-header .subsection-changes-save button",(e) => {@@ -717,7 +717,7 @@ export function initialize() {},);- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".subsection-header .subsection-changes-discard button",(e) => {diff --git a/web/src/stream_edit_subscribers.js b/web/src/stream_edit_subscribers.jsindex ce2796e0ac9..3fe1e7d9f08 100644--- a/web/src/stream_edit_subscribers.js+++ b/web/src/stream_edit_subscribers.js@@ -389,13 +389,13 @@ export function rerender_subscribers_list(sub) {export function initialize() {add_subscribers_pill.set_up_handlers({get_pill_widget: () => pill_widget,- $parent_container: $("#streams_overlay_container"),+ $parent_container: $("#channels_overlay_container"),pill_selector: ".edit_subscribers_for_stream .pill-container",button_selector: ".edit_subscribers_for_stream .add-subscriber-button",action: subscribe_new_users,});- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("submit",".edit_subscribers_for_stream .subscriber_list_remove form",(e) => {diff --git a/web/src/stream_edit_toggler.ts b/web/src/stream_edit_toggler.tsindex 8e35a2b337f..c5b5ff8c4f5 100644--- a/web/src/stream_edit_toggler.ts+++ b/web/src/stream_edit_toggler.ts@@ -25,7 +25,7 @@ export function setup_toggler(): void {$(".stream_section").hide();$(`[data-stream-section="${CSS.escape(key)}"]`).show();select_tab = key;- const $stream_header = $("#streams_overlay_container .stream_settings_header");+ const $stream_header = $("#channels_overlay_container .stream_settings_header");const stream_id = Number.parseInt($stream_header.attr("data-stream-id") ?? "", 10);const sub = sub_store.get(stream_id);if (sub) {diff --git a/web/src/stream_settings_components.js b/web/src/stream_settings_components.jsindex f32de3986d9..d32888e29b1 100644--- a/web/src/stream_settings_components.js+++ b/web/src/stream_settings_components.js@@ -210,7 +210,9 @@ export function unsubscribe_from_private_stream(sub) {let $stream_row;if (overlays.streams_open()) {$stream_row = $(- "#streams_overlay_container div.stream-row[data-stream-id='" + sub.stream_id + "']",+ "#channels_overlay_container div.stream-row[data-stream-id='" ++ sub.stream_id ++ "']",);}diff --git a/web/src/stream_settings_ui.js b/web/src/stream_settings_ui.jsindex 20a28bea625..adbb2e5f884 100644--- a/web/src/stream_settings_ui.js+++ b/web/src/stream_settings_ui.js@@ -226,7 +226,7 @@ export function add_sub_to_table(sub) {sub: stream_settings_data.get_sub_for_settings(sub),});scroll_util- .get_content_element($("#streams_overlay_container .settings"))+ .get_content_element($("#channels_overlay_container .settings")).append($(settings_html));if (stream_create.get_name() === sub.name) {@@ -412,7 +412,7 @@ export function render_left_panel_superset() {subscriptions: stream_settings_data.get_updated_unsorted_subs(),});- scroll_util.get_content_element($("#streams_overlay_container .streams-list")).html(html);+ scroll_util.get_content_element($("#channels_overlay_container .streams-list")).html(html);}export function update_empty_left_panel_message() {@@ -425,7 +425,7 @@ export function update_empty_left_panel_message() {// displayed in panel or not.has_streams =stream_data.subscribed_subs().length ||- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length;} else {has_streams = stream_data.get_unsorted_subs().length;}@@ -457,7 +457,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {const stream_ids = [];- for (const row of $("#streams_overlay_container .stream-row")) {+ for (const row of $("#channels_overlay_container .stream-row")) {const stream_id = stream_id_for_row(row);stream_ids.push(stream_id);}@@ -472,7 +472,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {hidden_ids.add(stream_id);}- for (const row of $("#streams_overlay_container .stream-row")) {+ for (const row of $("#channels_overlay_container .stream-row")) {const stream_id = stream_id_for_row(row);// Below code goes away if we don't do sort-DOM-in-place.@@ -491,7 +491,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {for (const stream_id of all_stream_ids) {scroll_util- .get_content_element($("#streams_overlay_container .streams-list"))+ .get_content_element($("#channels_overlay_container .streams-list")).append(widgets.get(stream_id));}update_empty_left_panel_message();@@ -593,7 +593,7 @@ export function setup_page(callback) {},});- sort_toggler.get().prependTo("#streams_overlay_container .list-toggler-container");+ sort_toggler.get().prependTo("#channels_overlay_container .list-toggler-container");// Reset our internal state to reflect that we're initially in// the "Subscribed" tab if we're reopening "Stream settings".@@ -611,7 +611,7 @@ export function setup_page(callback) {if (should_list_all_streams()) {const $toggler_elem = toggler.get();- $("#streams_overlay_container .list-toggler-container").prepend($toggler_elem);+ $("#channels_overlay_container .list-toggler-container").prepend($toggler_elem);}if (current_user.is_guest) {toggler.disable_tab("all-streams");@@ -622,7 +622,7 @@ export function setup_page(callback) {}function populate_and_fill() {- $("#streams_overlay_container").empty();+ $("#channels_overlay_container").empty();// TODO: Ideally we'd indicate in some way what stream types// the user can create, by showing other options as disabled.@@ -658,7 +658,7 @@ export function setup_page(callback) {};const rendered = render_stream_settings_overlay(template_data);- $("#streams_overlay_container").append($(rendered));+ $("#channels_overlay_container").append($(rendered));render_left_panel_superset();initialize_components();@@ -910,12 +910,12 @@ export function update_stream_privacy_choices(policy) {}export function initialize() {- $("#streams_overlay_container").on("click", ".create_stream_button", (e) => {+ $("#channels_overlay_container").on("click", ".create_stream_button", (e) => {e.preventDefault();open_create_stream();});- $("#streams_overlay_container").on("click", "#stream_creation_form [data-dismiss]", (e) => {+ $("#channels_overlay_container").on("click", "#stream_creation_form [data-dismiss]", (e) => {e.preventDefault();// we want to make sure that the click is not just a simulated// click; this fixes an issue where hitting "Enter" would@@ -925,17 +925,17 @@ export function initialize() {}});- $("#streams_overlay_container").on("click", ".email-address", function () {+ $("#channels_overlay_container").on("click", ".email-address", function () {selectText(this);});- $("#streams_overlay_container").on(+ $("#channels_overlay_container").on("click",".stream-row, .create_stream_button",show_right_section,);- $("#streams_overlay_container").on("click", ".fa-chevron-left", () => {+ $("#channels_overlay_container").on("click", ".fa-chevron-left", () => {$(".right").removeClass("show");$(".subscriptions-header").removeClass("slide-left");});diff --git a/web/src/stream_ui_updates.js b/web/src/stream_ui_updates.jsindex 46dba119f63..0046eab40b1 100644--- a/web/src/stream_ui_updates.js+++ b/web/src/stream_ui_updates.js@@ -309,7 +309,7 @@ export function update_permissions_banner(sub) {export function update_notification_setting_checkbox(notification_name) {// This is in the right panel (Personal settings).- const $stream_row = $("#streams_overlay_container .stream-row.active");+ const $stream_row = $("#channels_overlay_container .stream-row.active");if (!$stream_row.length) {return;}diff --git a/web/tests/stream_events.test.js b/web/tests/stream_events.test.jsindex 49276d82b66..deaf3f64142 100644--- a/web/tests/stream_events.test.js+++ b/web/tests/stream_events.test.js@@ -314,7 +314,7 @@ test("marked_subscribed (normal)", ({override}) => {});override(user_profile, "update_user_profile_streams_list_for_users", noop);- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;stream_events.mark_subscribed(sub, [], "blue");@@ -345,7 +345,7 @@ test("marked_subscribed (color)", ({override}) => {override(color_data, "pick_color", () => "green");override(user_profile, "update_user_profile_streams_list_for_users", noop);- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;// narrow state is undefined{@@ -376,7 +376,7 @@ test("marked_subscribed (emails)", ({override}) => {override(stream_settings_ui, "update_settings_for_subscribed", subs_stub.f);override(user_profile, "update_user_profile_streams_list_for_users", noop);- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;assert.ok(!stream_data.is_subscribed_by_name(sub.name));@@ -403,7 +403,7 @@ test("mark_unsubscribed (update_settings_for_unsubscribed)", ({override}) => {override(unread_ui, "update_unread_counts", noop);override(user_profile, "update_user_profile_streams_list_for_users", noop);- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;stream_events.mark_unsubscribed(sub);const args = stub.get_args("sub");@@ -431,7 +431,7 @@ test("mark_unsubscribed (render_title_area)", ({override}) => {override(user_profile, "update_user_profile_streams_list_for_users", noop);override(buddy_list, "populate", noop);- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;stream_events.mark_unsubscribed(sub);diff --git a/web/tests/stream_settings_ui.test.js b/web/tests/stream_settings_ui.test.jsindex 5a9f195cbaf..930925a6ea8 100644--- a/web/tests/stream_settings_ui.test.js+++ b/web/tests/stream_settings_ui.test.js@@ -130,7 +130,7 @@ run_test("redraw_left_panel", ({mock_template}) => {$(sub_row).detach = () => sub_row;}- $.create("#streams_overlay_container .stream-row", {children: sub_stubs});+ $.create("#channels_overlay_container .stream-row", {children: sub_stubs});let ui_called = false;scroll_util.reset_scrollbar = ($elem) => {@@ -145,7 +145,7 @@ run_test("redraw_left_panel", ({mock_template}) => {assert.ok(!$denmark_row.hasClass("active"));function test_filter(params, expected_streams) {- $("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;+ $("#channels_overlay_container .stream-row:not(.notdisplayed)").length = 0;const stream_ids = stream_settings_ui.redraw_left_panel(params);assert.deepEqual(stream_ids,