mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
inbox: Alter dropdown text for channel view.
This commit is contained in:
@@ -965,6 +965,12 @@ function render_channel_view(channel_id: number): void {
|
||||
channel_view_topic_widget.build();
|
||||
}
|
||||
|
||||
function inbox_view_dropdown_options(
|
||||
current_value: string | number | undefined,
|
||||
): dropdown_widget.Option[] {
|
||||
return views_util.filters_dropdown_options(current_value, inbox_util.is_channel_view());
|
||||
}
|
||||
|
||||
export function complete_rerender(): void {
|
||||
if (!inbox_util.is_visible()) {
|
||||
return;
|
||||
@@ -1023,6 +1029,7 @@ export function complete_rerender(): void {
|
||||
item_click_callback: filter_click_handler,
|
||||
$events_container: $("#inbox-main"),
|
||||
default_id: first_filter.done ? undefined : first_filter.value,
|
||||
get_options: inbox_view_dropdown_options,
|
||||
});
|
||||
filters_dropdown_widget.setup();
|
||||
}
|
||||
|
||||
@@ -40,8 +40,17 @@ export const COMMON_DROPDOWN_WIDGET_PARAMS = {
|
||||
disable_for_spectators: true,
|
||||
} satisfies Partial<dropdown_widget.DropdownWidgetOptions>;
|
||||
|
||||
const ALL_TOPICS_OPTION_DESCRIPTION = $t({
|
||||
defaultMessage: "Includes muted channels and topics",
|
||||
});
|
||||
|
||||
const ALL_TOPICS_OPTION_DESCRIPTION_FOR_CHANNEL_VIEW = $t({
|
||||
defaultMessage: "Includes muted topics",
|
||||
});
|
||||
|
||||
export function filters_dropdown_options(
|
||||
current_value: string | number | undefined,
|
||||
channel_view = false,
|
||||
): dropdown_widget.Option[] {
|
||||
return [
|
||||
{
|
||||
@@ -59,9 +68,9 @@ export function filters_dropdown_options(
|
||||
{
|
||||
unique_id: FILTERS.ALL_TOPICS,
|
||||
name: $t({defaultMessage: "All topics"}),
|
||||
description: $t({
|
||||
defaultMessage: "Includes muted channels and topics",
|
||||
}),
|
||||
description: channel_view
|
||||
? ALL_TOPICS_OPTION_DESCRIPTION_FOR_CHANNEL_VIEW
|
||||
: ALL_TOPICS_OPTION_DESCRIPTION,
|
||||
bold_current_selection: current_value === FILTERS.ALL_TOPICS,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user