From 1c55004cda421cec1f89d6ff79fcb4c94a18315e Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Fri, 18 Apr 2025 09:39:55 -0500 Subject: [PATCH] decorated_channels: Rename partial as 'decorated_channel'. --- web/src/compose_recipient.ts | 4 ++-- web/src/dropdown_widget.ts | 4 ++-- web/src/stream_edit.ts | 4 ++-- web/src/stream_edit_subscribers.ts | 4 ++-- web/src/stream_events.ts | 4 ++-- web/src/stream_popover.ts | 4 ++-- web/src/stream_settings_components.ts | 6 ++++-- web/src/unread_ops.ts | 6 +++--- web/templates/dropdown_list.hbs | 2 +- ...ed_stream_name.hbs => inline_decorated_channel_name.hbs} | 0 web/templates/inline_stream_or_topic_reference.hbs | 2 +- web/templates/stream_settings/announce_stream_checkbox.hbs | 2 +- web/templates/stream_settings/browse_streams_list_item.hbs | 6 +++--- .../stream_settings/first_stream_created_modal.hbs | 2 +- web/templates/stream_settings/stream_settings.hbs | 2 +- web/templates/typeahead_list_item.hbs | 2 +- .../stream_group_permission_settings.hbs | 2 +- web/tests/compose_actions.test.cjs | 6 +++--- 18 files changed, 32 insertions(+), 30 deletions(-) rename web/templates/{inline_decorated_stream_name.hbs => inline_decorated_channel_name.hbs} (100%) diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts index 6ed3ef2b51..464565c7d3 100644 --- a/web/src/compose_recipient.ts +++ b/web/src/compose_recipient.ts @@ -5,7 +5,7 @@ import _ from "lodash"; import assert from "minimalistic-assert"; import type * as tippy from "tippy.js"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import * as compose_banner from "./compose_banner.ts"; import * as compose_fade from "./compose_fade.ts"; @@ -167,7 +167,7 @@ function update_recipient_label(stream_id?: number): void { ); } else { $("#compose_select_recipient_widget .dropdown_widget_value").html( - render_inline_decorated_stream_name({stream, show_colored_icon: true}), + render_inline_decorated_channel_name({stream, show_colored_icon: true}), ); } } diff --git a/web/src/dropdown_widget.ts b/web/src/dropdown_widget.ts index b2f23ddf71..71059f9d54 100644 --- a/web/src/dropdown_widget.ts +++ b/web/src/dropdown_widget.ts @@ -6,7 +6,7 @@ import render_dropdown_current_value_not_in_options from "../templates/dropdown_ import render_dropdown_disabled_state from "../templates/dropdown_disabled_state.hbs"; import render_dropdown_list from "../templates/dropdown_list.hbs"; import render_dropdown_list_container from "../templates/dropdown_list_container.hbs"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import * as blueslip from "./blueslip.ts"; import * as ListWidget from "./list_widget.ts"; @@ -591,7 +591,7 @@ export class DropdownWidget { $(this.widget_value_selector).html(render_dropdown_disabled_state({name: option.name})); } else if (option.stream) { $(this.widget_value_selector).html( - render_inline_decorated_stream_name({ + render_inline_decorated_channel_name({ stream: option.stream, show_colored_icon: true, }), diff --git a/web/src/stream_edit.ts b/web/src/stream_edit.ts index a37185037c..7614b0c042 100644 --- a/web/src/stream_edit.ts +++ b/web/src/stream_edit.ts @@ -5,7 +5,7 @@ import type * as tippy from "tippy.js"; import {z} from "zod"; import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_change_stream_info_modal from "../templates/stream_settings/change_stream_info_modal.hbs"; import render_confirm_stream_privacy_change_modal from "../templates/stream_settings/confirm_stream_privacy_change_modal.hbs"; import render_copy_email_address_modal from "../templates/stream_settings/copy_email_address_modal.hbs"; @@ -712,7 +712,7 @@ export function initialize(): void { const stream_id = get_stream_id(this); const stream = sub_store.get(stream_id); - const stream_name_with_privacy_symbol_html = render_inline_decorated_stream_name({stream}); + const stream_name_with_privacy_symbol_html = render_inline_decorated_channel_name({stream}); const is_new_stream_announcements_stream = stream_id === realm.realm_new_stream_announcements_stream_id; diff --git a/web/src/stream_edit_subscribers.ts b/web/src/stream_edit_subscribers.ts index 4b6e633a51..5c22b6893f 100644 --- a/web/src/stream_edit_subscribers.ts +++ b/web/src/stream_edit_subscribers.ts @@ -3,7 +3,7 @@ import assert from "minimalistic-assert"; import {z} from "zod"; import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_stream_member_list_entry from "../templates/stream_settings/stream_member_list_entry.hbs"; import render_stream_members_table from "../templates/stream_settings/stream_members_table.hbs"; import render_stream_subscription_request_result from "../templates/stream_settings/stream_subscription_request_result.hbs"; @@ -357,7 +357,7 @@ function remove_subscriber({ return; } - const stream_name_with_privacy_symbol_html = render_inline_decorated_stream_name({ + const stream_name_with_privacy_symbol_html = render_inline_decorated_channel_name({ stream: sub, }); diff --git a/web/src/stream_events.ts b/web/src/stream_events.ts index 97c7a4c3a5..cbd28dc159 100644 --- a/web/src/stream_events.ts +++ b/web/src/stream_events.ts @@ -1,7 +1,7 @@ import $ from "jquery"; import assert from "minimalistic-assert"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_first_stream_created_modal from "../templates/stream_settings/first_stream_created_modal.hbs"; import * as activity_ui from "./activity_ui.ts"; @@ -222,7 +222,7 @@ function show_first_stream_created_modal(stream: StreamSubscription): void { html_heading: $t_html( {defaultMessage: "Channel created!"}, { - "z-stream": () => render_inline_decorated_stream_name({stream}), + "z-stream": () => render_inline_decorated_channel_name({stream}), }, ), html_body: render_first_stream_created_modal({stream}), diff --git a/web/src/stream_popover.ts b/web/src/stream_popover.ts index be9e067d75..6251e20a2f 100644 --- a/web/src/stream_popover.ts +++ b/web/src/stream_popover.ts @@ -3,7 +3,7 @@ import assert from "minimalistic-assert"; import type * as tippy from "tippy.js"; import {z} from "zod"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_inline_stream_or_topic_reference from "../templates/inline_stream_or_topic_reference.hbs"; import render_topic_already_exists_warning_banner from "../templates/modal_banner/topic_already_exists_warning_banner.hbs"; import render_move_topic_to_stream from "../templates/move_topic_to_stream.hbs"; @@ -672,7 +672,7 @@ export async function build_move_topic_to_stream_popover( ); } else { $("#move_topic_to_stream_widget .dropdown_widget_value").html( - render_inline_decorated_stream_name({stream, show_colored_icon: true}), + render_inline_decorated_channel_name({stream, show_colored_icon: true}), ); } } diff --git a/web/src/stream_settings_components.ts b/web/src/stream_settings_components.ts index 78c96a46d1..6a9d150858 100644 --- a/web/src/stream_settings_components.ts +++ b/web/src/stream_settings_components.ts @@ -2,7 +2,7 @@ import $ from "jquery"; import {z} from "zod"; import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_selected_stream_title from "../templates/stream_settings/selected_stream_title.hbs"; import * as channel from "./channel.ts"; @@ -225,7 +225,9 @@ function ajaxUnsubscribe(sub: StreamSubscription, $stream_row: JQuery | undefine export function unsubscribe_from_private_stream(sub: StreamSubscription): void { const invite_only = sub.invite_only; const sub_count = peer_data.get_subscriber_count(sub.stream_id); - const stream_name_with_privacy_symbol_html = render_inline_decorated_stream_name({stream: sub}); + const stream_name_with_privacy_symbol_html = render_inline_decorated_channel_name({ + stream: sub, + }); const html_body = render_unsubscribe_private_stream_modal({ unsubscribing_other_user: false, diff --git a/web/src/unread_ops.ts b/web/src/unread_ops.ts index 00b8d8d3d5..c018bdd3b4 100644 --- a/web/src/unread_ops.ts +++ b/web/src/unread_ops.ts @@ -5,7 +5,7 @@ import {z} from "zod"; import render_confirm_mark_all_as_read from "../templates/confirm_dialog/confirm_mark_all_as_read.hbs"; import render_confirm_mark_as_unread_from_here from "../templates/confirm_dialog/confirm_mark_as_unread_from_here.hbs"; -import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs"; +import render_inline_decorated_channel_name from "../templates/inline_decorated_channel_name.hbs"; import render_skipped_marking_unread from "../templates/skipped_marking_unread.hbs"; import * as blueslip from "./blueslip.ts"; @@ -102,8 +102,8 @@ function handle_skipped_unsubscribed_streams( const stream_names_with_privacy_symbol_html = ignored_because_not_subscribed_channels.map( (stream_id) => { const stream = sub_store.get(stream_id); - const decorated_stream_name = render_inline_decorated_stream_name({stream}); - return `${decorated_stream_name}`; + const decorated_channel_name = render_inline_decorated_channel_name({stream}); + return `${decorated_channel_name}`; }, ); diff --git a/web/templates/dropdown_list.hbs b/web/templates/dropdown_list.hbs index ada974ef84..4a6e809242 100644 --- a/web/templates/dropdown_list.hbs +++ b/web/templates/dropdown_list.hbs @@ -22,7 +22,7 @@ {{else}} {{#if stream}} - {{> inline_decorated_stream_name stream=stream show_colored_icon=true}} + {{> inline_decorated_channel_name stream=stream show_colored_icon=true}} {{else if is_direct_message}} {{name}} {{else if is_setting_disabled}} diff --git a/web/templates/inline_decorated_stream_name.hbs b/web/templates/inline_decorated_channel_name.hbs similarity index 100% rename from web/templates/inline_decorated_stream_name.hbs rename to web/templates/inline_decorated_channel_name.hbs diff --git a/web/templates/inline_stream_or_topic_reference.hbs b/web/templates/inline_stream_or_topic_reference.hbs index 09c6081ec4..6afcce2b9c 100644 --- a/web/templates/inline_stream_or_topic_reference.hbs +++ b/web/templates/inline_stream_or_topic_reference.hbs @@ -1,6 +1,6 @@ {{~#if stream~}} - {{> inline_decorated_stream_name stream=stream show_colored_icon=show_colored_icon}} + {{> inline_decorated_channel_name stream=stream show_colored_icon=show_colored_icon}} {{#if topic_display_name~}} > {{/if}} {{~/if~}} {{~ topic_display_name ~}} diff --git a/web/templates/stream_settings/announce_stream_checkbox.hbs b/web/templates/stream_settings/announce_stream_checkbox.hbs index 313d565ad7..9b3ee3a170 100644 --- a/web/templates/stream_settings/announce_stream_checkbox.hbs +++ b/web/templates/stream_settings/announce_stream_checkbox.hbs @@ -4,7 +4,7 @@ {{t "Announce new channel in"}} {{#if new_stream_announcements_stream_sub}} - {{> ../inline_decorated_stream_name + {{> ../inline_decorated_channel_name stream=new_stream_announcements_stream_sub }} diff --git a/web/templates/stream_settings/browse_streams_list_item.hbs b/web/templates/stream_settings/browse_streams_list_item.hbs index d631976f0a..2bf543bd5e 100644 --- a/web/templates/stream_settings/browse_streams_list_item.hbs +++ b/web/templates/stream_settings/browse_streams_list_item.hbs @@ -8,7 +8,7 @@ {{#tr}} Unsubscribe from - {{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} + {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}} {{/tr}} @@ -26,7 +26,7 @@ {{#tr}} Subscribe to - {{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} + {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}} {{/tr}} @@ -35,7 +35,7 @@ {{#tr}} Cannot subscribe to - {{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} + {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}} {{/tr}} diff --git a/web/templates/stream_settings/first_stream_created_modal.hbs b/web/templates/stream_settings/first_stream_created_modal.hbs index c133fefd79..7add2cb483 100644 --- a/web/templates/stream_settings/first_stream_created_modal.hbs +++ b/web/templates/stream_settings/first_stream_created_modal.hbs @@ -3,7 +3,7 @@
  • {{#tr}} Click on at the top of your Zulip window. - {{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=stream}}{{/inline}} + {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=stream}}{{/inline}} {{/tr}}
  • diff --git a/web/templates/stream_settings/stream_settings.hbs b/web/templates/stream_settings/stream_settings.hbs index 43990fc347..59e16e3858 100644 --- a/web/templates/stream_settings/stream_settings.hbs +++ b/web/templates/stream_settings/stream_settings.hbs @@ -7,7 +7,7 @@ {{#tr}} Cannot subscribe to private channel - {{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=../sub}}{{/inline}} + {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=../sub}}{{/inline}} {{/tr}} diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbs index c18684ef76..5d36ae7ecd 100644 --- a/web/templates/typeahead_list_item.hbs +++ b/web/templates/typeahead_list_item.hbs @@ -28,7 +28,7 @@
    {{~#if stream~}} - {{~> inline_decorated_stream_name stream=stream ~}} + {{~> inline_decorated_channel_name stream=stream ~}} {{~else~}} {{~ primary ~}} {{~/if~}} diff --git a/web/templates/user_group_settings/stream_group_permission_settings.hbs b/web/templates/user_group_settings/stream_group_permission_settings.hbs index a67a57adc3..592e7fd89a 100644 --- a/web/templates/user_group_settings/stream_group_permission_settings.hbs +++ b/web/templates/user_group_settings/stream_group_permission_settings.hbs @@ -1,7 +1,7 @@

    - {{> ../inline_decorated_stream_name stream=stream }} + {{> ../inline_decorated_channel_name stream=stream }}

    {{> ../settings/settings_save_discard_widget show_only_indicator=false }}
    diff --git a/web/tests/compose_actions.test.cjs b/web/tests/compose_actions.test.cjs index eac935cc1f..e86f1b6df1 100644 --- a/web/tests/compose_actions.test.cjs +++ b/web/tests/compose_actions.test.cjs @@ -162,7 +162,7 @@ test("start", ({override, override_rewire, mock_template}) => { override_rewire(compose_recipient, "on_compose_select_recipient_update", noop); override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); override_rewire(stream_data, "can_post_messages_in_stream", () => true); - mock_template("inline_decorated_stream_name.hbs", false, noop); + mock_template("inline_decorated_channel_name.hbs", false, noop); let compose_defaults; override(narrow_state, "set_compose_defaults", () => compose_defaults); @@ -311,7 +311,7 @@ test("respond_to_message", ({override, override_rewire, mock_template}) => { override_rewire(compose_recipient, "on_compose_select_recipient_update", noop); override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); override_private_message_recipient({override}); - mock_template("inline_decorated_stream_name.hbs", false, noop); + mock_template("inline_decorated_channel_name.hbs", false, noop); override(realm, "realm_direct_message_permission_group", nobody.id); override(realm, "realm_direct_message_initiator_group", everyone.id); @@ -375,7 +375,7 @@ test("reply_with_mention", ({override, override_rewire, mock_template}) => { override_private_message_recipient({override}); override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); - mock_template("inline_decorated_stream_name.hbs", false, noop); + mock_template("inline_decorated_channel_name.hbs", false, noop); const denmark = { subscribed: true,