From fe89dee284c963a7a3932e0d30c8a1fec37dd7cc Mon Sep 17 00:00:00 2001 From: Wesley Aptekar-Cassels Date: Sun, 4 Jul 2021 15:06:50 -0700 Subject: [PATCH] compose: Remove "Drafts" button. Now that this is in the left sidebar, we can remove the now-redundant compose area button for it. This also changes where the "Saved as draft" tooltip appears. --- frontend_tests/puppeteer_tests/drafts.ts | 2 +- static/js/drafts.js | 7 ++----- static/templates/compose.hbs | 5 ----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/frontend_tests/puppeteer_tests/drafts.ts b/frontend_tests/puppeteer_tests/drafts.ts index 6e8274a7ec..fec9e601cf 100644 --- a/frontend_tests/puppeteer_tests/drafts.ts +++ b/frontend_tests/puppeteer_tests/drafts.ts @@ -20,7 +20,7 @@ async function get_drafts_count(page: Page): Promise { return await page.$$eval(".draft-row", (drafts) => drafts.length); } -const drafts_button = ".compose_drafts_button"; +const drafts_button = ".top_left_drafts"; const drafts_overlay = "#draft_overlay"; const drafts_button_in_compose = "#below-compose-content .drafts-link"; diff --git a/static/js/drafts.js b/static/js/drafts.js index a7698c9062..f8e11fffd2 100644 --- a/static/js/drafts.js +++ b/static/js/drafts.js @@ -26,9 +26,6 @@ import * as ui_util from "./ui_util"; import * as util from "./util"; function set_count(count) { - const draft_count = count.toString(); - const text = $t({defaultMessage: "Drafts ({draft_count})"}, {draft_count}); - $(".compose_drafts_button").text(text); const drafts_li = $(".top_left_drafts"); ui_util.update_unread_count_in_dom(drafts_li, count); } @@ -147,10 +144,10 @@ export function restore_message(draft) { function draft_notify() { // Display a tooltip to notify the user about the saved draft. - const instance = tippy(".compose_drafts_button", { + const instance = tippy(".top_left_drafts .unread_count", { content: $t({defaultMessage: "Saved as draft"}), arrow: true, - placement: "top", + placement: "right", })[0]; instance.show(); function remove_instance() { diff --git a/static/templates/compose.hbs b/static/templates/compose.hbs index 492385c957..0a34c82858 100644 --- a/static/templates/compose.hbs +++ b/static/templates/compose.hbs @@ -36,11 +36,6 @@ {{t 'Log in to send messages' }} - - - {{t 'Drafts' }} - -