onboarding: Update initial messages and stream descriptions.

This commit is contained in:
Rishi Gupta 2019-02-23 23:14:13 -08:00 committed by Tim Abbott
parent 52fb22277b
commit 6c2c351894
3 changed files with 24 additions and 19 deletions

View File

@ -3547,7 +3547,9 @@ def do_create_realm(string_id: str, name: str,
realm.save() realm.save()
# Create stream once Realm object has been saved # 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 realm.notifications_stream = notifications_stream
# With the current initial streams situation, the only public # With the current initial streams situation, the only public

View File

@ -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 # Order corresponds to the ordering of the streams on the left sidebar, to make the initial Home
# view slightly less overwhelming # view slightly less overwhelming
welcome_messages = [ 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, {'stream': Realm.INITIAL_PRIVATE_STREAM_NAME,
'topic': "private streams", 'topic': "private streams",
'content': "This is a private stream. Only admins and people you invite " 'content': "This is a private stream, as indicated by the "
"to the stream will be able to see that this stream exists."}, "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, {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME,
'topic': "topic demonstration", '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, {'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME,
'topic': "topic demonstration", 'topic': "topic demonstration",
'content': "A second message in this topic. With [turtles](/static/images/cute/turtle.png)!"}, 'content': "Topics are a lightweight tool to keep conversations organized. "
{'stream': Realm.DEFAULT_NOTIFICATION_STREAM_NAME, "You can learn more about topics at [Streams and topics](/help/about-streams-and-topics). "},
'topic': "second topic", {'stream': realm.DEFAULT_NOTIFICATION_STREAM_NAME,
'content': "This is a message in a second topic.\n\nTopics are similar to email subjects, " 'topic': "swimming turtles",
"in that each conversation should get its own topic. Keep them short, though; one " 'content': "This is a message on stream #**%(default_notification_stream_name)s** with the "
"or two words will do it! " "topic `swimming turtles`. "
"Type `c` or click on `New Topic` at the bottom of the " "\n\n[](/static/images/cute/turtle.png)"
"screen to start a new topic."}, "\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]] ] # type: List[Dict[str, str]]
messages = [internal_prep_stream_message_by_name( messages = [internal_prep_stream_message_by_name(
realm, welcome_bot, message['stream'], realm, welcome_bot, message['stream'], message['topic'],
message['topic'], message['content'] 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] ) for message in welcome_messages]
message_ids = do_send_messages(messages) message_ids = do_send_messages(messages)

View File

@ -1708,7 +1708,7 @@ class RealmCreationTest(ZulipTestCase):
# Check welcome messages # Check welcome messages
for stream_name, text, message_count in [ 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)]: (Realm.INITIAL_PRIVATE_STREAM_NAME, 'private stream', 1)]:
stream = get_stream(stream_name, realm) stream = get_stream(stream_name, realm)
recipient = get_stream_recipient(stream.id) recipient = get_stream_recipient(stream.id)