diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 736bb64589..fe2fd75cbb 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -156,7 +156,6 @@ EXEMPT_FILES = make_set( "web/src/reload.js", "web/src/reminder.js", "web/src/resize.js", - "web/src/right_sidebar_ui.js", "web/src/rows.js", "web/src/scheduled_messages.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_users.js", "web/src/setup.ts", + "web/src/sidebar_ui.js", "web/src/spectators.ts", "web/src/spoilers.ts", "web/src/starred_messages_ui.js", diff --git a/web/src/click_handlers.js b/web/src/click_handlers.js index aa3fe370dc..d4ad150d74 100644 --- a/web/src/click_handlers.js +++ b/web/src/click_handlers.js @@ -30,12 +30,12 @@ import * as pm_list from "./pm_list"; import * as popovers from "./popovers"; import * as reactions from "./reactions"; 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 server_events from "./server_events"; import * as settings_display from "./settings_display"; import * as settings_panel_menu from "./settings_panel_menu"; import * as settings_toggle from "./settings_toggle"; +import * as sidebar_ui from "./sidebar_ui"; import * as spectators from "./spectators"; import * as starred_messages_ui from "./starred_messages_ui"; import * as stream_list from "./stream_list"; @@ -496,7 +496,7 @@ export function initialize() { const sidebarHidden = !$(".app-main .column-right").hasClass("expanded"); popovers.hide_all(); if (sidebarHidden) { - right_sidebar_ui.show_userlist_sidebar(); + sidebar_ui.show_userlist_sidebar(); } }); diff --git a/web/src/popovers.js b/web/src/popovers.js index 9bfc14989e..184c1653a1 100644 --- a/web/src/popovers.js +++ b/web/src/popovers.js @@ -4,7 +4,7 @@ import {hideAll} from "tippy.js"; import * as emoji_picker from "./emoji_picker"; import * as playground_links_popover from "./playground_links_popover"; 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 user_card_popover from "./user_card_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 // or narrow window sidebars. export function hide_all(not_hide_tippy_instances) { - right_sidebar_ui.hide_userlist_sidebar(); + sidebar_ui.hide_userlist_sidebar(); stream_popover.hide_streamlist_sidebar(); hide_all_except_sidebars({ not_hide_tippy_instances, diff --git a/web/src/right_sidebar_ui.js b/web/src/sidebar_ui.js similarity index 100% rename from web/src/right_sidebar_ui.js rename to web/src/sidebar_ui.js diff --git a/web/src/user_card_popover.js b/web/src/user_card_popover.js index 0aa3455e51..0dba6f70b9 100644 --- a/web/src/user_card_popover.js +++ b/web/src/user_card_popover.js @@ -25,9 +25,9 @@ import {page_params} from "./page_params"; import * as people from "./people"; import * as popover_menus from "./popover_menus"; 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 settings_config from "./settings_config"; +import * as sidebar_ui from "./sidebar_ui"; import * as timerender from "./timerender"; import * as ui_report from "./ui_report"; import * as ui_util from "./ui_util"; @@ -710,7 +710,7 @@ function register_click_handlers() { const mention = people.get_mention_syntax(name, user_id); compose_ui.insert_syntax_and_focus(mention); user_sidebar.hide(); - right_sidebar_ui.hide_userlist_sidebar(); + sidebar_ui.hide_userlist_sidebar(); e.stopPropagation(); e.preventDefault(); }); diff --git a/web/src/user_search.js b/web/src/user_search.js index 5523f436dc..5558eb234e 100644 --- a/web/src/user_search.js +++ b/web/src/user_search.js @@ -2,7 +2,7 @@ import $ from "jquery"; import * as popovers from "./popovers"; 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"; export class UserSearch { @@ -100,7 +100,7 @@ export class UserSearch { if ($column.hasClass("column-left")) { stream_popover.show_streamlist_sidebar(); } else if ($column.hasClass("column-right")) { - right_sidebar_ui.show_userlist_sidebar(); + sidebar_ui.show_userlist_sidebar(); } } } diff --git a/web/tests/activity.test.js b/web/tests/activity.test.js index 36e93c547b..f9d2f9b2d5 100644 --- a/web/tests/activity.test.js +++ b/web/tests/activity.test.js @@ -25,7 +25,7 @@ const padded_widget = mock_esm("../src/padded_widget"); const pm_list = mock_esm("../src/pm_list"); const popovers = mock_esm("../src/popovers"); 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 watchdog = mock_esm("../src/watchdog"); @@ -281,7 +281,7 @@ test("handlers", ({override, mock_template}) => { override(padded_widget, "update_padding", () => {}); override(popovers, "hide_all", () => {}); override(popovers, "hide_all_except_sidebars", () => {}); - override(right_sidebar_ui, "show_userlist_sidebar", () => {}); + override(sidebar_ui, "show_userlist_sidebar", () => {}); override(resize, "resize_sidebars", () => {}); // This is kind of weak coverage; we are mostly making sure that diff --git a/web/tests/user_search.test.js b/web/tests/user_search.test.js index 07bdd65869..f60b63498b 100644 --- a/web/tests/user_search.test.js +++ b/web/tests/user_search.test.js @@ -27,9 +27,8 @@ mock_esm("../src/buddy_list", { const popovers = mock_esm("../src/popovers"); const presence = mock_esm("../src/presence"); -const stream_popover = mock_esm("../src/stream_popover"); 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); @@ -107,7 +106,7 @@ test("escape_search", ({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_except_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_except_sidebars", () => {}); - override(right_sidebar_ui, "show_userlist_sidebar", () => {}); + override(sidebar_ui, "show_userlist_sidebar", () => {}); override(resize, "resize_sidebars", () => {}); page_params.realm_presence_disabled = true;