mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
stream_settings: Update ID of overlay container element.
This commit renames ID of the container element of stream settings overlay to streams_overlay_container. This makes it consistent with the container element of settings overlay.
This commit is contained in:
@@ -106,7 +106,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="manage_streams_container"></div>
|
||||
<div id="streams_overlay_container"></div>
|
||||
<div id="manage_groups_container"></div>
|
||||
<div id="drafts_table"></div>
|
||||
<div id="scheduled_messages_overlay_container"></div>
|
||||
|
||||
@@ -413,7 +413,7 @@ export function initialize() {
|
||||
stream_settings_ui.sub_or_unsub(sub);
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("click", "#open_stream_info_modal", (e) => {
|
||||
$("#streams_overlay_container").on("click", "#open_stream_info_modal", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const stream_id = get_stream_id(e.target);
|
||||
@@ -441,7 +441,7 @@ export function initialize() {
|
||||
});
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("keypress", "#change_stream_description", (e) => {
|
||||
$("#streams_overlay_container").on("keypress", "#change_stream_description", (e) => {
|
||||
// Stream descriptions can not be multiline, so disable enter key
|
||||
// to prevent new line
|
||||
if (keydown_util.is_enter_event(e)) {
|
||||
@@ -475,7 +475,7 @@ export function initialize() {
|
||||
settings_ui.do_settings_change(channel.patch, url, data, $status_element);
|
||||
}
|
||||
|
||||
$("#manage_streams_container").on("click", ".copy_email_button", (e) => {
|
||||
$("#streams_overlay_container").on("click", ".copy_email_button", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -541,13 +541,13 @@ export function initialize() {
|
||||
});
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"change",
|
||||
"#sub_is_muted_setting .sub_setting_control",
|
||||
stream_is_muted_changed,
|
||||
);
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"change",
|
||||
".sub_setting_checkbox .sub_setting_control",
|
||||
stream_setting_changed,
|
||||
@@ -555,11 +555,11 @@ export function initialize() {
|
||||
|
||||
// This handler isn't part of the normal edit interface; it's the convenient
|
||||
// checkmark in the subscriber list.
|
||||
$("#manage_streams_container").on("click", ".sub_unsub_button", (e) => {
|
||||
$("#streams_overlay_container").on("click", ".sub_unsub_button", (e) => {
|
||||
const sub = get_sub_for_target(e.target);
|
||||
// Makes sure we take the correct stream_row.
|
||||
const $stream_row = $(
|
||||
`#manage_streams_container div.stream-row[data-stream-id='${CSS.escape(
|
||||
`#streams_overlay_container div.stream-row[data-stream-id='${CSS.escape(
|
||||
sub.stream_id,
|
||||
)}']`,
|
||||
);
|
||||
@@ -574,7 +574,7 @@ export function initialize() {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("click", ".deactivate", (e) => {
|
||||
$("#streams_overlay_container").on("click", ".deactivate", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -621,13 +621,13 @@ export function initialize() {
|
||||
$(".dialog_submit_button").attr("data-stream-id", stream_id);
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("click", ".stream-row", function (e) {
|
||||
$("#streams_overlay_container").on("click", ".stream-row", function (e) {
|
||||
if ($(e.target).closest(".check, .subscription_settings").length === 0) {
|
||||
open_edit_panel_for_row(this);
|
||||
}
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("change", ".stream_message_retention_setting", (e) => {
|
||||
$("#streams_overlay_container").on("change", ".stream_message_retention_setting", (e) => {
|
||||
const message_retention_setting_dropdown_value = e.target.value;
|
||||
settings_org.change_element_block_display_property(
|
||||
"stream_message_retention_custom_input",
|
||||
@@ -635,7 +635,7 @@ export function initialize() {
|
||||
);
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("change input", "input, select, textarea", (e) => {
|
||||
$("#streams_overlay_container").on("change input", "input, select, textarea", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -653,7 +653,7 @@ export function initialize() {
|
||||
return true;
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"click",
|
||||
".subsection-header .subsection-changes-save button",
|
||||
(e) => {
|
||||
@@ -671,7 +671,7 @@ export function initialize() {
|
||||
},
|
||||
);
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"click",
|
||||
".subsection-header .subsection-changes-discard button",
|
||||
(e) => {
|
||||
|
||||
@@ -358,13 +358,13 @@ export function rerender_subscribers_list(sub) {
|
||||
export function initialize() {
|
||||
add_subscribers_pill.set_up_handlers({
|
||||
get_pill_widget: () => pill_widget,
|
||||
$parent_container: $("#manage_streams_container"),
|
||||
$parent_container: $("#streams_overlay_container"),
|
||||
pill_selector: ".edit_subscribers_for_stream .pill-container",
|
||||
button_selector: ".edit_subscribers_for_stream .add-subscriber-button",
|
||||
action: subscribe_new_users,
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"submit",
|
||||
".edit_subscribers_for_stream .subscriber_list_remove form",
|
||||
(e) => {
|
||||
|
||||
@@ -287,7 +287,7 @@ export function add_sub_to_table(sub) {
|
||||
const settings_html = render_stream_settings({
|
||||
sub: stream_settings_data.get_sub_for_settings(sub),
|
||||
});
|
||||
ui.get_content_element($("#manage_streams_container .settings")).append($(settings_html));
|
||||
ui.get_content_element($("#streams_overlay_container .settings")).append($(settings_html));
|
||||
|
||||
if (stream_create.get_name() === sub.name) {
|
||||
// This `stream_create.get_name()` check tells us whether the
|
||||
@@ -441,7 +441,7 @@ export function render_left_panel_superset() {
|
||||
subscriptions: stream_settings_data.get_updated_unsorted_subs(),
|
||||
});
|
||||
|
||||
ui.get_content_element($("#manage_streams_container .streams-list")).html(html);
|
||||
ui.get_content_element($("#streams_overlay_container .streams-list")).html(html);
|
||||
}
|
||||
|
||||
export function update_empty_left_panel_message() {
|
||||
@@ -477,7 +477,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {
|
||||
|
||||
const stream_ids = [];
|
||||
|
||||
for (const row of $("#manage_streams_container .stream-row")) {
|
||||
for (const row of $("#streams_overlay_container .stream-row")) {
|
||||
const stream_id = stream_id_for_row(row);
|
||||
stream_ids.push(stream_id);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {
|
||||
hidden_ids.add(stream_id);
|
||||
}
|
||||
|
||||
for (const row of $("#manage_streams_container .stream-row")) {
|
||||
for (const row of $("#streams_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.
|
||||
@@ -510,7 +510,7 @@ export function redraw_left_panel(left_panel_params = get_left_panel_params()) {
|
||||
const all_stream_ids = [...buckets.name, ...buckets.desc, ...buckets.other];
|
||||
|
||||
for (const stream_id of all_stream_ids) {
|
||||
ui.get_content_element($("#manage_streams_container .streams-list")).append(
|
||||
ui.get_content_element($("#streams_overlay_container .streams-list")).append(
|
||||
widgets.get(stream_id),
|
||||
);
|
||||
}
|
||||
@@ -621,7 +621,7 @@ export function setup_page(callback) {
|
||||
},
|
||||
});
|
||||
|
||||
$("#manage_streams_container .search-container").prepend(sort_toggler.get());
|
||||
$("#streams_overlay_container .search-container").prepend(sort_toggler.get());
|
||||
|
||||
// Reset our internal state to reflect that we're initially in
|
||||
// the "Subscribed" tab if we're reopening "Manage streams".
|
||||
@@ -639,7 +639,7 @@ export function setup_page(callback) {
|
||||
|
||||
if (should_list_all_streams()) {
|
||||
const toggler_elem = toggler.get();
|
||||
$("#manage_streams_container .search-container").prepend(toggler_elem);
|
||||
$("#streams_overlay_container .search-container").prepend(toggler_elem);
|
||||
}
|
||||
if (page_params.is_guest) {
|
||||
toggler.disable_tab("all-streams");
|
||||
@@ -650,7 +650,7 @@ export function setup_page(callback) {
|
||||
}
|
||||
|
||||
function populate_and_fill() {
|
||||
$("#manage_streams_container").empty();
|
||||
$("#streams_overlay_container").empty();
|
||||
|
||||
const opts = {
|
||||
widget_name: "new_stream_can_remove_subscribers_group_id",
|
||||
@@ -691,7 +691,7 @@ export function setup_page(callback) {
|
||||
};
|
||||
|
||||
const rendered = render_stream_settings_overlay(template_data);
|
||||
$("#manage_streams_container").append(rendered);
|
||||
$("#streams_overlay_container").append(rendered);
|
||||
|
||||
render_left_panel_superset();
|
||||
initialize_components();
|
||||
@@ -1038,7 +1038,7 @@ export function unsubscribe_from_private_stream(sub) {
|
||||
let $stream_row;
|
||||
if (overlays.streams_open()) {
|
||||
$stream_row = $(
|
||||
"#manage_streams_container div.stream-row[data-stream-id='" + sub.stream_id + "']",
|
||||
"#streams_overlay_container div.stream-row[data-stream-id='" + sub.stream_id + "']",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1178,12 +1178,12 @@ export function update_stream_privacy_choices(policy) {
|
||||
}
|
||||
|
||||
export function initialize() {
|
||||
$("#manage_streams_container").on("click", ".create_stream_button", (e) => {
|
||||
$("#streams_overlay_container").on("click", ".create_stream_button", (e) => {
|
||||
e.preventDefault();
|
||||
open_create_stream();
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("click", "#stream_creation_form [data-dismiss]", (e) => {
|
||||
$("#streams_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
|
||||
@@ -1193,17 +1193,17 @@ export function initialize() {
|
||||
}
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on("click", ".email-address", function () {
|
||||
$("#streams_overlay_container").on("click", ".email-address", function () {
|
||||
selectText(this);
|
||||
});
|
||||
|
||||
$("#manage_streams_container").on(
|
||||
$("#streams_overlay_container").on(
|
||||
"click",
|
||||
".stream-row, .create_stream_button",
|
||||
show_right_section,
|
||||
);
|
||||
|
||||
$("#manage_streams_container").on("click", ".fa-chevron-left", () => {
|
||||
$("#streams_overlay_container").on("click", ".fa-chevron-left", () => {
|
||||
$(".right").removeClass("show");
|
||||
$(".subscriptions-header").removeClass("slide-left");
|
||||
});
|
||||
|
||||
@@ -180,7 +180,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 = $("#manage_streams_container .stream-row.active");
|
||||
const $stream_row = $("#streams_overlay_container .stream-row.active");
|
||||
if (!$stream_row.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ test("marked_subscribed (normal)", ({override}) => {
|
||||
list_updated = true;
|
||||
});
|
||||
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
|
||||
stream_events.mark_subscribed(sub, [], "blue");
|
||||
|
||||
@@ -330,7 +330,7 @@ test("marked_subscribed (color)", ({override}) => {
|
||||
|
||||
override(color_data, "pick_color", () => "green");
|
||||
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
|
||||
// narrow state is undefined
|
||||
{
|
||||
@@ -360,7 +360,7 @@ test("marked_subscribed (emails)", ({override}) => {
|
||||
const subs_stub = make_stub();
|
||||
override(stream_settings_ui, "update_settings_for_subscribed", subs_stub.f);
|
||||
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
|
||||
assert.ok(!stream_data.is_subscribed_by_name(sub.name));
|
||||
|
||||
@@ -386,7 +386,7 @@ test("mark_unsubscribed (update_settings_for_unsubscribed)", ({override}) => {
|
||||
override(stream_list, "update_subscribe_to_more_streams_link", noop);
|
||||
override(unread_ui, "update_unread_counts", noop);
|
||||
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
|
||||
stream_events.mark_unsubscribed(sub);
|
||||
const args = stub.get_args("sub");
|
||||
@@ -412,7 +412,7 @@ test("mark_unsubscribed (render_title_area)", ({override}) => {
|
||||
override(unread_ui, "update_unread_counts", noop);
|
||||
override(unread_ui, "hide_mark_as_read_turned_off_banner", noop);
|
||||
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
|
||||
stream_events.mark_unsubscribed(sub);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ run_test("redraw_left_panel", ({mock_template}) => {
|
||||
$(sub_row).detach = () => sub_row;
|
||||
}
|
||||
|
||||
$.create("#manage_streams_container .stream-row", {children: sub_stubs});
|
||||
$.create("#streams_overlay_container .stream-row", {children: sub_stubs});
|
||||
|
||||
let ui_called = false;
|
||||
ui.reset_scrollbar = ($elem) => {
|
||||
@@ -129,7 +129,7 @@ run_test("redraw_left_panel", ({mock_template}) => {
|
||||
assert.ok(!$denmark_row.hasClass("active"));
|
||||
|
||||
function test_filter(params, expected_streams) {
|
||||
$("#manage_streams_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
$("#streams_overlay_container .stream-row:not(.notdisplayed)").length = 0;
|
||||
const stream_ids = stream_settings_ui.redraw_left_panel(params);
|
||||
assert.deepEqual(
|
||||
stream_ids,
|
||||
|
||||
Reference in New Issue
Block a user