compose: Change stream field in composebox to be a dropdown.

Fixes #11832

This lets the user see more options than the three that appear
in the typeahead menu, and prevents them from inputting invalid
stream names.

This change replaces the input field with the dropdown, and
updates everything that referred to the classnames of the old
input field, so that they now get the data they need from the
new dropdown.
This commit is contained in:
evykassirer
2022-10-20 15:44:55 -07:00
committed by Tim Abbott
parent 429f23fc4f
commit 8a2455a294
25 changed files with 381 additions and 169 deletions

View File

@@ -13,6 +13,12 @@ async function check_compose_form_empty(page: Page): Promise<void> {
}
async function close_compose_box(page: Page): Promise<void> {
const stream_dropdown_visible = (await page.$("#compose_select_stream_widget .open")) !== null;
if (stream_dropdown_visible) {
await page.keyboard.press("Escape");
await page.waitForSelector("#id_compose_select_stream.open", {hidden: true});
}
await page.keyboard.press("Escape");
await page.waitForSelector("#compose-textarea", {hidden: true});
}
@@ -119,7 +125,7 @@ async function test_narrow_to_private_messages_with_cordelia(page: Page): Promis
await page.keyboard.press("KeyC");
await page.waitForSelector("#compose", {visible: true});
await page.waitForSelector(".compose_table #stream_message_recipient_stream:focus", {
await page.waitForSelector(".compose_table #id_compose_select_stream.open", {
visible: true,
});
await close_compose_box(page);