right_sidebar_ui: Rename to sidebar_ui.

This commit is contained in:
Aman Agrawal 2023-09-28 09:08:09 +00:00 committed by Tim Abbott
parent 5774486c12
commit 820b564072
8 changed files with 14 additions and 15 deletions

View File

@ -156,7 +156,6 @@ EXEMPT_FILES = make_set(
"web/src/reload.js", "web/src/reload.js",
"web/src/reminder.js", "web/src/reminder.js",
"web/src/resize.js", "web/src/resize.js",
"web/src/right_sidebar_ui.js",
"web/src/rows.js", "web/src/rows.js",
"web/src/scheduled_messages.js", "web/src/scheduled_messages.js",
"web/src/scheduled_messages_overlay_ui.js", "web/src/scheduled_messages_overlay_ui.js",
@ -190,6 +189,7 @@ EXEMPT_FILES = make_set(
"web/src/settings_user_topics.js", "web/src/settings_user_topics.js",
"web/src/settings_users.js", "web/src/settings_users.js",
"web/src/setup.ts", "web/src/setup.ts",
"web/src/sidebar_ui.js",
"web/src/spectators.ts", "web/src/spectators.ts",
"web/src/spoilers.ts", "web/src/spoilers.ts",
"web/src/starred_messages_ui.js", "web/src/starred_messages_ui.js",

View File

@ -30,12 +30,12 @@ import * as pm_list from "./pm_list";
import * as popovers from "./popovers"; import * as popovers from "./popovers";
import * as reactions from "./reactions"; import * as reactions from "./reactions";
import * as recent_view_ui from "./recent_view_ui"; import * as recent_view_ui from "./recent_view_ui";
import * as right_sidebar_ui from "./right_sidebar_ui";
import * as rows from "./rows"; import * as rows from "./rows";
import * as server_events from "./server_events"; import * as server_events from "./server_events";
import * as settings_display from "./settings_display"; import * as settings_display from "./settings_display";
import * as settings_panel_menu from "./settings_panel_menu"; import * as settings_panel_menu from "./settings_panel_menu";
import * as settings_toggle from "./settings_toggle"; import * as settings_toggle from "./settings_toggle";
import * as sidebar_ui from "./sidebar_ui";
import * as spectators from "./spectators"; import * as spectators from "./spectators";
import * as starred_messages_ui from "./starred_messages_ui"; import * as starred_messages_ui from "./starred_messages_ui";
import * as stream_list from "./stream_list"; import * as stream_list from "./stream_list";
@ -496,7 +496,7 @@ export function initialize() {
const sidebarHidden = !$(".app-main .column-right").hasClass("expanded"); const sidebarHidden = !$(".app-main .column-right").hasClass("expanded");
popovers.hide_all(); popovers.hide_all();
if (sidebarHidden) { if (sidebarHidden) {
right_sidebar_ui.show_userlist_sidebar(); sidebar_ui.show_userlist_sidebar();
} }
}); });

View File

@ -4,7 +4,7 @@ import {hideAll} from "tippy.js";
import * as emoji_picker from "./emoji_picker"; import * as emoji_picker from "./emoji_picker";
import * as playground_links_popover from "./playground_links_popover"; import * as playground_links_popover from "./playground_links_popover";
import * as popover_menus from "./popover_menus"; import * as popover_menus from "./popover_menus";
import * as right_sidebar_ui from "./right_sidebar_ui"; import * as sidebar_ui from "./sidebar_ui";
import * as stream_popover from "./stream_popover"; import * as stream_popover from "./stream_popover";
import * as user_card_popover from "./user_card_popover"; import * as user_card_popover from "./user_card_popover";
import * as user_group_popover from "./user_group_popover"; import * as user_group_popover from "./user_group_popover";
@ -44,7 +44,7 @@ export function hide_all_except_sidebars(opts) {
// This function will hide all the popovers, including the mobile web // This function will hide all the popovers, including the mobile web
// or narrow window sidebars. // or narrow window sidebars.
export function hide_all(not_hide_tippy_instances) { export function hide_all(not_hide_tippy_instances) {
right_sidebar_ui.hide_userlist_sidebar(); sidebar_ui.hide_userlist_sidebar();
stream_popover.hide_streamlist_sidebar(); stream_popover.hide_streamlist_sidebar();
hide_all_except_sidebars({ hide_all_except_sidebars({
not_hide_tippy_instances, not_hide_tippy_instances,

View File

@ -25,9 +25,9 @@ import {page_params} from "./page_params";
import * as people from "./people"; import * as people from "./people";
import * as popover_menus from "./popover_menus"; import * as popover_menus from "./popover_menus";
import {hide_all, hide_all_except_sidebars} from "./popovers"; import {hide_all, hide_all_except_sidebars} from "./popovers";
import * as right_sidebar_ui from "./right_sidebar_ui";
import * as rows from "./rows"; import * as rows from "./rows";
import * as settings_config from "./settings_config"; import * as settings_config from "./settings_config";
import * as sidebar_ui from "./sidebar_ui";
import * as timerender from "./timerender"; import * as timerender from "./timerender";
import * as ui_report from "./ui_report"; import * as ui_report from "./ui_report";
import * as ui_util from "./ui_util"; import * as ui_util from "./ui_util";
@ -710,7 +710,7 @@ function register_click_handlers() {
const mention = people.get_mention_syntax(name, user_id); const mention = people.get_mention_syntax(name, user_id);
compose_ui.insert_syntax_and_focus(mention); compose_ui.insert_syntax_and_focus(mention);
user_sidebar.hide(); user_sidebar.hide();
right_sidebar_ui.hide_userlist_sidebar(); sidebar_ui.hide_userlist_sidebar();
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
}); });

View File

@ -2,7 +2,7 @@ import $ from "jquery";
import * as popovers from "./popovers"; import * as popovers from "./popovers";
import * as resize from "./resize"; import * as resize from "./resize";
import * as right_sidebar_ui from "./right_sidebar_ui"; import * as sidebar_ui from "./sidebar_ui";
import * as stream_popover from "./stream_popover"; import * as stream_popover from "./stream_popover";
export class UserSearch { export class UserSearch {
@ -100,7 +100,7 @@ export class UserSearch {
if ($column.hasClass("column-left")) { if ($column.hasClass("column-left")) {
stream_popover.show_streamlist_sidebar(); stream_popover.show_streamlist_sidebar();
} else if ($column.hasClass("column-right")) { } else if ($column.hasClass("column-right")) {
right_sidebar_ui.show_userlist_sidebar(); sidebar_ui.show_userlist_sidebar();
} }
} }
} }

View File

@ -25,7 +25,7 @@ const padded_widget = mock_esm("../src/padded_widget");
const pm_list = mock_esm("../src/pm_list"); const pm_list = mock_esm("../src/pm_list");
const popovers = mock_esm("../src/popovers"); const popovers = mock_esm("../src/popovers");
const resize = mock_esm("../src/resize"); const resize = mock_esm("../src/resize");
const right_sidebar_ui = mock_esm("../src/right_sidebar_ui"); const sidebar_ui = mock_esm("../src/sidebar_ui");
const scroll_util = mock_esm("../src/scroll_util"); const scroll_util = mock_esm("../src/scroll_util");
const watchdog = mock_esm("../src/watchdog"); const watchdog = mock_esm("../src/watchdog");
@ -281,7 +281,7 @@ test("handlers", ({override, mock_template}) => {
override(padded_widget, "update_padding", () => {}); override(padded_widget, "update_padding", () => {});
override(popovers, "hide_all", () => {}); override(popovers, "hide_all", () => {});
override(popovers, "hide_all_except_sidebars", () => {}); override(popovers, "hide_all_except_sidebars", () => {});
override(right_sidebar_ui, "show_userlist_sidebar", () => {}); override(sidebar_ui, "show_userlist_sidebar", () => {});
override(resize, "resize_sidebars", () => {}); override(resize, "resize_sidebars", () => {});
// This is kind of weak coverage; we are mostly making sure that // This is kind of weak coverage; we are mostly making sure that

View File

@ -27,9 +27,8 @@ mock_esm("../src/buddy_list", {
const popovers = mock_esm("../src/popovers"); const popovers = mock_esm("../src/popovers");
const presence = mock_esm("../src/presence"); const presence = mock_esm("../src/presence");
const stream_popover = mock_esm("../src/stream_popover");
const resize = mock_esm("../src/resize"); const resize = mock_esm("../src/resize");
const right_sidebar_ui = mock_esm("../src/right_sidebar_ui"); const sidebar_ui = mock_esm("../src/sidebar_ui");
set_global("document", _document); set_global("document", _document);
@ -107,7 +106,7 @@ test("escape_search", ({override}) => {
}); });
test("blur search right", ({override}) => { test("blur search right", ({override}) => {
override(right_sidebar_ui, "show_userlist_sidebar", () => {}); override(sidebar_ui, "show_userlist_sidebar", () => {});
override(popovers, "hide_all", () => {}); override(popovers, "hide_all", () => {});
override(popovers, "hide_all_except_sidebars", () => {}); override(popovers, "hide_all_except_sidebars", () => {});
override(resize, "resize_sidebars", () => {}); override(resize, "resize_sidebars", () => {});
@ -199,7 +198,7 @@ test("click on user header to toggle display", ({override}) => {
override(popovers, "hide_all", () => {}); override(popovers, "hide_all", () => {});
override(popovers, "hide_all_except_sidebars", () => {}); override(popovers, "hide_all_except_sidebars", () => {});
override(right_sidebar_ui, "show_userlist_sidebar", () => {}); override(sidebar_ui, "show_userlist_sidebar", () => {});
override(resize, "resize_sidebars", () => {}); override(resize, "resize_sidebars", () => {});
page_params.realm_presence_disabled = true; page_params.realm_presence_disabled = true;