setting: Divide user_invite_restriction into a checkbox and dropdown.

This commit divides the user_invite_restriction setting dropdown to
a checkbox and a dropdown.
The checkbox is used for 'realm_invite_required' setting and dropdown
for 'realm_invite_to_realm_policy'.

This separation of UI elements is fine as these two settings are
separate in database also and also helps in removing excess if-else
conditions and switch cases.
This commit is contained in:
sahil839
2021-05-24 01:10:20 +05:30
committed by Tim Abbott
parent 8846df6b53
commit d8c4b96b12
5 changed files with 23 additions and 104 deletions

View File

@@ -43,6 +43,9 @@ const admin_settings_label = {
defaultMessage: "Prevent users from changing their email address",
}),
realm_avatar_changes_disabled: $t({defaultMessage: "Prevent users from changing their avatar"}),
realm_invite_required: $t({
defaultMessage: "Invitations are required for joining this organization",
}),
};
function insert_tip_box() {
@@ -122,6 +125,7 @@ export function build_page() {
bot_creation_policy_values: settings_bots.bot_creation_policy_values,
email_address_visibility_values: settings_config.email_address_visibility_values,
can_invite_others_to_realm: settings_data.user_can_invite_others_to_realm(),
realm_invite_required: page_params.realm_invite_required,
...settings_org.get_organization_settings_options(),
};