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.
This commit is contained in:
Mateusz Mandera 2019-09-05 11:57:40 +02:00 committed by Tim Abbott
parent dfd6771237
commit bf7f4f3f1b
5 changed files with 6 additions and 47 deletions

View File

@ -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",

View File

@ -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();

View File

@ -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;

View File

@ -1,10 +0,0 @@
{{! Explanation of the stream email address }}
<div class="email_address_hint">
<p>{{#tr this}}You can send emails to Zulip! Just copy and use this address as an email recipient, and:{{/tr}}</p>
<img class="subscription-email-hint-image" src="/static/images/integrations/zulip_mail.png" />
<ul>
<li>{{t "The email will be forwarded to this stream" }}</li>
<li>{{#tr this}}The email subject will become the Zulip topic{{/tr}}</li>
<li>{{#tr this}}The email body will become the Zulip message{{/tr}}</li>
</ul>
</div>

View File

@ -72,7 +72,12 @@
</ul>
</div>
<div class="stream-email-box" {{#unless sub.email_address}}style="display: none;"{{/unless}}>
<div class="sub_settings_title">{{t "Email address" }} <i class="fa fa-question-circle stream-email-hint" aria-hidden="true"></i></div>
<div class="sub_settings_title">
{{t "Email address" }}
<a href="/help/message-a-stream-by-email" target="_blank">
<i class="fa fa-question-circle" aria-hidden="true"></i>
</a>
</div>
<div class="stream-email">
<span class="email-address">{{sub.email_address}}</span>
</div>