mirror of https://github.com/zulip/zulip.git
settings: Disable organization deactivation button for admins.
This commit adds the code to disable deactivate organization button
for admins. We now allow only owners to deactivate the organization.
The backend implementation for allowing only owners to deactivate
is already added in 81c28c1
.
This commit is contained in:
parent
dbd64c4362
commit
a6f31c3668
|
@ -14,7 +14,12 @@ exports.reset = function () {
|
|||
|
||||
|
||||
exports.maybe_disable_widgets = function () {
|
||||
if (page_params.is_owner) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (page_params.is_admin) {
|
||||
$("#deactivate_realm_button").attr("disabled", true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ exports.update_person = function update(person) {
|
|||
|
||||
if (people.is_my_user_id(person.user_id) && page_params.is_owner !== person_obj.is_owner) {
|
||||
page_params.is_owner = person_obj.is_owner;
|
||||
settings_org.maybe_disable_widgets();
|
||||
}
|
||||
|
||||
if (people.is_my_user_id(person.user_id) && page_params.is_admin !== person_obj.is_admin) {
|
||||
|
|
|
@ -74,7 +74,10 @@
|
|||
theme_mode="night"
|
||||
logo_url=realm_night_logo_url}}
|
||||
|
||||
<h3 class="light">{{t "Deactivate organization" }}</h3>
|
||||
<h3 class="light">
|
||||
{{t "Deactivate organization" }}
|
||||
<i class="fa fa-info-circle settings-info-icon realm_allow_message_deleting_tooltip" data-toggle="tooltip" aria-hidden="true" title="{{t 'Only owners can deactivate the organization.' }}"></i>
|
||||
</h3>
|
||||
<div class="deactivate-realm-section">
|
||||
<div class="input-group">
|
||||
<button class="button rounded btn-danger" id="deactivate_realm_button">
|
||||
|
|
Loading…
Reference in New Issue