Extract stream_edit.js.

This code makes the right pane work in "Manage Streams" when
you are editing a stream subscription.  It handles basic
functionality (submitting forms, etc.), live updates, and
showing the pane as needed.

Most of the code here was simply moved from subs.js, but some
functions were pulled out of larger functions:

    live update:
        add_me_to_member_list
        update_stream_name
        update_stream_description

    collapse/show:
        collapse
        show_sub

We also now export subs.show_subs_pane.

We eventually want stream_edit not to call into subs.js, and
this should be fairly easy--we just need to move some shared
methods to a new module.
This commit is contained in:
Steve Howell
2017-04-23 19:11:25 -07:00
committed by Tim Abbott
parent ca2aea8d01
commit 7326971380
9 changed files with 620 additions and 559 deletions

View File

@@ -137,6 +137,9 @@ def find_edges_to_remove(graph, methods):
('compose_actions', 'resize'),
('settings_streams', 'stream_data'),
('drafts', 'hashchange'),
('settings_notifications', 'stream_edit'),
('compose', 'stream_edit'),
('subs', 'stream_edit'),
] # type: List[Edge]
def is_exempt(edge):
@@ -152,6 +155,7 @@ def find_edges_to_remove(graph, methods):
return edge in EXEMPT_EDGES
APPROVED_CUTS = [
('stream_edit', 'stream_events'),
('unread_ui', 'pointer'),
('typing_events', 'narrow'),
('echo', 'message_events'),
@@ -199,6 +203,7 @@ def find_edges_to_remove(graph, methods):
('muting_ui', 'stream_popover'),
('popovers', 'stream_popover'),
('topic_list', 'stream_popover'),
('stream_edit', 'subs'),
('topic_list', 'narrow'),
('stream_list', 'narrow'),
('stream_list', 'pm_list'),