From bf7f4f3f1b941f768eb53baec26ccc868902fa36 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Thu, 5 Sep 2019 11:57:40 +0200 Subject: [PATCH] stream settings: Replace email address hint popup with link to docs. Fixes #13134 as the last commit in the series for this issue. Solves the "The (?) should just be a target=_blank link to /help/message-a-stream-by-email." part of the issue. As a result, a bunch code managing the email hint popup can be deleted, together with a node test for that. --- frontend_tests/node_tests/templates.js | 7 ------- static/js/subs.js | 23 ---------------------- static/styles/subscriptions.scss | 6 ------ static/templates/email_address_hint.hbs | 10 ---------- static/templates/subscription_settings.hbs | 7 ++++++- 5 files changed, 6 insertions(+), 47 deletions(-) delete mode 100644 static/templates/email_address_hint.hbs diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index c12a34f1e0..137bd45109 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -641,13 +641,6 @@ run_test('draft_table_body', () => { assert.equal(row_2.find(".message_content").text().trim(), "Private draft"); }); - -run_test('email_address_hint', () => { - var html = render('email_address_hint'); - var li = $(html).find("li").first(); - assert.equal(li.text(), 'translated: The email will be forwarded to this stream'); -}); - run_test('emoji_popover', () => { var args = { class: "emoji-info-popover", diff --git a/static/js/subs.js b/static/js/subs.js index a192985203..495bbdaf4f 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -1,4 +1,3 @@ -var render_email_address_hint = require('../templates/email_address_hint.hbs'); var render_subscription = require('../templates/subscription.hbs'); var render_subscription_settings = require('../templates/subscription_settings.hbs'); var render_subscription_table_body = require('../templates/subscription_table_body.hbs'); @@ -211,26 +210,6 @@ exports.rerender_subscriptions_settings = function (sub) { stream_ui_updates.update_subscribers_list(sub); }; -function add_email_hint_handler() { - // Add a popover explaining stream e-mail addresses on hover. - - $("body").on("mouseover", '.stream-email-hint', function (e) { - var email_address_hint_content = render_email_address_hint({ page_params: page_params }); - $(e.target).popover({ - placement: "right", - title: "Email integration", - content: email_address_hint_content, - trigger: "manual", - animation: false}); - $(e.target).popover('show'); - e.stopPropagation(); - }); - $("body").on("mouseout", '.stream-email-hint', function (e) { - $(e.target).popover('hide'); - e.stopPropagation(); - }); -} - exports.add_sub_to_table = function (sub) { if (exports.is_sub_already_present(sub)) { // If a stream is already listed/added in subscription modal, @@ -805,8 +784,6 @@ exports.sub_or_unsub = function (sub) { exports.initialize = function () { - add_email_hint_handler(); - $("#subscriptions_table").on("click", ".create_stream_button", function (e) { e.preventDefault(); exports.open_create_stream(); diff --git a/static/styles/subscriptions.scss b/static/styles/subscriptions.scss index 68ba41ec6f..f1067dd390 100644 --- a/static/styles/subscriptions.scss +++ b/static/styles/subscriptions.scss @@ -10,12 +10,6 @@ margin: 0; } -.email_address_hint { - max-width: 430px; - padding-left: 10px; - padding-right: 10px; -} - .subscription-email-hint-image { float: right; width: 80px; diff --git a/static/templates/email_address_hint.hbs b/static/templates/email_address_hint.hbs deleted file mode 100644 index 8273e64b9f..0000000000 --- a/static/templates/email_address_hint.hbs +++ /dev/null @@ -1,10 +0,0 @@ -{{! Explanation of the stream email address }} -
-

{{#tr this}}You can send emails to Zulip! Just copy and use this address as an email recipient, and:{{/tr}}

- - -
diff --git a/static/templates/subscription_settings.hbs b/static/templates/subscription_settings.hbs index 3a7b13c0d8..a815b29819 100644 --- a/static/templates/subscription_settings.hbs +++ b/static/templates/subscription_settings.hbs @@ -72,7 +72,12 @@
-
{{t "Email address" }}
+
+ {{t "Email address" }} + + + +