mirror of https://github.com/zulip/zulip.git
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:
parent
918c0b039b
commit
d180f7ccfc
|
@ -157,7 +157,7 @@ function initialize_left_sidebar() {
|
|||
function initialize_right_sidebar() {
|
||||
const rendered_sidebar = render_right_sidebar({
|
||||
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);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
</a>
|
||||
<div class="only-visible-for-spectators">
|
||||
<div class="realm-description">
|
||||
<div class="rendered_markdown">{{rendered_markdown realm_description }}</div>
|
||||
<div class="rendered_markdown">{{rendered_markdown realm_rendered_description }}</div>
|
||||
<hr />
|
||||
<a href="/register" class="signup_button color_animated_button">
|
||||
<i class="fa fa-pencil-square-o"></i>
|
||||
|
|
|
@ -243,6 +243,6 @@ def build_page_params_for_home_page_load(
|
|||
if user_profile is None:
|
||||
# Get rendered version of realm description which is displayed in right
|
||||
# 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
|
||||
|
|
|
@ -336,8 +336,10 @@ class HomeTest(ZulipTestCase):
|
|||
"narrow",
|
||||
"narrow_stream",
|
||||
]
|
||||
expected_keys = [i for i in self.expected_page_params_keys if i not in removed_keys]
|
||||
self.assertEqual(actual_keys, expected_keys)
|
||||
expected_keys = set(self.expected_page_params_keys + ["realm_rendered_description"]) - set(
|
||||
removed_keys
|
||||
)
|
||||
self.assertEqual(set(actual_keys), set(expected_keys))
|
||||
|
||||
# Test information passed to client about users.
|
||||
page_params = self._get_page_params(result)
|
||||
|
|
Loading…
Reference in New Issue