right sidebar: Clean up rendered description logic.

Previously, we were masking the realm_description raw Markdown with
rendered Markdown, which was a type error.

When we switch to calling /register explicitly in a few commits, this
results in a bug, since the raw Markdown ends up taking priority.

Fix this by just using a different name for this different concept.
This commit is contained in:
Tim Abbott 2022-05-04 21:50:20 -07:00
parent 918c0b039b
commit d180f7ccfc
4 changed files with 7 additions and 5 deletions

View File

@ -157,7 +157,7 @@ function initialize_left_sidebar() {
function initialize_right_sidebar() { function initialize_right_sidebar() {
const rendered_sidebar = render_right_sidebar({ const rendered_sidebar = render_right_sidebar({
can_invite_others_to_realm: settings_data.user_can_invite_others_to_realm(), can_invite_others_to_realm: settings_data.user_can_invite_others_to_realm(),
realm_description: page_params.realm_description, realm_rendered_description: page_params.realm_rendered_description,
}); });
$("#right-sidebar-container").html(rendered_sidebar); $("#right-sidebar-container").html(rendered_sidebar);

View File

@ -32,7 +32,7 @@
</a> </a>
<div class="only-visible-for-spectators"> <div class="only-visible-for-spectators">
<div class="realm-description"> <div class="realm-description">
<div class="rendered_markdown">{{rendered_markdown realm_description }}</div> <div class="rendered_markdown">{{rendered_markdown realm_rendered_description }}</div>
<hr /> <hr />
<a href="/register" class="signup_button color_animated_button"> <a href="/register" class="signup_button color_animated_button">
<i class="fa fa-pencil-square-o"></i> <i class="fa fa-pencil-square-o"></i>

View File

@ -243,6 +243,6 @@ def build_page_params_for_home_page_load(
if user_profile is None: if user_profile is None:
# Get rendered version of realm description which is displayed in right # Get rendered version of realm description which is displayed in right
# sidebar for spectator. # sidebar for spectator.
page_params["realm_description"] = get_realm_rendered_description(realm) page_params["realm_rendered_description"] = get_realm_rendered_description(realm)
return register_ret["queue_id"], page_params return register_ret["queue_id"], page_params

View File

@ -336,8 +336,10 @@ class HomeTest(ZulipTestCase):
"narrow", "narrow",
"narrow_stream", "narrow_stream",
] ]
expected_keys = [i for i in self.expected_page_params_keys if i not in removed_keys] expected_keys = set(self.expected_page_params_keys + ["realm_rendered_description"]) - set(
self.assertEqual(actual_keys, expected_keys) removed_keys
)
self.assertEqual(set(actual_keys), set(expected_keys))
# Test information passed to client about users. # Test information passed to client about users.
page_params = self._get_page_params(result) page_params = self._get_page_params(result)