stream edit: Extract stream_subscribers_ui.js.

This is a fairly straightforward extraction.

It's good to test this with Iago, and then go into
Manage Streams and add/remove subscribers for a stream
like devel.

I copy/pasted two small functions that will soon
diverge from stream_edit. The get_stream_id function
will either use a module variable (since we're
generally only editing subscribers for one stream, and
we already have the singleton assumption with
`input_pill`) or a more strict CSS selector.  And then
get_sub_for_target depends on get_stream_id. We may not
always need full subs, anyway, and when we adapt some
of this code for creating streams, things are likely to
change.

I stopped exporting a couple functions that have no
callers outside of this module.

The main entry point for the module is
enable_subscriber_management.

We continue to export invite_user_to_stream and
remove_user_from_stream, which should possibly be just
pulled into their own module to lessen some
dependencies, but they don't have too much baggage,
since they just wrap channel calls.
This commit is contained in:
Steve Howell
2021-12-18 17:47:21 +00:00
committed by Tim Abbott
parent d938f73d05
commit 0777cd73bb
8 changed files with 351 additions and 309 deletions

View File

@@ -81,6 +81,7 @@ import * as stream_data from "./stream_data";
import * as stream_edit from "./stream_edit";
import * as stream_list from "./stream_list";
import * as stream_settings_ui from "./stream_settings_ui";
import * as stream_subscribers_ui from "./stream_subscribers_ui";
import * as timerender from "./timerender";
import * as tippyjs from "./tippyjs";
import * as topic_list from "./topic_list";
@@ -568,6 +569,7 @@ export function initialize_everything() {
initialize_kitchen_sink_stuff();
echo.initialize();
stream_edit.initialize();
stream_subscribers_ui.initialize();
stream_data.initialize(stream_data_params);
pm_conversations.recent.initialize(pm_conversations_params);
muted_topics.initialize();