mirror of https://github.com/zulip/zulip.git
web-compose-warnings: Update banners for stream rename channel.
Updates warning string when linking to a private stream/channel when composing a message in the web app to use channel instead of stream. Updates error banner when using a stream/channel wildcard mention when composing a message in the web app to use channel instead of stream. Part of stream to channel rename project.
This commit is contained in:
parent
ff98758ed0
commit
36e00308b8
|
@ -187,7 +187,7 @@ export function warn_if_private_stream_is_linked(
|
||||||
const new_row_html = render_private_stream_warning({
|
const new_row_html = render_private_stream_warning({
|
||||||
stream_id: linked_stream.stream_id,
|
stream_id: linked_stream.stream_id,
|
||||||
banner_type: compose_banner.WARNING,
|
banner_type: compose_banner.WARNING,
|
||||||
stream_name: linked_stream.name,
|
channel_name: linked_stream.name,
|
||||||
classname: compose_banner.CLASSNAMES.private_stream_warning,
|
classname: compose_banner.CLASSNAMES.private_stream_warning,
|
||||||
});
|
});
|
||||||
compose_banner.append_compose_banner_to_banner_list($(new_row_html), $banner_container);
|
compose_banner.append_compose_banner_to_banner_list($(new_row_html), $banner_container);
|
||||||
|
@ -514,7 +514,7 @@ export function validate_stream_message_mentions(opts: StreamWildcardOptions): b
|
||||||
const new_row_html = render_wildcard_mention_not_allowed_error({
|
const new_row_html = render_wildcard_mention_not_allowed_error({
|
||||||
banner_type: compose_banner.ERROR,
|
banner_type: compose_banner.ERROR,
|
||||||
classname: compose_banner.CLASSNAMES.wildcards_not_allowed,
|
classname: compose_banner.CLASSNAMES.wildcards_not_allowed,
|
||||||
stream_wildcard_mention: opts.stream_wildcard_mention,
|
wildcard_mention_string: opts.stream_wildcard_mention,
|
||||||
});
|
});
|
||||||
compose_banner.append_compose_banner_to_banner_list(
|
compose_banner.append_compose_banner_to_banner_list(
|
||||||
$(new_row_html),
|
$(new_row_html),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{#> compose_banner }}
|
{{#> compose_banner }}
|
||||||
<p class="banner_message">
|
<p class="banner_message">
|
||||||
{{#tr}}Warning: <strong>#{stream_name}</strong> is a private stream.{{/tr}}
|
{{#tr}}Warning: <strong>#{channel_name}</strong> is a private channel.{{/tr}}
|
||||||
</p>
|
</p>
|
||||||
{{/compose_banner}}
|
{{/compose_banner}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{#> compose_banner }}
|
{{#> compose_banner }}
|
||||||
<p class="banner_message">
|
<p class="banner_message">
|
||||||
{{#if stream_wildcard_mention}}
|
{{#if wildcard_mention_string}}
|
||||||
{{#tr}}You do not have permission to use <b>@{stream_wildcard_mention}</b> mentions in this stream.{{/tr}}
|
{{#tr}}You do not have permission to use <b>@{wildcard_mention_string}</b> mentions in this channel.{{/tr}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#tr}}You do not have permission to use <b>@topic</b> mentions in this topic.{{/tr}}
|
{{#tr}}You do not have permission to use <b>@topic</b> mentions in this topic.{{/tr}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -395,7 +395,7 @@ test_ui("validate_stream_message", ({override_rewire, mock_template}) => {
|
||||||
let wildcards_not_allowed_rendered = false;
|
let wildcards_not_allowed_rendered = false;
|
||||||
mock_template("compose_banner/wildcard_mention_not_allowed_error.hbs", false, (data) => {
|
mock_template("compose_banner/wildcard_mention_not_allowed_error.hbs", false, (data) => {
|
||||||
assert.equal(data.classname, compose_banner.CLASSNAMES.wildcards_not_allowed);
|
assert.equal(data.classname, compose_banner.CLASSNAMES.wildcards_not_allowed);
|
||||||
assert.equal(data.stream_wildcard_mention, "all");
|
assert.equal(data.wildcard_mention_string, "all");
|
||||||
wildcards_not_allowed_rendered = true;
|
wildcards_not_allowed_rendered = true;
|
||||||
return "<banner-stub>";
|
return "<banner-stub>";
|
||||||
});
|
});
|
||||||
|
@ -627,7 +627,7 @@ test_ui("warn_if_private_stream_is_linked", ({mock_template}) => {
|
||||||
let banner_rendered = false;
|
let banner_rendered = false;
|
||||||
mock_template("compose_banner/private_stream_warning.hbs", false, (data) => {
|
mock_template("compose_banner/private_stream_warning.hbs", false, (data) => {
|
||||||
assert.equal(data.classname, compose_banner.CLASSNAMES.private_stream_warning);
|
assert.equal(data.classname, compose_banner.CLASSNAMES.private_stream_warning);
|
||||||
assert.equal(data.stream_name, "Denmark");
|
assert.equal(data.channel_name, "Denmark");
|
||||||
banner_rendered = true;
|
banner_rendered = true;
|
||||||
return "<banner-stub>";
|
return "<banner-stub>";
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue