compose_send_menu_popover: Rename module to reflect broader uses.

This commit is contained in:
evykassirer 2024-04-16 14:40:09 -07:00 committed by Tim Abbott
parent 3ef4e80dff
commit 0e369e7ff3
6 changed files with 12 additions and 12 deletions

View File

@ -75,6 +75,7 @@ EXEMPT_FILES = make_set(
"web/src/compose_popovers.js",
"web/src/compose_recipient.ts",
"web/src/compose_reply.js",
"web/src/compose_send_menu_popover.js",
"web/src/compose_setup.js",
"web/src/compose_state.ts",
"web/src/compose_textarea.ts",
@ -192,7 +193,6 @@ EXEMPT_FILES = make_set(
"web/src/scheduled_messages.ts",
"web/src/scheduled_messages_feed_ui.ts",
"web/src/scheduled_messages_overlay_ui.js",
"web/src/scheduled_messages_popover.js",
"web/src/scheduled_messages_ui.js",
"web/src/scroll_bar.ts",
"web/src/scroll_util.ts",

View File

@ -9,6 +9,7 @@ import * as compose_banner from "./compose_banner";
import * as compose_call from "./compose_call";
import * as compose_call_ui from "./compose_call_ui";
import * as compose_recipient from "./compose_recipient";
import * as compose_send_menu_popover from "./compose_send_menu_popover";
import * as compose_state from "./compose_state";
import * as compose_ui from "./compose_ui";
import * as compose_validate from "./compose_validate";
@ -23,7 +24,6 @@ import * as popovers from "./popovers";
import * as resize from "./resize";
import * as rows from "./rows";
import * as scheduled_messages from "./scheduled_messages";
import * as scheduled_messages_popover from "./scheduled_messages_popover";
import * as stream_data from "./stream_data";
import * as stream_settings_components from "./stream_settings_components";
import * as sub_store from "./sub_store";
@ -127,7 +127,7 @@ export function initialize() {
if (is_edit_input) {
message_edit.save_message_row_edit($row);
} else if (event.target.dataset.validationTrigger === "schedule") {
scheduled_messages_popover.open_send_later_menu();
compose_send_menu_popover.open_send_later_menu();
// We need to set this flag to true here because `open_send_later_menu` validates the message and sets
// the user acknowledged wildcard flag back to 'false' and we don't want that to happen because then it
@ -231,7 +231,7 @@ export function initialize() {
(event) => {
event.preventDefault();
const send_at_timestamp = scheduled_messages.get_selected_send_later_timestamp();
scheduled_messages_popover.do_schedule_message(send_at_timestamp);
compose_send_menu_popover.do_schedule_message(send_at_timestamp);
},
);

View File

@ -10,6 +10,7 @@ import * as compose_actions from "./compose_actions";
import * as compose_banner from "./compose_banner";
import * as compose_recipient from "./compose_recipient";
import * as compose_reply from "./compose_reply";
import * as compose_send_menu_popover from "./compose_send_menu_popover";
import * as compose_state from "./compose_state";
import * as compose_textarea from "./compose_textarea";
import * as condense from "./condense";
@ -47,7 +48,6 @@ import * as read_receipts from "./read_receipts";
import * as recent_view_ui from "./recent_view_ui";
import * as recent_view_util from "./recent_view_util";
import * as scheduled_messages_overlay_ui from "./scheduled_messages_overlay_ui";
import * as scheduled_messages_popover from "./scheduled_messages_popover";
import * as search from "./search";
import * as settings_data from "./settings_data";
import * as sidebar_ui from "./sidebar_ui";
@ -503,7 +503,7 @@ export function process_enter_key(e) {
// it since it is the trigger for the popover. <button> is already used
// to trigger the tooltip so it cannot be used to trigger the popover.
if (e.target.id === "send_later") {
scheduled_messages_popover.toggle();
compose_send_menu_popover.toggle();
return true;
}

View File

@ -27,6 +27,7 @@ import * as compose_pm_pill from "./compose_pm_pill";
import * as compose_popovers from "./compose_popovers";
import * as compose_recipient from "./compose_recipient";
import * as compose_reply from "./compose_reply";
import * as compose_send_menu_popover from "./compose_send_menu_popover";
import * as compose_setup from "./compose_setup";
import * as compose_textarea from "./compose_textarea";
import * as compose_tooltips from "./compose_tooltips";
@ -98,7 +99,6 @@ import * as reload_setup from "./reload_setup";
import * as resize_handler from "./resize_handler";
import * as scheduled_messages from "./scheduled_messages";
import * as scheduled_messages_overlay_ui from "./scheduled_messages_overlay_ui";
import * as scheduled_messages_popover from "./scheduled_messages_popover";
import * as scheduled_messages_ui from "./scheduled_messages_ui";
import * as scroll_bar from "./scroll_bar";
import * as scroll_util from "./scroll_util";
@ -682,7 +682,7 @@ export function initialize_everything(state_data) {
user_topic_popover.initialize();
topic_popover.initialize();
message_actions_popover.initialize();
scheduled_messages_popover.initialize();
compose_send_menu_popover.initialize();
realm_user_settings_defaults.initialize(realm_settings_defaults_params);
people.initialize(current_user.user_id, people_params);

View File

@ -6,7 +6,7 @@ const {zrequire} = require("./lib/namespace");
const {run_test} = require("./lib/test");
const scheduled_messages = zrequire("scheduled_messages");
const scheduled_messages_popover = zrequire("scheduled_messages_popover");
const compose_send_menu_popover = zrequire("compose_send_menu_popover");
const per_day_stamps = {
"2023-04-30": {
@ -146,7 +146,7 @@ run_test("should_update_send_later_options", () => {
// We should rerender at midnight
const start_of_the_day = new Date();
start_of_the_day.setHours(0, 0);
assert.ok(scheduled_messages_popover.should_update_send_later_options(start_of_the_day));
assert.ok(compose_send_menu_popover.should_update_send_later_options(start_of_the_day));
function get_minutes_to_hour(minutes) {
const date = new Date();
@ -161,10 +161,10 @@ run_test("should_update_send_later_options", () => {
const current_time = get_minutes_to_hour(minute);
if (minute === 55) {
// Should rerender
assert.ok(scheduled_messages_popover.should_update_send_later_options(current_time));
assert.ok(compose_send_menu_popover.should_update_send_later_options(current_time));
} else {
// Should not rerender
assert.ok(!scheduled_messages_popover.should_update_send_later_options(current_time));
assert.ok(!compose_send_menu_popover.should_update_send_later_options(current_time));
}
}
});