Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream settings: Fix exception for users who cannot create streams.

Tim Abbott387237f26366
diff --git a/static/js/stream_settings_ui.js b/static/js/stream_settings_ui.js
index b9678bcd9bf..94e9dedeeaa 100644
--- a/static/js/stream_settings_ui.js
+++ b/static/js/stream_settings_ui.js
@@ -601,19 +601,9 @@ export function setup_page(callback) {
function populate_and_fill() {
$("#subscriptions_table").empty();
- // Show only stream types the user is allowed to create.
- const stream_privacy_policy_values = _.pickBy(
- stream_data.stream_privacy_policy_values,
- (value, key) =>
- (key === "public" && settings_data.user_can_create_public_streams()) ||
- (key !== "public" && settings_data.user_can_create_private_streams()),
- );
-
- // Required to mark the first item in the list of stream types as checked in stream_types.hbs.
- const stream_privacy_policy = settings_data.user_can_create_public_streams()
- ? stream_privacy_policy_values.public.code
- : stream_privacy_policy_values.private_with_public_history.code;
-
+ // TODO: Ideally we'd indicate in some way what stream types
+ // the user can create, by showing other options as disabled.
+ const stream_privacy_policy = stream_data.stream_privacy_policy_values.public.code;
const template_data = {
can_create_streams:
settings_data.user_can_create_private_streams() ||
@@ -622,7 +612,7 @@ export function setup_page(callback) {
max_name_length: page_params.max_stream_name_length,
max_description_length: page_params.max_stream_description_length,
is_owner: page_params.is_owner,
- stream_privacy_policy_values,
+ stream_privacy_policy_values: stream_data.stream_privacy_policy_values,
stream_privacy_policy,
stream_post_policy_values: stream_data.stream_post_policy_values,
zulip_plan_is_not_limited: page_params.zulip_plan_is_not_limited,