mirror of https://github.com/zulip/zulip.git
streams-settings-overlay: Update hash for stream to channel rename.
Updates the base hash for the streams setting overlay to be "channels" instead of "streams". Because there are Welcome Bot and Notification Bot messages that would have been sent with the "/#streams" hash, we will need to support parsing those overlay hashes as an alias for "/#channels" permanently. Part of the stream to channels rename project.
This commit is contained in:
parent
21ba90c0ff
commit
8e953d9896
|
@ -8,9 +8,9 @@ be used to deep-link into the application and allow the browser's
|
|||
Some examples are:
|
||||
|
||||
- `/#settings/your-bots`: Bots section of the settings overlay.
|
||||
- `/#streams`: Streams overlay, where the user manages streams
|
||||
- `/#channels`: Streams overlay, where the user manages streams
|
||||
(subscription etc.)
|
||||
- `/#streams/11/announce`: Streams overlay with stream ID 11 (called
|
||||
- `/#channels/11/announce`: Streams overlay with stream ID 11 (called
|
||||
"announce") selected.
|
||||
- `/#narrow/stream/42-android/topic/fun`: Message feed showing stream
|
||||
"android" and topic "fun". (The `42` represents the id of the
|
||||
|
@ -25,7 +25,7 @@ different flows:
|
|||
- The user clicking on an in-app link, which in turn opens an overlay.
|
||||
For example the streams overlay opens when the user clicks the small
|
||||
cog symbol on the left sidebar, which is in fact a link to
|
||||
`/#streams`. This makes it easy to have simple links around the app
|
||||
`/#channels`. This makes it easy to have simple links around the app
|
||||
without custom click handlers for each one.
|
||||
- The user uses the "back" button in their browser (basically
|
||||
equivalent to the previous one, as a _link_ out of the browser history
|
||||
|
|
|
@ -544,7 +544,7 @@ export async function open_streams_modal(page: Page): Promise<void> {
|
|||
|
||||
await page.waitForSelector("#subscription_overlay.new-style", {visible: true});
|
||||
const url = await page_url_with_fragment(page);
|
||||
assert.ok(url.includes("#streams/all"));
|
||||
assert.ok(url.includes("#channels/all"));
|
||||
}
|
||||
|
||||
export async function open_personal_menu(page: Page): Promise<void> {
|
||||
|
|
|
@ -488,7 +488,7 @@ async function test_users_search(page: Page): Promise<void> {
|
|||
|
||||
async function test_narrow_public_streams(page: Page): Promise<void> {
|
||||
const stream_id = await common.get_stream_id(page, "Denmark");
|
||||
await page.goto(`http://zulip.zulipdev.com:9981/#streams/${stream_id}/Denmark`);
|
||||
await page.goto(`http://zulip.zulipdev.com:9981/#channels/${stream_id}/Denmark`);
|
||||
await page.waitForSelector("button.sub_unsub_button", {visible: true});
|
||||
await page.click("button.sub_unsub_button");
|
||||
await page.waitForSelector(
|
||||
|
|
|
@ -42,7 +42,7 @@ async function navigate_to_subscriptions(page: Page): Promise<void> {
|
|||
|
||||
await open_menu(page);
|
||||
|
||||
const manage_streams_selector = '.link-item a[href^="#streams"]';
|
||||
const manage_streams_selector = '.link-item a[href^="#channels"]';
|
||||
await page.waitForSelector(manage_streams_selector, {visible: true});
|
||||
await page.click(manage_streams_selector);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ export function initialize(): void {
|
|||
if (!can_create_streams) {
|
||||
// If the user can't create streams, we directly
|
||||
// navigate them to the Stream settings subscribe UI.
|
||||
window.location.assign("#streams/all");
|
||||
window.location.assign("#channels/all");
|
||||
// Returning false from an onShow handler cancels the show.
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ The menu itself has the selector
|
|||
The items with the prefix of "hash:" are in-page
|
||||
links:
|
||||
|
||||
#streams
|
||||
#channels
|
||||
#settings
|
||||
#organization
|
||||
#about-zulip
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
export function get_hash_category(hash?: string): string {
|
||||
// given "#streams/subscribed", returns "streams"
|
||||
// given "#channels/subscribed", returns "channels"
|
||||
return hash ? hash.replace(/^#/, "").split(/\//)[0] : "";
|
||||
}
|
||||
|
||||
export function get_hash_section(hash?: string): string {
|
||||
// given "#settings/profile", returns "profile"
|
||||
// given '#streams/5/social", returns "5"
|
||||
// given '#channels/5/social", returns "5"
|
||||
if (!hash) {
|
||||
return "";
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export function get_hash_section(hash?: string): string {
|
|||
|
||||
function get_nth_hash_section(hash: string, n: number): string {
|
||||
// given "#settings/profile" and n=1, returns "profile"
|
||||
// given '#streams/5/social" and n=2, returns "social"
|
||||
// given '#channels/5/social" and n=2, returns "social"
|
||||
const parts = hash.replace(/\/$/, "").split(/\//);
|
||||
return parts.at(n) ?? "";
|
||||
}
|
||||
|
@ -49,7 +49,13 @@ export function is_same_server_message_link(url: string): boolean {
|
|||
export function is_overlay_hash(hash: string): boolean {
|
||||
// Hash changes within this list are overlays and should not unnarrow (etc.)
|
||||
const overlay_list = [
|
||||
// In 2024, stream was renamed to channel in the Zulip API and UI.
|
||||
// Because pre-change Welcome Bot and Notification Bot messages
|
||||
// included links to "/#streams/all" and "/#streams/new", we'll
|
||||
// need to support "streams" as an overlay hash as an alias for
|
||||
// "channels" permanently.
|
||||
"streams",
|
||||
"channels",
|
||||
"drafts",
|
||||
"groups",
|
||||
"settings",
|
||||
|
@ -72,7 +78,7 @@ export function is_overlay_hash(hash: string): boolean {
|
|||
export function is_editing_stream(desired_stream_id: number): boolean {
|
||||
const hash_components = window.location.hash.slice(1).split(/\//);
|
||||
|
||||
if (hash_components[0] !== "streams") {
|
||||
if (hash_components[0] !== "channels") {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -88,7 +94,7 @@ export function is_editing_stream(desired_stream_id: number): boolean {
|
|||
}
|
||||
|
||||
export function is_create_new_stream_narrow(): boolean {
|
||||
return window.location.hash === "#streams/new";
|
||||
return window.location.hash === "#channels/new";
|
||||
}
|
||||
|
||||
// This checks whether the user is in the stream settings menu
|
||||
|
@ -96,7 +102,7 @@ export function is_create_new_stream_narrow(): boolean {
|
|||
export function is_subscribers_section_opened_for_stream(): boolean {
|
||||
const hash_components = window.location.hash.slice(1).split(/\//);
|
||||
|
||||
if (hash_components[0] !== "streams") {
|
||||
if (hash_components[0] !== "channels") {
|
||||
return false;
|
||||
}
|
||||
if (!hash_components[3]) {
|
||||
|
|
|
@ -145,7 +145,7 @@ export function by_conversation_and_time_url(message: Message): string {
|
|||
}
|
||||
|
||||
export function stream_edit_url(sub: StreamSubscription, right_side_tab: string): string {
|
||||
return `#streams/${sub.stream_id}/${internal_url.encodeHashComponent(
|
||||
return `#channels/${sub.stream_id}/${internal_url.encodeHashComponent(
|
||||
sub.name,
|
||||
)}/${right_side_tab}`;
|
||||
}
|
||||
|
@ -192,7 +192,16 @@ export function parse_narrow(hash: string): NarrowTerm[] | undefined {
|
|||
return terms;
|
||||
}
|
||||
|
||||
export function validate_stream_settings_hash(hash: string): string {
|
||||
export function channels_settings_section_url(section = "subscribed"): string {
|
||||
const valid_section_values = new Set(["new", "subscribed", "all"]);
|
||||
if (!valid_section_values.has(section)) {
|
||||
blueslip.warn("invalid section for channels settings: " + section);
|
||||
return "#channels/subscribed";
|
||||
}
|
||||
return `#channels/${section}`;
|
||||
}
|
||||
|
||||
export function validate_channels_settings_hash(hash: string): string {
|
||||
const hash_components = hash.slice(1).split(/\//);
|
||||
const section = hash_components[1];
|
||||
|
||||
|
@ -201,7 +210,7 @@ export function validate_stream_settings_hash(hash: string): string {
|
|||
settings_data.user_can_create_web_public_streams() ||
|
||||
settings_data.user_can_create_private_streams();
|
||||
if (section === "new" && !can_create_streams) {
|
||||
return "#streams/subscribed";
|
||||
return channels_settings_section_url();
|
||||
}
|
||||
|
||||
if (/\d+/.test(section)) {
|
||||
|
@ -216,27 +225,18 @@ export function validate_stream_settings_hash(hash: string): string {
|
|||
//
|
||||
// In all these cases we redirect the user to 'subscribed' tab.
|
||||
if (sub === undefined || (page_params.is_guest && !stream_data.is_subscribed(stream_id))) {
|
||||
return "#streams/subscribed";
|
||||
return channels_settings_section_url();
|
||||
}
|
||||
|
||||
const stream_name = hash_components[2];
|
||||
let right_side_tab = hash_components[3];
|
||||
const valid_right_side_tab_values = new Set(["general", "personal", "subscribers"]);
|
||||
if (sub.name === stream_name && valid_right_side_tab_values.has(right_side_tab)) {
|
||||
return hash;
|
||||
}
|
||||
if (!valid_right_side_tab_values.has(right_side_tab)) {
|
||||
right_side_tab = "general";
|
||||
}
|
||||
return stream_edit_url(sub, right_side_tab);
|
||||
}
|
||||
|
||||
const valid_section_values = ["new", "subscribed", "all"];
|
||||
if (!valid_section_values.includes(section)) {
|
||||
blueslip.warn("invalid section for streams: " + section);
|
||||
return "#streams/subscribed";
|
||||
}
|
||||
return hash;
|
||||
return channels_settings_section_url(section);
|
||||
}
|
||||
|
||||
export function validate_group_settings_hash(hash: string): string {
|
||||
|
|
|
@ -216,6 +216,7 @@ function do_hashchange_normal(from_reload) {
|
|||
case "#search-operators":
|
||||
case "#drafts":
|
||||
case "#invite":
|
||||
case "#channels":
|
||||
case "#streams":
|
||||
case "#organization":
|
||||
case "#settings":
|
||||
|
@ -235,7 +236,7 @@ function do_hashchange_overlay(old_hash) {
|
|||
// show the user's home view behind it.
|
||||
show_home_view();
|
||||
}
|
||||
const base = hash_parser.get_current_hash_category();
|
||||
let base = hash_parser.get_current_hash_category();
|
||||
const old_base = hash_parser.get_hash_category(old_hash);
|
||||
let section = hash_parser.get_current_hash_section();
|
||||
|
||||
|
@ -263,11 +264,21 @@ function do_hashchange_overlay(old_hash) {
|
|||
);
|
||||
}
|
||||
|
||||
if (base === "streams") {
|
||||
const valid_hash = hash_util.validate_stream_settings_hash(window.location.hash);
|
||||
// In 2024, stream was renamed to channel in the Zulip API and UI.
|
||||
// Because pre-change Welcome Bot and Notification Bot messages
|
||||
// included links to "/#streams/all" and "/#streams/new", we'll
|
||||
// need to support "streams" as an overlay hash as an alias for
|
||||
// "channels" permanently.
|
||||
if (base === "streams" || base === "channels") {
|
||||
const valid_hash = hash_util.validate_channels_settings_hash(window.location.hash);
|
||||
// Here valid_hash will always return "channels" as the base.
|
||||
// So, if we update the history because the valid hash does
|
||||
// not match the window.location.hash, then we also reset the
|
||||
// base string we're tracking for the hash.
|
||||
if (valid_hash !== window.location.hash) {
|
||||
history.replaceState(null, "", browser_history.get_full_url(valid_hash));
|
||||
section = hash_parser.get_current_hash_section();
|
||||
base = hash_parser.get_current_hash_category();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,14 +290,14 @@ function do_hashchange_overlay(old_hash) {
|
|||
}
|
||||
}
|
||||
|
||||
// Start by handling the specific case of going
|
||||
// from something like streams/all to streams_subscribed.
|
||||
// Start by handling the specific case of going from
|
||||
// something like "#channels/all" to "#channels/subscribed".
|
||||
//
|
||||
// In most situations we skip by this logic and load
|
||||
// the new overlay.
|
||||
if (coming_from_overlay && base === old_base) {
|
||||
if (base === "streams") {
|
||||
// e.g. #streams/29/social/subscribers
|
||||
if (base === "channels") {
|
||||
// e.g. #channels/29/social/subscribers
|
||||
const right_side_tab = hash_parser.get_current_nth_hash_section(3);
|
||||
stream_settings_ui.change_state(section, undefined, right_side_tab);
|
||||
return;
|
||||
|
@ -353,8 +364,8 @@ function do_hashchange_overlay(old_hash) {
|
|||
browser_history.set_hash_before_overlay(old_hash);
|
||||
}
|
||||
|
||||
if (base === "streams") {
|
||||
// e.g. #streams/29/social/subscribers
|
||||
if (base === "channels") {
|
||||
// e.g. #channels/29/social/subscribers
|
||||
const right_side_tab = hash_parser.get_current_nth_hash_section(3);
|
||||
|
||||
if (is_somebody_else_profile_open()) {
|
||||
|
|
|
@ -44,9 +44,9 @@ export function setup_subscriptions_tab_hash(tab_key_value) {
|
|||
return;
|
||||
}
|
||||
if (tab_key_value === "all-streams") {
|
||||
browser_history.update("#streams/all");
|
||||
browser_history.update("#channels/all");
|
||||
} else if (tab_key_value === "subscribed") {
|
||||
browser_history.update("#streams/subscribed");
|
||||
browser_history.update("#channels/subscribed");
|
||||
} else {
|
||||
blueslip.debug("Unknown tab_key_value: " + tab_key_value);
|
||||
}
|
||||
|
|
|
@ -731,7 +731,7 @@ function show_right_section() {
|
|||
}
|
||||
|
||||
export function change_state(section, left_side_tab, right_side_tab) {
|
||||
// if in #streams/new form.
|
||||
// if in #channels/new form.
|
||||
if (section === "new") {
|
||||
do_open_create_stream();
|
||||
show_right_section();
|
||||
|
@ -880,7 +880,7 @@ export function do_open_create_stream() {
|
|||
|
||||
export function open_create_stream() {
|
||||
do_open_create_stream();
|
||||
browser_history.update("#streams/new");
|
||||
browser_history.update("#channels/new");
|
||||
}
|
||||
|
||||
export function update_stream_privacy_choices(policy) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{#tr}}
|
||||
The channel <b>#{channel_name}</b> does not exist. Manage your subscriptions
|
||||
<z-link>on your Channels page</z-link>.
|
||||
{{#*inline "z-link"}}<a href='#streams/all'>{{> @partial-block}}</a>{{/inline}}
|
||||
{{#*inline "z-link"}}<a href='#channels/all'>{{> @partial-block}}</a>{{/inline}}
|
||||
{{/tr}}
|
||||
</p>
|
||||
{{/compose_banner}}
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<li class="popover-menu-outer-list-item">
|
||||
<ul class="popover-menu-inner-list">
|
||||
<li class="link-item popover-menu-inner-list-item hidden-for-spectators">
|
||||
<a href="#streams/subscribed" class="navigate-link-on-enter popover-menu-link">
|
||||
<a href="#channels/subscribed" class="navigate-link-on-enter popover-menu-link">
|
||||
<i class="popover-menu-icon zulip-icon zulip-icon-hash" aria-hidden="true"></i>
|
||||
<span class="popover-menu-label">{{t 'Channel settings' }}</span>
|
||||
</a>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<ul class="nav nav-list">
|
||||
<li>
|
||||
<a href="#streams/all" class="navigate_and_close_popover">
|
||||
<a href="#channels/all" class="navigate_and_close_popover">
|
||||
{{t "Browse channels" }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#streams/new" class="navigate_and_close_popover">
|
||||
<a href="#channels/new" class="navigate_and_close_popover">
|
||||
{{t "Create a channel" }}
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<span>
|
||||
{{t 'You are not subscribed to any channels.'}}
|
||||
{{#if can_view_all_streams}}
|
||||
<a href="#streams/all">{{t 'View all channels'}}</a>
|
||||
<a href="#channels/all">{{t 'View all channels'}}</a>
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<span>
|
||||
{{t 'There are no channels you can view in this organization.'}}
|
||||
{{#if can_create_streams}}
|
||||
<a href="#streams/new">{{t 'Create a channel'}}</a>
|
||||
<a href="#channels/new">{{t 'Create a channel'}}</a>
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{{#if exactly_one_unsubscribed_stream}}
|
||||
<a href="#streams/all">
|
||||
<a href="#channels/all">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
||||
{{~t "Browse 1 more channel" ~}}
|
||||
</a>
|
||||
{{else if can_subscribe_stream_count}}
|
||||
<a href="#streams/all">
|
||||
<a href="#channels/all">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
||||
{{~t "Browse {can_subscribe_stream_count} more channels" ~}}
|
||||
</a>
|
||||
{{else if can_create_streams}}
|
||||
<a href="#streams/new">
|
||||
<a href="#channels/new">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
||||
{{~t "Create a channel" ~}}
|
||||
</a>
|
||||
|
|
|
@ -53,7 +53,7 @@ run_test("hash_util", () => {
|
|||
});
|
||||
|
||||
run_test("test_get_hash_category", () => {
|
||||
assert.deepEqual(hash_parser.get_hash_category("streams/subscribed"), "streams");
|
||||
assert.deepEqual(hash_parser.get_hash_category("channels/subscribed"), "channels");
|
||||
assert.deepEqual(hash_parser.get_hash_category("#settings/preferences"), "settings");
|
||||
assert.deepEqual(hash_parser.get_hash_category("#drafts"), "drafts");
|
||||
assert.deepEqual(hash_parser.get_hash_category("invites"), "invites");
|
||||
|
@ -63,7 +63,7 @@ run_test("test_get_hash_category", () => {
|
|||
});
|
||||
|
||||
run_test("test_get_hash_section", () => {
|
||||
assert.equal(hash_parser.get_hash_section("streams/subscribed"), "subscribed");
|
||||
assert.equal(hash_parser.get_hash_section("channels/subscribed"), "subscribed");
|
||||
assert.equal(hash_parser.get_hash_section("#settings/profile"), "profile");
|
||||
|
||||
assert.equal(hash_parser.get_hash_section("settings/10/general/"), "10");
|
||||
|
@ -138,15 +138,15 @@ run_test("build_reload_url", () => {
|
|||
});
|
||||
|
||||
run_test("test is_editing_stream", () => {
|
||||
window.location.hash = "#streams/1/announce";
|
||||
window.location.hash = "#channels/1/announce";
|
||||
assert.equal(hash_parser.is_editing_stream(1), true);
|
||||
assert.equal(hash_parser.is_editing_stream(2), false);
|
||||
|
||||
// url is missing name at end
|
||||
window.location.hash = "#streams/1";
|
||||
window.location.hash = "#channels/1";
|
||||
assert.equal(hash_parser.is_editing_stream(1), false);
|
||||
|
||||
window.location.hash = "#streams/bogus/bogus";
|
||||
window.location.hash = "#channels/bogus/bogus";
|
||||
assert.equal(hash_parser.is_editing_stream(1), false);
|
||||
|
||||
window.location.hash = "#test/narrow";
|
||||
|
@ -154,7 +154,7 @@ run_test("test is_editing_stream", () => {
|
|||
});
|
||||
|
||||
run_test("test_is_create_new_stream_narrow", () => {
|
||||
window.location.hash = "#streams/new";
|
||||
window.location.hash = "#channels/new";
|
||||
assert.equal(hash_parser.is_create_new_stream_narrow(), true);
|
||||
|
||||
window.location.hash = "#some/random/hash";
|
||||
|
@ -162,13 +162,13 @@ run_test("test_is_create_new_stream_narrow", () => {
|
|||
});
|
||||
|
||||
run_test("test_is_subscribers_section_opened_for_stream", () => {
|
||||
window.location.hash = "#streams/1/Design/subscribers";
|
||||
window.location.hash = "#channels/1/Design/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), true);
|
||||
|
||||
window.location.hash = "#streams/99/.EC.A1.B0.EB.A6.AC.EB.B2.95.20.F0.9F.98.8E/subscribers";
|
||||
window.location.hash = "#channels/99/.EC.A1.B0.EB.A6.AC.EB.B2.95.20.F0.9F.98.8E/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), true);
|
||||
|
||||
window.location.hash = "#streams/random/subscribers";
|
||||
window.location.hash = "#channels/random/subscribers";
|
||||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), false);
|
||||
|
||||
window.location.hash = "#some/random/place/subscribers";
|
||||
|
@ -203,7 +203,7 @@ run_test("test_stream_edit_url", () => {
|
|||
};
|
||||
assert.equal(
|
||||
hash_util.stream_edit_url(sub, "general"),
|
||||
"#streams/42/research.20.26.20development/general",
|
||||
"#channels/42/research.20.26.20development/general",
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ run_test("hash_interactions", ({override, override_rewire}) => {
|
|||
[ui_report, "error"],
|
||||
]);
|
||||
|
||||
window.location.hash = "#streams/subscribed";
|
||||
window.location.hash = "#channels/subscribed";
|
||||
|
||||
helper.clear_events();
|
||||
$window_stub.trigger("hashchange");
|
||||
|
|
|
@ -1471,7 +1471,7 @@ def send_pm_if_empty_stream(
|
|||
arg_dict = {
|
||||
**arg_dict,
|
||||
"channel_name": f"#**{stream_name}**",
|
||||
"new_channel_link": "#streams/new",
|
||||
"new_channel_link": "#channels/new",
|
||||
}
|
||||
content = _(
|
||||
"Your bot {bot_identity} tried to send a message to channel "
|
||||
|
|
|
@ -21,7 +21,7 @@ gear_info = {
|
|||
# link is used for relative links: `Select [name](link).`
|
||||
"stream-settings": [
|
||||
'<i class="zulip-icon zulip-icon-hash"></i> Stream settings',
|
||||
"/#streams/subscribed",
|
||||
"/#channels/subscribed",
|
||||
],
|
||||
"settings": [
|
||||
'<i class="zulip-icon zulip-icon-tool"></i> Personal Settings',
|
||||
|
@ -98,7 +98,7 @@ def help_handle_match(key: str) -> str:
|
|||
|
||||
|
||||
stream_info = {
|
||||
"all": ["All streams", "/#streams/all"],
|
||||
"all": ["All streams", "/#channels/all"],
|
||||
}
|
||||
|
||||
stream_all_instructions = """
|
||||
|
|
|
@ -177,7 +177,7 @@ def select_welcome_bot_response(human_response_lower: str) -> str:
|
|||
)
|
||||
+ "\n\n",
|
||||
_("[Browse and subscribe to channels]({settings_link}).").format(
|
||||
settings_link="#streams/all"
|
||||
settings_link="#channels/all"
|
||||
),
|
||||
]
|
||||
)
|
||||
|
@ -279,7 +279,7 @@ def send_initial_realm_messages(realm: Realm) -> None:
|
|||
"and click on `{initial_private_channel_name}`."
|
||||
)
|
||||
).format(
|
||||
channel_settings_url="#streams/subscribed",
|
||||
channel_settings_url="#channels/subscribed",
|
||||
initial_private_channel_name=Realm.INITIAL_PRIVATE_STREAM_NAME,
|
||||
)
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ 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"><i class="zulip-icon zulip-icon-hash"></i> Stream settings</a>',
|
||||
'<a href="/#channels/subscribed"><i class="zulip-icon zulip-icon-hash"></i> Stream settings</a>',
|
||||
str(result.content),
|
||||
)
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
@ -438,7 +438,7 @@ class HelpTest(ZulipTestCase):
|
|||
'<strong><i class="zulip-icon zulip-icon-hash"></i> Stream settings</strong>',
|
||||
str(result.content),
|
||||
)
|
||||
self.assertNotIn("/#streams", str(result.content))
|
||||
self.assertNotIn("/#channels", str(result.content))
|
||||
|
||||
|
||||
class IntegrationTest(ZulipTestCase):
|
||||
|
|
|
@ -3175,11 +3175,11 @@ class MarkdownTest(ZulipTestCase):
|
|||
realm = get_realm("zulip")
|
||||
sender_user_profile = self.example_user("othello")
|
||||
message = Message(sender=sender_user_profile, sending_client=get_client("test"))
|
||||
msg = "http://zulip.testserver/#streams/all"
|
||||
msg = "http://zulip.testserver/#channels/all"
|
||||
|
||||
self.assertEqual(
|
||||
markdown_convert(msg, message_realm=realm, message=message).rendered_content,
|
||||
'<p><a href="#streams/all">http://zulip.testserver/#streams/all</a></p>',
|
||||
'<p><a href="#channels/all">http://zulip.testserver/#channels/all</a></p>',
|
||||
)
|
||||
|
||||
def test_md_relative_link(self) -> None:
|
||||
|
|
|
@ -94,7 +94,7 @@ class TutorialTests(ZulipTestCase):
|
|||
self.send_personal_message(user, bot, content)
|
||||
expected_response = (
|
||||
"In Zulip, channels [determine who gets a message](/help/streams-and-topics).\n\n"
|
||||
"[Browse and subscribe to channels](#streams/all)."
|
||||
"[Browse and subscribe to channels](#channels/all)."
|
||||
)
|
||||
self.assertEqual(most_recent_message(user).content, expected_response)
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class HelloWorldHookTests(WebhookTestCase):
|
|||
self.url = self.build_webhook_url()
|
||||
realm = get_realm("zulip")
|
||||
notification_bot = get_system_bot(settings.NOTIFICATION_BOT, realm.id)
|
||||
expected_message = "Your bot `webhook-bot@zulip.com` tried to send a message to channel #**nonexistent**, but that channel does not exist. Click [here](#streams/new) to create it."
|
||||
expected_message = "Your bot `webhook-bot@zulip.com` tried to send a message to channel #**nonexistent**, but that channel does not exist. Click [here](#channels/new) to create it."
|
||||
self.send_and_test_private_message(
|
||||
"goodbye",
|
||||
expected_message=expected_message,
|
||||
|
|
Loading…
Reference in New Issue