From 6c2c3518946d6031d479a1d1efc4e74360482d62 Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Sat, 23 Feb 2019 23:14:13 -0800 Subject: [PATCH] onboarding: Update initial messages and stream descriptions. --- zerver/lib/actions.py | 4 +++- zerver/lib/onboarding.py | 37 ++++++++++++++++++++----------------- zerver/tests/test_signup.py | 2 +- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 90d4830623..4fbe3cedf4 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -3547,7 +3547,9 @@ def do_create_realm(string_id: str, name: str, realm.save() # Create stream once Realm object has been saved - notifications_stream = ensure_stream(realm, Realm.DEFAULT_NOTIFICATION_STREAM_NAME) + notifications_stream = ensure_stream( + realm, Realm.DEFAULT_NOTIFICATION_STREAM_NAME, + stream_description="Everyone is added to this stream by default. Welcome! :octopus:") realm.notifications_stream = notifications_stream # With the current initial streams situation, the only public diff --git a/zerver/lib/onboarding.py b/zerver/lib/onboarding.py index 0b7ae72241..06aad6de92 100644 --- a/zerver/lib/onboarding.py +++ b/zerver/lib/onboarding.py @@ -65,31 +65,34 @@ def send_initial_realm_messages(realm: Realm) -> None: # Order corresponds to the ordering of the streams on the left sidebar, to make the initial Home # view slightly less overwhelming welcome_messages = [ - {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, - 'topic': "welcome", - 'content': "This is a message on stream `%s` with the topic `welcome`. We'll use this stream " - "for system-generated notifications." % (Realm.DEFAULT_NOTIFICATION_STREAM_NAME,)}, {'stream': Realm.INITIAL_PRIVATE_STREAM_NAME, 'topic': "private streams", - 'content': "This is a private stream. Only admins and people you invite " - "to the stream will be able to see that this stream exists."}, + 'content': "This is a private stream, as indicated by the " + "lock icon next to the stream name. Private streams are only visible to stream members. " + "\n\nTo manage this stream, go to [Stream settings](#streams/subscribed) and click on " + "`%(initial_private_stream_name)s`."}, {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, 'topic': "topic demonstration", - 'content': "Here is a message in one topic. Replies to this message will go to this topic."}, + 'content': "This is a message on stream #**%(default_notification_stream_name)s** with the " + "topic `topic demonstration`."}, {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, 'topic': "topic demonstration", - 'content': "A second message in this topic. With [turtles](/static/images/cute/turtle.png)!"}, - {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, - 'topic': "second topic", - 'content': "This is a message in a second topic.\n\nTopics are similar to email subjects, " - "in that each conversation should get its own topic. Keep them short, though; one " - "or two words will do it! " - "Type `c` or click on `New Topic` at the bottom of the " - "screen to start a new topic."}, + 'content': "Topics are a lightweight tool to keep conversations organized. " + "You can learn more about topics at [Streams and topics](/help/about-streams-and-topics). "}, + {'stream': realm.DEFAULT_NOTIFICATION_STREAM_NAME, + 'topic': "swimming turtles", + 'content': "This is a message on stream #**%(default_notification_stream_name)s** with the " + "topic `swimming turtles`. " + "\n\n[](/static/images/cute/turtle.png)" + "\n\n[Start a new topic](/help/start-a-new-topic) any time you're not replying to a " + "previous message."}, ] # type: List[Dict[str, str]] messages = [internal_prep_stream_message_by_name( - realm, welcome_bot, message['stream'], - message['topic'], message['content'] + realm, welcome_bot, message['stream'], message['topic'], + message['content'] % { + 'initial_private_stream_name': Realm.INITIAL_PRIVATE_STREAM_NAME, + 'default_notification_stream_name': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, + } ) for message in welcome_messages] message_ids = do_send_messages(messages) diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 82d907c567..ffb5742abf 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -1708,7 +1708,7 @@ class RealmCreationTest(ZulipTestCase): # Check welcome messages for stream_name, text, message_count in [ - (Realm.DEFAULT_NOTIFICATION_STREAM_NAME, 'with the topic', 4), + (Realm.DEFAULT_NOTIFICATION_STREAM_NAME, 'with the topic', 3), (Realm.INITIAL_PRIVATE_STREAM_NAME, 'private stream', 1)]: stream = get_stream(stream_name, realm) recipient = get_stream_recipient(stream.id)