notification_settings: Display streams that differ.

The user has an option for setting global
notification settings as well as the same settings
for individual streams. Currently the user has to
keep track of each unmatched stream and then visit
each individual stream whose settings he wants to
update.

Thus this adds a dedicated UI table allowing the user
to view and update the notifications of the specific
streams which differs from the global settings.
It is located on the same page where the user defined
global notification settings can be modified.

Fixes #9228.
This commit is contained in:
Ryan Rehman
2020-03-12 22:10:38 +05:30
committed by Tim Abbott
parent e845b2364f
commit 9cb2475b53
6 changed files with 82 additions and 7 deletions

View File

@@ -328,12 +328,16 @@ function stream_is_muted_clicked(e) {
}
}
function stream_setting_clicked(e) {
exports.stream_setting_clicked = function (e) {
if (e.currentTarget.id === 'sub_is_muted_setting') {
return;
}
const checkbox = $(e.currentTarget).find('.sub_setting_control');
let checkbox = $(e.currentTarget).find('.sub_setting_control');
// sub data is being changed from the notification settings page.
if (checkbox.length === 0) {
checkbox = $(e.currentTarget);
}
const sub = get_sub_for_target(e.target);
const setting = checkbox.attr('name');
if (!sub) {
@@ -351,7 +355,7 @@ function stream_setting_clicked(e) {
}
}
exports.set_stream_property(sub, setting, !sub[setting]);
}
};
exports.bulk_set_stream_property = function (sub_data) {
return channel.post({
@@ -548,7 +552,7 @@ exports.initialize = function () {
stream_is_muted_clicked);
$("#subscriptions_table").on("click", ".sub_setting_checkbox",
stream_setting_clicked);
exports.stream_setting_clicked);
$("#subscriptions_table").on("submit", ".subscriber_list_add form", function (e) {
e.preventDefault();