stream-settings: Replace "Not subscribed" tab with "Available".

This commit replaces "Not subscribed" tab in stream settings
with "Available" tab where only streams which the user can
subscribe to are shown.

Fixes #35919.
This commit is contained in:
Sahil Batra
2025-09-03 12:00:17 +05:30
committed by Tim Abbott
parent 24f678feb6
commit 683eca97a7
13 changed files with 63 additions and 69 deletions

View File

@@ -263,58 +263,46 @@ run_test("redraw_left_panel", ({override, mock_template}) => {
}
// Search with single keyword
test_filter({input: "Po", show_subscribed: false, show_not_subscribed: false}, [
poland,
pomona,
]);
test_filter({input: "Po", show_subscribed: false, show_available: false}, [poland, pomona]);
assert.ok(ui_called);
// The denmark row is active, even though it's not displayed.
assert.ok($denmark_row.hasClass("active"));
// Search with multiple keywords
test_filter({input: "Denmark, Pol", show_subscribed: false, show_not_subscribed: false}, [
test_filter({input: "Denmark, Pol", show_subscribed: false, show_available: false}, [
denmark,
poland,
]);
test_filter({input: "Den, Pol", show_subscribed: false, show_not_subscribed: false}, [
test_filter({input: "Den, Pol", show_subscribed: false, show_available: false}, [
denmark,
poland,
]);
// Search is case-insensitive
test_filter({input: "po", show_subscribed: false, show_not_subscribed: false}, [
poland,
pomona,
]);
test_filter({input: "po", show_subscribed: false, show_available: false}, [poland, pomona]);
// Search handles unusual characters like C++
test_filter({input: "c++", show_subscribed: false, show_not_subscribed: false}, [cpp]);
test_filter({input: "c++", show_subscribed: false, show_available: false}, [cpp]);
// Search subscribed streams only
test_filter({input: "d", show_subscribed: true, show_not_subscribed: false}, [poland]);
test_filter({input: "d", show_subscribed: true, show_available: false}, [poland]);
// Search unsubscribed streams only
test_filter({input: "d", show_subscribed: false, show_not_subscribed: true}, [abcd, denmark]);
test_filter({input: "d", show_subscribed: false, show_available: true}, [abcd, denmark]);
// Search terms match stream description
test_filter({input: "Co", show_subscribed: false, show_not_subscribed: false}, [
denmark,
pomona,
]);
test_filter({input: "Co", show_subscribed: false, show_available: false}, [denmark, pomona]);
// Search names AND descriptions
test_filter({input: "Mon", show_subscribed: false, show_not_subscribed: false}, [
pomona,
poland,
]);
test_filter({input: "Mon", show_subscribed: false, show_available: false}, [pomona, poland]);
// Explicitly order streams by name
test_filter(
{
input: "",
show_subscribed: false,
show_not_subscribed: false,
show_available: false,
sort_order: "by-stream-name",
},
[abcd, cpp, denmark, jerry, poland, pomona, utopia, zzyzx],
@@ -325,7 +313,7 @@ run_test("redraw_left_panel", ({override, mock_template}) => {
{
input: "",
show_subscribed: false,
show_not_subscribed: false,
show_available: false,
sort_order: "by-subscriber-count",
},
[utopia, abcd, poland, cpp, zzyzx, denmark, jerry, pomona],
@@ -336,7 +324,7 @@ run_test("redraw_left_panel", ({override, mock_template}) => {
{
input: "",
show_subscribed: false,
show_not_subscribed: false,
show_available: false,
sort_order: "by-weekly-traffic",
},
[poland, utopia, cpp, zzyzx, jerry, abcd, pomona, denmark],
@@ -347,7 +335,7 @@ run_test("redraw_left_panel", ({override, mock_template}) => {
{
input: "",
show_subscribed: true,
show_not_subscribed: false,
show_available: false,
sort_order: "by-subscriber-count",
},
[poland, cpp, zzyzx, pomona],
@@ -358,7 +346,7 @@ run_test("redraw_left_panel", ({override, mock_template}) => {
{
input: "",
show_subscribed: false,
show_not_subscribed: true,
show_available: true,
sort_order: "by-subscriber-count",
},
[utopia, abcd, denmark, jerry],