Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
buddy_list: Set html instead of append for view all subscribers link.
Shubham Padia7b925ce94ac4
diff --git a/web/src/buddy_list.ts b/web/src/buddy_list.tsindex 1b76cda59c7..f9c3ecdb62b 100644--- a/web/src/buddy_list.ts+++ b/web/src/buddy_list.ts@@ -366,7 +366,7 @@ export class BuddyList extends BuddyListConf {this.fill_screen_with_content();// This must happen after `fill_screen_with_content`- $("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();+ $("#buddy-list-users-matching-view-container .view-all-subscribers-link").empty();$("#buddy-list-other-users-container .view-all-users-link").empty();void this.render_view_user_list_links();this.display_or_hide_sections();@@ -746,12 +746,10 @@ export class BuddyList extends BuddyListConf {current_sub,"subscribers",);- $("#buddy-list-users-matching-view-container").append(- $(- render_view_all_subscribers({- stream_edit_hash,- }),- ),+ $("#buddy-list-users-matching-view-container .view-all-subscribers-link").html(+ render_view_all_subscribers({+ stream_edit_hash,+ }),);}diff --git a/web/templates/buddy_list/view_all_subscribers.hbs b/web/templates/buddy_list/view_all_subscribers.hbsindex c8a5d62c19c..4d5270341ea 100644--- a/web/templates/buddy_list/view_all_subscribers.hbs+++ b/web/templates/buddy_list/view_all_subscribers.hbs@@ -1,7 +1,5 @@-<div class="buddy-list-user-link view-all-subscribers-link">- <a class="right-sidebar-wrappable-text-container" href="{{stream_edit_hash}}">- <span class="right-sidebar-wrappable-text-inner">- {{t "View all subscribers" }}- </span>- </a>-</div>+<a class="right-sidebar-wrappable-text-container" href="{{stream_edit_hash}}">+ <span class="right-sidebar-wrappable-text-inner">+ {{t "View all subscribers" }}+ </span>+</a>diff --git a/web/templates/right_sidebar.hbs b/web/templates/right_sidebar.hbsindex 0e6053ad7b6..0b94a4bd6fc 100644--- a/web/templates/right_sidebar.hbs+++ b/web/templates/right_sidebar.hbs@@ -20,6 +20,7 @@<div id="buddy-list-users-matching-view-container" class="buddy-list-section-container"><div class="buddy-list-subsection-header"></div><ul id="buddy-list-users-matching-view" class="buddy-list-section"></ul>+ <div class="buddy-list-user-link view-all-subscribers-link"></div></div><div id="buddy-list-other-users-container" class="buddy-list-section-container"><div class="buddy-list-subsection-header"></div>diff --git a/web/tests/lib/buddy_list.cjs b/web/tests/lib/buddy_list.cjsindex a0c5e211997..13f8acbcc3c 100644--- a/web/tests/lib/buddy_list.cjs+++ b/web/tests/lib/buddy_list.cjs@@ -41,7 +41,7 @@ exports.stub_buddy_list_elements = () => {$("#buddy-list-users-matching-view .empty-list-message").length = 0;$("#buddy-list-other-users .empty-list-message").length = 0;$("#buddy-list-other-users-container .view-all-users-link").length = 0;- $("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove = noop;+ $("#buddy-list-users-matching-view-container .view-all-subscribers-link").empty = noop;$("#buddy-list-other-users-container .view-all-users-link").empty = noop;$(`#buddy-list-users-matching-view .empty-list-message`).remove = noop;$(`#buddy-list-other-users .empty-list-message`).remove = noop;