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: Live update subscribers list correctly.

Sahil Batra03ec0e1f14c1
diff --git a/web/src/stream_edit_subscribers.ts b/web/src/stream_edit_subscribers.ts
index 2e42b009ef2..b38f69b3ef4 100644
--- a/web/src/stream_edit_subscribers.ts
+++ b/web/src/stream_edit_subscribers.ts
@@ -5,7 +5,7 @@ import {z} from "zod";
import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs";
import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs";
import render_stream_member_list_entry from "../templates/stream_settings/stream_member_list_entry.hbs";
-import render_stream_members from "../templates/stream_settings/stream_members.hbs";
+import render_stream_members_table from "../templates/stream_settings/stream_members_table.hbs";
import render_stream_subscription_request_result from "../templates/stream_settings/stream_subscription_request_result.hbs";
import * as add_subscribers_pill from "./add_subscribers_pill";
@@ -440,11 +440,9 @@ export function rerender_subscribers_list(sub: sub_store.StreamSubscription): vo
.get_edit_container(sub)
.find(".edit_subscribers_for_stream");
- $parent_container.html(
- render_stream_members({
- can_access_subscribers: true,
+ $parent_container.find(".subscriber-list-box").html(
+ render_stream_members_table({
can_remove_subscribers: user_can_remove_subscribers,
- render_subscribers: sub.render_subscribers,
}),
);
subscribers_list_widget = make_list_widget({
diff --git a/web/templates/stream_settings/stream_members.hbs b/web/templates/stream_settings/stream_members.hbs
index 07ecea109fa..587654d4b69 100644
--- a/web/templates/stream_settings/stream_members.hbs
+++ b/web/templates/stream_settings/stream_members.hbs
@@ -17,19 +17,7 @@
</span>
</div>
<div class="subscriber-list-box">
- <div class="subscriber_list_container" data-simplebar data-simplebar-tab-index="-1">
- <div class="subscriber_list_loading_indicator"></div>
- <table id="stream_members_list" class="subscriber-list table table-striped">
- <thead class="table-sticky-headers">
- <th data-sort="alphabetic" data-sort-prop="full_name">{{t "Name" }}</th>
- <th class="settings-email-column" data-sort="email">{{t "Email" }}</th>
- {{#if can_remove_subscribers}}
- <th>{{t "Actions" }}</th>
- {{/if}}
- </thead>
- <tbody class="subscriber_table" data-empty="{{t 'This channel has no subscribers.' }}" data-search-results-empty="{{t 'No channel subscribers match your current filter.'}}"></tbody>
- </table>
- </div>
+ {{> stream_members_table}}
</div>
</div>
{{/render_subscribers}}
diff --git a/web/templates/stream_settings/stream_members_table.hbs b/web/templates/stream_settings/stream_members_table.hbs
new file mode 100644
index 00000000000..4006d61e49b
--- /dev/null
+++ b/web/templates/stream_settings/stream_members_table.hbs
@@ -0,0 +1,13 @@
+<div class="subscriber_list_container" data-simplebar data-simplebar-tab-index="-1">
+ <div class="subscriber_list_loading_indicator"></div>
+ <table id="stream_members_list" class="subscriber-list table table-striped">
+ <thead class="table-sticky-headers">
+ <th data-sort="alphabetic" data-sort-prop="full_name">{{t "Name" }}</th>
+ <th class="settings-email-column" data-sort="email">{{t "Email" }}</th>
+ {{#if can_remove_subscribers}}
+ <th>{{t "Actions" }}</th>
+ {{/if}}
+ </thead>
+ <tbody class="subscriber_table" data-empty="{{t 'This channel has no subscribers.' }}" data-search-results-empty="{{t 'No channel subscribers match your current filter.'}}"></tbody>
+ </table>
+</div>