Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
web-stream-create: Update frontend errors for stream rename channel.
Lauryn Menardba766a564ad8
diff --git a/web/e2e-tests/stream_create.test.ts b/web/e2e-tests/stream_create.test.tsindex 41b3a6c76ce..e3ad444dbac 100644--- a/web/e2e-tests/stream_create.test.ts+++ b/web/e2e-tests/stream_create.test.ts@@ -115,13 +115,13 @@ async function test_streams_with_empty_names_cannot_be_created(page: Page): Promawait page.waitForSelector("form#stream_creation_form", {visible: true});await common.fill_form(page, "form#stream_creation_form", {stream_name: " "});await page.click("form#stream_creation_form button.finalize_create_stream");- assert.strictEqual(await stream_name_error(page), "Choose a name for the new stream.");+ assert.strictEqual(await stream_name_error(page), "Choose a name for the new channel.");}async function test_streams_with_duplicate_names_cannot_be_created(page: Page): Promise<void> {await common.fill_form(page, "form#stream_creation_form", {stream_name: "Puppeteer"});await page.click("form#stream_creation_form button.finalize_create_stream");- assert.strictEqual(await stream_name_error(page), "A stream with this name already exists.");+ assert.strictEqual(await stream_name_error(page), "A channel with this name already exists.");const cancel_button_selector = "form#stream_creation_form button.button.white";await page.click(cancel_button_selector);diff --git a/web/src/stream_create.js b/web/src/stream_create.jsindex a4003c75a20..40f68b754ff 100644--- a/web/src/stream_create.js+++ b/web/src/stream_create.js@@ -42,7 +42,7 @@ export function should_show_first_stream_created_modal() {class StreamSubscriptionError {report_no_subs_to_stream() {$("#stream_subscription_error").text(- $t({defaultMessage: "You cannot create a stream with no subscribers."}),+ $t({defaultMessage: "You cannot create a channel with no subscribers."}),);$("#stream_subscription_error").show();}@@ -51,7 +51,7 @@ class StreamSubscriptionError {$("#stream_subscription_error").text($t({defaultMessage:- "You must be an organization administrator to create a stream without subscribing.",+ "You must be an organization administrator to create a channel without subscribing.",}),);$("#stream_subscription_error").show();@@ -66,7 +66,7 @@ const stream_subscription_error = new StreamSubscriptionError();class StreamNameError {report_already_exists() {$("#stream_name_error").text(- $t({defaultMessage: "A stream with this name already exists."}),+ $t({defaultMessage: "A channel with this name already exists."}),);$("#stream_name_error").show();}@@ -76,7 +76,7 @@ class StreamNameError {}report_empty_stream() {- $("#stream_name_error").text($t({defaultMessage: "Choose a name for the new stream."}));+ $("#stream_name_error").text($t({defaultMessage: "Choose a name for the new channel."}));$("#stream_name_error").show();}@@ -176,7 +176,7 @@ function create_stream() {// and paste over a description with newline characters in it. Prevent that.if (description.includes("\n")) {ui_report.client_error(- $t_html({defaultMessage: "The stream description cannot contain newline characters."}),+ $t_html({defaultMessage: "The channel description cannot contain newline characters."}),$(".stream_create_info"),);return undefined;@@ -269,7 +269,7 @@ function create_stream() {data.can_remove_subscribers_group = can_remove_subscribers_group_id;loading.make_indicator($("#stream_creating_indicator"), {- text: $t({defaultMessage: "Creating stream..."}),+ text: $t({defaultMessage: "Creating channel..."}),});// Subscribe yourself and possible other people to a new stream.@@ -280,7 +280,7 @@ function create_stream() {$("#create_stream_name").val("");$("#create_stream_description").val("");ui_report.success(- $t_html({defaultMessage: "Stream successfully created!"}),+ $t_html({defaultMessage: "Channel successfully created!"}),$(".stream_create_info"),);loading.destroy_indicator($("#stream_creating_indicator"));@@ -295,13 +295,13 @@ function create_stream() {// parsing the error string, so it works correctly// with i18n. And likely we should be reporting the// error text directly rather than turning it into- // "Error creating stream"?+ // "Error creating channel"?stream_name_error.report_already_exists();stream_name_error.select();}ui_report.error(- $t_html({defaultMessage: "Error creating stream"}),+ $t_html({defaultMessage: "Error creating channel"}),xhr,$(".stream_create_info"),);@@ -428,7 +428,7 @@ export function set_up_handlers() {if (principals.length >= 50) {const html_body = render_subscription_invites_warning_modal({- stream_name,+ channel_name: stream_name,count: principals.length,});diff --git a/web/templates/confirm_dialog/confirm_subscription_invites_warning.hbs b/web/templates/confirm_dialog/confirm_subscription_invites_warning.hbsindex 539f37bc9fd..9efbf07ade0 100644--- a/web/templates/confirm_dialog/confirm_subscription_invites_warning.hbs+++ b/web/templates/confirm_dialog/confirm_subscription_invites_warning.hbs@@ -1,3 +1,3 @@<p>- {{t "Are you sure you want to create stream ''''{stream_name}'''' and subscribe {count} users to it?" }}+ {{t "Are you sure you want to create channel ''''{channel_name}'''' and subscribe {count} users to it?" }}</p>