stream_settings: Add text in the left panel.

Display "No channels match your filter" in the left panel
when no matches are found for filter queries in
"Subscribed", "All channels" and "Not subscribed" tabs.

Fixes #18332.
This commit is contained in:
sujal shah 2024-07-24 17:08:56 +05:30 committed by Tim Abbott
parent aafcd43038
commit 333eedb351
2 changed files with 16 additions and 0 deletions

View File

@ -420,6 +420,17 @@ export function update_empty_left_panel_message() {
} else {
has_streams = stream_data.get_unsorted_subs().length;
}
const has_hidden_streams =
$("#channels_overlay_container .stream-row:not(.notdisplayed)").length === 0;
const has_search_query = $("#stream_filter input[type='text']").val().trim() !== "";
// Show "no channels match" text if all channels are hidden and there's a search query.
if (has_hidden_streams && has_search_query) {
$(".no-streams-to-show").children().hide();
$(".no_stream_match_filter_empty_text").show();
$(".no-streams-to-show").show();
return;
}
if (has_streams) {
$(".no-streams-to-show").hide();
return;

View File

@ -41,6 +41,11 @@
<a href="#channels/all">{{t 'View all channels'}}</a>
</span>
</div>
<div class="no_stream_match_filter_empty_text">
<span class="settings-empty-option-text">
{{t 'No channels match your filter.'}}
</span>
</div>
<div class="all_streams_tab_empty_text">
<span class="settings-empty-option-text">
{{t 'There are no channels you can view in this organization.'}}