mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
stream_settings: Add confirmation modal for changing privacy.
Fixes: #27916
This commit is contained in:
@@ -4,6 +4,7 @@ import $ from "jquery";
|
|||||||
import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs";
|
import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs";
|
||||||
import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs";
|
import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs";
|
||||||
import render_change_stream_info_modal from "../templates/stream_settings/change_stream_info_modal.hbs";
|
import render_change_stream_info_modal from "../templates/stream_settings/change_stream_info_modal.hbs";
|
||||||
|
import render_confirm_stream_privacy_change_modal from "../templates/stream_settings/confirm_stream_privacy_change_modal.hbs";
|
||||||
import render_copy_email_address_modal from "../templates/stream_settings/copy_email_address_modal.hbs";
|
import render_copy_email_address_modal from "../templates/stream_settings/copy_email_address_modal.hbs";
|
||||||
import render_stream_description from "../templates/stream_settings/stream_description.hbs";
|
import render_stream_description from "../templates/stream_settings/stream_description.hbs";
|
||||||
import render_stream_settings from "../templates/stream_settings/stream_settings.hbs";
|
import render_stream_settings from "../templates/stream_settings/stream_settings.hbs";
|
||||||
@@ -683,7 +684,23 @@ export function initialize() {
|
|||||||
const data = settings_org.populate_data_for_request($subsection_elem, false, sub);
|
const data = settings_org.populate_data_for_request($subsection_elem, false, sub);
|
||||||
|
|
||||||
const url = "/json/streams/" + stream_id;
|
const url = "/json/streams/" + stream_id;
|
||||||
settings_org.save_organization_settings(data, $save_button, url);
|
if (
|
||||||
|
data.is_private === undefined ||
|
||||||
|
stream_data.get_stream_privacy_policy(stream_id) !== "invite-only"
|
||||||
|
) {
|
||||||
|
settings_org.save_organization_settings(data, $save_button, url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dialog_widget.launch({
|
||||||
|
html_heading: $t_html({defaultMessage: "Confirm changing access permissions"}),
|
||||||
|
html_body: render_confirm_stream_privacy_change_modal,
|
||||||
|
id: "confirm_stream_privacy_change",
|
||||||
|
html_submit_button: $t_html({defaultMessage: "Confirm"}),
|
||||||
|
on_click() {
|
||||||
|
settings_org.save_organization_settings(data, $save_button, url);
|
||||||
|
},
|
||||||
|
close_on_submit: true,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<div class="confirm-stream-privacy-modal">
|
||||||
|
<div class="new-style">
|
||||||
|
<p class="confirm-stream-privacy-info">
|
||||||
|
{{t "This change will make this stream's entire message history accessible according to the new configuration."}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user