decorated_channels: Rename partial as 'decorated_channel'.

This commit is contained in:
Karl Stolley
2025-04-18 09:39:55 -05:00
committed by Tim Abbott
parent b8ba174455
commit 1c55004cda
18 changed files with 32 additions and 30 deletions

View File

@@ -5,7 +5,7 @@ import _ from "lodash";
import assert from "minimalistic-assert"; import assert from "minimalistic-assert";
import type * as tippy from "tippy.js"; 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_banner from "./compose_banner.ts";
import * as compose_fade from "./compose_fade.ts"; import * as compose_fade from "./compose_fade.ts";
@@ -167,7 +167,7 @@ function update_recipient_label(stream_id?: number): void {
); );
} else { } else {
$("#compose_select_recipient_widget .dropdown_widget_value").html( $("#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}),
); );
} }
} }

View File

@@ -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_disabled_state from "../templates/dropdown_disabled_state.hbs";
import render_dropdown_list from "../templates/dropdown_list.hbs"; import render_dropdown_list from "../templates/dropdown_list.hbs";
import render_dropdown_list_container from "../templates/dropdown_list_container.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 blueslip from "./blueslip.ts";
import * as ListWidget from "./list_widget.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})); $(this.widget_value_selector).html(render_dropdown_disabled_state({name: option.name}));
} else if (option.stream) { } else if (option.stream) {
$(this.widget_value_selector).html( $(this.widget_value_selector).html(
render_inline_decorated_stream_name({ render_inline_decorated_channel_name({
stream: option.stream, stream: option.stream,
show_colored_icon: true, show_colored_icon: true,
}), }),

View File

@@ -5,7 +5,7 @@ import type * as tippy from "tippy.js";
import {z} from "zod"; import {z} from "zod";
import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs"; 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_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_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"; 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_id = get_stream_id(this);
const stream = sub_store.get(stream_id); 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 = const is_new_stream_announcements_stream =
stream_id === realm.realm_new_stream_announcements_stream_id; stream_id === realm.realm_new_stream_announcements_stream_id;

View File

@@ -3,7 +3,7 @@ import assert from "minimalistic-assert";
import {z} from "zod"; import {z} from "zod";
import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs"; 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_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_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"; import render_stream_subscription_request_result from "../templates/stream_settings/stream_subscription_request_result.hbs";
@@ -357,7 +357,7 @@ function remove_subscriber({
return; 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, stream: sub,
}); });

View File

@@ -1,7 +1,7 @@
import $ from "jquery"; import $ from "jquery";
import assert from "minimalistic-assert"; 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 render_first_stream_created_modal from "../templates/stream_settings/first_stream_created_modal.hbs";
import * as activity_ui from "./activity_ui.ts"; 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( html_heading: $t_html(
{defaultMessage: "Channel <b><z-stream></z-stream></b> created!"}, {defaultMessage: "Channel <b><z-stream></z-stream></b> 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}), html_body: render_first_stream_created_modal({stream}),

View File

@@ -3,7 +3,7 @@ import assert from "minimalistic-assert";
import type * as tippy from "tippy.js"; import type * as tippy from "tippy.js";
import {z} from "zod"; 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_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_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"; 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 { } else {
$("#move_topic_to_stream_widget .dropdown_widget_value").html( $("#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}),
); );
} }
} }

View File

@@ -2,7 +2,7 @@ import $ from "jquery";
import {z} from "zod"; import {z} from "zod";
import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs"; 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 render_selected_stream_title from "../templates/stream_settings/selected_stream_title.hbs";
import * as channel from "./channel.ts"; 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 { export function unsubscribe_from_private_stream(sub: StreamSubscription): void {
const invite_only = sub.invite_only; const invite_only = sub.invite_only;
const sub_count = peer_data.get_subscriber_count(sub.stream_id); 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({ const html_body = render_unsubscribe_private_stream_modal({
unsubscribing_other_user: false, unsubscribing_other_user: false,

View File

@@ -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_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_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 render_skipped_marking_unread from "../templates/skipped_marking_unread.hbs";
import * as blueslip from "./blueslip.ts"; 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( const stream_names_with_privacy_symbol_html = ignored_because_not_subscribed_channels.map(
(stream_id) => { (stream_id) => {
const stream = sub_store.get(stream_id); const stream = sub_store.get(stream_id);
const decorated_stream_name = render_inline_decorated_stream_name({stream}); const decorated_channel_name = render_inline_decorated_channel_name({stream});
return `<span class="white-space-nowrap">${decorated_stream_name}</span>`; return `<span class="white-space-nowrap">${decorated_channel_name}</span>`;
}, },
); );

View File

@@ -22,7 +22,7 @@
{{else}} {{else}}
<a class="dropdown-list-item-common-styles"> <a class="dropdown-list-item-common-styles">
{{#if stream}} {{#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}} {{else if is_direct_message}}
<i class="zulip-icon zulip-icon-users stream-privacy-type-icon"></i> {{name}} <i class="zulip-icon zulip-icon-users stream-privacy-type-icon"></i> {{name}}
{{else if is_setting_disabled}} {{else if is_setting_disabled}}

View File

@@ -1,6 +1,6 @@
<span class="stream-or-topic-reference"> <span class="stream-or-topic-reference">
{{~#if stream~}} {{~#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~}} &gt; {{/if}} {{#if topic_display_name~}} &gt; {{/if}}
{{~/if~}} {{~/if~}}
<span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}>{{~ topic_display_name ~}}</span> <span {{#if is_empty_string_topic}}class="empty-topic-display"{{/if}}>{{~ topic_display_name ~}}</span>

View File

@@ -4,7 +4,7 @@
{{t "Announce new channel in"}} {{t "Announce new channel in"}}
{{#if new_stream_announcements_stream_sub}} {{#if new_stream_announcements_stream_sub}}
<strong> <strong>
{{> ../inline_decorated_stream_name {{> ../inline_decorated_channel_name
stream=new_stream_announcements_stream_sub stream=new_stream_announcements_stream_sub
}} }}
</strong> </strong>

View File

@@ -8,7 +8,7 @@
<span> <span>
{{#tr}} {{#tr}}
Unsubscribe from <z-stream></z-stream> Unsubscribe from <z-stream></z-stream>
{{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
{{/tr}} {{/tr}}
</span> </span>
</template> </template>
@@ -26,7 +26,7 @@
<span> <span>
{{#tr}} {{#tr}}
Subscribe to <z-stream></z-stream> Subscribe to <z-stream></z-stream>
{{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
{{/tr}} {{/tr}}
</span> </span>
</template> </template>
@@ -35,7 +35,7 @@
<span> <span>
{{#tr}} {{#tr}}
Cannot subscribe to <z-stream></z-stream> Cannot subscribe to <z-stream></z-stream>
{{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=this}}{{/inline}} {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
{{/tr}} {{/tr}}
</span> </span>
</template> </template>

View File

@@ -3,7 +3,7 @@
<li> <li>
{{#tr}} {{#tr}}
Click on <z-stream></z-stream> at the top of your Zulip window. Click on <z-stream></z-stream> at the top of your Zulip window.
{{#*inline "z-stream"}}<b>{{> ../inline_decorated_stream_name stream=stream}}</b>{{/inline}} {{#*inline "z-stream"}}<b>{{> ../inline_decorated_channel_name stream=stream}}</b>{{/inline}}
{{/tr}} {{/tr}}
</li> </li>
<li> <li>

View File

@@ -7,7 +7,7 @@
<span> <span>
{{#tr}} {{#tr}}
Cannot subscribe to private channel <z-stream></z-stream> Cannot subscribe to private channel <z-stream></z-stream>
{{#*inline "z-stream"}}{{> ../inline_decorated_stream_name stream=../sub}}{{/inline}} {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=../sub}}{{/inline}}
{{/tr}} {{/tr}}
</span> </span>
</template> </template>

View File

@@ -28,7 +28,7 @@
<div class="typeahead-text-container{{#if has_secondary_html}} has_secondary_html{{/if}}"> <div class="typeahead-text-container{{#if has_secondary_html}} has_secondary_html{{/if}}">
<strong class="typeahead-strong-section{{#if is_empty_string_topic}} empty-topic-display{{/if}}"> <strong class="typeahead-strong-section{{#if is_empty_string_topic}} empty-topic-display{{/if}}">
{{~#if stream~}} {{~#if stream~}}
{{~> inline_decorated_stream_name stream=stream ~}} {{~> inline_decorated_channel_name stream=stream ~}}
{{~else~}} {{~else~}}
{{~ primary ~}} {{~ primary ~}}
{{~/if~}} {{~/if~}}

View File

@@ -1,7 +1,7 @@
<div class="settings-subsection-parent" data-stream-id="{{stream.stream_id}}"> <div class="settings-subsection-parent" data-stream-id="{{stream.stream_id}}">
<div class="subsection-header"> <div class="subsection-header">
<h3> <h3>
{{> ../inline_decorated_stream_name stream=stream }} {{> ../inline_decorated_channel_name stream=stream }}
</h3> </h3>
{{> ../settings/settings_save_discard_widget show_only_indicator=false }} {{> ../settings/settings_save_discard_widget show_only_indicator=false }}
</div> </div>

View File

@@ -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, "on_compose_select_recipient_update", noop);
override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop);
override_rewire(stream_data, "can_post_messages_in_stream", () => true); 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; let compose_defaults;
override(narrow_state, "set_compose_defaults", () => 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, "on_compose_select_recipient_update", noop);
override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop);
override_private_message_recipient({override}); 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_permission_group", nobody.id);
override(realm, "realm_direct_message_initiator_group", everyone.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_private_message_recipient({override});
override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop); 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 = { const denmark = {
subscribed: true, subscribed: true,