streams: Warn when archiving a notification stream.

Archiving a user/stream notification stream disables
user/stream notifications.This commit adds a warning
that notifications will be disabled while archiving
any notification stream.

Fixes #22110.

Co-authored-by: Victor Fróes <71036803+vfroes21@users.noreply.github.com>
Co-authored-by: Isabella Carmo <isabella.carmo@hotmail.com>
This commit is contained in:
Ujjawal Modi
2023-06-25 15:36:27 +05:30
committed by Tim Abbott
parent eebe46ad1c
commit a45853d313
3 changed files with 32 additions and 4 deletions

View File

@@ -601,8 +601,19 @@ export function initialize() {
const stream = sub_store.get(stream_id);
const stream_name_with_privacy_symbol_html = render_inline_decorated_stream_name({stream});
const is_new_stream_notification_stream =
stream_id === page_params.realm_notifications_stream_id;
const is_signup_notification_stream =
stream_id === page_params.realm_signup_notifications_stream_id;
const is_notification_stream =
is_new_stream_notification_stream || is_signup_notification_stream;
const html_body = render_settings_deactivation_stream_modal({
stream_name_with_privacy_symbol_html,
is_new_stream_notification_stream,
is_signup_notification_stream,
is_notification_stream,
});
confirm_dialog.launch({

View File

@@ -148,6 +148,10 @@
margin-bottom: 10px;
}
#archive-stream-modal .notification_stream_archive_warning {
margin-bottom: 0;
}
#read_receipts_modal {
.modal__container {
width: 360px;

View File

@@ -1,4 +1,17 @@
<p>
{{#tr}}
Archiving stream <z-stream></z-stream> will immediately unsubscribe everyone. This action cannot be undone.
{{#*inline "z-stream"}}<strong>{{{stream_name_with_privacy_symbol_html}}}</strong>{{/inline}}
{{/tr}}
</p>
{{#if is_notification_stream}}
<p class="notification_stream_archive_warning">{{#tr}}Archiving this stream will also disable settings that were configured to use this stream:{{/tr}}</p>
<ul>
{{#if is_new_stream_notification_stream}}
<li>{{#tr}}New stream notifications{{/tr}}</li>
{{/if}}
{{#if is_signup_notification_stream}}
<li>{{#tr}}New user notifications{{/tr}}</li>
{{/if}}
</ul>
{{/if}}