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.

web: Pass missing data to Handlebars templates.

Anders Kaseorg73d400e4a3b2
diff --git a/web/src/settings_profile_fields.js b/web/src/settings_profile_fields.js
index bf3024a2a91..874330cb5dd 100644
--- a/web/src/settings_profile_fields.js
+++ b/web/src/settings_profile_fields.js
@@ -186,7 +186,7 @@ function get_value_for_new_option(container) {
}
function create_choice_row(container) {
- const context = {value: get_value_for_new_option(container)};
+ const context = {text: "", value: get_value_for_new_option(container)};
const row = render_settings_profile_field_choice(context);
$(container).append(row);
}
diff --git a/web/src/stream_data.js b/web/src/stream_data.js
index b27b74f79cc..3befd4a3f92 100644
--- a/web/src/stream_data.js
+++ b/web/src/stream_data.js
@@ -746,6 +746,7 @@ export function create_streams(streams) {
// We handle subscriber stuff in other events.
const attrs = {
+ stream_weekly_traffic: null,
subscribers: [],
subscribed: false,
...stream,
diff --git a/web/src/stream_settings_ui.js b/web/src/stream_settings_ui.js
index 029f9c3df55..1edbd9e71f3 100644
--- a/web/src/stream_settings_ui.js
+++ b/web/src/stream_settings_ui.js
@@ -284,7 +284,9 @@ export function add_sub_to_table(sub) {
ui.get_content_element($(".streams-list")).append($new_row);
}
- const settings_html = render_stream_settings(sub);
+ const settings_html = render_stream_settings({
+ sub: stream_settings_data.get_sub_for_settings(sub),
+ });
ui.get_content_element($("#manage_streams_container .settings")).append($(settings_html));
if (stream_create.get_name() === sub.name) {
diff --git a/web/src/user_profile.js b/web/src/user_profile.js
index c90c95ba09d..a55feb1a631 100644
--- a/web/src/user_profile.js
+++ b/web/src/user_profile.js
@@ -120,6 +120,7 @@ export function get_custom_profile_field_data(user, field, field_types) {
if (!field_value.value) {
return profile_field;
}
+ profile_field.id = field.id;
profile_field.name = field.name;
profile_field.is_user_field = false;
profile_field.is_link = field_type === field_types.URL.id;
@@ -135,7 +136,6 @@ export function get_custom_profile_field_data(user, field, field_types) {
);
break;
case field_types.USER.id:
- profile_field.id = field.id;
profile_field.is_user_field = true;
profile_field.value = field_value.value;
break;