stream settings: Disable Mobile notifications if push bouncer not set up.

This commit disables "Mobile notifications" if `push_notifications` are not
enabled. It also adds a tooltip explaining why this is disabled.

Fixes #12208
This commit is contained in:
Pragati Agrawal
2019-04-26 18:44:53 +05:30
committed by Tim Abbott
parent 84234cabcb
commit 747e797092
5 changed files with 23 additions and 3 deletions

View File

@@ -238,6 +238,10 @@ var settings_labels = {
pin_to_top: i18n.t("Pin stream to top of left sidebar"),
};
var check_realm_setting = {
push_notifications: !page_params.realm_push_notifications_enabled,
};
exports.stream_settings = function (sub) {
var settings = [];
_.each(Object.keys(settings_labels), function (setting) {
@@ -267,6 +271,7 @@ exports.show_settings_for = function (node) {
var html = templates.render('subscription_settings', {
sub: sub,
settings: exports.stream_settings(sub),
realm_settings: check_realm_setting,
});
ui.get_content_element($('.subscriptions .right .settings')).html(html);