mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +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();
|
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 {
|
export function complete_rerender(): void {
|
||||||
if (!inbox_util.is_visible()) {
|
if (!inbox_util.is_visible()) {
|
||||||
return;
|
return;
|
||||||
@@ -1023,6 +1029,7 @@ export function complete_rerender(): void {
|
|||||||
item_click_callback: filter_click_handler,
|
item_click_callback: filter_click_handler,
|
||||||
$events_container: $("#inbox-main"),
|
$events_container: $("#inbox-main"),
|
||||||
default_id: first_filter.done ? undefined : first_filter.value,
|
default_id: first_filter.done ? undefined : first_filter.value,
|
||||||
|
get_options: inbox_view_dropdown_options,
|
||||||
});
|
});
|
||||||
filters_dropdown_widget.setup();
|
filters_dropdown_widget.setup();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,17 @@ export const COMMON_DROPDOWN_WIDGET_PARAMS = {
|
|||||||
disable_for_spectators: true,
|
disable_for_spectators: true,
|
||||||
} satisfies Partial<dropdown_widget.DropdownWidgetOptions>;
|
} 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(
|
export function filters_dropdown_options(
|
||||||
current_value: string | number | undefined,
|
current_value: string | number | undefined,
|
||||||
|
channel_view = false,
|
||||||
): dropdown_widget.Option[] {
|
): dropdown_widget.Option[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -59,9 +68,9 @@ export function filters_dropdown_options(
|
|||||||
{
|
{
|
||||||
unique_id: FILTERS.ALL_TOPICS,
|
unique_id: FILTERS.ALL_TOPICS,
|
||||||
name: $t({defaultMessage: "All topics"}),
|
name: $t({defaultMessage: "All topics"}),
|
||||||
description: $t({
|
description: channel_view
|
||||||
defaultMessage: "Includes muted channels and topics",
|
? ALL_TOPICS_OPTION_DESCRIPTION_FOR_CHANNEL_VIEW
|
||||||
}),
|
: ALL_TOPICS_OPTION_DESCRIPTION,
|
||||||
bold_current_selection: current_value === FILTERS.ALL_TOPICS,
|
bold_current_selection: current_value === FILTERS.ALL_TOPICS,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user