stream settings: Allow org admin to update settings of unsub-stream.

As per backend validations.
This commit is contained in:
YJDave
2018-01-06 16:55:03 +05:30
committed by showell
parent 3189388258
commit c22285c154
2 changed files with 9 additions and 1 deletions

View File

@@ -325,6 +325,12 @@ function change_stream_privacy(e) {
redraw_privacy_related_stuff(sub_row, sub); redraw_privacy_related_stuff(sub_row, sub);
$("#stream_privacy_modal").remove(); $("#stream_privacy_modal").remove();
// For auto update, without rendering whole template
stream_data.update_calculated_fields(sub);
if (!sub.can_change_subscription_type) {
$(".change-stream-privacy").hide();
}
}, },
error: function () { error: function () {
$("#change-stream-privacy-button").text(i18n.t("Try again")); $("#change-stream-privacy-button").text(i18n.t("Try again"));

View File

@@ -270,7 +270,9 @@ exports.create_sidebar_row = function (sub) {
exports.redraw_stream_privacy = function (sub) { exports.redraw_stream_privacy = function (sub) {
var li = exports.get_stream_li(sub.stream_id); var li = exports.get_stream_li(sub.stream_id);
if (!li) { if (!li) {
blueslip.error('passed in bad stream: ' + sub.name); // We don't want to raise error here, if we can't find stream in subscription
// stream list. Cause we allow org admin to update stream privacy
// even if they don't subscribe to public stream.
return; return;
} }