From e8030fadc6dde70cd970a3295b7b31910ec2b1ed Mon Sep 17 00:00:00 2001 From: m-e-l-u-h-a-n Date: Sun, 4 Jul 2021 21:42:08 +0530 Subject: [PATCH] stream settings: Improve title for stream settings based on content. We had a common title `stream settings` for two cases when no stream was selected and also when settings for a particular stream were shown. To improve this situation we now show `Settings for {stream_name}` when settings for a particular stream are shown. --- static/js/stream_edit.js | 2 +- static/js/subs.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js index 45c813817b..76534f87c5 100644 --- a/static/js/stream_edit.js +++ b/static/js/stream_edit.js @@ -182,7 +182,7 @@ export function open_edit_panel_for_row(stream_row) { const sub = get_sub_for_target(stream_row); $(".stream-row.active").removeClass("active"); - subs.show_subs_pane.settings(); + subs.show_subs_pane.settings(sub.name); $(stream_row).addClass("active"); setup_subscriptions_stream_hash(sub); setup_stream_settings(stream_row); diff --git a/static/js/subs.js b/static/js/subs.js index 18eda84ec6..54e7893705 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -41,14 +41,19 @@ export const show_subs_pane = { nothing_selected() { $(".stream-info-title, .settings, #stream-creation").hide(); $("#stream_settings_title, .nothing-selected").show(); + $("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Stream settings"})); }, - settings() { + settings(stream_name) { $(".stream-info-title, .settings, #stream-creation").hide(); $("#stream_settings_title, .settings").show(); + $("#subscription_overlay .stream-info-title").text( + $t({defaultMessage: "Settings for #{stream_name}"}, {stream_name}), + ); }, create_stream() { $(".stream-info-title, .nothing-selected, .settings, #stream-creation").hide(); $("#add_new_stream_title, #stream-creation").show(); + $("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Create stream"})); }, };