help: Tweak stream/group settings instructions for logged in users.

Adds gear menu instructions for how to navigate to "All streams"
and "All groups".
This commit is contained in:
David Rosa 2023-12-08 19:22:52 -08:00 committed by Tim Abbott
parent 9bb90b7358
commit 91ddcd4e1d
8 changed files with 30 additions and 22 deletions

View File

@ -23,7 +23,7 @@ stream. Changing a stream's color does not change it for anyone else.
{start_tabs}
{relative|stream|subscribed}
{relative|gear|stream-settings}
1. Select a stream.

View File

@ -1,6 +1,6 @@
{start_tabs}
{relative|group|all}
{relative|gear|group-settings}
1. Click **Create user group** on the right, or click the **plus**
(<i class="fa fa-plus"></i>) icon in the upper right.

View File

@ -24,7 +24,7 @@ API](/api/send-message).
{start_tabs}
{relative|stream|subscribed}
{relative|gear|stream-settings}
1. Select a stream.

View File

@ -49,7 +49,7 @@
{tab|desktop-web}
{relative|stream|subscribed}
{relative|gear|stream-settings}
1. Select a stream.

View File

@ -50,7 +50,7 @@ which is especially handy if you are subscribed to a large number of streams.
{tab|desktop-web}
{relative|stream|subscribed}
{relative|gear|stream-settings}
1. Select a stream.

View File

@ -28,7 +28,7 @@ You can always unsubscribe from any stream in Zulip.
{tab|desktop-web}
{relative|stream|subscribed}
{relative|gear|stream-settings}
1. Click the **checkmark**
(<img src="/static/images/help/desktop-web-check-icon.svg" alt="checkmark" class="help-center-icon"/>)

View File

@ -99,44 +99,46 @@ def help_handle_match(key: str) -> str:
stream_info = {
"all": ["All streams", "/#streams/all"],
"subscribed": ["Subscribed streams", "/#streams/subscribed"],
}
stream_instructions_no_link = """
stream_all_instructions = """
1. Click on the **gear** (<i class="zulip-icon zulip-icon-gear"></i>) icon in
the upper right corner of the web or desktop app.
1. Click <i class="zulip-icon zulip-icon-hash"></i> **Stream settings**.
1. Select <i class="zulip-icon zulip-icon-hash"></i> **Stream settings**.
1. Click {item} in the upper left.
"""
def stream_handle_match(key: str) -> str:
if relative_help_links:
return f"1. Go to [{stream_info[key][0]}]({stream_info[key][1]})."
if key == "all":
return stream_instructions_no_link + "\n\n1. Click **All streams** in the upper left."
return stream_instructions_no_link
item = f"[{stream_info[key][0]}]({stream_info[key][1]})"
else:
item = f"**{stream_info[key][0]}**"
return stream_all_instructions.format(item=item)
group_info = {
"all": ["All groups", "/#groups/all"],
"subscribed": ["Your groups", "/#groups/your"],
}
group_instructions_no_link = """
group_all_instructions = """
1. Click on the **gear** (<i class="zulip-icon zulip-icon-gear"></i>) icon in
the upper right corner of the web or desktop app.
1. Click <i class="zulip-icon zulip-icon-user-cog"></i> **Group settings**.
1. Select <i class="zulip-icon zulip-icon-user-cog"></i> **Group settings**.
1. Click {item} in the upper left.
"""
def group_handle_match(key: str) -> str:
if relative_help_links:
return f"1. Go to [{group_info[key][0]}]({group_info[key][1]})."
if key == "all":
return group_instructions_no_link + "\n\n1. Click **All groups** in the upper left."
return group_instructions_no_link
item = f"[{group_info[key][0]}]({group_info[key][1]})"
else:
item = f"**{group_info[key][0]}**"
return group_all_instructions.format(item=item)
draft_instructions = """

View File

@ -424,13 +424,19 @@ class HelpTest(ZulipTestCase):
def test_help_relative_links_for_stream(self) -> None:
result = self.client_get("/help/message-a-stream-by-email")
self.assertIn('<a href="/#streams/subscribed">Subscribed streams</a>', str(result.content))
self.assertIn(
'<a href="/#streams/subscribed"><i class="zulip-icon zulip-icon-hash"></i> Stream settings</a>',
str(result.content),
)
self.assertEqual(result.status_code, 200)
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
result = self.client_get("/help/message-a-stream-by-email", subdomain="")
self.assertEqual(result.status_code, 200)
self.assertIn("<strong>Stream settings</strong>", str(result.content))
self.assertIn(
'<strong><i class="zulip-icon zulip-icon-hash"></i> Stream settings</strong>',
str(result.content),
)
self.assertNotIn("/#streams", str(result.content))