mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
stream_edit: Enable notification settings for muted streams.
This commit allows the user to change notification settings even though the stream is muted and adds a line of text in stream settings and notification settings. Fixes #27272.
This commit is contained in:
@@ -181,7 +181,6 @@ export function stream_settings(sub) {
|
|||||||
ret.is_checked =
|
ret.is_checked =
|
||||||
stream_data.receives_notifications(sub.stream_id, setting) &&
|
stream_data.receives_notifications(sub.stream_id, setting) &&
|
||||||
!check_realm_setting[setting];
|
!check_realm_setting[setting];
|
||||||
ret.is_disabled = ret.is_disabled || sub.is_muted;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret.is_checked = sub[setting] && !check_realm_setting[setting];
|
ret.is_checked = sub[setting] && !check_realm_setting[setting];
|
||||||
@@ -282,13 +281,10 @@ export function setup_stream_settings(node) {
|
|||||||
|
|
||||||
export function update_muting_rendering(sub) {
|
export function update_muting_rendering(sub) {
|
||||||
const $edit_container = stream_settings_containers.get_edit_container(sub);
|
const $edit_container = stream_settings_containers.get_edit_container(sub);
|
||||||
const $notification_checkboxes = $edit_container.find(".sub_notification_setting");
|
|
||||||
const $is_muted_checkbox = $edit_container.find("#sub_is_muted_setting .sub_setting_control");
|
const $is_muted_checkbox = $edit_container.find("#sub_is_muted_setting .sub_setting_control");
|
||||||
|
|
||||||
$is_muted_checkbox.prop("checked", sub.is_muted);
|
$is_muted_checkbox.prop("checked", sub.is_muted);
|
||||||
$edit_container.find(".mute-note").toggleClass("hide-mute-note", !sub.is_muted);
|
$edit_container.find(".mute-note").toggleClass("hide-mute-note", !sub.is_muted);
|
||||||
$notification_checkboxes.toggleClass("muted-sub", sub.is_muted);
|
|
||||||
$notification_checkboxes.find("input[type='checkbox']").prop("disabled", sub.is_muted);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stream_is_muted_changed(e) {
|
function stream_is_muted_changed(e) {
|
||||||
|
|||||||
@@ -49,12 +49,10 @@
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.muted-sub,
|
|
||||||
.control-label-disabled {
|
.control-label-disabled {
|
||||||
color: hsl(0deg 0% 64%);
|
color: hsl(0deg 0% 64%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub_setting_checkbox .muted-sub label,
|
|
||||||
.sub_setting_checkbox .control-label-disabled label {
|
.sub_setting_checkbox .control-label-disabled label {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
@@ -117,6 +115,10 @@ h3.user_group_setting_subsection_title {
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h4.stream_setting_subsection_title {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
h4.stream_setting_subsection_title,
|
h4.stream_setting_subsection_title,
|
||||||
h4.user_group_setting_subsection_title {
|
h4.user_group_setting_subsection_title {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<h3>{{t "Notification triggers" }}</h3>
|
<h3>{{t "Notification triggers" }}</h3>
|
||||||
{{> settings_save_discard_widget section_name="general-notify-settings" show_only_indicator=(not for_realm_settings) }}
|
{{> settings_save_discard_widget section_name="general-notify-settings" show_only_indicator=(not for_realm_settings) }}
|
||||||
</div>
|
</div>
|
||||||
<p>{{t "Configure how Zulip notifies you about new messages." }}</p>
|
<p>{{t "Configure how Zulip notifies you about new messages. In muted streams, stream notification settings apply only to unmuted topics." }}</p>
|
||||||
<table class="notification-table table table-bordered wrapped-table">
|
<table class="notification-table table table-bordered wrapped-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -120,13 +120,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="stream_setting_subsection_title">{{t "Notification settings" }}</h4>
|
<h4 class="stream_setting_subsection_title">{{t "Notification settings" }}</h4>
|
||||||
|
<p>{{t "In muted streams, stream notification settings apply only to unmuted topics." }}</p>
|
||||||
<div class="subsection-parent">
|
<div class="subsection-parent">
|
||||||
{{#each notification_settings}}
|
{{#each notification_settings}}
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
{{> stream_settings_checkbox
|
{{> stream_settings_checkbox
|
||||||
setting_name=name
|
setting_name=name
|
||||||
is_checked=is_checked
|
is_checked=is_checked
|
||||||
is_muted=(lookup ../sub "is_muted")
|
|
||||||
stream_id=(lookup ../sub "stream_id")
|
stream_id=(lookup ../sub "stream_id")
|
||||||
notification_setting=true
|
notification_setting=true
|
||||||
disabled_realm_setting=disabled_realm_setting
|
disabled_realm_setting=disabled_realm_setting
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div id="sub_{{setting_name}}_setting"
|
<div id="sub_{{setting_name}}_setting"
|
||||||
class="sub_setting_checkbox
|
class="sub_setting_checkbox
|
||||||
{{#if disabled_realm_setting}}control-label-disabled
|
{{#if disabled_realm_setting}}control-label-disabled
|
||||||
{{else if notification_setting}}sub_notification_setting {{#if is_muted}}muted-sub{{/if}}{{/if}} new-style">
|
{{else if notification_setting}}sub_notification_setting{{/if}} new-style">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="{{setting_name}}_{{stream_id}}" name="{{setting_name}}"
|
<input id="{{setting_name}}_{{stream_id}}" name="{{setting_name}}"
|
||||||
class="sub_setting_control" type="checkbox"
|
class="sub_setting_control" type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user